Indexer registry cleanup, BuyViaKumbaya ingest, platform-usage API (#319) #472
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!472
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-319-indexer-registry-platform-usage"
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
Indexer registry cleanup and Arena HTTP improvements for #319:
DoubPresaleVestingfromaddress-registry.megaeth-mainnet.json(#243).BuyViaKumbayafromTimeArenaBuyRouter(log filter + decode +idx_arena_buy.pay_kindannotation on matchingtx_hash).GET /v1/arena/platform-usage(schema ≥ 2.12.0) aggregatingidx_arena_buy+ WarBow tables; wire frontendfetchArenaPlatformUsage.cursor/next_cursor(block_number:log_index) onGET /v1/arena/buysandGET /v1/arena/activity; keepoffsetfor compatibility.filter_mapsilent drops withpg_row_required→ 500 on corrupt projections.Acceptance checklist
rg DoubPresaleVesting indexer/address-registry.megaeth-mainnet.json→ no matches/v1/arena/buyswith pay kindcd indexer && YIELDOMEGA_PG_TEST_URL=… cargo test postgres_stage2(api_buy_via_kumbaya_pay_kind_smoke)cd indexer && cargo test postgres_stage2(api_platform_usage_smoke);cd frontend && npm test -- --run src/lib/indexerApi.test.tscd indexer && cargo test(referral handlers usepg_row_required)cd indexer && cargo test postgres_stage2(api_buys_cursor_smoke)bash scripts/verify-time-arena-buy-router-anvil.shcd indexer && cargo clippy --all-targets -- -D warnings && cargo testcargo test arena_wallet_stats_two_epochsmainbefore this MR (warbow_battle_points1000 vs 750)Verification for third parties
bash scripts/bootstrap-cloud-postgres-native.shand exportYIELDOMEGA_PG_TEST_URL.cd indexer && cargo test postgres_stage2_persist_all_events_and_rollback_aftercd frontend && npm test -- --run src/lib/indexerApi.test.tsbash scripts/verify-time-arena-buy-router-anvil.shcurl -sS "$INDEXER_URL/v1/arena/platform-usage?limit=5&velocity_window=1h" | jq .total_buysBlockers
arena_wallet_stats_two_epochs_and_bonus_fieldsremains flaky on currentmain(out of scope).changed the description
changed the description
Security review — MR !472
Commit reviewed:
c2f9dc9383c3b0aa5243c17b684f30cf95988d2eScope: Indexer registry cleanup (
DoubPresaleVestingremoval),BuyViaKumbayaingest +pay_kindannotation, restoredGET /v1/arena/platform-usage, cursor pagination on buys/activity, referralpg_row_requiredhardening, frontend platform-usage wiring.Outcome:
FINDINGS: 0medium+Areas reviewed
fetch_warbow_action_totals)'static strtable/where literals only.BuyViaKumbayaingestpay_kindUPDATE is keyed by on-chaintx_hash(same-tx Buy pairing). No off-chain trust boundary bypass identified.INDEXER_REGISTRY_REQUIRE_BUY_ROUTERfail-closed wiring is a hardening change.URLSearchParams;pay_kindis not rendered in new UI paths in this diff.internal_db_error_responseunchanged; no new sensitive logging.Inline threads
None — no medium+ findings to anchor on specific diff lines.
Security review: no medium+ findings on this diff.
Stale Security Review comment
Stale Security Review comment
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit
c2f9dc9383. Configure here.Buys list drops timestamp ordering
Medium Severity
GET /v1/arena/buysnow sorts only byblock_numberandlog_index, replacing the priorblock_timestamp DESC NULLS LASTordering. Recent-buy views and offset pagination can disagree with RPC time order when timestamps are missing or not aligned with block height, and no longer match how platform-usage velocity filters buys byblock_timestamp.Additional Locations (1)
indexer/src/api_arena.rs#L371-L374Reviewed by Cursor Bugbot for commit
c2f9dc9383. Configure here.added 1 commit
eb908c58- fix(indexer): restore block_timestamp ordering on GET /v1/arena/buysCompare with previous version
changed the description
resolved all threads
Stale Security Review comment
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit
eb908c587e. Configure here.Cursor filter mismatches buy sort
Medium Severity
GET /v1/arena/buyscursor pages now sort byblock_timestampfirst, but the cursor path still filters with(block_number, log_index) < ($1, $2)andnext_cursoronly encodes those two fields. When timestamps and block height disagree (e.g. NULLblock_timestamp), clients can see duplicate or skipped buys across pages.Additional Locations (1)
indexer/src/api_arena.rs#L482-L489Reviewed by Cursor Bugbot for commit
eb908c587e. Configure here.added 1 commit
1a72a6e0- fix(indexer): align arena buys cursor with timestamp sortCompare with previous version
changed the description
resolved all threads
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit
1a72a6e0a9. Configure here.Buy cursor misparses epoch text
High Severity
next_cursorfor buys buildsTimestampBlockLogCursorby parsingblock_timestamp_secwithparse::<i64>, but the query returnsEXTRACT(EPOCH FROM block_timestamp)::text, which PostgreSQL often formats with a fractional part. Failed parses become a null-timestamp cursor (-) while the row sorts with a real epoch in the SQL watermark, so cursor pages can skip or repeat buys.Reviewed by Cursor Bugbot for commit
1a72a6e0a9. Configure here.added 1 commit
b6d9b350- fix(indexer): use integer epoch text for buys cursor #319Compare with previous version
changed the description
resolved all threads
added 31 commits
main5b201b5b- Merge origin/main into issue-319-indexer-registry-platform-usageCompare with previous version
Resolved merge conflicts with
main:indexer/src/persist.rs: kept #319BuyViaKumbayapay_kind UPDATE alongside #317ArenaWarbowFlagClaimed/ArenaWarbowPodiumFinalizedINSERT handlers (replacing the temporary no-op stub).docs/testing/invariants-and-business-logic.md: merged #317 TimeArena event coverage with #319 registry/Kumbaya/platform-usage invariants.Sanity:
cargo clippy --all-targets -- -D warningsandcargo testpass on the merge commit.changed the description
Security review — MR !472
Commit reviewed:
5b201b5bab6e27286a972014f60540bd060c36ccScope: Indexer registry cleanup (
DoubPresaleVestingremoval),BuyViaKumbayaingest +pay_kindannotation, restoredGET /v1/arena/platform-usage, timestamp-aware cursor pagination on buys/activity, referralpg_row_requiredhardening, frontend platform-usage wiring.Outcome:
FINDINGS: 0medium+Areas reviewed
cursor,velocity_window, pagination,fetch_warbow_action_totals)'static strtable/where literals only (arena_platform_usage.rs).BuyViaKumbayaingestindex_addresses()(router + arena contracts). Decode is topic-gated;pay_kindUPDATE is keyed by on-chaintx_hashand pairs withTimeArenaBuyRouter.buyViaKumbayaemitting afterbuyForin the same tx (TimeArenaBuyRouter.sol). Annotation is indexer metadata only — no fund-moving off-chain trust path.INDEXER_REGISTRY_REQUIRE_BUY_ROUTERfail-closed wiring is a hardening change; vesting removal is intentional registry cleanup.URLSearchParams;pay_kindis typed in API client only and not rendered in new UI paths in this diff.internal_db_error_responseunchanged (generic 500 body); no new sensitive logging.Prior threads
Re-checked Bugbot cursor-pagination notes on buys ordering — correctness/data-integrity issues on a public read API, not an authn/authz or injection attack path at medium+ severity. No re-report.
Inline threads
None — no medium+ findings to anchor on specific diff lines.
Security review: no medium+ findings on this diff.
mentioned in commit
889ab2e0ae