Enable/disable trace fields for RPCs that dump traces to files#9183
Enable/disable trace fields for RPCs that dump traces to files#9183lu-pinto merged 10 commits intobesu-eth:mainfrom
Conversation
be9ca84 to
fc4cf7d
Compare
| @@ -0,0 +1,225 @@ | |||
| /* | |||
| * Copyright ConsenSys AG. | |||
There was a problem hiding this comment.
| * Copyright ConsenSys AG. | |
| * Copyright contributors to Besu. |
There was a problem hiding this comment.
how did you spot this? was it some automated tool. I guess this should be done as part of spotless? do we need to make any changes?
There was a problem hiding this comment.
build.gradle (spotless) should add the newer version if it's not there already
...erledger/besu/ethereum/api/jsonrpc/methods/DebugStandardTraceBlockToFileIntegrationTest.java
Outdated
Show resolved
Hide resolved
fc4cf7d to
3dfe7ce
Compare
…nd debug_traceStandardBadBlockToFile Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
3dfe7ce to
a409cd3
Compare
macfarla
left a comment
There was a problem hiding this comment.
LGTM - maybe worth a quick doc on how to use it for devs
@macfarla do you mean a doc entry in the readmes of this project or an entry in the wiki? |
I think because it's for devs it could be a markdown file in docs folder https://github.com/hyperledger/besu/tree/main/docs |
well this PR only allows for options to be overridden by the user like other RPC endpoints already do. It is nothing new I'm adding. It just happens that these 2 endpoints do not allow modification of these options by the user like the others. Looking at the |
here might make sense too https://besu.hyperledger.org/public-networks/reference/api#debug-methods - also doesn't have to block this PR |
|
As discussed offline I think it is good to document these changes in here. I added a |
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
a28978b to
0eb307e
Compare
…eth#9183) Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com> Allows for enabling and disabling stack, storage, returnData, etc.. for these 2 specific RPC endpoints: debug_traceStandardBlockToFile and debug_traceStandardBadBlockToFile. It does not change any previous defaults for memory which is shown by default. Example of usage: curl --location --globoff 'http://localhost:8545' --data '{ "jsonrpc": "2.0", "method": "debug_standardTraceBlockToFile", "params": [ "0x2476b23a03dd87f272724a12213dc4a1ca8f13a1aa9d128a690e1b7d7d312e5e", { "txHash": "0xdfd5028da0f2f306ae71dc558c26bb1935b13ec3a0e909223eaa77bf761189a8", "disableStack": true, "disableMemory": false, "disableStorage": false } ], "id": 1 }' curl --location --globoff 'http://localhost:8545/' --data '{ "jsonrpc": "2.0", "method": "debug_standardTraceBadBlockToFile", "params": [ "0x2476b23a03dd87f272724a12213dc4a1ca8f13a1aa9d128a690e1b7d7d312e5e", { "txHash": "0xdfd5028da0f2f306ae71dc558c26bb1935b13ec3a0e909223eaa77bf761189a8", "disableStack": true, "disableMemory": false, "disableStorage": false } ], "id": 1 }' # Conflicts: # ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java
…eth#9183) Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com> Allows for enabling and disabling stack, storage, returnData, etc.. for these 2 specific RPC endpoints: debug_traceStandardBlockToFile and debug_traceStandardBadBlockToFile. It does not change any previous defaults for memory which is shown by default. Example of usage: curl --location --globoff 'http://localhost:8545' --data '{ "jsonrpc": "2.0", "method": "debug_standardTraceBlockToFile", "params": [ "0x2476b23a03dd87f272724a12213dc4a1ca8f13a1aa9d128a690e1b7d7d312e5e", { "txHash": "0xdfd5028da0f2f306ae71dc558c26bb1935b13ec3a0e909223eaa77bf761189a8", "disableStack": true, "disableMemory": false, "disableStorage": false } ], "id": 1 }' curl --location --globoff 'http://localhost:8545/' --data '{ "jsonrpc": "2.0", "method": "debug_standardTraceBadBlockToFile", "params": [ "0x2476b23a03dd87f272724a12213dc4a1ca8f13a1aa9d128a690e1b7d7d312e5e", { "txHash": "0xdfd5028da0f2f306ae71dc558c26bb1935b13ec3a0e909223eaa77bf761189a8", "disableStack": true, "disableMemory": false, "disableStorage": false } ], "id": 1 }' Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
This PR allows for enabling and disabling stack, storage, returnData, etc.. for these 2 specific RPC endpoints:
debug_traceStandardBlockToFileanddebug_traceStandardBadBlockToFile. It does not change any previous defaults formemorywhich is shown by default. This is to allow debugging of big transactions by dumping them to disk instead of waiting for a JSON reply withdebug_traceBlock*kind of methods.This PR also refactors
OpCodeTracerConfigto be created using a builder pattern and passed around to the 2 tracers involved in the mentioned RPC endpoints:DebugOperationTracerandStandardJsonTracerakaStreamingOperationTracer, avoiding code duplication.Example of usage:
Fixed Issue(s)
fixes #9182 9182
Thanks for sending a pull request! Have you done the following?
doc-change-requiredlabel to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew spotlessApply./gradlew build./gradlew acceptanceTest./gradlew integrationTest./gradlew ethereum:referenceTests:referenceTests