Sparse and empty podium roll contract tests #355
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#355
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Transition Gap Analysis (#342) — P2 #15. Bundles M-C2.
Current codebase
_rollPodiumEpoch) handles winners and tranche promotion; sparse paths lightly exercised.poolBal == 0or zero-address winners during roll.Why needed
Edge transitions at epoch roll (empty pool, partial winners) can strand DOUB or mis-pay; need contract tests before production incidents.
Constraints / guardrails
TimeArena.t.solroll test style.INV-TIME-ARENA-*.Relevant files
contracts/src/arena/TimeArena.sol(_rollPodiumEpoch)contracts/src/arena/ArenaPodiumSettlement.solcontracts/test/TimeArena.t.solRecommended direction
test_roll_empty_pool_tranche_promotion— roll with zero active pool balance; assert promotion still correct, no revert loop.test_roll_partial_winners— one or more zero-address winner slots; assert payout math and events.docs/product/time-arena.mdpayout rules in test comments.Acceptance criteria
forge test.Test plan
cd contracts && forge test --match-test test_roll_emptycd contracts && forge testAttack / abuse test plan
Verification criteria
forge testPASS for new tests.mentioned in issue #342
Timer for a podium should not start if the associated prize pool is empty
mentioned in commit
a824654811mentioned in merge request !528
mentioned in commit
d8fbb7ab2fVerification — GitLab #355 (sparse / empty podium roll contract tests)
Result: PASS — acceptance criteria met on
main(no repo changes required).What was verified
test_roll_empty_pool_tranche_promotioncd contracts && forge test --match-test test_roll_emptytest_roll_partial_winnerscd contracts && forge test --match-test test_roll_partial_winnersTimeArena.t.sol— comments reference time-arena.md tranches and 4:2:1 payout; empty-pool test asserts timer disarmed (podiumDeadline=0) after rollforge test --match-test test_roll_— 7/7 PASS (5 existing + 2 new)INV-TIME-ARENA-PODIUM-ROLL-EMPTY,INV-TIME-ARENA-PODIUM-ROLL-SPARSE(+ detail IDs) indocs/testing/invariants-and-business-logic.md§355test_roll_empty_pool_tranche_promotion— alice/vault balances unchanged; tranches still promotetest_roll_partial_winners— bob balance unchanged; sole winner gets 4/7 onlypodiumTimerArmed == falseandpodiumDeadline == 0after roll; invariants operator note documents sameFull suite note
cd contracts && forge test— 234 PASS, 4 FAIL onDoubAirdropMegaethForkfork tests only (../airdrop/doub.csvmissing; expected on Cloud VMs per AGENTS.md). No TimeArena / roll regressions.Follow-ups
None required for this issue scope.