From c089e73456f7818f6f496a50428d7fd1d9ee385a Mon Sep 17 00:00:00 2001 From: Karim Taam Date: Fri, 31 Jan 2025 15:40:55 +0100 Subject: [PATCH] fix issue for DebugTraceTransaction and add tests for traceBlock apis Signed-off-by: Karim Taam --- .../methods/DebugTraceTransaction.java | 8 +- .../DebugTraceJsonRpcHttpBySpecTest.java | 3 +- .../DebugTraceJsonRpcHttpBySpecTest.java | 3 +- .../trace-block/debug_traceBlock_default.json | 456 +++++++++++++++++ .../debug_traceBlock_disableMemory.json | 459 ++++++++++++++++++ .../debug_traceBlock_disableStack.json | 348 +++++++++++++ .../debug_traceBlock_disableStorage.json | 392 +++++++++++++++ 7 files changed, 1663 insertions(+), 6 deletions(-) create mode 100644 ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_default.json create mode 100644 ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableMemory.json create mode 100644 ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableStack.json create mode 100644 ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableStorage.json diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransaction.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransaction.java index 1e85e6530a4..6adc6c9bf7a 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransaction.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransaction.java @@ -25,7 +25,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionResult; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionDetails; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.TransactionWithMetadata; import org.hyperledger.besu.ethereum.debug.TraceOptions; @@ -76,7 +76,7 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { RpcErrorType.INVALID_TRANSACTION_TRACE_PARAMS, e); } - final DebugTraceTransactionResult debugTraceTransactionResult = + final DebugTraceTransactionDetails debugTraceTransactionResult = debugTraceTransactionResult(hash, transactionWithMetadata.get(), traceOptions); return new JsonRpcSuccessResponse( @@ -86,7 +86,7 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { } } - private DebugTraceTransactionResult debugTraceTransactionResult( + private DebugTraceTransactionDetails debugTraceTransactionResult( final Hash hash, final TransactionWithMetadata transactionWithMetadata, final TraceOptions traceOptions) { @@ -100,7 +100,7 @@ private DebugTraceTransactionResult debugTraceTransactionResult( mutableWorldState -> transactionTracer .traceTransaction(mutableWorldState, blockHash, hash, execTracer) - .map(DebugTraceTransactionResult::new)) + .map(DebugTraceTransactionDetails::new)) .orElse(null); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/DebugTraceJsonRpcHttpBySpecTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/DebugTraceJsonRpcHttpBySpecTest.java index fbe3f32196a..3d066d14e9e 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/DebugTraceJsonRpcHttpBySpecTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/DebugTraceJsonRpcHttpBySpecTest.java @@ -39,7 +39,8 @@ protected BlockchainSetupUtil getBlockchainSetupUtil(final DataStorageFormat sto } public static Object[][] specs() { - return AbstractJsonRpcHttpBySpecTest.findSpecFiles(new String[] {"debug/trace-call"}); + return AbstractJsonRpcHttpBySpecTest.findSpecFiles( + new String[] {"debug/trace-call", "debug/trace-block"}); } @Test diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/forest/DebugTraceJsonRpcHttpBySpecTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/forest/DebugTraceJsonRpcHttpBySpecTest.java index cdedc3438b6..d90873fbd2f 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/forest/DebugTraceJsonRpcHttpBySpecTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/forest/DebugTraceJsonRpcHttpBySpecTest.java @@ -39,7 +39,8 @@ protected BlockchainSetupUtil getBlockchainSetupUtil(final DataStorageFormat sto } public static Object[][] specs() { - return AbstractJsonRpcHttpBySpecTest.findSpecFiles(new String[] {"debug/trace-call"}); + return AbstractJsonRpcHttpBySpecTest.findSpecFiles( + new String[] {"debug/trace-call", "debug/trace-block"}); } @Test diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_default.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_default.json new file mode 100644 index 00000000000..dfaa0333b2c --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_default.json @@ -0,0 +1,456 @@ +{ + "request": { + "id": 1, + "jsonrpc": "2.0", + "method": "debug_traceBlockByNumber", + "params": [ + "0x04" + ] + }, + "response": { + "jsonrpc":"2.0", + "id":1, + "result":[ + { + "txHash":"0x4de634fe767d1f6d0512ca0c9c0a054d3a2596f7cdd7c1eea5f93046a740b3c7", + "result":{ + "gas":61584, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755642, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755639, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755636, + "gasCost":3, + "depth":1, + "stack":[ + "0x1" + ] + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755633, + "gasCost":3, + "depth":1, + "stack":[ + "0x1", + "0x0" + ] + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755630, + "gasCost":20000, + "depth":1, + "stack":[ + "0x1", + "0x1" + ], + "storage":{ + "1":"1" + } + }, + { + "pc":7, + "op":"PUSH1", + "gas":16735630, + "gasCost":3, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"1" + } + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16735627, + "gasCost":3, + "depth":1, + "stack":[ + "0x60" + ], + "storage":{ + "1":"1" + } + }, + { + "pc":10, + "op":"PUSH1", + "gas":16735624, + "gasCost":3, + "depth":1, + "stack":[ + "0x2" + ], + "storage":{ + "1":"1" + } + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16735621, + "gasCost":3, + "depth":1, + "stack":[ + "0x2", + "0x40" + ], + "storage":{ + "1":"1" + } + }, + { + "pc":13, + "op":"SSTORE", + "gas":16735618, + "gasCost":20000, + "depth":1, + "stack":[ + "0x2", + "0x2" + ], + "storage":{ + "1":"1", + "2":"2" + } + }, + { + "pc":14, + "op":"STOP", + "gas":16715618, + "gasCost":0, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"1", + "2":"2" + } + } + ] + } + }, + { + "txHash":"0xf882ec206292910527fd7095e59a1ca027b873296f1eba3886aa1addc4ff0ab9", + "result":{ + "gas":31584, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755642, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755639, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755636, + "gasCost":3, + "depth":1, + "stack":[ + "0x3" + ] + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755633, + "gasCost":3, + "depth":1, + "stack":[ + "0x3", + "0x0" + ] + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755630, + "gasCost":5000, + "depth":1, + "stack":[ + "0x3", + "0x1" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":7, + "op":"PUSH1", + "gas":16750630, + "gasCost":3, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"3" + } + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16750627, + "gasCost":3, + "depth":1, + "stack":[ + "0x60" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":10, + "op":"PUSH1", + "gas":16750624, + "gasCost":3, + "depth":1, + "stack":[ + "0x4" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16750621, + "gasCost":3, + "depth":1, + "stack":[ + "0x4", + "0x40" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":13, + "op":"SSTORE", + "gas":16750618, + "gasCost":5000, + "depth":1, + "stack":[ + "0x4", + "0x2" + ], + "storage":{ + "1":"3", + "2":"4" + } + }, + { + "pc":14, + "op":"STOP", + "gas":16745618, + "gasCost":0, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"3", + "2":"4" + } + } + ] + } + }, + { + "txHash":"0x7ca6bf869e8882216f7443accb8d642df41af5bfa3a0e63bf03be2cfe629a030", + "result":{ + "gas":13686, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755654, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755651, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755648, + "gasCost":3, + "depth":1, + "stack":[ + "0x3" + ] + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755645, + "gasCost":3, + "depth":1, + "stack":[ + "0x3", + "0x0" + ] + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755642, + "gasCost":800, + "depth":1, + "stack":[ + "0x3", + "0x1" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":7, + "op":"PUSH1", + "gas":16754842, + "gasCost":3, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"3" + } + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16754839, + "gasCost":3, + "depth":1, + "stack":[ + "0x60" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":10, + "op":"PUSH1", + "gas":16754836, + "gasCost":3, + "depth":1, + "stack":[ + "0x0" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16754833, + "gasCost":3, + "depth":1, + "stack":[ + "0x0", + "0x40" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":13, + "op":"SSTORE", + "gas":16754830, + "gasCost":5000, + "depth":1, + "stack":[ + "0x0", + "0x1" + ], + "storage":{ + "1":"0" + } + }, + { + "pc":14, + "op":"STOP", + "gas":16749830, + "gasCost":0, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"0" + } + } + ] + } + } + ] + }, + "statusCode": 200 +} \ No newline at end of file diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableMemory.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableMemory.json new file mode 100644 index 00000000000..bb907bf8d35 --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableMemory.json @@ -0,0 +1,459 @@ +{ + "request": { + "id": 1, + "jsonrpc": "2.0", + "method": "debug_traceBlockByNumber", + "params": [ + "0x04", + { + "disableMemory":true + } + ] + }, + "response":{ + "jsonrpc":"2.0", + "id":1, + "result":[ + { + "txHash":"0x4de634fe767d1f6d0512ca0c9c0a054d3a2596f7cdd7c1eea5f93046a740b3c7", + "result":{ + "gas":61584, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755642, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755639, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755636, + "gasCost":3, + "depth":1, + "stack":[ + "0x1" + ] + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755633, + "gasCost":3, + "depth":1, + "stack":[ + "0x1", + "0x0" + ] + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755630, + "gasCost":20000, + "depth":1, + "stack":[ + "0x1", + "0x1" + ], + "storage":{ + "1":"1" + } + }, + { + "pc":7, + "op":"PUSH1", + "gas":16735630, + "gasCost":3, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"1" + } + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16735627, + "gasCost":3, + "depth":1, + "stack":[ + "0x60" + ], + "storage":{ + "1":"1" + } + }, + { + "pc":10, + "op":"PUSH1", + "gas":16735624, + "gasCost":3, + "depth":1, + "stack":[ + "0x2" + ], + "storage":{ + "1":"1" + } + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16735621, + "gasCost":3, + "depth":1, + "stack":[ + "0x2", + "0x40" + ], + "storage":{ + "1":"1" + } + }, + { + "pc":13, + "op":"SSTORE", + "gas":16735618, + "gasCost":20000, + "depth":1, + "stack":[ + "0x2", + "0x2" + ], + "storage":{ + "1":"1", + "2":"2" + } + }, + { + "pc":14, + "op":"STOP", + "gas":16715618, + "gasCost":0, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"1", + "2":"2" + } + } + ] + } + }, + { + "txHash":"0xf882ec206292910527fd7095e59a1ca027b873296f1eba3886aa1addc4ff0ab9", + "result":{ + "gas":31584, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755642, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755639, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755636, + "gasCost":3, + "depth":1, + "stack":[ + "0x3" + ] + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755633, + "gasCost":3, + "depth":1, + "stack":[ + "0x3", + "0x0" + ] + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755630, + "gasCost":5000, + "depth":1, + "stack":[ + "0x3", + "0x1" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":7, + "op":"PUSH1", + "gas":16750630, + "gasCost":3, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"3" + } + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16750627, + "gasCost":3, + "depth":1, + "stack":[ + "0x60" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":10, + "op":"PUSH1", + "gas":16750624, + "gasCost":3, + "depth":1, + "stack":[ + "0x4" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16750621, + "gasCost":3, + "depth":1, + "stack":[ + "0x4", + "0x40" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":13, + "op":"SSTORE", + "gas":16750618, + "gasCost":5000, + "depth":1, + "stack":[ + "0x4", + "0x2" + ], + "storage":{ + "1":"3", + "2":"4" + } + }, + { + "pc":14, + "op":"STOP", + "gas":16745618, + "gasCost":0, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"3", + "2":"4" + } + } + ] + } + }, + { + "txHash":"0x7ca6bf869e8882216f7443accb8d642df41af5bfa3a0e63bf03be2cfe629a030", + "result":{ + "gas":13686, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755654, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755651, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755648, + "gasCost":3, + "depth":1, + "stack":[ + "0x3" + ] + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755645, + "gasCost":3, + "depth":1, + "stack":[ + "0x3", + "0x0" + ] + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755642, + "gasCost":800, + "depth":1, + "stack":[ + "0x3", + "0x1" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":7, + "op":"PUSH1", + "gas":16754842, + "gasCost":3, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"3" + } + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16754839, + "gasCost":3, + "depth":1, + "stack":[ + "0x60" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":10, + "op":"PUSH1", + "gas":16754836, + "gasCost":3, + "depth":1, + "stack":[ + "0x0" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16754833, + "gasCost":3, + "depth":1, + "stack":[ + "0x0", + "0x40" + ], + "storage":{ + "1":"3" + } + }, + { + "pc":13, + "op":"SSTORE", + "gas":16754830, + "gasCost":5000, + "depth":1, + "stack":[ + "0x0", + "0x1" + ], + "storage":{ + "1":"0" + } + }, + { + "pc":14, + "op":"STOP", + "gas":16749830, + "gasCost":0, + "depth":1, + "stack":[ + + ], + "storage":{ + "1":"0" + } + } + ] + } + } + ] + }, + "statusCode": 200 +} \ No newline at end of file diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableStack.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableStack.json new file mode 100644 index 00000000000..e2b1a41f206 --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableStack.json @@ -0,0 +1,348 @@ +{ + "request": { + "id": 1, + "jsonrpc": "2.0", + "method": "debug_traceBlockByNumber", + "params": [ + "0x04", + { + "disableStack": true + } + ] + }, + "response": { + "jsonrpc":"2.0", + "id":1, + "result":[ + { + "txHash":"0x4de634fe767d1f6d0512ca0c9c0a054d3a2596f7cdd7c1eea5f93046a740b3c7", + "result":{ + "gas":61584, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755642, + "gasCost":3, + "depth":1 + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755639, + "gasCost":3, + "depth":1 + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755636, + "gasCost":3, + "depth":1 + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755633, + "gasCost":3, + "depth":1 + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755630, + "gasCost":20000, + "depth":1, + "storage":{ + "1":"1" + } + }, + { + "pc":7, + "op":"PUSH1", + "gas":16735630, + "gasCost":3, + "depth":1, + "storage":{ + "1":"1" + } + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16735627, + "gasCost":3, + "depth":1, + "storage":{ + "1":"1" + } + }, + { + "pc":10, + "op":"PUSH1", + "gas":16735624, + "gasCost":3, + "depth":1, + "storage":{ + "1":"1" + } + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16735621, + "gasCost":3, + "depth":1, + "storage":{ + "1":"1" + } + }, + { + "pc":13, + "op":"SSTORE", + "gas":16735618, + "gasCost":20000, + "depth":1, + "storage":{ + "1":"1", + "2":"2" + } + }, + { + "pc":14, + "op":"STOP", + "gas":16715618, + "gasCost":0, + "depth":1, + "storage":{ + "1":"1", + "2":"2" + } + } + ] + } + }, + { + "txHash":"0xf882ec206292910527fd7095e59a1ca027b873296f1eba3886aa1addc4ff0ab9", + "result":{ + "gas":31584, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755642, + "gasCost":3, + "depth":1 + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755639, + "gasCost":3, + "depth":1 + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755636, + "gasCost":3, + "depth":1 + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755633, + "gasCost":3, + "depth":1 + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755630, + "gasCost":5000, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":7, + "op":"PUSH1", + "gas":16750630, + "gasCost":3, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16750627, + "gasCost":3, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":10, + "op":"PUSH1", + "gas":16750624, + "gasCost":3, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16750621, + "gasCost":3, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":13, + "op":"SSTORE", + "gas":16750618, + "gasCost":5000, + "depth":1, + "storage":{ + "1":"3", + "2":"4" + } + }, + { + "pc":14, + "op":"STOP", + "gas":16745618, + "gasCost":0, + "depth":1, + "storage":{ + "1":"3", + "2":"4" + } + } + ] + } + }, + { + "txHash":"0x7ca6bf869e8882216f7443accb8d642df41af5bfa3a0e63bf03be2cfe629a030", + "result":{ + "gas":13686, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755654, + "gasCost":3, + "depth":1 + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755651, + "gasCost":3, + "depth":1 + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755648, + "gasCost":3, + "depth":1 + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755645, + "gasCost":3, + "depth":1 + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755642, + "gasCost":800, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":7, + "op":"PUSH1", + "gas":16754842, + "gasCost":3, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16754839, + "gasCost":3, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":10, + "op":"PUSH1", + "gas":16754836, + "gasCost":3, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16754833, + "gasCost":3, + "depth":1, + "storage":{ + "1":"3" + } + }, + { + "pc":13, + "op":"SSTORE", + "gas":16754830, + "gasCost":5000, + "depth":1, + "storage":{ + "1":"0" + } + }, + { + "pc":14, + "op":"STOP", + "gas":16749830, + "gasCost":0, + "depth":1, + "storage":{ + "1":"0" + } + } + ] + } + } + ] + }, + "statusCode": 200 +} \ No newline at end of file diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableStorage.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableStorage.json new file mode 100644 index 00000000000..1c0e1b717a2 --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-block/debug_traceBlock_disableStorage.json @@ -0,0 +1,392 @@ +{ + "request": { + "id": 1, + "jsonrpc": "2.0", + "method": "debug_traceBlockByNumber", + "params": [ + "0x04", + { + "disableStorage": true + } + ] + }, + "response": { + "jsonrpc":"2.0", + "id":1, + "result":[ + { + "txHash":"0x4de634fe767d1f6d0512ca0c9c0a054d3a2596f7cdd7c1eea5f93046a740b3c7", + "result":{ + "gas":61584, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755642, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755639, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755636, + "gasCost":3, + "depth":1, + "stack":[ + "0x1" + ] + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755633, + "gasCost":3, + "depth":1, + "stack":[ + "0x1", + "0x0" + ] + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755630, + "gasCost":20000, + "depth":1, + "stack":[ + "0x1", + "0x1" + ] + }, + { + "pc":7, + "op":"PUSH1", + "gas":16735630, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16735627, + "gasCost":3, + "depth":1, + "stack":[ + "0x60" + ] + }, + { + "pc":10, + "op":"PUSH1", + "gas":16735624, + "gasCost":3, + "depth":1, + "stack":[ + "0x2" + ] + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16735621, + "gasCost":3, + "depth":1, + "stack":[ + "0x2", + "0x40" + ] + }, + { + "pc":13, + "op":"SSTORE", + "gas":16735618, + "gasCost":20000, + "depth":1, + "stack":[ + "0x2", + "0x2" + ] + }, + { + "pc":14, + "op":"STOP", + "gas":16715618, + "gasCost":0, + "depth":1, + "stack":[ + + ] + } + ] + } + }, + { + "txHash":"0xf882ec206292910527fd7095e59a1ca027b873296f1eba3886aa1addc4ff0ab9", + "result":{ + "gas":31584, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755642, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755639, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755636, + "gasCost":3, + "depth":1, + "stack":[ + "0x3" + ] + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755633, + "gasCost":3, + "depth":1, + "stack":[ + "0x3", + "0x0" + ] + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755630, + "gasCost":5000, + "depth":1, + "stack":[ + "0x3", + "0x1" + ] + }, + { + "pc":7, + "op":"PUSH1", + "gas":16750630, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16750627, + "gasCost":3, + "depth":1, + "stack":[ + "0x60" + ] + }, + { + "pc":10, + "op":"PUSH1", + "gas":16750624, + "gasCost":3, + "depth":1, + "stack":[ + "0x4" + ] + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16750621, + "gasCost":3, + "depth":1, + "stack":[ + "0x4", + "0x40" + ] + }, + { + "pc":13, + "op":"SSTORE", + "gas":16750618, + "gasCost":5000, + "depth":1, + "stack":[ + "0x4", + "0x2" + ] + }, + { + "pc":14, + "op":"STOP", + "gas":16745618, + "gasCost":0, + "depth":1, + "stack":[ + + ] + } + ] + } + }, + { + "txHash":"0x7ca6bf869e8882216f7443accb8d642df41af5bfa3a0e63bf03be2cfe629a030", + "result":{ + "gas":13686, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755654, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16755651, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16755648, + "gasCost":3, + "depth":1, + "stack":[ + "0x3" + ] + }, + { + "pc":5, + "op":"CALLDATALOAD", + "gas":16755645, + "gasCost":3, + "depth":1, + "stack":[ + "0x3", + "0x0" + ] + }, + { + "pc":6, + "op":"SSTORE", + "gas":16755642, + "gasCost":800, + "depth":1, + "stack":[ + "0x3", + "0x1" + ] + }, + { + "pc":7, + "op":"PUSH1", + "gas":16754842, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":9, + "op":"CALLDATALOAD", + "gas":16754839, + "gasCost":3, + "depth":1, + "stack":[ + "0x60" + ] + }, + { + "pc":10, + "op":"PUSH1", + "gas":16754836, + "gasCost":3, + "depth":1, + "stack":[ + "0x0" + ] + }, + { + "pc":12, + "op":"CALLDATALOAD", + "gas":16754833, + "gasCost":3, + "depth":1, + "stack":[ + "0x0", + "0x40" + ] + }, + { + "pc":13, + "op":"SSTORE", + "gas":16754830, + "gasCost":5000, + "depth":1, + "stack":[ + "0x0", + "0x1" + ] + }, + { + "pc":14, + "op":"STOP", + "gas":16749830, + "gasCost":0, + "depth":1, + "stack":[ + + ] + } + ] + } + } + ] + }, + "statusCode": 200 +} \ No newline at end of file