Commit ef1f93b
committed
runtime: Collect stake delegations only once during epoch activation
Processing new epoch (`Bank::process_new_epoch`) involves collecting
stake delegations twice:
1) In `Bank::compute_new_epoch_caches_and_rewards`, to create a stake
history entry and refresh vote accounts.
2) In `Bank::get_epoch_reward_calculate_param_info`, which is then used
in `Bank::calculate_stake_vote_rewards` to calculate rewards for
stakers and voters.
Reduce that to just one collect by passing the vector 1) with freshly
computed stake history and vote accounts to `Bank::begin_partitioned_rewards`.
This way, we can avoid calling `Bank::get_epoch_reward_calculate_param_info`.1 parent c9f6cfa commit ef1f93b
File tree
2 files changed
+147
-42
lines changed- runtime/src
- bank/partitioned_epoch_rewards
2 files changed
+147
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1052 | 1052 | | |
1053 | 1053 | | |
1054 | 1054 | | |
| 1055 | + | |
1055 | 1056 | | |
| 1057 | + | |
1056 | 1058 | | |
1057 | 1059 | | |
1058 | 1060 | | |
| |||
1598 | 1600 | | |
1599 | 1601 | | |
1600 | 1602 | | |
1601 | | - | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
1602 | 1612 | | |
1603 | 1613 | | |
1604 | 1614 | | |
| |||
1608 | 1618 | | |
1609 | 1619 | | |
1610 | 1620 | | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
1611 | 1634 | | |
1612 | 1635 | | |
1613 | 1636 | | |
| 1637 | + | |
1614 | 1638 | | |
| 1639 | + | |
1615 | 1640 | | |
1616 | 1641 | | |
1617 | 1642 | | |
| |||
1637 | 1662 | | |
1638 | 1663 | | |
1639 | 1664 | | |
| 1665 | + | |
1640 | 1666 | | |
1641 | 1667 | | |
1642 | 1668 | | |
| 1669 | + | |
1643 | 1670 | | |
1644 | | - | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
1645 | 1680 | | |
1646 | 1681 | | |
1647 | 1682 | | |
| |||
1650 | 1685 | | |
1651 | 1686 | | |
1652 | 1687 | | |
1653 | | - | |
1654 | 1688 | | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
1661 | | - | |
1662 | | - | |
1663 | | - | |
1664 | 1689 | | |
1665 | 1690 | | |
1666 | 1691 | | |
| |||
0 commit comments