feat: support state overrides in debug_traceCall#1181
Conversation
|
PR author is not in the allowed authors list. |
aljo242
left a comment
There was a problem hiding this comment.
dos risk: req.Overrides is unmarshaled from raw bytes with no size bound. on a public query node, a caller can send an arbitrarily large blob and force a large allocation. add a max-size check before unmarshal.
traceTxWithMsg has 9 parameters -- group stateOverride and the config args into a struct.
missing behavioral test: the tests register the override struct but don't verify that an override (e.g., balance or code) actually changes the trace output. need at least one table-driven case that sets an override and asserts the result reflects it.
Thanks for the review, @aljo242. For the DoS concern: I checked geth’s behavior and it does not enforce a stateOverride-specific size or depth limit. The request is bounded at the transport layer instead. We are already bounded by Also, For the For the missing behavioral test: also agreed. I updated the test traces the same call again without overrides to verify the underlying contract state remains unchanged. |
Description
This PR adds geth-compatible
stateOverridessupport todebug_traceCall.The implementation keeps state overrides scoped to call tracing:
rpctypes.TraceCallConfig, embedding the existingTraceConfigand addingstateOverridesdebug_traceCallRPC/backend path to acceptTraceCallConfigoverridesbytes toQueryTraceCallRequestx/vm/keeper.TraceCallusing the existingrpctypes.StateOverrideformatApplyMessageWithConfigdebug_traceTransactionanddebug_traceBlock*on the existingTraceConfigpathAuthor Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
mainbranchCloses: #1180