Skip to content

address.events is 21-41x slower than in-house RPC scanner on identical contract/window, and doesn't complete the requested range #59

Description

@spouletmathis

Interface: MCP
Alter version: 1.22.0
Platform: macOS 26.5.2
Context: performance benchmark comparing address.events against an in-house direct-RPC scanner, same contract, on 2026-07-17. Related to #33 (closed 15/07, "fixed timeouts reduced 5s→3s per endpoint") and #38 point 4 (slow full-pool scans) — this issue provides fresh measurements suggesting the #33 fix did not resolve the underlying problem, and may have introduced a new one (incomplete coverage instead of just slowness).

Observation

Same contract (RMM v3 pool, Gnosis, 0xFb9b496519fCa8473fba1af0850B6B8F476BFdB3), same 20,000-block window (from_block=47221062, to_block=47241062), same 5 event types (Supply (V3), Withdraw, Repay, Borrow, LiquidationCall):

Run Tool Duration Blocks/s Coverage
In-house direct RPC (full 3.05M-block scan, same contract/events) 223.6s for 3,047,072 blocks ~13,626 complete
Alter address.events, attempt 1 MCP 60.6s 330 incomplete (has_incomplete_coverage:true, has_more:true, 3/5 chunks failed)
Alter address.events, attempt 2 MCP 31.0s 645 incomplete (has_incomplete_coverage:true, has_more:true, 1/5 chunks failed)

Normalized to blocks/second, Alter is 21-41x slower than the in-house scanner on the identical contract, and unlike the in-house scanner, neither Alter run completed the requested window — both returned has_more:true after 20-60s, meaning a caller would need multiple round-trips (each taking tens of seconds) to cover even this modest 20k-block range.

Both runs show heavy endpoint churn: calls_retried: 111-116 against calls_total: 15-24 (ratio ~5-7x, per Alter's own documented threshold this "suggests failing public RPC endpoints"), global_health: "unhealthy", 1-3 of 5 chunks failing outright per run.

Why this isn't just "public RPC is flaky"

The in-house scanner hits the exact same public Gnosis endpoints (no private RPC configured on either side) and sustains ~13.6k blocks/s on a 150x larger window in the same session. The gap isn't network conditions — it's how each side handles endpoint failures: the in-house scanner's chunking/retry strategy tolerates individual RPC failures without stalling or under-covering the requested range; Alter's address.events degrades to both slow and incomplete under the same conditions.

Relation to #33

#33 (closed 15/07) described a ~32s fixed ceiling regardless of scan size, "fixed" by reducing per-endpoint timeouts (5s→3s) and maxConsecutiveFailures (5→3). Both runs here still land in a 31-61s range — consistent with #33 not actually being resolved, or with the timeout reduction trading one symptom (fixed wait) for another (incomplete coverage returned faster). Either way, a 20k-block scan should not take 30-60s and still not finish.

Acceptance test to verify a fix

address_events(
  contract="0xFb9b496519fCa8473fba1af0850B6B8F476BFdB3",
  events=["Supply (V3)", "Withdraw", "Repay", "Borrow", "LiquidationCall"],
  network="gnosis",
  from_block=<any recent block N>,
  to_block=<N + 20000>
)

Pass: has_incomplete_coverage:false, has_more:false, elapsed_ms well under 10s (in-house baseline: ~1.5s for an equivalent 20k-block window at 13.6k blocks/s).
Fail: has_more:true and/or elapsed_ms > 15s on a plain 20k-block window with no unusual RPC outage.

Happy to share the in-house scanner's chunking approach if useful for comparison — it's a simple bounded-chunk-size + retry-per-chunk strategy, nothing exotic.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions