Fix WarBow benchmark forge tests (#353) #524
No reviewers
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!524
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-353-warbow-benchmark-slots"
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?
Summary
GitLab #353 —
TimeArenaWarbowBenchmark.t.solused stalevm.storeslot constants after append-onlyTimeArenastorage layout drift. Wrong slots meant_cachedLevelwas never set (level gate / WarBow timer arming failed) and_battlePoints/battlePointsGenerationwere written to the wrong words.Fix: refresh slots from
forge inspect TimeArena storage-layout(_battlePoints60,battlePointsGeneration62,_cachedLevel106). No production ranking logic changes (#312).Acceptance checklist
cd contracts && forge test --match-contract TimeArenaWarbowBenchmarkforge testhas no unexpected Warbow failurescd contracts && FOUNDRY_PROFILE=ci forge testDoubAirdropMegaethForkmisses withoutairdrop/doub.csv)contracts/test/TimeArenaWarbowBenchmark.t.sol+ snapshots/docsVerification checklist (third parties)
cd contracts && forge test --match-contract TimeArenaWarbowBenchmark -vv— expect 2 passed, gas logs for update/roll/steal.cd contracts && FOUNDRY_PROFILE=ci forge test— expect Warbow benchmark green; only optional fork/airdrop failures ifdoub.csvabsent.TimeArena.solunchanged in this MR.Related docs
docs/testing/warbow-ranking-benchmark-312.md— slot refresh note (#353)docs/testing/ci.md— optional isolated benchmark commanddocs/testing/invariants-and-business-logic.md—INV-TIME-ARENA-WARBOW-RANK-312cross-linkSecurity review — MR !524
Commit reviewed:
df74d3fa85a23731e33b6b668d46f6a56b3b3988Scope:
contracts/test/TimeArenaWarbowBenchmark.t.sol(storage slot constant refresh),contracts/snapshots/TimeArenaWarbowBenchmarkTest.json, and docs (ci.md,invariants-and-business-logic.md,warbow-ranking-benchmark-312.md). No production contract changes (TimeArena.solunchanged).Method: Diff review; traced
vm.storeusage in the benchmark harness; verified slot constants 60 / 62 / 106 againstforge inspect TimeArena storage-layouton the MR branch; confirmedvm.storeis Foundry test-only (not reachable on deployed contracts).Outcome: FINDINGS: 0 medium+
Security review: no medium+ findings on this diff.
Inline threads: none (no findings to anchor).
Notes: This MR corrects stale mapping base slots after append-only
TimeArenalayout drift so gas benchmarks write_battlePoints,battlePointsGeneration, and_cachedLevelat the intended storage words. Prior wrong slots affected test fidelity only, not on-chain authz or ranking logic.mentioned in commit
078c379d56