feat: calculate block rewards by timestamp #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change is
Note
Switches to timestamp-based per-epoch block rewards (cached) and updates tests/utilities, including reward supplier V3 upgrade and block-time-aware helpers.
last_calculated_epochandblock_rewardstoStorageand compute block rewards viacalculate_block_rewards(...)using per-epoch caching andupdate_current_epoch_block_rewards().update_rewards(passcurr_epoch).calculate_current_block_rewards_v3(...)and variant with custom avg block time; derive rewards from yearly mint and block duration (SECONDS_IN_YEAR,BLOCK_DURATION_SCALE).advance_blocks(blocks, block_duration)to move block number and timestamp together.advance_block_number_globalwithadvance_blocks(..., AVG_BLOCK_DURATION)where rewards are updated per block; adjust expectations to block-level rewards helpers and drop unusedstaking_contractparams.RewardSupplierimplementation.flow_test/flow_ideas.md.Written by Cursor Bugbot for commit 313688c. This will update automatically on new commits. Configure here.