Indexer: persist LastBuyEpochStarted and assign global last_buy_epoch on buys (#278) #407

Merged
PlasticDigits merged 2 commits from cursor/indexer-last-buy-epoch-278-7e0c into main 2026-06-03 11:34:22 +00:00
PlasticDigits commented 2026-06-03 11:34:17 +00:00 (Migrated from gitlab.com)

Summary

Closes GitLab #278 — indexer parity with onchain global lastBuyEpoch.

  • Persist LastBuyEpochStarted to idx_arena_last_buy_epoch_started
  • Assign idx_arena_buy.last_buy_epoch from ordered global head during ingest
  • Replace wallet-stats per-wallet timer_hard_reset window inference
  • Integration regression + bash scripts/verify-last-buy-epoch-anvil.sh
  • Docs: INV-INDEXER-278-LAST-BUY-EPOCH, guardrails/skills cross-links

Verification

Layer Command Result
Indexer clippy cd indexer && cargo clippy --all-targets -- -D warnings PASS
Indexer tests YIELDOMEGA_PG_TEST_URL=… cargo test PASS (4 integration)
Anvil smoke bash scripts/verify-last-buy-epoch-anvil.sh PASS

Leave #278 open for QA sign-off.

## Summary Closes GitLab #278 — indexer parity with onchain global `lastBuyEpoch`. - Persist `LastBuyEpochStarted` to `idx_arena_last_buy_epoch_started` - Assign `idx_arena_buy.last_buy_epoch` from ordered global head during ingest - Replace wallet-stats per-wallet `timer_hard_reset` window inference - Integration regression + `bash scripts/verify-last-buy-epoch-anvil.sh` - Docs: `INV-INDEXER-278-LAST-BUY-EPOCH`, guardrails/skills cross-links ## Verification | Layer | Command | Result | |-------|---------|--------| | Indexer clippy | `cd indexer && cargo clippy --all-targets -- -D warnings` | PASS | | Indexer tests | `YIELDOMEGA_PG_TEST_URL=… cargo test` | PASS (4 integration) | | Anvil smoke | `bash scripts/verify-last-buy-epoch-anvil.sh` | PASS | Leave #278 open for QA sign-off.
PlasticDigits commented 2026-06-03 11:34:23 +00:00 (Migrated from gitlab.com)

mentioned in commit ae9653fc5b

mentioned in commit ae9653fc5b8d8d39187361e7e94997ae5c1e95c1
PlasticDigits (Migrated from gitlab.com) merged commit ae9653fc5b into main 2026-06-03 11:34:23 +00:00
PlasticDigits commented 2026-06-03 11:34:40 +00:00 (Migrated from gitlab.com)

mentioned in issue #278

mentioned in issue #278
ghost1 commented 2026-06-03 11:36:57 +00:00 (Migrated from gitlab.com)

Security review (MR !407)

Commit reviewed: 0899de7d27c5a949e9d1667364b21a8295c8b6c4

Scope: Indexer global last_buy_epoch ingest (#278) — 16 files (last_buy_epoch_head.rs, migration, persist.rs, ingestion.rs, wallet-stats SQL, reorg list, tests, verify script, docs).

Method: Diff-only; traced attacker-controlled input to sinks (SQL, HTTP wallet path, on-chain log order).

Outcome: FINDINGS: 0 — no medium, high, or critical issues on this diff.

Inline threads: None.


## Security review (MR !407) **Commit reviewed:** `0899de7d27c5a949e9d1667364b21a8295c8b6c4` **Scope:** Indexer global `last_buy_epoch` ingest ([#278](https://gitlab.com/PlasticDigits/yieldomega/-/issues/278)) — 16 files (`last_buy_epoch_head.rs`, migration, `persist.rs`, `ingestion.rs`, wallet-stats SQL, reorg list, tests, verify script, docs). **Method:** Diff-only; traced attacker-controlled input to sinks (SQL, HTTP wallet path, on-chain log order). **Outcome:** **FINDINGS: 0** — no medium, high, or critical issues on this diff. **Inline threads:** None. --- <!-- cursor-security-review automation-id=82932c12-7e15-4032-8586-f089d8ffda11 -->
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!407
No description provided.