Repository navigation
Conversation
execution-apis requires -32602 Invalid params for an eth_getProof request with more storage keys than the client's limit. The per-call cap answered -32005 Limit exceeded. The batch-wide cap is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ilitteri
left a comment
There was a problem hiding this comment.
The change to GetProofRequest::parse gives the right -32602 for a standalone call, but wrapping that same 1,025-key call in a one-item JSON-RPC batch hits validate_batch -> batch_proof_keys_error before dispatch, returning a single -32005 error with id: null instead of a per-item -32602 with the request ID.
Please have batch_proof_keys_error skip calls that individually exceed MAX_PROOF_STORAGE_KEYS when summing the batch budget so their own parser returns -32602 with the original ID (preserving -32005 for batches of individually valid calls that exceed the aggregate cap), and add a one-item batch test.
(Related RPC / eth_getProof PRs on EthLib: ethereum/EthLib#5446 and ethereum/EthLib#5449.)
A one-call JSON-RPC batch whose eth_getProof asks for more storage keys than the per-call cap was refused as a whole by the batch key budget, with -32005 and a null id, while the same call on its own gets -32602. Such a call is now left out of the batch total: its own parser refuses it with -32602 under its id before any trie work, so it costs the batch nothing. Calls within the cap are still held to the cap together and refused with -32005 when they exceed it. Adds a validate_batch test for the total with and without calls over the cap, and an HTTP test for a one-call batch over the cap.
ilitteri
left a comment
There was a problem hiding this comment.
Pushed the follow-up fix (f9957f0fca) excluding individually over-cap eth_getProof calls from batch_proof_keys_error so single-call batches return -32602 under the call's own id while aggregate multi-call batches remain capped at -32005, with unit and HTTP batch tests. Looks good to merge.
Motivation
The
eth_getProoftext of execution-apis (from ethereum/execution-apis#954) says: "Clients MUST accept at least 1024 storage keys in one request, and MAY limit the number of keys above that. For a request over the limit, or for a storage key that is not hex or has more than 64 hex digits, clients MUST return the-32602: Invalid paramserror."ethrex caps a call at 1024 keys (#7485), but answers a call over the cap with
-32005(LimitExceeded).Description
GetProofRequest::parsereturnsRpcErr::InvalidParams(-32602) for more thanMAX_PROOF_STORAGE_KEYSkeys, with the same message.eth_getProofcalls of one batch keeps-32005; the spec does not address batches.get_proof_parse_rejects_more_storage_keys_than_the_capnow expectsInvalidParams; it fails before the change.Checks:
cargo test -p ethrex-rpc --lib proof(12 passed),rustfmt --checkon the touched file.🤖 Generated with Claude Code