Persist missing TimeArena events and harden ingest side-effects #317
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#317
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
Gap analysis follow-up from #309.
Current codebase
Six
TimeArenaevents lack durable Postgres projections perINV-INDEXER-112:FirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet— not decodedWarbowPodiumFinalized— not decodedWarBowFlagClaimed— decoded asArenaWarbowFlagClaimedbut persist no-op (persist.rsL336)PausedSetABI present indecoder.rsbut no topic branch;pausedcomes from pollereth_callonly.Ingest side-effects:
ingestion.rsL398–432 —warbow_score::snapshot_warbow_players_after_logandarena_podium_live::snapshot_live_podium_after_loglog warnings oneth_callfailure but do not fail the block tx → staleidx_warbow_epoch_score/idx_arena_podium_live.Why needed
Approved: Close #112 event gaps; harden ingest so derived tables cannot silently drift.
Constraints / guardrails
DecodedEvent+idx_*table +rollback_afterinreorg.rs.integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after.Relevant files
indexer/src/decoder.rs,indexer/src/persist.rs,indexer/src/reorg.rsindexer/src/ingestion.rs,indexer/src/warbow_score.rs,indexer/src/arena_podium_live.rsindexer/migrations/— new tablesindexer/tests/integration_stage2.rsdocs/testing/invariants-and-business-logic.md§112contracts/src/arena/TimeArena.solL182–197Recommended direction
eth_callsnapshot failure: fail ingestion transaction or writeingest_side_effect_failuresqueue with retry worker.PausedSethistory via API if useful for AUDIT timeline.Acceptance criteria
idx_*rows after ingest.Test plan
cd indexer && cargo clippy --all-targets -- -D warnings && cargo test.bash scripts/verify-podium-live-anvil.sh.YIELDOMEGA_PG_TEST_URL=... cargo test --test integration_stage2if Postgres available.Attack / abuse test plan
Verification criteria
INV-INDEXER-112checklist complete in invariants doc.TimeArenaevents.mentioned in issue #309
mentioned in merge request !462
mentioned in commit
a4660ac669Verification — issue #317 (FAIL — not implemented on
main)Verified 2026-06-13 on Cloud Agent VM (
main, no open MR for #317).Acceptance criteria
TimeArenaevents haveidx_*rows after ingestDecodedEventvariant / decode branch:FirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet(ABI indecoder.rssol! block only),WarbowPodiumFinalized.WarBowFlagClaimeddecodes asArenaWarbowFlagClaimedbutpersist.rsL336 is a no-op{}. No matching migrations underindexer/migrations/.ARENA_INDEX_TABLESinreorg.rshas no tables for the six events (nothing to roll back).eth_callfailure no longer leaves silent stale stateingestion.rsL398–432:snapshot_warbow_players_after_log/snapshot_live_podium_after_logstilltracing::warn!on error and continue the block tx. Noingest_side_effect_failuresqueue.integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_afterdoes not enumerate any of the six events;grepoverindexer/testsfinds no matches.INV-INDEXER-112checklist complete§112) but the six-event gap from the issue body remains open onmain.Test plan (issue body)
bash scripts/verify-cloud-postgres.sh:5433,CREATEDBOK.cd indexer && cargo clippy --all-targets -- -D warningsYIELDOMEGA_PG_TEST_URL=… cargo testarena_wallet_stats_two_epochs_and_bonus_fields: expectedwarbow_battle_points"750", got"1000"(integration_stage2.rs:1153). Unrelated to #317 scope but blocks fullcargo testgreen.YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_afterbash scripts/verify-podium-live-anvil.shintegration_stage2internally; fails onarena_wallet_stats_two_epochs_and_bonus_fields(same assertion). Live-podium ingest path itself not exercised to completion.Attack / abuse plan
LevelUp/FeatureUnlockedrowsingestion.rsL409–432).Code inspection summary
Gap matches issue description on
main:decoder.rs: no topic branches forFirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet,WarbowPodiumFinalized.persist.rsL336:ArenaWarbowFlagClaimedno-op.reorg.rsARENA_INDEX_TABLES: no new tables.ingestion.rsL398–432: side-effect failures non-fatal.Follow-ups
agent:implement— decode + migrate + persist +rollback_afterfor all six events; extendpostgres_stage2_persist_all_events_and_rollback_after; pick and document side-effect policy (fail block tx vs retry queue).arena_wallet_stats_two_epochs_and_bonus_fields(warbow_battle_points750 vs 1000) socargo testandverify-podium-live-anvil.share unblocked for regression gates.INV-INDEXER-112-317rows in invariants (per-event checklist + verify commands) when implementation lands.Issue left open — acceptance criteria not met on
main.mentioned in commit
5b201b5babmentioned in merge request !472
Verification — issue #317 (FAIL — not implemented on
main)Verified 2026-06-14 on Cloud Agent VM (
main, commit at verification time).Acceptance criteria
TimeArenaevents haveidx_*rows after ingestDecodedEventvariant / decode branch:FirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet(ABI indecoder.rssol! block only — noTimeArenaEvents::PausedSet::SIGNATURE_HASHbranch),WarbowPodiumFinalized(not in sol! block).WarBowFlagClaimeddecodes asArenaWarbowFlagClaimedbutpersist.rsL336 is a no-op{}. No matching migrations underindexer/migrations/.ARENA_INDEX_TABLESinreorg.rsL113–130 has no tables for the six events (nothing to roll back).eth_callfailure no longer leaves silent stale stateingestion.rsL398–432:snapshot_warbow_players_after_log/snapshot_live_podium_after_logstilltracing::warn!on error and continue the block tx. Noingest_side_effect_failuresqueue anywhere in repo (grepempty).integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after(L299–391) enumerates 15 existing variants; none of the six missing events.grepoverindexer/testsfinds noFirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet, orWarbowPodiumFinalized.INV-INDEXER-112checklist complete§112L540) but the six-event gap from the issue body remains open onmain. NoINV-INDEXER-112-317per-event rows.Test plan (issue body)
bash scripts/verify-cloud-postgres.sh:5433,CREATEDBOK.cd indexer && cargo clippy --all-targets -- -D warningsYIELDOMEGA_PG_TEST_URL=… cargo testarena_wallet_stats_two_epochs_and_bonus_fields: expectedwarbow_battle_points"750", got"1000"(integration_stage2.rs:1153). Unrelated to #317 scope but blocks fullcargo testgreen.YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_afterbash scripts/verify-podium-live-anvil.shverify-podium-live-anvil: indexer /v1/status unavailable(script L141–143). Did not reachintegration_stage2cargo test step.Attack / abuse plan
LevelUp/FeatureUnlockedrowsingestion.rsL409–432).Code inspection summary
Gap matches issue description on
main:decoder.rs: topic branches for 15TimeArenaevents; missingFirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet,WarbowPodiumFinalized.persist.rsL336:ArenaWarbowFlagClaimedno-op.reorg.rsARENA_INDEX_TABLES: no new tables.ingestion.rsL398–432: side-effect failures non-fatal.Follow-ups
agent:implement— decode + migrate + persist +rollback_afterfor all six events; extendpostgres_stage2_persist_all_events_and_rollback_after; pick and document side-effect policy (fail block tx vs retry queue).arena_wallet_stats_two_epochs_and_bonus_fields(warbow_battle_points750 vs 1000) socargo testandverify-podium-live-anvil.shregression gates are unblocked.INV-INDEXER-112-317rows in invariants (per-event checklist + verify commands) when implementation lands.Issue left open — acceptance criteria not met on
main.mentioned in merge request !478
mentioned in merge request !481
Verification — issue #317 (FAIL — not implemented on
main)Verified 2026-06-14 on Cloud Agent VM (
main, commita0d325c5).Acceptance criteria
TimeArenaevents haveidx_*rows after ingestDecodedEventvariant / decode branch:FirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet(ABI indecoder.rssol! block only — noTimeArenaEvents::PausedSet::SIGNATURE_HASHbranch),WarbowPodiumFinalized(not in sol! block).WarBowFlagClaimeddecodes asArenaWarbowFlagClaimedbutpersist.rsL336 is a no-op{}. No matching migrations underindexer/migrations/.ARENA_INDEX_TABLESinreorg.rsL113–130 has no tables for the six events (nothing to roll back).eth_callfailure no longer leaves silent stale stateingestion.rsL398–432:snapshot_warbow_players_after_log/snapshot_live_podium_after_logstilltracing::warn!on error and continue the block tx. Noingest_side_effect_failuresqueue anywhere in repo (grepempty).integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after(L299–391) enumerates 15 existing variants; none of the six missing events.grepoverindexer/finds noFirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet, orWarbowPodiumFinalized.INV-INDEXER-112checklist complete§112L540) but the six-event gap from the issue body remains open onmain. NoINV-INDEXER-112-317per-event rows.Test plan (issue body)
bash scripts/verify-cloud-postgres.sh:5433,CREATEDBOK.cd indexer && cargo clippy --all-targets -- -D warningsYIELDOMEGA_PG_TEST_URL=… cargo testarena_wallet_stats_two_epochs_and_bonus_fields: expectedwarbow_battle_points"750", got"1000"(integration_stage2.rs:1153). Unrelated to #317 scope but blocks fullcargo testgreen.YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_afterbash scripts/verify-podium-live-anvil.shverify-podium-live-anvil: indexer /v1/status unavailable(script exit 1). Did not reachintegration_stage2cargo test step.Attack / abuse plan
LevelUp/FeatureUnlockedrowsingestion.rsL409–432).Code inspection summary
Gap matches issue description on
main:decoder.rs: topic branches for 15TimeArenaevents; missingFirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet,WarbowPodiumFinalized.persist.rsL336:ArenaWarbowFlagClaimedno-op.reorg.rsARENA_INDEX_TABLES: no new tables.ingestion.rsL398–432: side-effect failures non-fatal.Follow-ups
agent:implement— decode + migrate + persist +rollback_afterfor all six events; extendpostgres_stage2_persist_all_events_and_rollback_after; pick and document side-effect policy (fail block tx vs retry queue).arena_wallet_stats_two_epochs_and_bonus_fields(warbow_battle_points750 vs 1000) socargo testandverify-podium-live-anvil.shregression gates are unblocked.INV-INDEXER-112-317rows in invariants (per-event checklist + verify commands) when implementation lands.Issue left open — acceptance criteria not met on
main.mentioned in merge request !487
mentioned in merge request !497
mentioned in commit
6c822804a8Verification — issue #317 (PASS — on
main)Verified 2026-06-14 on Cloud Agent VM (
main, commit6c822804— merged MRverify/issue-317-timearena-events).Acceptance criteria
TimeArenaevents haveidx_*rows after ingestdecoder.rstopic branches forFirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet,WarbowPodiumFinalized;ArenaWarbowFlagClaimedpersists toidx_arena_warbow_flag_claimed. Migration20260613120000_idx_arena_timearena_events_gl317.up.sql.integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_afterasserts row counts for all six tables.ARENA_INDEX_TABLESinreorg.rsincludes all six new tables. Integration testrollback_afterclearsidx_arena_level_up/idx_arena_feature_unlocked(and full table list viaARENA_INDEX_TABLES).eth_callfailure no longer leaves silent stale stateingestion.rsL398–432:snapshot_warbow_players_after_log/snapshot_live_podium_after_logpropagate errors with?→ block tx rolls back. Documented policy:INV-INDEXER-317-INGEST-SIDE-EFFECTS· indexer design §317.postgres_stage2_persist_all_events_and_rollback_afterenumerates all six variants (L344–393) with persist + rollback assertions.INV-INDEXER-112checklist completeINV-INDEXER-317-TIMEARENA-EVENTS,INV-INDEXER-317-INGEST-SIDE-EFFECTS,INV-INDEXER-317-REORG) with per-event table mapping at invariants §317.Test plan (issue body)
bash scripts/verify-cloud-postgres.sh:5433,CREATEDBOK.cd indexer && cargo clippy --all-targets -- -D warningsYIELDOMEGA_PG_TEST_URL=… cargo testarena_wallet_stats_two_epochs_and_bonus_fields).YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_afterbash scripts/verify-podium-live-anvil.shintegration_stage24/4; live podium rows=12.Attack / abuse plan
LevelUp/FeatureUnlockedrowsrollback_afterdeletes rows withblock_number > ancestor.Code inspection summary
Implementation matches issue scope on
main:decoder.rs: decode branches for all six events includingWarbowPodiumFinalizedin sol! block.persist.rs: INSERT into dedicatedidx_*tables (no no-op onArenaWarbowFlagClaimed).reorg.rsARENA_INDEX_TABLES: six new tables registered.ingestion.rs: side-effect failures fail-closed (block tx rollback).Issue closed — all acceptance criteria met on
main.mentioned in issue #356
marked as related to #356