Repository navigation
eth/tracers: make debug_traceCall block parameter optional - #35583
Merged
rjl493456442 merged 1 commit intoAug 28, 2026
Merged
Conversation
Default the block parameter to latest when omitted, consistent with the state-method defaults (ethereum#35100). No behavior change when the parameter is supplied.
rjl493456442
approved these changes
Aug 28, 2026
taratorio
pushed a commit
to nerolation/erigon
that referenced
this pull request
Aug 31, 2026
…ntech#23683) `debug_traceCall` took the block selector by value (`rpc.BlockNumberOrHash`), so omitting it — or passing `null` — was rejected by the positional argument parser with `missing value for required argument 1`. It was the last state-reading method still requiring the parameter: `eth_call`, `eth_estimateGas`, `eth_getBalance`, `eth_getCode`, `eth_getProof`, `eth_createAccessList`, `trace_call` and friends already take `*rpc.BlockNumberOrHash` and default to `latest`. The parameter is now a pointer and defaults to `latest`, matching geth (`ethereum/go-ethereum#35583`) and the pending spec in `ethereum/execution-apis#855`, which marks it optional with default `latest`. `pending` is still rejected, as before. Also renames the shared helper `orLatest` to `blockOrLatest` (mechanical, 9 call sites) and adds unit tests for it. ## Testing - New `TestDebugTraceCallBlockParamDefaultsToLatest` drives the change through the JSON-RPC dispatch layer (where the failure was): an omitted and a `null` block selector must produce the same trace as an explicit `"latest"`. Red before the change with `missing value for required argument 1` on both cases. - New `TestBlockOrLatest` covers the helper: nil defaults to latest, an explicit number is kept, a hash keeps `requireCanonical`, `pending` is passed through for the caller to reject. - `go test -short ./rpc/jsonrpc/ ./rpc/` and `golangci-lint` on `rpc/jsonrpc/...` are clean.
jimmyc256
pushed a commit
to Lambda256/go-ethereum-ralim
that referenced
this pull request
Sep 23, 2026
…35583) `debug_traceCall` requires the block number or hash parameter today. `TraceCall` takes `rpc.BlockNumberOrHash` by value, so an omitted parameter returns "missing value for required argument 1". The pending callTracer spec (ethereum/execution-apis#855) marks the parameter optional with a default of `latest`, consistent with the state-method defaults from ethereum#35100 (execution-apis ethereum#812/ethereum#814 lineage). This changes the argument to `*rpc.BlockNumberOrHash` and defaults to latest when nil. A regression test calls `debug_traceCall` through the RPC server with the parameter omitted and compares against an explicit `latest`. No behavior change when the parameter is supplied.
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.
debug_traceCallrequires the block number or hash parameter today.TraceCalltakesrpc.BlockNumberOrHashby value, so an omitted parameter returns "missing value for required argument 1".The pending callTracer spec (ethereum/execution-apis#855) marks the parameter optional with a default of
latest, consistent with the state-method defaults from #35100 (execution-apis #812/#814 lineage).This changes the argument to
*rpc.BlockNumberOrHashand defaults to latest when nil. A regression test callsdebug_traceCallthrough the RPC server with the parameter omitted and compares against an explicitlatest. No behavior change when the parameter is supplied.