Skip to content

Commit b027a32

Browse files
chore: update flow ideas (#61)
<!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/starkware-libs/starknet-staking/61) <!-- Reviewable:end --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Update flow ideas doc: add a Views section and expand/normalize migration and balance test scenarios. > > - **Docs** (`src/flow_test/flow_ideas.md`): > - **New section**: Add `Views` with cases for staker/member balance changes and current-epoch balance views. > - **Expanded scenarios**: > - k=1 -> k=2 balances: add delegator/staker claim and delegation edge cases. > - Migration Member: add V0->V1->V3 flow and refine multiple reward/update-balance permutations. > - Migration Staker: add additional enter/upgrade/attest sequences (e.g., V0/V1 to V3). > - Pool member current-epoch migration: add explicit cases for V0/V1 paths. > - **Cleanup**: normalize bullet formatting and remove duplicates/minor typos. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a1ef5f2. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 620bfeb commit b027a32

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

src/flow_test/flow_ideas.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Flow Ideas
2-
## `get_current_staker_info` (name is WIP)
2+
## Views
33
- Get staker info while staker has zero balance.
4+
- staker change balance and test with view of current epoch balance
5+
- member change balance and test with view of current epoch balance
46

57
## `update_rewards`
68
- staker with only btc pool.
@@ -15,23 +17,15 @@
1517
- with member from previous versions.
1618

1719
## k=1 -> k=2 balances
18-
- staker with stake, upgrade, increase stake - before upgrade after 1 epoch, after 2 epochs (check also total stake)
19-
- delegator delegate, upgrade, add delegation - same
2020
- delegator claim rewards when last change is in epoch + 2, then advance epochs and claim again to see no missing rewards
2121
- same as above, also when there is change in epoch + 1
22-
- delegate, advance epoch and get rewards for the pool, claim - zero rewards for the delegate
22+
- delegate, advance epoch and get rewards for the pool, claim - zero rewards for the delegate
2323
- delegate, advance epoch, delegate, advance epoch, claim rewards - only for the first delegation, advance epoch, claim rewards - for all
24-
- delegator claim after claim
24+
- delegator claim after claim
2525
- delegator claim after claim when exists checkpoint with the current epoch of the first claim
2626
- staker change balance in each epoch (increase, intent, delegate increase, delegate intent, delegate exit) and attest in each epoch - test rewards (also some epochs with no balance change and some epochs with no attest)
2727
- staker has multiple pool with multiple delegator each, change balance (staker, strk delegate, btc delegate) and attest in many epochs and test rewards both staker and members
28-
- staker change balance and test with view of current epoch balance
29-
- mamber change balance and test with view of current epoch balance
30-
- staker increase stake, attest same epoch, advance epoch, attest, advance epoch, attest, test rewards
31-
- delegator increase delegate, attest same epoch, advance epoch, attest, advance epoch, attest, test rewards
3228
- test staker claim rewards with more than one balance change in an epoch.
33-
- test delegator claim rewards with V3 rewards?
34-
- test staker rewards with v3 rewards?
3529
- member enter, in the same epoch or one epoch after claim (balance is zero).
3630

3731
## k=1 -> k=2 Migration Member
@@ -56,7 +50,7 @@
5650
- member from V1(+V2), pool gets rewards at V1, pool gets rewards at V1, update balance at V1, update balance at V3, test rewards (IDX=LEN)
5751
- member from V1(+V2), pool gets_rewards at V1, pool gets rewards at V1, update balance at V1, pool gets rewards at V3, update balance at V3, test rewards. (REGULAR CASE)
5852
- member from V1(+V2), pool gets_rewards at V1, pool gets rewards at V1, update balance at V1, pool gets rewards at V1 same epoch, pool gets rewards at V3, update balance at V3, test rewards. (REGULAR CASE)
59-
- V0->V1->V3:
53+
- V0->V1->V3:
6054
- enter in V0, pool gets rewards in V1, change balance at V1, pool gets rewards in V1, pool gets rewards in V3, update balance at V3, pool gets rewards in V3, test rewards.
6155
more ideas:
6256
- member from V1, pool gets rewards at V1, update balance at V1, update balance at V3, pool gets rewards at V3, test rewards.
@@ -71,20 +65,19 @@ more ideas:
7165
- staker enter in V2, advance epoch, advance epoch, upgrade to V3, attest, update balance,advance epoch, attest, advance epoch, attest, test rewards
7266
- staker enter in V2, advance epoch, update balance, upgrade to V3, attest, advance epoch, attest, advance epoch, attest, test rewards
7367
- staker enter in V2, advance epoch, upgrade to V3, advance epoch, attest,
74-
- staker enter in V0, upgrade to V3, attest
68+
- staker enter in V0, upgrade to V3, attest
7569
- staker enter in V0, advance epoch, update balance, upgrade to V3, attest, update balance, advance epoch, attest
7670
- staker enter in V1, advance epoch, update balance, upgrade to V3, attest, update balance, advance epoch, attest
77-
- staker enter in V0, advance epoch, update balance, advance epoch, update balance, upgrade to V3, attest
78-
- staker enter in V1, advance epoch, update balance, advance epoch, update balance, upgrade to V3, attest
71+
- staker enter in V0, advance epoch, update balance, advance epoch, update balance, upgrade to V3, attest
72+
- staker enter in V1, advance epoch, update balance, advance epoch, update balance, upgrade to V3, attest
7973
- staker in V2, update balance staker+update balance pool, upgrade, attest in current epoch, attest in next epoch, attest in next next epoch
8074
- staker in V2, update balance staker+update balance pool, upgrade, update balance staker+update balance pool, attest in current epoch, attest in next epoch, attest in next next epoch
8175
- staker in V2, advance epoch, update balance staker+update balance pool, advance epoch, update balance staker+update balance pool, upgrade, update balance staker+update balance pool, attest in current epoch, attest in next epoch, attest in next next epoch
8276

8377
## pool member balance at curr epoch migration
84-
- Member from V0, no actions in V1 or V2, test curr balance
85-
- Member from V1, no actions in V2, test curr balance
86-
- Member from V0, change balance at V1, no action at V2, test curr balance
87-
- Member from V0, no action at V1, change balance at V2, test curr balance
78+
- Member from V0, no actions in V1 or V2, test curr balance
79+
- Member from V1, no actions in V2, test curr balance
80+
- Member from V0, change balance at V1, no action at V2, test curr balance
8881
- Member from V2, change balance, upgrade, test curr balance
8982
- Cover all ifs with migration from: V0, V1, V2.
9083

0 commit comments

Comments
 (0)