Add verify-indexer-reorg-anvil smoke script (#351) #525

Merged
PlasticDigits merged 1 commit from issue-351-verify-indexer-reorg-anvil into main 2026-06-26 04:29:19 +00:00
PlasticDigits commented 2026-06-26 03:56:52 +00:00 (Migrated from gitlab.com)

Summary

Adds scripts/verify-indexer-reorg-anvil.sh (#351) — a live Anvil smoke that walks the full indexer reorg path (find_common_ancestor → rollback_after → re-ingest) using evm_snapshot / evm_revert and empty remines. Asserts chain_pointer matches RPC head, rolled-back idx_arena_level_up rows are cleared, no duplicate buys, and GET /v1/arena/wallet/{address}/stats level_history matches on-chain TimeArena.level().

Documents INV-INDEXER-351-REORG-ANVIL in invariants, REORG_STRATEGY.md, e2e-anvil.md, and scripts/qa/README.md (gap #342).

Acceptance checklist

Criterion Command / step Result
New verify script exits 0 on happy path bash scripts/verify-indexer-reorg-anvil.sh PASS
Script documented in gap-analysis verify table / scripts/qa/README.md Review scripts/qa/README.md § Indexer Anvil verify scripts PASS
Fails loudly on ingest divergence Script assert_no_ingest_divergence + log tail on timeout (YIELDOMEGA_REORG_HEAL_TIMEOUT_SEC) PASS
Indexer tests cd indexer && YIELDOMEGA_PG_TEST_URL=postgres://yieldomega:password@127.0.0.1:5433/yieldomega_indexer_test cargo test PASS
Postgres bash scripts/verify-cloud-postgres.sh PASS

Verification checklist (third parties)

  1. bash scripts/bootstrap-cloud-postgres-native.sh (or ensure native Postgres on :5433).
  2. export PATH="$HOME/.foundry/bin:$PATH" and source /usr/local/cargo/env if needed.
  3. bash scripts/verify-indexer-reorg-anvil.sh → expect === verify-indexer-reorg-anvil: OK ===.
  4. Optional: grep "rolled back after reorg" /tmp/yieldomega_verify351_indexer.log.
  • Parent gap analysis #342 P2 #11 · M-I4
  • Invariant detail: docs/testing/invariants-and-business-logic.md#indexer-live-reorg-anvil-gitlab-351
## Summary Adds `scripts/verify-indexer-reorg-anvil.sh` ([#351](https://gitlab.com/PlasticDigits/yieldomega/-/issues/351)) — a live Anvil smoke that walks the full indexer reorg path (`find_common_ancestor` → `rollback_after` → re-ingest) using `evm_snapshot` / `evm_revert` and empty remines. Asserts `chain_pointer` matches RPC head, rolled-back `idx_arena_level_up` rows are cleared, no duplicate buys, and `GET /v1/arena/wallet/{address}/stats` `level_history` matches on-chain `TimeArena.level()`. Documents **`INV-INDEXER-351-REORG-ANVIL`** in invariants, `REORG_STRATEGY.md`, `e2e-anvil.md`, and `scripts/qa/README.md` (gap [#342](https://gitlab.com/PlasticDigits/yieldomega/-/issues/342)). ## Acceptance checklist | Criterion | Command / step | Result | |-----------|----------------|--------| | New verify script exits 0 on happy path | `bash scripts/verify-indexer-reorg-anvil.sh` | PASS | | Script documented in gap-analysis verify table / `scripts/qa/README.md` | Review `scripts/qa/README.md` § Indexer Anvil verify scripts | PASS | | Fails loudly on ingest divergence | Script `assert_no_ingest_divergence` + log tail on timeout (`YIELDOMEGA_REORG_HEAL_TIMEOUT_SEC`) | PASS | | Indexer tests | `cd indexer && YIELDOMEGA_PG_TEST_URL=postgres://yieldomega:password@127.0.0.1:5433/yieldomega_indexer_test cargo test` | PASS | | Postgres | `bash scripts/verify-cloud-postgres.sh` | PASS | ## Verification checklist (third parties) 1. `bash scripts/bootstrap-cloud-postgres-native.sh` (or ensure native Postgres on `:5433`). 2. `export PATH="$HOME/.foundry/bin:$PATH"` and `source /usr/local/cargo/env` if needed. 3. `bash scripts/verify-indexer-reorg-anvil.sh` → expect `=== verify-indexer-reorg-anvil: OK ===`. 4. Optional: `grep "rolled back after reorg" /tmp/yieldomega_verify351_indexer.log`. ## Related - Parent gap analysis [#342](https://gitlab.com/PlasticDigits/yieldomega/-/issues/342) P2 #11 · **M-I4** - Invariant detail: `docs/testing/invariants-and-business-logic.md#indexer-live-reorg-anvil-gitlab-351`
PlasticDigits commented 2026-06-26 03:58:58 +00:00 (Migrated from gitlab.com)

Security review — MR !525

Commit reviewed: 4907e9dce5e3b96c6f428022f602b3b53fbe6ca0
Base: 87b4f06ce127da9023939ceb4fcb43b6ba48a960

Scope

Reviewed added/modified paths in this MR:

  • scripts/verify-indexer-reorg-anvil.sh (new)
  • Documentation updates: docs/testing/ci.md, docs/testing/e2e-anvil.md, docs/testing/invariants-and-business-logic.md, indexer/REORG_STRATEGY.md, scripts/qa/README.md, skills/script-with-timearena-local/SKILL.md

No smart-contract, indexer application, or frontend runtime code changes.

Method

Traced attacker-controlled inputs in the new smoke script (DATABASE_URL, ANVIL_PORT, INDEXER_PORT, Anvil-derived BUYER/BUYER_LC) through sinks (psql, curl, cast). Compared patterns against existing verify scripts (verify-wallet-profile-anvil.sh, scripts/lib/verify_indexer_stack.sh).

Outcome

FINDINGS: 0 medium+

Security review: no medium+ findings on this diff.

The new script is a local Anvil/Postgres/indexer smoke test bound to 127.0.0.1, using static SQL in pg_scalar, hex-normalized wallet addresses in API paths, and shared bootstrap helpers already used by sibling verify scripts. It does not expand production attack surface, introduce new dependencies, or modify authn/authz, ingestion, or on-chain logic.

Inline threads

None (no medium+ findings).

## Security review — MR !525 **Commit reviewed:** `4907e9dce5e3b96c6f428022f602b3b53fbe6ca0` **Base:** `87b4f06ce127da9023939ceb4fcb43b6ba48a960` ### Scope Reviewed added/modified paths in this MR: - `scripts/verify-indexer-reorg-anvil.sh` (new) - Documentation updates: `docs/testing/ci.md`, `docs/testing/e2e-anvil.md`, `docs/testing/invariants-and-business-logic.md`, `indexer/REORG_STRATEGY.md`, `scripts/qa/README.md`, `skills/script-with-timearena-local/SKILL.md` No smart-contract, indexer application, or frontend runtime code changes. ### Method Traced attacker-controlled inputs in the new smoke script (`DATABASE_URL`, `ANVIL_PORT`, `INDEXER_PORT`, Anvil-derived `BUYER`/`BUYER_LC`) through sinks (`psql`, `curl`, `cast`). Compared patterns against existing verify scripts (`verify-wallet-profile-anvil.sh`, `scripts/lib/verify_indexer_stack.sh`). ### Outcome **FINDINGS: 0** medium+ **Security review: no medium+ findings on this diff.** The new script is a local Anvil/Postgres/indexer smoke test bound to `127.0.0.1`, using static SQL in `pg_scalar`, hex-normalized wallet addresses in API paths, and shared bootstrap helpers already used by sibling verify scripts. It does not expand production attack surface, introduce new dependencies, or modify authn/authz, ingestion, or on-chain logic. ### Inline threads None (no medium+ findings).
PlasticDigits commented 2026-06-26 04:29:20 +00:00 (Migrated from gitlab.com)

mentioned in commit 1dae16d806

mentioned in commit 1dae16d806d4ff35b45805be63d209928c305284
PlasticDigits (Migrated from gitlab.com) merged commit 1dae16d806 into main 2026-06-26 04:29:20 +00:00
Sign in to join this conversation.
No reviewers
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!525
No description provided.