Web3: query returned more than 10000 results (eth_getLogs)
The RPC provider caps how much a single log query may return or how many blocks it may span, and the limit is per provider rather than part of the JSON-RPC spec. The same code works against a local node and fails on a hosted endpoint, usually at the point where an indexer starts from the contract deployment block.
Quick fix
Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.
// Page the range rather than asking for all of history at once
const STEP = 2000n; // stay under the provider block span limit
for (let from = startBlock; from <= head; from += STEP) {
const to = from + STEP - 1n > head ? head : from + STEP - 1n;
const logs = await provider.getLogs({ address, topics, fromBlock: from, toBlock: to });
await handle(logs);
}
// Narrow the filter before widening the range: an indexed topic costs nothing
const topics = [id("Transfer(address,address,uint256)"), null, pad(recipient)];
// Halve the window when the provider complains, rather than failing the job
try { await provider.getLogs(f); }
catch (e) { if (/more than|range/i.test(e.message)) return split(f); throw e; }
# Check the published limits before tuning the constant, they differ by plan
# and a pruned node returns an empty result rather than an error for old blocks
How to diagnose Web3 errors
Web3 errors are unusually terse because the EVM reports failure without explanation by default. execution reverted means a require or revert triggered. The reason string is present in the return data but most libraries discard it. Nonce errors reflect the strict sequential ordering of transactions per account, so a stuck transaction blocks every one behind it.
If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.
- Simulate before sending:
eth_callagainst the same block returns the revert reason string that a submitted transaction hides. - Use a transaction tracer (Tenderly, Foundry's
cast run, or a node'sdebug_traceTransaction) to see the exact opcode and contract where execution reverted. - For nonce errors, query the account's pending nonce (
eth_getTransactionCountwith thependingtag) rather than tracking it locally. - To replace a stuck transaction, resend with the same nonce and a materially higher gas price: most nodes require at least a 10% increase.
- Check the chain ID matches the network you intend. Signing for the wrong chain produces confusing rejection messages.
Tools worth reaching for
cast (Foundry)eth_call simulationTenderly / block explorer tracerdebug_traceTransaction
Authoritative references
Primary documentation for this error, worth reading before applying any fix in production.
Related Web3 errors
- Web3: already known / ALREADY_EXISTS when sending a transactionThe node already holds a transaction with this exact hash in its pool, so the resend is…
- Web3: cannot estimate gas; transaction may fail or may require manual gas limitThe node ran the transaction against current state and it reverted, so no gas figure could be…
- Web3: execution revertedThe smart contract reverted. Solidity custom errors or revert strings often explain the exact…
- Web3: gas required exceeds allowance (0)The node simulated the transaction and found the sender cannot cover it, so the allowance it…
- Web3: insufficient funds for gas * price + valueThe wallet lacks enough native token to pay transaction value plus gas. This is separate from…
- Web3: intrinsic gas too lowThe gas limit on the transaction is below the minimum the EVM charges before executing any…
- Web3: max fee per gas less than block base feeThe node rejected the transaction because its maxFeePerGas is below the base fee of the next…
- Web3: missing revert data in call exception (CALL_EXCEPTION)The call failed without a reason string, which usually means there is no contract at that…
Browse other categories
- HTTP 494xx client errors, 5xx server errors, redirects, headers and protocol problems.
- JavaScript 42npm resolution, async pitfalls, hydration, memory limits and runtime type…
- Database 41Connections, deadlocks, constraints, replication and memory limits.
- AI 35Rate limits, context windows, GPU memory and model-serving failures.
- Network 35Refused connections, timeouts, resets, MTU problems and port exhaustion.
- Python 35Imports, virtual environments, encoding, concurrency and dependency conflicts.
- Kubernetes 34CrashLoopBackOff, ImagePullBackOff, OOMKilled, RBAC, scheduling and storage.
- Docker 27Daemon connectivity, disk space, image pulls, ports and architecture mismatches.
- System 26Disk space, systemd units, file descriptors, OOM killer and scheduled jobs.
- Cloud 25IAM permissions, quotas, service limits and credential failures.
- Security 25JWT validation, CSRF, OAuth grants, SELinux, SSH host keys and CSP.
- TLS 24Untrusted authorities, expiry, hostname mismatch, chains and cipher negotiation.
Something missing or wrong?
This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.