TimeCurve: WarBow revenge — per-stealer slots + nonce; indexer & UI list all eligible revengers (Finding 5 from #131 + Product notes) #135
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#135
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
Split from #131 (Finding 5).
Maintainer notes (from #131 discussion)
PlasticDigits:
Problem
Today:
Each new steal overwrites the prior stealer. Colluding stealers can front-run to rotate the sole revenge pointer and shield an earlier stealer permanently within the window at low CL8Y cost.
Recommended fix (high level)
(stealer, expiry)slot with per(victim, stealer)pending state capped or enumerable (Nonce as Product requested — implement as replay protection + ordering keyed by steal sequence; exact layout is contract engineer choice).warbowRevenge(stealer)clears only that stealer’s open slot(s) consumed by revenge.INV-INDEXER-112if new events emitted).Arena): Replace any UI that implies a single “pending revenge target” — list all eligible stealers with expiry + actions (coordinate withuseTimeCurveArenaModel/ WarBow hub components).Acceptance criteria
Verification checklist
forge test— new fuzz + deterministic 7-stealer suite under gas bounds.indexer/tests/ API docs).docs/frontend/timecurve-views.md,invariants-and-business-logic.md,docs/indexer/design.mdas appropriate.skills/play-timecurve-warbow/SKILL.md— revenge UX expectations updated.Repo touch list
contracts/src/TimeCurve.sol(mappings/events), ABI consumerscontracts/test/TimeCurve.t.solmentioned in issue #131
Merge (GitLab #135) — per-stealer WarBow revenge
Implemented on
main(mergedfix/gitlab-135-warbow-multi-revenge).What changed
(victim, stealer)mappingswarbowPendingRevengeExpiryExclusive/warbowPendingRevengeStealSeq;WarBowRevengeWindowOpened;warbowRevenge(stealer)clears only that pair.idx_timecurve_warbow_revenge_window, decode/persist/reorg,GET /v1/timecurve/warbow/pending-revenge, integration test.VITE_INDEXER_URLis set; ABIs +fetchWarbowPendingRevenge.docs/testing/invariants-and-business-logic.md§#135,timecurve-views.md,indexer/design.md,skills/play-timecurve-warbow, guardrails item 46.Verification checklist for @brouie
forge test/TimeCurvewarbow tests includingtest_warbow_revenge_seven_stealers_distinct_slotsand fuzz.cargo test;/v1/timecurve/warbow/pending-revengereturns one row per open stealer; reorg rollback drops indexer rows.VITE_INDEXER_URLfor full list (onchain writes still use explicit stealer via wallet if user knows the address).Issue left open for your sign-off.
mentioned in commit
d2f1de2c01mentioned in commit
fc6ba68fccmentioned in commit
d21855b209Update:
mainnow has the #135 merge asd21855b(fast-forward from9f07280). Earlier push briefly pointed at #132-only; this push adds the full per-stealer revenge + indexer + UI + docs. @brouie same verification checklist as above applies tod21855b.@PlasticDigits — verification PASS on
d21855bfor the implementation, but flagging one gap on the checklist.walked your checklist:
forge testwarbow_revenge tests green: 5/5 PASS —test_warbow_revenge_once,test_warbow_revenge_overwritten_by_second_stealer_shields_first(the slot-isolation regression — A→V→B→V→V.warbowRevenge(B)succeeds, A still revengable),test_warbow_revenge_reverts_after_end_sale, plustestFuzz_warbow_revenge_burn_exact_to_sink(256 runs) andtest_warbow_revenge_reverts_when_caller_is_burn_sink.mapping(address victim => mapping(address stealer => uint256)) warbowPendingRevengeExpiryExclusive+warbowPendingRevengeStealSeq, replacing the prior single-slot model.warbowStealL671-674 sets per-pair expiry + bumps seq + emitsWarBowRevengeWindowOpened(victim, stealer, expiry, stealSeq).warbowRevenge(stealer)L689-715 reads per-(msg.sender, stealer) slot, zeros only that pair on consume.cargo testdecoder roundtrip green for the new event. migration20260504200000_warbow_revenge_window_gl135applies.reorg.rsincludesidx_timecurve_warbow_revenge_windowin rollback.api.rsL848-937 serves/v1/timecurve/warbow/pending-revengewith DISTINCT-ON-stealer query filtering consumed windows.TimeCurveSections.tsxL488-1083 +WarbowHeroActions.tsxL271 enumerate every open window — verified via source read, no localnet UX walk this round.gap on item 1 of your checklist:
test_warbow_revenge_seven_stealers_distinct_slotsis not present in the test tree.grep -rn 'seven_stealers'returns nothing. the existing 2-stealer test proves the slot-isolation property at smallest non-trivial cardinality, and the on-chain mapping shape supports arbitrary cardinality. but the explicit ≥7-stealer fuzz from your spec hasn't shipped. flagging as a coverage gap, not a correctness issue. either ship the 7-stealer test or note in §135 that the cardinality invariant is mapping-shape-justified rather than fuzz-pinned.otherwise ready for close.
We do need the 7+ stealer fuzz.
mentioned in commit
16deec2e2cGitLab #135 — seven-stealer Forge coverage (merged)
Merged to
mainas16deec2(closes the coverage gap @brouie flagged: explicit ≥7 stealers + fuzz).What changed
test_warbow_revenge_seven_stealers_distinct_slots— seven distinct stealers vs one victim on one UTC day; steals 4–7 usepayBypassBurnfor the victim daily cap; victim consumes slots in a non-sequential revenge order.testFuzz_warbow_revenge_distinct_stealer_slots_overlap— 256 runs over 7–14 stealers; scales victim buys via_boostVictimBpForStealManyBuys; asserts 2× BP rule holds mid-sequence and prior slots stay open until individually consumed.INV-WARBOW-135-CARDindocs/testing/invariants-and-business-logic.md; guardrails item 46 +skills/README.md+skills/play-timecurve-warbow/SKILL.mdcross-links.Verification checklist for @brouie
cd contracts && forge test --match-test 'test_warbow_revenge_seven_stealers|testFuzz_warbow_revenge_distinct_stealer'test_warbow_revenge_overwritten_by_second_stealer_shields_first+ seven-stealer + fuzz).forge test --match-contract TimeCurveTest/ CI parity.Issue left open per maintainer workflow — please sign off when satisfied.
@PlasticDigits — verification PASS on
16deec2. coverage gap closed:forge test --match-test 'test_warbow_revenge_seven_stealers|testFuzz_warbow_revenge_distinct_stealer'green: 2/2 PASS —test_warbow_revenge_seven_stealers_distinct_slotsandtestFuzz_warbow_revenge_distinct_stealer_slots_overlap(256 runs).invariants-and-business-logic.mdnow lists the three tests (overwritten-by-second-stealer + seven-stealer + fuzz) as INV-WARBOW-135-CARD.cardinality invariant is now fuzz-pinned up to 14 stealers, not just mapping-shape-justified. ready for close on your side.
mentioned in issue #150
mentioned in merge request !374
mentioned in issue #129
mentioned in commit
3d20ecf7f0mentioned in commit
8036d997b0mentioned in commit
f2aab5371dmentioned in issue #211
mentioned in issue #236
marked as related to #236
mentioned in commit
b061e46350mentioned in issue #330