Skip to content

test: block rewards by timestamp flows#98

Merged
noa-starkware merged 2 commits into
mainfrom
noa/staking/v3/test/flows-rewards-by-timestamp
Apr 5, 2026
Merged

test: block rewards by timestamp flows#98
noa-starkware merged 2 commits into
mainfrom
noa/staking/v3/test/flows-rewards-by-timestamp

Conversation

@noa-starkware

@noa-starkware noa-starkware commented Nov 30, 2025

Copy link
Copy Markdown
Collaborator

Note

Low Risk
Changes are confined to test flows and test harness utilities; primary risk is brittle/incorrect assumptions in new reward calculations or role setup causing flaky tests rather than production impact.

Overview
Adds several new flow tests in flow_test/test.cairo to validate timestamp-based rewards behavior: average block duration calculation across mixed block times, identical rewards within the same epoch, correct accrual when update_rewards skips blocks/epochs, and reward changes when updating epoch length or the reward supplier’s block-duration config.

Updates the flow-test harness (flow_test/utils.cairo) to support new reward-supplier governance roles (app_role_admin, app_governor) and exposes a helper to call set_block_duration_config via the config dispatcher. Test utilities add split_pool_rewards and clarify avg_block_time units used by calculate_current_block_rewards_with_avg_block_time_v3.

Reviewed by Cursor Bugbot for commit ad43fab. Bugbot is set up for automated code reviews on this repo. Configure here.


This change is Reviewable

@noa-starkware noa-starkware self-assigned this Nov 30, 2025
@noa-starkware noa-starkware requested a review from remollemo March 11, 2026 10:47
@noa-starkware noa-starkware force-pushed the noa/staking/v3/rs-eic branch from 5036954 to ce8d6f9 Compare March 17, 2026 20:53
@noa-starkware noa-starkware force-pushed the noa/staking/v3/test/flows-rewards-by-timestamp branch from 6cbd473 to f9adaa8 Compare March 17, 2026 21:05

@remollemo remollemo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@remollemo reviewed 19 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on NirLevi-starkware).

@noa-starkware noa-starkware force-pushed the noa/staking/v3/rs-eic branch from ce8d6f9 to 0682062 Compare March 22, 2026 21:19
@noa-starkware noa-starkware force-pushed the noa/staking/v3/test/flows-rewards-by-timestamp branch from f9adaa8 to e3e9325 Compare March 22, 2026 21:20
@noa-starkware noa-starkware changed the base branch from noa/staking/v3/rs-eic to main March 23, 2026 12:19
@noa-starkware noa-starkware force-pushed the noa/staking/v3/test/flows-rewards-by-timestamp branch from e3e9325 to 0ec7e12 Compare March 23, 2026 12:19
@noa-starkware noa-starkware enabled auto-merge (squash) March 23, 2026 12:19
@noa-starkware noa-starkware merged commit 06d3d2e into main Apr 5, 2026
5 of 6 checks passed
@noa-starkware noa-starkware deleted the noa/staking/v3/test/flows-rewards-by-timestamp branch April 5, 2026 14:38
@codecov

codecov Bot commented Apr 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.91%. Comparing base (24da68f) to head (ad43fab).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   95.80%   95.91%   +0.10%     
==========================================
  Files          43       43              
  Lines       10517    10797     +280     
==========================================
+ Hits        10076    10356     +280     
  Misses        441      441              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants