Persist missing TimeArena events and harden ingest side-effects (#317) #462
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!462
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-317-timearena-events-ingest-harden"
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
Closes INV-INDEXER-112 gaps from #309 / #317:
TimeArenaevents:FirstBuyCredScheduled,LevelUp,FeatureUnlocked,PausedSet,WarbowPodiumFinalized, andWarBowFlagClaimed(was decoded but no-op).20260613120000_idx_arena_timearena_events_gl317with dedicatedidx_*tables.eth_callsnapshot failures now abort the block transaction (no warn-and-continue) perINV-INDEXER-317-INGEST-SIDE-EFFECTS.postgres_stage2_persist_all_events_and_rollback_afterto cover all new variants plusArenaLastBuyEpochCharmAnchored.docs/testing/invariants-and-business-logic.md§317 anddocs/indexer/design.md§ ingest side-effects.Acceptance checklist
idx_*rows after ingestcd indexer && YIELDOMEGA_PG_TEST_URL=postgres://yieldomega:password@127.0.0.1:5433/yieldomega_indexer_test cargo test --test integration_stage2 postgres_stage2_persist_all_eventsrollback_afterassertions for level/feature rows)ingestion.rspropagates snapshot errors; block tx rolls backintegration_stage2.rsenumerates all six + charm anchorINV-INDEXER-112checklist in invariants docdocs/testing/invariants-and-business-logic.md#indexer-timearena-events-gitlab-317cargo clippy+cargo testcd indexer && cargo clippy --all-targets -- -D warnings && cargo testverify-podium-live-anvil.shbash scripts/verify-podium-live-anvil.sh(pre-build release indexer first)YIELDOMEGA_PG_TEST_URL=... cargo test --test integration_stage2arena_wallet_stats_two_epochs_and_bonus_fieldsfails on main too (warbow_battle_points1000 vs 750; pre-existing, unrelated to #317)Third-party verification
After ingest on Anvil, confirm rows exist:
Blockers
integration_stage2green requires fixing pre-existingarena_wallet_stats_two_epochs_and_bonus_fieldson main.Follow-ups
PausedSethistory viaGET /v1/arena/*for AUDIT timeline (issue recommended direction).changed the description
changed the description
Security review — MR !462
Commit reviewed:
ac5f4330edd21a0160e8092531668b6bfb013f49Scope: Indexer ingest hardening for GitLab #317 — six missing
TimeArenaevent decode/persist/rollback paths, newidx_*migration tables, and fail-fast propagation of post-logeth_callsnapshot errors (idx_warbow_epoch_score,idx_arena_podium_live) inside the per-block Postgres transaction.Method: Traced attacker-controlled inputs (onchain logs via
eth_getLogs, RPCeth_callresponses) throughdecoder.rs→persist.rs/ingestion.rs→ Postgres sinks; checked SQL parameterization, reorg rollback coverage, side-effect failure handling, and API exposure of new tables.Outcome:
FINDINGS: 0medium+Summary
No medium, high, or critical vulnerabilities identified on this diff.
persist.rsuse sqlx parameterized binds ($1…$N); table names inreorg.rsrollback come from a compile-timeARENA_INDEX_TABLESallowlist — no attacker-controlled SQL fragments.TimeArena.solevent definitions; no new trust boundary or auth bypass.ingestion.rs): Propagating snapshot RPC failures aborts the block transaction instead of warn-and-continue. This hardens integrity (prevents committed derived rows ahead of failed RPC work perINV-INDEXER-317-INGEST-SIDE-EFFECTS). Availability impact from RPC griefing is operational/infrastructure trust, not a new onchain exploit path —battlePoints/podiumview calls used by snapshots do not expose attacker-triggered reverts under normal contract state.Inline threads: None (no findings to anchor).
Security review: no medium+ findings on this diff.
mentioned in commit
a4660ac669