Persist missing TimeArena events and harden ingest side-effects #317

Closed
opened 2026-06-13 07:34:26 +00:00 by PlasticDigits · 16 comments
PlasticDigits commented 2026-06-13 07:34:26 +00:00 (Migrated from gitlab.com)

Parent

Gap analysis follow-up from #309.

Current codebase

Six TimeArena events lack durable Postgres projections per INV-INDEXER-112:

  • FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet — not decoded
  • WarbowPodiumFinalized — not decoded
  • WarBowFlagClaimed — decoded as ArenaWarbowFlagClaimed but persist no-op (persist.rs L336)

PausedSet ABI present in decoder.rs but no topic branch; paused comes from poller eth_call only.

Ingest side-effects: ingestion.rs L398–432 — warbow_score::snapshot_warbow_players_after_log and arena_podium_live::snapshot_live_podium_after_log log warnings on eth_call failure but do not fail the block tx → stale idx_warbow_epoch_score / idx_arena_podium_live.

Why needed

Approved: Close #112 event gaps; harden ingest so derived tables cannot silently drift.

Constraints / guardrails

  • Every new event → DecodedEvent + idx_* table + rollback_after in reorg.rs.
  • Extend integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after.
  • Side-effect policy: fail block ingest or enqueue retry — pick one and document.

Relevant files

  • indexer/src/decoder.rs, indexer/src/persist.rs, indexer/src/reorg.rs
  • indexer/src/ingestion.rs, indexer/src/warbow_score.rs, indexer/src/arena_podium_live.rs
  • indexer/migrations/ — new tables
  • indexer/tests/integration_stage2.rs
  • docs/testing/invariants-and-business-logic.md §112
  • contracts/src/arena/TimeArena.sol L182–197
  1. Add decode + persist + migrations for all six events.
  2. On eth_call snapshot failure: fail ingestion transaction or write ingest_side_effect_failures queue with retry worker.
  3. Expose PausedSet history via API if useful for AUDIT timeline.

Acceptance criteria

  • All six events have idx_* rows after ingest.
  • Reorg rollback clears new tables.
  • Side-effect failure no longer leaves silent stale state.
  • Stage 2 integration test covers new variants.

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_stage2 if Postgres available.

Attack / abuse test plan

  • Reorg: rollback removes LevelUp/FeatureUnlocked rows.
  • RPC griefing: failed snapshot must not commit partial derived state.

Verification criteria

  • INV-INDEXER-112 checklist complete in invariants doc.
  • Integration test enumerates all TimeArena events.
## Parent Gap analysis follow-up from [#309](https://gitlab.com/PlasticDigits/yieldomega/-/issues/309). ## Current codebase Six `TimeArena` events lack durable Postgres projections per `INV-INDEXER-112`: - `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet` — not decoded - `WarbowPodiumFinalized` — not decoded - `WarBowFlagClaimed` — decoded as `ArenaWarbowFlagClaimed` but persist no-op (`persist.rs` L336) `PausedSet` ABI present in `decoder.rs` but no topic branch; `paused` comes from poller `eth_call` only. **Ingest side-effects:** `ingestion.rs` L398–432 — `warbow_score::snapshot_warbow_players_after_log` and `arena_podium_live::snapshot_live_podium_after_log` log warnings on `eth_call` failure but **do not fail** the block tx → stale `idx_warbow_epoch_score` / `idx_arena_podium_live`. ## Why needed Approved: Close #112 event gaps; harden ingest so derived tables cannot silently drift. ## Constraints / guardrails - Every new event → `DecodedEvent` + `idx_*` table + `rollback_after` in `reorg.rs`. - Extend `integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after`. - Side-effect policy: fail block ingest or enqueue retry — pick one and document. ## Relevant files - `indexer/src/decoder.rs`, `indexer/src/persist.rs`, `indexer/src/reorg.rs` - `indexer/src/ingestion.rs`, `indexer/src/warbow_score.rs`, `indexer/src/arena_podium_live.rs` - `indexer/migrations/` — new tables - `indexer/tests/integration_stage2.rs` - `docs/testing/invariants-and-business-logic.md` §112 - `contracts/src/arena/TimeArena.sol` L182–197 ## Recommended direction 1. Add decode + persist + migrations for all six events. 2. On `eth_call` snapshot failure: fail ingestion transaction **or** write `ingest_side_effect_failures` queue with retry worker. 3. Expose `PausedSet` history via API if useful for AUDIT timeline. ## Acceptance criteria - [ ] All six events have `idx_*` rows after ingest. - [ ] Reorg rollback clears new tables. - [ ] Side-effect failure no longer leaves silent stale state. - [ ] Stage 2 integration test covers new variants. ## 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_stage2` if Postgres available. ## Attack / abuse test plan - Reorg: rollback removes LevelUp/FeatureUnlocked rows. - RPC griefing: failed snapshot must not commit partial derived state. ## Verification criteria - `INV-INDEXER-112` checklist complete in invariants doc. - Integration test enumerates all `TimeArena` events.
PlasticDigits commented 2026-06-13 07:34:43 +00:00 (Migrated from gitlab.com)

mentioned in issue #309

mentioned in issue #309
PlasticDigits commented 2026-06-13 08:13:01 +00:00 (Migrated from gitlab.com)

mentioned in merge request !462

mentioned in merge request !462
PlasticDigits commented 2026-06-13 09:29:41 +00:00 (Migrated from gitlab.com)

mentioned in commit a4660ac669

mentioned in commit a4660ac66995213ef94ff9236096b5a290b91217
PlasticDigits commented 2026-06-13 12:58:14 +00:00 (Migrated from gitlab.com)

Verification — issue #317 (FAIL — not implemented on main)

Verified 2026-06-13 on Cloud Agent VM (main, no open MR for #317).

Acceptance criteria

Criterion Result Evidence
All six TimeArena events have idx_* rows after ingest FAIL Five events have no DecodedEvent variant / decode branch: FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet (ABI in decoder.rs sol! block only), WarbowPodiumFinalized. WarBowFlagClaimed decodes as ArenaWarbowFlagClaimed but persist.rs L336 is a no-op {}. No matching migrations under indexer/migrations/.
Reorg rollback clears new tables FAIL ARENA_INDEX_TABLES in reorg.rs has no tables for the six events (nothing to roll back).
Side-effect eth_call failure no longer leaves silent stale state FAIL ingestion.rs L398–432: snapshot_warbow_players_after_log / snapshot_live_podium_after_log still tracing::warn! on error and continue the block tx. No ingest_side_effect_failures queue.
Stage 2 integration test covers new variants FAIL integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after does not enumerate any of the six events; grep over indexer/tests finds no matches.
INV-INDEXER-112 checklist complete FAIL Invariants doc states the rule (§112) but the six-event gap from the issue body remains open on main.

Test plan (issue body)

Command Result Notes
bash scripts/verify-cloud-postgres.sh PASS Native PG 16 on :5433, CREATEDB OK.
cd indexer && cargo clippy --all-targets -- -D warnings PASS Clean build.
YIELDOMEGA_PG_TEST_URL=… cargo test FAIL arena_wallet_stats_two_epochs_and_bonus_fields: expected warbow_battle_points "750", got "1000" (integration_stage2.rs:1153). Unrelated to #317 scope but blocks full cargo test green.
YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after PASS Existing variants persist/rollback; does not cover the six missing events.
bash scripts/verify-podium-live-anvil.sh FAIL Script runs integration_stage2 internally; fails on arena_wallet_stats_two_epochs_and_bonus_fields (same assertion). Live-podium ingest path itself not exercised to completion.

Attack / abuse plan

Scenario Result Notes
Reorg removes LevelUp / FeatureUnlocked rows FAIL Events not persisted — nothing to remove.
RPC griefing: failed snapshot must not commit partial derived state FAIL Current code still warns-and-continues (ingestion.rs L409–432).

Code inspection summary

Gap matches issue description on main:

  • decoder.rs: no topic branches for FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet, WarbowPodiumFinalized.
  • persist.rs L336: ArenaWarbowFlagClaimed no-op.
  • reorg.rs ARENA_INDEX_TABLES: no new tables.
  • ingestion.rs L398–432: side-effect failures non-fatal.

Follow-ups

  1. agent:implement — decode + migrate + persist + rollback_after for all six events; extend postgres_stage2_persist_all_events_and_rollback_after; pick and document side-effect policy (fail block tx vs retry queue).
  2. Fix arena_wallet_stats_two_epochs_and_bonus_fields (warbow_battle_points 750 vs 1000) so cargo test and verify-podium-live-anvil.sh are unblocked for regression gates.
  3. Add explicit INV-INDEXER-112-317 rows in invariants (per-event checklist + verify commands) when implementation lands.

Issue left open — acceptance criteria not met on main.

## Verification — issue #317 (FAIL — not implemented on `main`) Verified **2026-06-13** on Cloud Agent VM (`main`, no open MR for #317). ### Acceptance criteria | Criterion | Result | Evidence | |-----------|--------|----------| | All six `TimeArena` events have `idx_*` rows after ingest | **FAIL** | Five events have no `DecodedEvent` variant / decode branch: `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet` (ABI in `decoder.rs` sol! block only), `WarbowPodiumFinalized`. `WarBowFlagClaimed` decodes as `ArenaWarbowFlagClaimed` but `persist.rs` L336 is a no-op `{}`. No matching migrations under `indexer/migrations/`. | | Reorg rollback clears new tables | **FAIL** | `ARENA_INDEX_TABLES` in `reorg.rs` has no tables for the six events (nothing to roll back). | | Side-effect `eth_call` failure no longer leaves silent stale state | **FAIL** | `ingestion.rs` L398–432: `snapshot_warbow_players_after_log` / `snapshot_live_podium_after_log` still `tracing::warn!` on error and continue the block tx. No `ingest_side_effect_failures` queue. | | Stage 2 integration test covers new variants | **FAIL** | `integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after` does not enumerate any of the six events; `grep` over `indexer/tests` finds no matches. | | `INV-INDEXER-112` checklist complete | **FAIL** | Invariants doc states the rule (`§112`) but the six-event gap from the issue body remains open on `main`. | ### Test plan (issue body) | Command | Result | Notes | |---------|--------|-------| | `bash scripts/verify-cloud-postgres.sh` | **PASS** | Native PG 16 on `:5433`, `CREATEDB` OK. | | `cd indexer && cargo clippy --all-targets -- -D warnings` | **PASS** | Clean build. | | `YIELDOMEGA_PG_TEST_URL=… cargo test` | **FAIL** | `arena_wallet_stats_two_epochs_and_bonus_fields`: expected `warbow_battle_points` `"750"`, got `"1000"` (`integration_stage2.rs:1153`). Unrelated to #317 scope but blocks full `cargo test` green. | | `YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after` | **PASS** | Existing variants persist/rollback; does **not** cover the six missing events. | | `bash scripts/verify-podium-live-anvil.sh` | **FAIL** | Script runs `integration_stage2` internally; fails on `arena_wallet_stats_two_epochs_and_bonus_fields` (same assertion). Live-podium ingest path itself not exercised to completion. | ### Attack / abuse plan | Scenario | Result | Notes | |----------|--------|-------| | Reorg removes `LevelUp` / `FeatureUnlocked` rows | **FAIL** | Events not persisted — nothing to remove. | | RPC griefing: failed snapshot must not commit partial derived state | **FAIL** | Current code still warns-and-continues (`ingestion.rs` L409–432). | ### Code inspection summary Gap matches issue description on `main`: - `decoder.rs`: no topic branches for `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet`, `WarbowPodiumFinalized`. - `persist.rs` L336: `ArenaWarbowFlagClaimed` no-op. - `reorg.rs` `ARENA_INDEX_TABLES`: no new tables. - `ingestion.rs` L398–432: side-effect failures non-fatal. ### Follow-ups 1. **`agent:implement`** — decode + migrate + persist + `rollback_after` for all six events; extend `postgres_stage2_persist_all_events_and_rollback_after`; pick and document side-effect policy (fail block tx vs retry queue). 2. Fix **`arena_wallet_stats_two_epochs_and_bonus_fields`** (`warbow_battle_points` 750 vs 1000) so `cargo test` and `verify-podium-live-anvil.sh` are unblocked for regression gates. 3. Add explicit **`INV-INDEXER-112-317`** rows in invariants (per-event checklist + verify commands) when implementation lands. **Issue left open** — acceptance criteria not met on `main`.
PlasticDigits commented 2026-06-13 14:14:26 +00:00 (Migrated from gitlab.com)

mentioned in commit 5b201b5bab

mentioned in commit 5b201b5bab6e27286a972014f60540bd060c36cc
PlasticDigits commented 2026-06-13 14:14:29 +00:00 (Migrated from gitlab.com)

mentioned in merge request !472

mentioned in merge request !472
PlasticDigits commented 2026-06-14 02:54:56 +00:00 (Migrated from gitlab.com)

Verification — issue #317 (FAIL — not implemented on main)

Verified 2026-06-14 on Cloud Agent VM (main, commit at verification time).

Acceptance criteria

Criterion Result Evidence
All six TimeArena events have idx_* rows after ingest FAIL Five events have no DecodedEvent variant / decode branch: FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet (ABI in decoder.rs sol! block only — no TimeArenaEvents::PausedSet::SIGNATURE_HASH branch), WarbowPodiumFinalized (not in sol! block). WarBowFlagClaimed decodes as ArenaWarbowFlagClaimed but persist.rs L336 is a no-op {}. No matching migrations under indexer/migrations/.
Reorg rollback clears new tables FAIL ARENA_INDEX_TABLES in reorg.rs L113–130 has no tables for the six events (nothing to roll back).
Side-effect eth_call failure no longer leaves silent stale state FAIL ingestion.rs L398–432: snapshot_warbow_players_after_log / snapshot_live_podium_after_log still tracing::warn! on error and continue the block tx. No ingest_side_effect_failures queue anywhere in repo (grep empty).
Stage 2 integration test covers new variants FAIL integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after (L299–391) enumerates 15 existing variants; none of the six missing events. grep over indexer/tests finds no FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet, or WarbowPodiumFinalized.
INV-INDEXER-112 checklist complete FAIL Invariants doc states the rule (§112 L540) but the six-event gap from the issue body remains open on main. No INV-INDEXER-112-317 per-event rows.

Test plan (issue body)

Command Result Notes
bash scripts/verify-cloud-postgres.sh PASS Native PG 16 on :5433, CREATEDB OK.
cd indexer && cargo clippy --all-targets -- -D warnings PASS Clean build.
YIELDOMEGA_PG_TEST_URL=… cargo test FAIL arena_wallet_stats_two_epochs_and_bonus_fields: expected warbow_battle_points "750", got "1000" (integration_stage2.rs:1153). Unrelated to #317 scope but blocks full cargo test green.
YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after PASS Existing variants persist/rollback; does not cover the six missing events.
bash scripts/verify-podium-live-anvil.sh FAIL Anvil deploy + seed OK; indexer never became ready — verify-podium-live-anvil: indexer /v1/status unavailable (script L141–143). Did not reach integration_stage2 cargo test step.

Attack / abuse plan

Scenario Result Notes
Reorg removes LevelUp / FeatureUnlocked rows FAIL Events not persisted — nothing to remove.
RPC griefing: failed snapshot must not commit partial derived state FAIL Current code still warns-and-continues (ingestion.rs L409–432).

Code inspection summary

Gap matches issue description on main:

  • decoder.rs: topic branches for 15 TimeArena events; missing FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet, WarbowPodiumFinalized.
  • persist.rs L336: ArenaWarbowFlagClaimed no-op.
  • reorg.rs ARENA_INDEX_TABLES: no new tables.
  • ingestion.rs L398–432: side-effect failures non-fatal.

Follow-ups

  1. agent:implement — decode + migrate + persist + rollback_after for all six events; extend postgres_stage2_persist_all_events_and_rollback_after; pick and document side-effect policy (fail block tx vs retry queue).
  2. Fix arena_wallet_stats_two_epochs_and_bonus_fields (warbow_battle_points 750 vs 1000) so cargo test and verify-podium-live-anvil.sh regression gates are unblocked.
  3. Add explicit INV-INDEXER-112-317 rows in invariants (per-event checklist + verify commands) when implementation lands.

Issue left open — acceptance criteria not met on main.

## Verification — issue #317 (FAIL — not implemented on `main`) Verified **2026-06-14** on Cloud Agent VM (`main`, commit at verification time). ### Acceptance criteria | Criterion | Result | Evidence | |-----------|--------|----------| | All six `TimeArena` events have `idx_*` rows after ingest | **FAIL** | Five events have no `DecodedEvent` variant / decode branch: `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet` (ABI in `decoder.rs` sol! block only — no `TimeArenaEvents::PausedSet::SIGNATURE_HASH` branch), `WarbowPodiumFinalized` (not in sol! block). `WarBowFlagClaimed` decodes as `ArenaWarbowFlagClaimed` but `persist.rs` L336 is a no-op `{}`. No matching migrations under `indexer/migrations/`. | | Reorg rollback clears new tables | **FAIL** | `ARENA_INDEX_TABLES` in `reorg.rs` L113–130 has no tables for the six events (nothing to roll back). | | Side-effect `eth_call` failure no longer leaves silent stale state | **FAIL** | `ingestion.rs` L398–432: `snapshot_warbow_players_after_log` / `snapshot_live_podium_after_log` still `tracing::warn!` on error and continue the block tx. No `ingest_side_effect_failures` queue anywhere in repo (`grep` empty). | | Stage 2 integration test covers new variants | **FAIL** | `integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after` (L299–391) enumerates 15 existing variants; none of the six missing events. `grep` over `indexer/tests` finds no `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet`, or `WarbowPodiumFinalized`. | | `INV-INDEXER-112` checklist complete | **FAIL** | Invariants doc states the rule (`§112` L540) but the six-event gap from the issue body remains open on `main`. No `INV-INDEXER-112-317` per-event rows. | ### Test plan (issue body) | Command | Result | Notes | |---------|--------|-------| | `bash scripts/verify-cloud-postgres.sh` | **PASS** | Native PG 16 on `:5433`, `CREATEDB` OK. | | `cd indexer && cargo clippy --all-targets -- -D warnings` | **PASS** | Clean build. | | `YIELDOMEGA_PG_TEST_URL=… cargo test` | **FAIL** | `arena_wallet_stats_two_epochs_and_bonus_fields`: expected `warbow_battle_points` `"750"`, got `"1000"` (`integration_stage2.rs:1153`). Unrelated to #317 scope but blocks full `cargo test` green. | | `YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after` | **PASS** | Existing variants persist/rollback; does **not** cover the six missing events. | | `bash scripts/verify-podium-live-anvil.sh` | **FAIL** | Anvil deploy + seed OK; indexer never became ready — `verify-podium-live-anvil: indexer /v1/status unavailable` (script L141–143). Did not reach `integration_stage2` cargo test step. | ### Attack / abuse plan | Scenario | Result | Notes | |----------|--------|----------| | Reorg removes `LevelUp` / `FeatureUnlocked` rows | **FAIL** | Events not persisted — nothing to remove. | | RPC griefing: failed snapshot must not commit partial derived state | **FAIL** | Current code still warns-and-continues (`ingestion.rs` L409–432). | ### Code inspection summary Gap matches issue description on `main`: - `decoder.rs`: topic branches for 15 `TimeArena` events; missing `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet`, `WarbowPodiumFinalized`. - `persist.rs` L336: `ArenaWarbowFlagClaimed` no-op. - `reorg.rs` `ARENA_INDEX_TABLES`: no new tables. - `ingestion.rs` L398–432: side-effect failures non-fatal. ### Follow-ups 1. **`agent:implement`** — decode + migrate + persist + `rollback_after` for all six events; extend `postgres_stage2_persist_all_events_and_rollback_after`; pick and document side-effect policy (fail block tx vs retry queue). 2. Fix **`arena_wallet_stats_two_epochs_and_bonus_fields`** (`warbow_battle_points` 750 vs 1000) so `cargo test` and `verify-podium-live-anvil.sh` regression gates are unblocked. 3. Add explicit **`INV-INDEXER-112-317`** rows in invariants (per-event checklist + verify commands) when implementation lands. **Issue left open** — acceptance criteria not met on `main`.
PlasticDigits commented 2026-06-14 02:55:11 +00:00 (Migrated from gitlab.com)

mentioned in merge request !478

mentioned in merge request !478
PlasticDigits commented 2026-06-14 05:14:39 +00:00 (Migrated from gitlab.com)

mentioned in merge request !481

mentioned in merge request !481
PlasticDigits commented 2026-06-14 05:42:01 +00:00 (Migrated from gitlab.com)

Verification — issue #317 (FAIL — not implemented on main)

Verified 2026-06-14 on Cloud Agent VM (main, commit a0d325c5).

Acceptance criteria

Criterion Result Evidence
All six TimeArena events have idx_* rows after ingest FAIL Five events have no DecodedEvent variant / decode branch: FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet (ABI in decoder.rs sol! block only — no TimeArenaEvents::PausedSet::SIGNATURE_HASH branch), WarbowPodiumFinalized (not in sol! block). WarBowFlagClaimed decodes as ArenaWarbowFlagClaimed but persist.rs L336 is a no-op {}. No matching migrations under indexer/migrations/.
Reorg rollback clears new tables FAIL ARENA_INDEX_TABLES in reorg.rs L113–130 has no tables for the six events (nothing to roll back).
Side-effect eth_call failure no longer leaves silent stale state FAIL ingestion.rs L398–432: snapshot_warbow_players_after_log / snapshot_live_podium_after_log still tracing::warn! on error and continue the block tx. No ingest_side_effect_failures queue anywhere in repo (grep empty).
Stage 2 integration test covers new variants FAIL integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after (L299–391) enumerates 15 existing variants; none of the six missing events. grep over indexer/ finds no FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet, or WarbowPodiumFinalized.
INV-INDEXER-112 checklist complete FAIL Invariants doc states the rule (§112 L540) but the six-event gap from the issue body remains open on main. No INV-INDEXER-112-317 per-event rows.

Test plan (issue body)

Command Result Notes
bash scripts/verify-cloud-postgres.sh PASS Native PG 16 on :5433, CREATEDB OK.
cd indexer && cargo clippy --all-targets -- -D warnings PASS Clean build.
YIELDOMEGA_PG_TEST_URL=… cargo test FAIL arena_wallet_stats_two_epochs_and_bonus_fields: expected warbow_battle_points "750", got "1000" (integration_stage2.rs:1153). Unrelated to #317 scope but blocks full cargo test green.
YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after PASS Existing variants persist/rollback; does not cover the six missing events.
bash scripts/verify-podium-live-anvil.sh FAIL Anvil deploy + seed OK; indexer never became ready — verify-podium-live-anvil: indexer /v1/status unavailable (script exit 1). Did not reach integration_stage2 cargo test step.

Attack / abuse plan

Scenario Result Notes
Reorg removes LevelUp / FeatureUnlocked rows FAIL Events not persisted — nothing to remove.
RPC griefing: failed snapshot must not commit partial derived state FAIL Current code still warns-and-continues (ingestion.rs L409–432).

Code inspection summary

Gap matches issue description on main:

  • decoder.rs: topic branches for 15 TimeArena events; missing FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet, WarbowPodiumFinalized.
  • persist.rs L336: ArenaWarbowFlagClaimed no-op.
  • reorg.rs ARENA_INDEX_TABLES: no new tables.
  • ingestion.rs L398–432: side-effect failures non-fatal.

Follow-ups

  1. agent:implement — decode + migrate + persist + rollback_after for all six events; extend postgres_stage2_persist_all_events_and_rollback_after; pick and document side-effect policy (fail block tx vs retry queue).
  2. Fix arena_wallet_stats_two_epochs_and_bonus_fields (warbow_battle_points 750 vs 1000) so cargo test and verify-podium-live-anvil.sh regression gates are unblocked.
  3. Add explicit INV-INDEXER-112-317 rows in invariants (per-event checklist + verify commands) when implementation lands.

Issue left open — acceptance criteria not met on main.

## Verification — issue #317 (FAIL — not implemented on `main`) Verified **2026-06-14** on Cloud Agent VM (`main`, commit `a0d325c5`). ### Acceptance criteria | Criterion | Result | Evidence | |-----------|--------|----------| | All six `TimeArena` events have `idx_*` rows after ingest | **FAIL** | Five events have no `DecodedEvent` variant / decode branch: `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet` (ABI in `decoder.rs` sol! block only — no `TimeArenaEvents::PausedSet::SIGNATURE_HASH` branch), `WarbowPodiumFinalized` (not in sol! block). `WarBowFlagClaimed` decodes as `ArenaWarbowFlagClaimed` but `persist.rs` L336 is a no-op `{}`. No matching migrations under `indexer/migrations/`. | | Reorg rollback clears new tables | **FAIL** | `ARENA_INDEX_TABLES` in `reorg.rs` L113–130 has no tables for the six events (nothing to roll back). | | Side-effect `eth_call` failure no longer leaves silent stale state | **FAIL** | `ingestion.rs` L398–432: `snapshot_warbow_players_after_log` / `snapshot_live_podium_after_log` still `tracing::warn!` on error and continue the block tx. No `ingest_side_effect_failures` queue anywhere in repo (`grep` empty). | | Stage 2 integration test covers new variants | **FAIL** | `integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after` (L299–391) enumerates 15 existing variants; none of the six missing events. `grep` over `indexer/` finds no `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet`, or `WarbowPodiumFinalized`. | | `INV-INDEXER-112` checklist complete | **FAIL** | Invariants doc states the rule (`§112` L540) but the six-event gap from the issue body remains open on `main`. No `INV-INDEXER-112-317` per-event rows. | ### Test plan (issue body) | Command | Result | Notes | |---------|--------|-------| | `bash scripts/verify-cloud-postgres.sh` | **PASS** | Native PG 16 on `:5433`, `CREATEDB` OK. | | `cd indexer && cargo clippy --all-targets -- -D warnings` | **PASS** | Clean build. | | `YIELDOMEGA_PG_TEST_URL=… cargo test` | **FAIL** | `arena_wallet_stats_two_epochs_and_bonus_fields`: expected `warbow_battle_points` `"750"`, got `"1000"` (`integration_stage2.rs:1153`). Unrelated to #317 scope but blocks full `cargo test` green. | | `YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after` | **PASS** | Existing variants persist/rollback; does **not** cover the six missing events. | | `bash scripts/verify-podium-live-anvil.sh` | **FAIL** | Anvil deploy + seed OK; indexer never became ready — `verify-podium-live-anvil: indexer /v1/status unavailable` (script exit 1). Did not reach `integration_stage2` cargo test step. | ### Attack / abuse plan | Scenario | Result | Notes | |----------|--------|-------| | Reorg removes `LevelUp` / `FeatureUnlocked` rows | **FAIL** | Events not persisted — nothing to remove. | | RPC griefing: failed snapshot must not commit partial derived state | **FAIL** | Current code still warns-and-continues (`ingestion.rs` L409–432). | ### Code inspection summary Gap matches issue description on `main`: - `decoder.rs`: topic branches for 15 `TimeArena` events; missing `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet`, `WarbowPodiumFinalized`. - `persist.rs` L336: `ArenaWarbowFlagClaimed` no-op. - `reorg.rs` `ARENA_INDEX_TABLES`: no new tables. - `ingestion.rs` L398–432: side-effect failures non-fatal. ### Follow-ups 1. **`agent:implement`** — decode + migrate + persist + `rollback_after` for all six events; extend `postgres_stage2_persist_all_events_and_rollback_after`; pick and document side-effect policy (fail block tx vs retry queue). 2. Fix **`arena_wallet_stats_two_epochs_and_bonus_fields`** (`warbow_battle_points` 750 vs 1000) so `cargo test` and `verify-podium-live-anvil.sh` regression gates are unblocked. 3. Add explicit **`INV-INDEXER-112-317`** rows in invariants (per-event checklist + verify commands) when implementation lands. **Issue left open** — acceptance criteria not met on `main`.
PlasticDigits commented 2026-06-14 06:55:00 +00:00 (Migrated from gitlab.com)

mentioned in merge request !487

mentioned in merge request !487
PlasticDigits commented 2026-06-14 13:52:27 +00:00 (Migrated from gitlab.com)

mentioned in merge request !497

mentioned in merge request !497
PlasticDigits commented 2026-06-14 13:54:19 +00:00 (Migrated from gitlab.com)

mentioned in commit 6c822804a8

mentioned in commit 6c822804a8970947f59a489db094f062b60af8f9
PlasticDigits commented 2026-06-14 14:12:22 +00:00 (Migrated from gitlab.com)

Verification — issue #317 (PASS — on main)

Verified 2026-06-14 on Cloud Agent VM (main, commit 6c822804 — merged MR verify/issue-317-timearena-events).

Acceptance criteria

Criterion Result Evidence
All six TimeArena events have idx_* rows after ingest PASS decoder.rs topic branches for FirstBuyCredScheduled, LevelUp, FeatureUnlocked, PausedSet, WarbowPodiumFinalized; ArenaWarbowFlagClaimed persists to idx_arena_warbow_flag_claimed. Migration 20260613120000_idx_arena_timearena_events_gl317.up.sql. integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after asserts row counts for all six tables.
Reorg rollback clears new tables PASS ARENA_INDEX_TABLES in reorg.rs includes all six new tables. Integration test rollback_after clears idx_arena_level_up / idx_arena_feature_unlocked (and full table list via ARENA_INDEX_TABLES).
Side-effect eth_call failure no longer leaves silent stale state PASS ingestion.rs L398–432: snapshot_warbow_players_after_log / snapshot_live_podium_after_log propagate errors with ? → block tx rolls back. Documented policy: INV-INDEXER-317-INGEST-SIDE-EFFECTS · indexer design §317.
Stage 2 integration test covers new variants PASS postgres_stage2_persist_all_events_and_rollback_after enumerates all six variants (L344–393) with persist + rollback assertions.
INV-INDEXER-112 checklist complete PASS Invariants §317 (INV-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)

Command Result Notes
bash scripts/verify-cloud-postgres.sh PASS Native PG 16 on :5433, CREATEDB OK.
cd indexer && cargo clippy --all-targets -- -D warnings PASS Clean build.
YIELDOMEGA_PG_TEST_URL=… cargo test PASS 65 unit + 4 integration tests green (sequential run; parallel contention can flake arena_wallet_stats_two_epochs_and_bonus_fields).
YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after PASS All six new events persist/rollback.
bash scripts/verify-podium-live-anvil.sh PASS Anvil deploy + seed OK; indexer ready; integration_stage2 4/4; live podium rows=12.

Attack / abuse plan

Scenario Result Notes
Reorg removes LevelUp / FeatureUnlocked rows PASS Events persisted; rollback_after deletes rows with block_number > ancestor.
RPC griefing: failed snapshot must not commit partial derived state PASS Snapshot RPC errors abort block tx; supervised ingest retries block. No warn-and-continue path.

Code inspection summary

Implementation matches issue scope on main:

  • decoder.rs: decode branches for all six events including WarbowPodiumFinalized in sol! block.
  • persist.rs: INSERT into dedicated idx_* tables (no no-op on ArenaWarbowFlagClaimed).
  • reorg.rs ARENA_INDEX_TABLES: six new tables registered.
  • ingestion.rs: side-effect failures fail-closed (block tx rollback).

Issue closed — all acceptance criteria met on main.

## Verification — issue #317 (PASS — on `main`) Verified **2026-06-14** on Cloud Agent VM (`main`, commit `6c822804` — merged MR `verify/issue-317-timearena-events`). ### Acceptance criteria | Criterion | Result | Evidence | |-----------|--------|----------| | All six `TimeArena` events have `idx_*` rows after ingest | **PASS** | `decoder.rs` topic branches for `FirstBuyCredScheduled`, `LevelUp`, `FeatureUnlocked`, `PausedSet`, `WarbowPodiumFinalized`; `ArenaWarbowFlagClaimed` persists to `idx_arena_warbow_flag_claimed`. Migration `20260613120000_idx_arena_timearena_events_gl317.up.sql`. `integration_stage2.rs::postgres_stage2_persist_all_events_and_rollback_after` asserts row counts for all six tables. | | Reorg rollback clears new tables | **PASS** | `ARENA_INDEX_TABLES` in `reorg.rs` includes all six new tables. Integration test `rollback_after` clears `idx_arena_level_up` / `idx_arena_feature_unlocked` (and full table list via `ARENA_INDEX_TABLES`). | | Side-effect `eth_call` failure no longer leaves silent stale state | **PASS** | `ingestion.rs` L398–432: `snapshot_warbow_players_after_log` / `snapshot_live_podium_after_log` propagate errors with `?` → block tx rolls back. Documented policy: **`INV-INDEXER-317-INGEST-SIDE-EFFECTS`** · [indexer design §317](docs/indexer/design.md#ingest-side-effects-gitlab-317). | | Stage 2 integration test covers new variants | **PASS** | `postgres_stage2_persist_all_events_and_rollback_after` enumerates all six variants (L344–393) with persist + rollback assertions. | | `INV-INDEXER-112` checklist complete | **PASS** | Invariants §317 (`INV-INDEXER-317-TIMEARENA-EVENTS`, `INV-INDEXER-317-INGEST-SIDE-EFFECTS`, `INV-INDEXER-317-REORG`) with per-event table mapping at [invariants §317](docs/testing/invariants-and-business-logic.md#indexer-timearena-events-gitlab-317). | ### Test plan (issue body) | Command | Result | Notes | |---------|--------|-------| | `bash scripts/verify-cloud-postgres.sh` | **PASS** | Native PG 16 on `:5433`, `CREATEDB` OK. | | `cd indexer && cargo clippy --all-targets -- -D warnings` | **PASS** | Clean build. | | `YIELDOMEGA_PG_TEST_URL=… cargo test` | **PASS** | 65 unit + 4 integration tests green (sequential run; parallel contention can flake `arena_wallet_stats_two_epochs_and_bonus_fields`). | | `YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after` | **PASS** | All six new events persist/rollback. | | `bash scripts/verify-podium-live-anvil.sh` | **PASS** | Anvil deploy + seed OK; indexer ready; `integration_stage2` 4/4; live podium rows=12. | ### Attack / abuse plan | Scenario | Result | Notes | |----------|--------|-------| | Reorg removes `LevelUp` / `FeatureUnlocked` rows | **PASS** | Events persisted; `rollback_after` deletes rows with `block_number > ancestor`. | | RPC griefing: failed snapshot must not commit partial derived state | **PASS** | Snapshot RPC errors abort block tx; supervised ingest retries block. No warn-and-continue path. | ### Code inspection summary Implementation matches issue scope on `main`: - `decoder.rs`: decode branches for all six events including `WarbowPodiumFinalized` in sol! block. - `persist.rs`: INSERT into dedicated `idx_*` tables (no no-op on `ArenaWarbowFlagClaimed`). - `reorg.rs` `ARENA_INDEX_TABLES`: six new tables registered. - `ingestion.rs`: side-effect failures fail-closed (block tx rollback). **Issue closed** — all acceptance criteria met on `main`.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-14 14:12:23 +00:00
PlasticDigits commented 2026-06-28 05:40:33 +00:00 (Migrated from gitlab.com)

mentioned in issue #356

mentioned in issue #356
PlasticDigits commented 2026-06-28 05:40:34 +00:00 (Migrated from gitlab.com)

marked as related to #356

marked as related to #356
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega#317
No description provided.