SIMD-0118
Partitioned Epoch Rewards Distribution
Feature Gate Status
PERzQrt5gBD1XEe2c9XdFWqwgHY3mr7cYWbm5V772V8
TL;DR
A new way to distribute epoch rewards across multiple blocks is proposed to address the current performance problems associated with epoch reward distribution in a first block of a new epoch.
Summary
A new way to distribute epoch rewards across multiple blocks is proposed to address the current performance problems associated with epoch reward distribution in a first block of a new epoch.
Motivation
The distribution of epoch rewards at the start block of an epoch becomes a significant bottleneck due to the rising number of stake accounts and voting nodes on the network. To address this bottleneck, we propose a new approach for distributing the epoch rewards over multiple blocks.
Key Changes
- rewards calculation: calculate the epoch rewards for all active stake accounts
- rewards distribution: distribute the epoch rewards for the active stake accounts
- rewards calculation phase - during which the epoch rewards for all activate stake accounts are computed and distribution chunks are scheduled.
- rewards distribution phase - during which the calculated epoch rewards for the active stake accounts are distributed.
Impact
There are the two main impacts of the changes to stake accounts during the epoch rewarding phase. The first impact is that stake accounts will see their rewards being credited a few blocks later in the epoch than before. The second impact is that users will only be able to credit their stake accounts during the epoch reward phase. Any other updates will have to wait until the end of the phase. Nonetheless, the overall amount of wall time that the user must wait before receiving and updating their stake rewards should be roughly equivalent to what they are now experiencing on the current mainnet beta, since the prolonged first block time at the epoch boundary effectively obstructs the user's access to those stake accounts during that time. Another advantage with the new approach is that all non-staking transactions will continue to be processed, while those transactions are blocked on mainnet beta today.
Backwards Compatibility
This is a breaking change. The new epoch calculation and distribution approach will not be compatible with the old approach.
Security Considerations
While the proposed new approach does impact and modify various components of the validators, it does not alter the economics of the reward system. Reward distribution relies on restricting any lamport debit or state changes for stake accounts until distribution is completed. The initial reward calculation and reward-distribution progress should be recoverable from snapshots produced during the reward distribution period to avoid consensus failure.