Indexer: per-block Multicall3 batching for warbow_score + podium_live ingest RPC (#356) #530
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!530
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-356-ingest-multicall-batch"
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
Implements GitLab #356: per-block Multicall3
aggregate3batching for ingest-sidewarbow_score+arena_podium_liveRPC reads.indexer/src/arena_ingest_rpc.rs: plans deduped sub-calls per block, executes oneaggregate3atBlockId::Number(block)(calleringestion), applies DB writes in log order; sequential fallback on Multicall3 failure.indexer/src/ingestion.rs: replaces per-log dual RPC paths with block batch orchestration (preservesINV-INDEXER-140/INV-INDEXER-317).indexer/src/multicall.rs:push_address_arg+subcalls()for battlePoints + fallback iteration.INV-INDEXER-356-*indocs/testing/invariants-and-business-logic.md,docs/indexer/design.md,docs/indexer/rpc-load-benchmark.md.RPC metrics choice: successful ingest batches record one
eth_callunder calleringestion(not splitwarbow_score/podium_live). Sequential fallback attributes sub-calls towarbow_score/podium_liveby selector.Acceptance checklist
cargo test arena_ingest_rpc+ active-arena benchmark (eth_call:ingestiononly)integration_stage2+ verify scriptsbash scripts/verify-podium-live-anvil.shbash scripts/verify-wallet-profile-anvil.shallowFailure: false/ fail-closedmulticall.rs+INV-INDEXER-356-FAIL-CLOSEDarena_ingest_rpc::execute_sequential_batchintegration_stage2::postgres_stage2_persist_all_events_and_rollback_afterBENCHMARK_SCENARIO_SEC=120 bash scripts/benchmark-indexer-rpc-anvil.sheth_call:warbow_score+eth_call:podium_live: 297 → 0 vsrpc-benchmark-20260615T021945Z; batched as 33eth_call:ingestion(rpc-benchmark-20260628T055944Z)design.md+invariants-and-business-logic.mdcd indexer && cargo clippy --all-targets -- -D warnings && cargo testbash scripts/verify-indexer-rpc-metrics.shVerification for third parties
Compare active_arena
by_method_callerindocs/indexer/benchmarks/rpc-benchmark-20260628T055944Z.json— expect noeth_call:warbow_score/eth_call:podium_liveand nonzeroeth_call:ingestion.Security review — MR !530
Commit reviewed:
41ca39eb1d8c2d439aa3a94e49ac663dec8cabe3Scope:
indexer/src/arena_ingest_rpc.rs(new),ingestion.rsbatch orchestration,multicall.rshelpers, visibility tweaks inwarbow_score.rs/arena_podium_live.rs, docs/benchmark artifacts.Prior security threads: none on this MR (re-checked).
Method
Traced attacker-controlled inputs (on-chain arena logs → decoded events → Multicall3 sub-call planning → RPC results → SQL upserts) against sinks (RPC
eth_call,aggregate3decode,idx_warbow_epoch_score/idx_arena_podium_livewrites). Compared semantics to pre-MR per-logsnapshot_warbow_players_after_log/snapshot_live_podium_after_logpaths.Areas examined (no medium+ issues)
MULTICALL3_ADDRESS; SQL remains parameterized via existingsqlxhelpers.allowFailure: false+ block-tx abort on RPC/decode failure preserved (INV-INDEXER-317,INV-INDEXER-356-FAIL-CLOSED); Multicall3 failure falls back to sequential calls with identical calldata/block tag.BlockId::Number(next)matches prior per-logd.block_numbersemantics (end-of-block state); deduped sub-calls are safe because all reads share the same block tag; DB apply order (persist logs → batch RPC → per-log warbow then podium side-effects) preserves warbow-score visibility forrebuild_warbow_live_from_scores_conn.Outcome:
FINDINGS: 0medium+ — Security review: no medium+ findings on this diff.No inline threads (nothing to anchor).
mentioned in commit
e1be645b69