feat: migration to rewards by timestamp - #69
Merged
Merged
Conversation
noa-starkware
force-pushed
the
noa/staking/v3/adjust-avg-with-cfg
branch
from
November 27, 2025 20:52
35a662a to
353e2e7
Compare
noa-starkware
force-pushed
the
noa/staking/v3/migration-rewards
branch
from
November 27, 2025 20:52
a9ccb51 to
2793f13
Compare
noa-starkware
force-pushed
the
noa/staking/v3/adjust-avg-with-cfg
branch
from
November 30, 2025 08:49
353e2e7 to
324e872
Compare
noa-starkware
force-pushed
the
noa/staking/v3/migration-rewards
branch
2 times, most recently
from
November 30, 2025 08:53
f4ee42e to
4465436
Compare
noa-starkware
force-pushed
the
noa/staking/v3/adjust-avg-with-cfg
branch
from
March 17, 2026 20:50
324e872 to
42fbfcf
Compare
noa-starkware
force-pushed
the
noa/staking/v3/migration-rewards
branch
from
March 17, 2026 20:52
4465436 to
24e1ab6
Compare
remollemo
approved these changes
Mar 22, 2026
remollemo
left a comment
Contributor
There was a problem hiding this comment.
@remollemo reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: 3 of 4 files reviewed, all discussions resolved (waiting on NirLevi-starkware).
noa-starkware
force-pushed
the
noa/staking/v3/adjust-avg-with-cfg
branch
from
March 22, 2026 20:53
42fbfcf to
7ef4637
Compare
noa-starkware
force-pushed
the
noa/staking/v3/migration-rewards
branch
from
March 22, 2026 20:59
24e1ab6 to
e017847
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
==========================================
- Coverage 95.83% 95.82% -0.01%
==========================================
Files 42 42
Lines 10385 10434 +49
==========================================
+ Hits 9952 9998 +46
- Misses 433 436 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
Medium Risk
Touches staking reward configuration and initialization logic, which can affect on-chain reward calculations and epoch transitions if the new initialization path is incorrect. Test updates reduce risk but coverage is still limited to the exercised scenarios.
Overview
Consensus-rewards migration now initializes timestamp-based block rewards on configuration. When
set_consensus_rewards_first_epochis called for the first time, the staking contract precomputes and storesblock_rewards(and updateslast_calculated_epoch) to avoid starting consensus rewards without initialized per-block rewards.Tests and flows are updated to reflect timestamp-based progression: several staking tests advance an epoch before configuring consensus rewards, the
set_consensus_rewards_first_epochtest now assertsblock_rewards/last_calculated_epochinitialization, and flow tests replaceadvance_block_number_globalwithadvance_blocks(..., block_duration)to advance time as well as block number. Documentation/notes add additional migration test ideas for rewards-by-timestamp.Written by Cursor Bugbot for commit e017847. This will update automatically on new commits. Configure here.
This change is