EVM-778 Debug Transaction endpoint - use one structure for logs #1817
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.
Description
Use only one structure for logs to reduce memory consumption.
Prior to these changes, there was an additional slice of objects that stored information about each step's execution. That slice was later on converted into json response slice of different objects. That caused additional memory consumption without any special reason.
Additionally,
omitempty
is added for fieldsand that will reduce json output in case when those fields are empty or disabled by json request input parameters (
disableStack, disableStorage, enableMemory
).Changes include
Checklist
Testing
Manual tests
Start cluster, deploy smart contract(s) and transaction that calls some of those sc.
0x09e60436fc2344c03ef2c721dcb179d2e9cb4cecf535f1217f25abe24ea37dc6
is hash of that transaction and that is the tx you want to debug.Try to execute following endpoint request. You should get the same json response as with old code (minus that in newest version empty fields will be omitted)