Skip to content

test: delegator from v0 flows#45

Merged
noa-starkware merged 1 commit intomainfrom
noa/staking/v3/test/delegator-v0
Nov 26, 2025
Merged

test: delegator from v0 flows#45
noa-starkware merged 1 commit intomainfrom
noa/staking/v3/test/delegator-v0

Conversation

@noa-starkware
Copy link
Collaborator

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

Note

Adds four delegator cross-version reward/balance-change flows (V0→V3) and wires them into mainnet fork tests, introducing a v1 STRK pool rewards calc helper.

  • Flow tests (flows.cairo):
    • Add DelegatorChangeBalanceOverVersionsFlow, DelegatorFromV0Flow, DelegatorV0ChangeBalanceBeforeRewardsFlow, and DelegatorV0RewardsV1ChangeBalanceBeforeRewardsFlow:
      • Cover delegator entering in V0, attesting across V1/V2/V3, changing balances in V1/V3, and verifying rewards via view and claim.
    • Import helper calculate_strk_pool_rewards_v1 to compute expected rewards for V1 epochs.
  • Fork tests (fork_test.cairo):
    • Add MAINNET fork tests invoking the four new flows.
  • Docs (flow_ideas.md):
    • Update/expand test ideas around delegator/staker migration scenarios.

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


This change is Reviewable

Base automatically changed from noa/staking/v3/test/test-utils-rewards to main November 23, 2025 11:20
@noa-starkware noa-starkware force-pushed the noa/staking/v3/test/delegator-v0 branch from 4e31646 to 9b801e3 Compare November 23, 2025 14:48
@noa-starkware noa-starkware force-pushed the noa/staking/v3/test/delegator-v0 branch from 9b801e3 to 0cbc327 Compare November 23, 2025 14:56
@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.60%. Comparing base (ac1c7fe) to head (942f38d).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #45   +/-   ##
=======================================
  Coverage   95.60%   95.60%           
=======================================
  Files          42       42           
  Lines        9754     9754           
=======================================
  Hits         9325     9325           
  Misses        429      429           

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

Copy link
Collaborator

@NirLevi-starkware NirLevi-starkware left a comment

Choose a reason for hiding this comment

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

@NirLevi-starkware reviewed 1 of 3 files at r1, 2 of 2 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @noa-starkware)


src/flow_test/flow_ideas.md line 56 at r4 (raw file):

- find sigma: Enter V0, change in V2, catch all ifs.
- find sigma_edge_cases: catch the comments.
- find sigma - cover all branches with member from V0, V1, V2(V2 DONE).

why did you delete this?


src/flow_test/flow_ideas.md line 58 at r4 (raw file):

- find sigma - cover all branches with member from V0, V1, V2(V2 DONE).
- member from V0, update balance at V3 before getting rewards, pool gets rewards, test rewards.
- member from V0, pool gets rewards at V1, update balance at V3 before getting rewards, pool gets rewards, test rewards.

i dont see flow of this one.


src/flow_test/flows.cairo line 7186 at r4 (raw file):

/// Attest in V1 (pool gets rewards).
/// Attest in V2 (pool gets rewards).
/// Attest in V3 (pool gets rewards).

i dont see 3 different attestations here. we sould have here setup_v2 no?

@noa-starkware noa-starkware force-pushed the noa/staking/v3/test/delegator-v0 branch from 0cbc327 to 36e9a96 Compare November 26, 2025 09:59
Copy link
Collaborator Author

@noa-starkware noa-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 4 files reviewed, 3 unresolved discussions (waiting on @NirLevi-starkware)


src/flow_test/flow_ideas.md line 56 at r4 (raw file):

Previously, NirLevi-starkware (Nir Levi) wrote…

why did you delete this?

revert


src/flow_test/flow_ideas.md line 58 at r4 (raw file):

Previously, NirLevi-starkware (Nir Levi) wrote…

i dont see flow of this one.

Done.


src/flow_test/flows.cairo line 7186 at r4 (raw file):

Previously, NirLevi-starkware (Nir Levi) wrote…

i dont see 3 different attestations here. we sould have here setup_v2 no?

Done.

Copy link
Collaborator

@NirLevi-starkware NirLevi-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@NirLevi-starkware reviewed 3 of 3 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noa-starkware)

@noa-starkware noa-starkware force-pushed the noa/staking/v3/test/delegator-v0 branch from 36e9a96 to 942f38d Compare November 26, 2025 10:08
Copy link
Collaborator

@NirLevi-starkware NirLevi-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@NirLevi-starkware reviewed 3 of 3 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noa-starkware)

@noa-starkware noa-starkware merged commit 2ff67fd into main Nov 26, 2025
6 checks passed
@noa-starkware noa-starkware deleted the noa/staking/v3/test/delegator-v0 branch November 26, 2025 10:24
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