Skip to content

feat: add block time config in reward supplier#67

Merged
noa-starkware merged 1 commit into
mainfrom
noa/staking/v3/block-time-config
Mar 22, 2026
Merged

feat: add block time config in reward supplier#67
noa-starkware merged 1 commit into
mainfrom
noa/staking/v3/block-time-config

Conversation

@noa-starkware

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

Copy link
Copy Markdown
Collaborator

This change is Reviewable


Note

Medium Risk
Adds new on-chain configuration and a governor-only setter to the RewardSupplier, changing contract storage/ABI and introducing new validation paths that could impact reward calculations if misconfigured.

Overview
Adds configurable block-duration bounds to RewardSupplier. Introduces a stored BlockDurationConfig (with defaults) plus new get_block_duration_config and governor-only set_block_duration_config entrypoints, including validation and a new INVALID_MIN_MAX_BLOCK_DURATION error.

Updates deployment/test utilities to provision the app-governor role for the reward supplier, adds contract tests for the new getter/setter and their access-control/validation behavior, and documents the new API/types/errors in docs/spec.md.

Written by Cursor Bugbot for commit fb344f6. This will update automatically on new commits. Configure here.

@noa-starkware noa-starkware self-assigned this Nov 25, 2025
@noa-starkware noa-starkware changed the title feat(staking): add block time config in reward supplier feat: add block time config in reward supplier Nov 25, 2025

@noa-starkware noa-starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on @NirLevi-starkware)


src/reward_supplier/interface.cairo line 123 at r1 (raw file):

/// Configuration for block duration calculation.
#[derive(Debug, Copy, Drop, Serde, PartialEq, starknet::Store)]
pub struct BlockDurationConfig {

Do we prefer tuple?

@noa-starkware noa-starkware force-pushed the noa/staking/v3/calculate-block-rewards branch from 7b07058 to b29228c Compare November 27, 2025 20:51
@noa-starkware noa-starkware force-pushed the noa/staking/v3/block-time-config branch from ea1ad7f to b28368c Compare November 27, 2025 20:51
@noa-starkware noa-starkware force-pushed the noa/staking/v3/calculate-block-rewards branch 2 times, most recently from b6dd1db to 313688c Compare November 30, 2025 08:44
@noa-starkware noa-starkware force-pushed the noa/staking/v3/block-time-config branch from b28368c to 37e67c7 Compare November 30, 2025 08:45
@noa-starkware noa-starkware requested a review from remollemo March 11, 2026 10:46
@noa-starkware noa-starkware force-pushed the noa/staking/v3/calculate-block-rewards branch 3 times, most recently from 1adf198 to 76687b8 Compare March 17, 2026 20:44
Base automatically changed from noa/staking/v3/calculate-block-rewards to main March 17, 2026 20:47
@noa-starkware noa-starkware force-pushed the noa/staking/v3/block-time-config branch from 37e67c7 to d82b3d1 Compare March 17, 2026 20:49

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread src/reward_supplier/errors.cairo Outdated
@codecov

codecov Bot commented Mar 17, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #67      +/-   ##
==========================================
+ Coverage   95.78%   95.81%   +0.02%     
==========================================
  Files          42       42              
  Lines       10299    10342      +43     
==========================================
+ Hits         9865     9909      +44     
+ Misses        434      433       -1     

☔ 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.

@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.

@remollemo reviewed 6 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on NirLevi-starkware and noa-starkware).


src/reward_supplier/interface.cairo line 123 at r1 (raw file):

Previously, noa-starkware wrote…

Do we prefer tuple?

i think a struct is good.

Comment thread src/reward_supplier/errors.cairo Outdated
@noa-starkware noa-starkware force-pushed the noa/staking/v3/block-time-config branch from d82b3d1 to fb344f6 Compare March 22, 2026 20:48
@noa-starkware noa-starkware enabled auto-merge (squash) March 22, 2026 20:49
@noa-starkware noa-starkware merged commit 137d12b into main Mar 22, 2026
5 of 6 checks passed
@noa-starkware noa-starkware deleted the noa/staking/v3/block-time-config branch March 22, 2026 20:52
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