Repository navigation
fix(sdk): page EVM getLogs on "maximum [from, to] blocks distance: N" - #565
Merged
Merged
Conversation
mova's RPC rejects eth_getLogs spans over 1000 blocks with -32000
"maximum [from, to] blocks distance: 1000". parseLogRangeError did not
know that text, so every scan with the default 10000-block page failed.
Learn N as the max range. A depth limit ("fromBlock is too far from the
latest block") is still not a range error: a smaller page does not fix it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CI Test Report✅ 5081/5081 tests passed (1214 suites) in 5m 31s SummaryCoverage report |
micro-memoize 5.2.2's forceUpdate path caches a wrapper of the forced
promise that nothing reads, and that wrapper rethrows. After one
successful getBlockInfo('latest'), every failed one was also an
unhandled rejection (about 1.2k log lines per day on a Temporal worker).
Add memoizeBlockInfo(): it caches only positive block numbers (10 min,
100 entries) and calls the chain's getBlockInfo directly for tags and
depths. EVM, Solana and TON use it; `.cache` stays seedable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andrevmatos
marked this pull request as ready for review
November 24, 2026 12:08
AmrMohamedRezk
approved these changes
Nov 24, 2026
This branch was successfully deployed
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.
Problem
getLogs: Mova rejects requests that span more than 1,000 blocks withmaximum [from, to] blocks distance: 1000. ethers wraps the RPC error (-32000) asUNKNOWN_ERROR. The SDK did not recognize the message, so it failed instead of reducing the page size.getBlockInfo: After a successful tag lookup, a failed refresh could also cause an unhandled promise rejection.micro-memoizereturned one promise to the caller and left a second, unread promise in the cache.Changes
getLogswith pages of at most the reported size. The test also confirms that Jovay’sfromBlock is too far from the latest blockerror does not trigger pagination.getBlockInfo. Send tag and depth lookups directly to the chain implementation. Keep cache entries for up to 10 minutes and preserve the ability to seed the cache with known timestamps.[Unreleased]and document when contributors need to add a changelog entry.Verification
npm run buildandnpm run checkpassed locally.npm run test:unit: 4,814 passed.