fix(constants): cap Polygon getLogs lookback at 2k blocks - #3741
Closed
droplet-rl wants to merge 1 commit into
Closed
fix(constants): cap Polygon getLogs lookback at 2k blocks#3741droplet-rl wants to merge 1 commit into
droplet-rl wants to merge 1 commit into
Conversation
Polygon was falling through to the 10k default range. Alchemy only serves unbounded-response-size eth_getLogs up to a 2,000 block range; above that it caps at 10K logs and rejects oversized responses, which now trips on high-volume SpokePool topics. Co-Authored-By: Claude <noreply@anthropic.com>
droplet-rl
requested review from
bmzig,
dijanin-brat,
mrice32,
nicholaspai and
pxrl
as code owners
August 21, 2026 09:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
zion-across-disputer(dataworker) failed an Alchemyeth_getLogsforFundsDepositedon the Polygon SpokePool over blocks 92,330,000–92,339,999:Polygon has no entry in
resolveRpcConfig()'sranges, so it falls through todefaultRange = 10_000.This is a log-volume problem, not an Alchemy policy change
Measured from the indexer (
evm.v3_funds_deposited,originChainId = 137):FundsDepositedlogsAlchemy's suggested range is derived from observed density against the same long-standing 10K-log cap, so there's no evidence of a reduced threshold.
The volume came from a burst on 2026-08-20: 29,322 Polygon deposits vs. a 1,000–1,500/day baseline. 27,862 of them were one pattern — Polygon USDC → Base USDC, integrator
00cf, 180 depositor EOAs, uniform 5.25 USDC — running 03:00–10:00 UTC at a peak of about 5,100/hour. It has since subsided to about 60–100/hour.Why 2,000 and not 5,000
A stopgap of
"137": 4500is already live inbot-configs. The worst 2,000-block window that day held 4,324 logs, which extrapolates to 9,729 at a 4,500-block range — within 3% of failing again at peak.At a range of 2,000 or less Alchemy applies no response cap at all, so log density stops mattering entirely. That is the property worth having in the repo default, rather than a number tuned to the last burst.
Trade-off
5x more
eth_getLogscalls per Polygon lookback window across relayer / dataworker / finalizer, in exchange for a bound that doesn't depend on traffic. Worth discussing whether adaptive range-splitting on this error class is a better long-term answer than a static per-chain floor.BUNDLE_END_BLOCK_BUFFERS[POLYGON]is 128 and the largestMIN_DEPOSIT_CONFIRMATIONS[POLYGON]is 128, both well under 2,000, so the scan window doesn't get pinned behind head.Notes
Requested by @paul in Slack.
🤖 Generated with Claude Code