Batch chain-timer eth_calls via Multicall3 (#307) #456
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!456
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-307-chain-timer-multicall"
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
GitLab #307 — batch
chain_timerheadeth_calls through Multicall3aggregate3at a singleread_block_number, cutting idle JSON-RPC burst from 354 → 44peak_calls_10son Anvil (120s benchmark).indexer/src/multicall.rs:aggregate3encode/decode, duplicate-call coalescing, one logicaleth_callper batch inrpc_metrics.chain_timer.rs:poll_once_multicallcovers timer scalars, sale-head, sale-state, podiums, and optionalactivePoolBalance; sequential fallback when Multicall3 is missing.scripts/lib/anvil_multicall3.sh: deploy Multicall3 on fresh Anvil (signed tx); wired into stack/benchmark/verify scripts.rpc-benchmark-20260613T071949Z.json· invariants §307.Acceptance checklist
poll_onceuses Multicall3 for majority of chain-timereth_callspoll_once_multicallpeak_calls_10s≤ 50 (120s benchmark)BENCHMARK_SCENARIO_SEC=120 bash scripts/benchmark-indexer-rpc-anvil.sh→ final idle sample44)chain_timereth_call≥ 40% drop vs baselinerpc-benchmark-20260613T071949Z.jsonidle vsrpc-benchmark-20260610T111415Z.jsoneth_call:chain_timer)GET /v1/arena/timersfreshness ≤ 3sbash scripts/verify-indexer-rpc-metrics.sh(35s warm-up, 1 Hz poll)INV-INDEXER-306-NO-REGRESSIONcd indexer && cargo clippy --all-targets -- -D warnings && cargo testINV-INDEXER-306-NO-REGRESSIONpodium-livebash scripts/verify-podium-live-anvil.shintegration_stage2fails onarena_wallet_stats_two_epochs_and_bonus_fieldswhen script exportsYIELDOMEGA_PG_TEST_URL(same failure onmain; unrelated to #307)bash scripts/verify-indexer-rpc-metrics.shpeak_10s=44)docs/indexer/rpc-load-benchmark.md,invariants §307Verification for third parties
Operator note: Production RPC must expose Multicall3 at
0xcA11bde05977b3631167028862bE2a173976CA11; otherwise the indexer logs a debug fallback and uses sequentialeth_calls.changed the description
changed the description
Security review — MR !456
Commit reviewed:
32bf62ed0727d2e6ed592d2d7e3c9135475ff3faScope: Multicall3
aggregate3batching for chain-timer head reads (indexer/src/multicall.rs,indexer/src/chain_timer.rs,indexer/src/sale_state.rs), Anvil Multicall3 bootstrap (scripts/lib/anvil_multicall3.sh), and related verify/benchmark wiring.Prior security threads: None on this MR (re-reviewed from scratch).
Outcome:
FINDINGS: 0medium+Summary
No exploitable medium, high, or critical vulnerabilities were identified in this diff.
The change is a read-only RPC optimization on the indexer hot path. Sub-call targets and selectors are fixed from operator-configured
TIME_ARENA/PODIUM_VAULTSaddresses — not user-controlled HTTP/API input.aggregate3usesallowFailure: false, validates result count, and rejects failed sub-calls before decode. All batched reads share a singleread_block_numberblock tag (same or better consistency than the prior sequential path). Multicall3 failure falls back to the existing sequentialeth_callpath.Trust boundaries reviewed (unchanged by this MR):
RPC_URLcan spoof anyeth_callreturn (multicall or sequential) — pre-existing indexer RPC trust model.0xcA11…CA11) on production chains — standard deployment assumption; local Anvil bootstrap uses the published mds1/multicall signed deploy tx (dev-only).Inline findings: None (no medium+ issues to thread).
added 10 commits
maindff689ca- Merge origin/main into issue-307-chain-timer-multicall.Compare with previous version
Resolved merge conflicts with
main(merge commitdff689ca).Conflict:
docs/indexer/rpc-load-benchmark.md— mitigation strategies table.Resolution: Kept #307 multicall batching and duplicate-call coalescing as Shipped; adopted #308 adaptive poll interval from
main(was still marked Open on this branch).Sanity:
cargo clippy --all-targets -- -D warningsandcargo testinindexer/— PASS.changed the description
Security review — MR !456
Commit reviewed:
dff689cad32eaeca286ee587c6d24a0156f83c7eScope: Multicall3
aggregate3batching for chain-timer head reads (indexer/src/multicall.rs,indexer/src/chain_timer.rs,indexer/src/sale_state.rs), Anvil Multicall3 bootstrap (scripts/lib/anvil_multicall3.sh), and related verify/benchmark wiring. Re-reviewed after merge withmain(doc conflict resolution only; no new security-relevant code paths).Prior security threads: Review on
32bf62ed(2026-06-13) reportedFINDINGS: 0medium+. Re-checked on current HEAD; prior conclusions still hold.Outcome:
FINDINGS: 0medium+Summary
Security review: no medium+ findings on this diff.
No exploitable medium, high, or critical vulnerabilities were identified.
The change is a read-only RPC optimization on the indexer hot path. Sub-call targets and selectors are fixed from operator-configured
TIME_ARENA/PODIUM_VAULTSaddresses — not user-controlled HTTP/API input.aggregate3usesallowFailure: false, validates result count, and rejects failed sub-calls before decode. All batched reads share a singleread_block_numberblock tag (same or better consistency than the prior sequential path). Multicall3 failure falls back to the existing sequentialeth_callpath. Polled TimeArena/PodiumVaults view functions do not branch onmsg.sender, so routing via Multicall3 does not alter on-chain return semantics vs directeth_call.Trust boundaries reviewed (unchanged by this MR):
RPC_URLcan spoof anyeth_callreturn (multicall or sequential) — pre-existing indexer RPC trust model.0xcA11…CA11) on production chains — standard deployment assumption; local Anvil bootstrap uses the published mds1/multicall signed deploy tx (dev-only).Inline findings: None (no medium+ issues to thread).
mentioned in commit
c11c243660