Verify #317: fix integration_stage2 block_timestamp assertion #497

Merged
PlasticDigits merged 1 commit from verify/issue-317-timearena-events into main 2026-06-14 13:54:18 +00:00
PlasticDigits commented 2026-06-14 13:52:25 +00:00 (Migrated from gitlab.com)

Summary

Issue #317 implementation is already on main (merge a4660ac6). Verification found one regression in api_arena_buys_actual_seconds_added_smoke: the DB probe used raw EXTRACT(EPOCH…)::text (1700000000.000000) while GET /v1/arena/buys serializes via FLOOR(EXTRACT(EPOCH…))::bigint::text (1700000000). This one-line fix unblocks postgres_stage2_persist_all_events_and_rollback_after and verify-podium-live-anvil.sh.

Acceptance checklist (#317)

Criterion Result Command / evidence
All six TimeArena events persist idx_* rows PASS integration_stage2.rs L344–393 + persist counts L460–480; migration 20260613120000_idx_arena_timearena_events_gl317.up.sql
Reorg rollback clears new tables PASS reorg.rs ARENA_INDEX_TABLES L131–136; rollback assertions L538–545
Side-effect RPC failure aborts block tx (no silent stale) PASS ingestion.rs L407–429 (? propagates); INV-INDEXER-317-INGEST-SIDE-EFFECTS in invariants + indexer design §317
Stage 2 integration test covers new variants PASS postgres_stage2_persist_all_events_and_rollback_after enumerates all six events
INV-INDEXER-112 / #317 invariants complete PASS docs/testing/invariants-and-business-logic.md §317 table + INV-INDEXER-317-* rows

Test plan

Command Result
bash scripts/verify-cloud-postgres.sh PASS
cd indexer && cargo clippy --all-targets -- -D warnings PASS
YIELDOMEGA_PG_TEST_URL=… cargo test PASS (69 unit + 4 integration)
YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after PASS
bash scripts/verify-podium-live-anvil.sh PASS (read_block=25, live_rows=12)

Attack / abuse plan

Scenario Result
Reorg removes LevelUp / FeatureUnlocked rows PASS (rollback assertions in integration test)
RPC griefing: failed snapshot must not commit partial derived state PASS (ingest aborts block tx; code inspection)

Follow-ups

  • Extend rollback assertions in postgres_stage2_persist_all_events_and_rollback_after to cover all six new tables (currently asserts level_up + feature_unlocked only; ARENA_INDEX_TABLES already lists all six).
## Summary Issue #317 implementation is already on `main` (merge `a4660ac6`). Verification found one regression in `api_arena_buys_actual_seconds_added_smoke`: the DB probe used raw `EXTRACT(EPOCH…)::text` (`1700000000.000000`) while `GET /v1/arena/buys` serializes via `FLOOR(EXTRACT(EPOCH…))::bigint::text` (`1700000000`). This one-line fix unblocks `postgres_stage2_persist_all_events_and_rollback_after` and `verify-podium-live-anvil.sh`. ## Acceptance checklist (#317) | Criterion | Result | Command / evidence | |-----------|--------|-------------------| | All six `TimeArena` events persist `idx_*` rows | **PASS** | `integration_stage2.rs` L344–393 + persist counts L460–480; migration `20260613120000_idx_arena_timearena_events_gl317.up.sql` | | Reorg rollback clears new tables | **PASS** | `reorg.rs` `ARENA_INDEX_TABLES` L131–136; rollback assertions L538–545 | | Side-effect RPC failure aborts block tx (no silent stale) | **PASS** | `ingestion.rs` L407–429 (`?` propagates); `INV-INDEXER-317-INGEST-SIDE-EFFECTS` in invariants + indexer design §317 | | Stage 2 integration test covers new variants | **PASS** | `postgres_stage2_persist_all_events_and_rollback_after` enumerates all six events | | `INV-INDEXER-112` / `#317` invariants complete | **PASS** | `docs/testing/invariants-and-business-logic.md` §317 table + `INV-INDEXER-317-*` rows | ## Test plan | Command | Result | |---------|--------| | `bash scripts/verify-cloud-postgres.sh` | **PASS** | | `cd indexer && cargo clippy --all-targets -- -D warnings` | **PASS** | | `YIELDOMEGA_PG_TEST_URL=… cargo test` | **PASS** (69 unit + 4 integration) | | `YIELDOMEGA_PG_TEST_URL=… cargo test --test integration_stage2 postgres_stage2_persist_all_events_and_rollback_after` | **PASS** | | `bash scripts/verify-podium-live-anvil.sh` | **PASS** (`read_block=25`, `live_rows=12`) | ## Attack / abuse plan | Scenario | Result | |----------|--------| | Reorg removes `LevelUp` / `FeatureUnlocked` rows | **PASS** (rollback assertions in integration test) | | RPC griefing: failed snapshot must not commit partial derived state | **PASS** (ingest aborts block tx; code inspection) | ## Follow-ups - Extend rollback assertions in `postgres_stage2_persist_all_events_and_rollback_after` to cover all six new tables (currently asserts `level_up` + `feature_unlocked` only; `ARENA_INDEX_TABLES` already lists all six).
PlasticDigits commented 2026-06-14 13:53:55 +00:00 (Migrated from gitlab.com)

Security review — MR !497

Commit reviewed: 28049ecbd3407b8d9f3b552e9257e64fb4a410ad

Scope: Single-line change in indexer/tests/integration_stage2.rs (api_arena_buys_actual_seconds_added_smoke): DB probe query now uses FLOOR(EXTRACT(EPOCH FROM block_timestamp))::bigint::text to match GET /v1/arena/buys serialization on the MR branch.

Method: Diff inspection; traced the probe query and compared it to the production arena_buys handler (indexer/src/api_arena.rs, FLOOR(EXTRACT(EPOCH …))::bigint::text). Prior security-review threads on this MR: none.

Outcome: FINDINGS: 0 medium+

Security review: no medium+ findings on this diff.

Category Result
Injection (SQL/shell) N/A — test-only code; probe still uses $1/$2 parameterization
Authn/authz N/A — no API or access-control changes
Secret leakage / logging N/A
SSRF / XSS / deserialization N/A
EVM / smart-contract N/A — indexer integration test only; no contract or ingest/persist changes
Supply chain N/A — no dependency changes

Inline threads: none (no findings to anchor).

This change corrects a test assertion format mismatch (floating-point EXTRACT text vs integer floor serialization) and does not alter runtime indexer behavior or attack surface.

## Security review — MR !497 **Commit reviewed:** `28049ecbd3407b8d9f3b552e9257e64fb4a410ad` **Scope:** Single-line change in `indexer/tests/integration_stage2.rs` (`api_arena_buys_actual_seconds_added_smoke`): DB probe query now uses `FLOOR(EXTRACT(EPOCH FROM block_timestamp))::bigint::text` to match `GET /v1/arena/buys` serialization on the MR branch. **Method:** Diff inspection; traced the probe query and compared it to the production `arena_buys` handler (`indexer/src/api_arena.rs`, `FLOOR(EXTRACT(EPOCH …))::bigint::text`). Prior security-review threads on this MR: none. **Outcome:** `FINDINGS: 0` medium+ Security review: **no medium+ findings** on this diff. | Category | Result | |----------|--------| | Injection (SQL/shell) | N/A — test-only code; probe still uses `$1`/`$2` parameterization | | Authn/authz | N/A — no API or access-control changes | | Secret leakage / logging | N/A | | SSRF / XSS / deserialization | N/A | | EVM / smart-contract | N/A — indexer integration test only; no contract or ingest/persist changes | | Supply chain | N/A — no dependency changes | **Inline threads:** none (no findings to anchor). This change corrects a test assertion format mismatch (floating-point `EXTRACT` text vs integer floor serialization) and does not alter runtime indexer behavior or attack surface.
PlasticDigits (Migrated from gitlab.com) merged commit 6c822804a8 into main 2026-06-14 13:54:18 +00:00
PlasticDigits commented 2026-06-14 13:54:19 +00:00 (Migrated from gitlab.com)

mentioned in commit 6c822804a8

mentioned in commit 6c822804a8970947f59a489db094f062b60af8f9
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!497
No description provided.