From 6cfd297cde8954c423428cc437a0ed2362bcb58a Mon Sep 17 00:00:00 2001 From: Karim Taam Date: Thu, 30 Jan 2025 16:10:41 +0100 Subject: [PATCH 1/6] add transaction hash for debug trace responses Signed-off-by: Karim Taam --- .../DebugTraceTransactionIntegrationTest.java | 6 +- .../results/DebugTraceTransactionDetails.java | 77 +++ .../results/DebugTraceTransactionResult.java | 52 +- .../methods/DebugTraceBlockByHashTest.java | 15 +- .../methods/DebugTraceBlockByNumberTest.java | 15 +- .../internal/methods/DebugTraceBlockTest.java | 15 +- .../methods/DebugTraceTransactionTest.java | 6 +- .../debug/trace-call/debug_traceCall_all.json | 369 ++++++----- .../trace-call/debug_traceCall_default.json | 528 ++++++++++------ .../debug_traceCall_disableMemory.json | 528 ++++++++++------ .../debug_traceCall_disableStack.json | 427 +++++++------ .../debug_traceCall_disableStorage.json | 584 +++++++++++------- .../debug_traceCall_noGasPrice.json | 31 +- 13 files changed, 1619 insertions(+), 1034 deletions(-) create mode 100644 ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/DebugTraceTransactionDetails.java diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java index 5b488987169..47802df69c8 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java @@ -24,7 +24,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; 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.results.DebugTraceTransactionResult; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionDetails; import org.hyperledger.besu.plugin.services.rpc.RpcResponseType; import org.hyperledger.besu.testutil.BlockTestUtil; @@ -70,8 +70,8 @@ public void debugTraceTransactionSuccessTest() { final JsonRpcResponse response = method.response(request); assertThat(response.getType()).isEqualTo(RpcResponseType.SUCCESS); - DebugTraceTransactionResult debugTraceTransactionResult = - (DebugTraceTransactionResult) ((JsonRpcSuccessResponse) response).getResult(); + DebugTraceTransactionDetails debugTraceTransactionResult = + (DebugTraceTransactionDetails) ((JsonRpcSuccessResponse) response).getResult(); assertThat(debugTraceTransactionResult.getGas()).isEqualTo(23705L); assertThat(debugTraceTransactionResult.getReturnValue()).isEmpty(); assertThat(debugTraceTransactionResult.failed()).isFalse(); diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/DebugTraceTransactionDetails.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/DebugTraceTransactionDetails.java new file mode 100644 index 00000000000..1c91c6c5050 --- /dev/null +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/DebugTraceTransactionDetails.java @@ -0,0 +1,77 @@ +/* + * Copyright contributors to Besu. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results; + +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; +import org.hyperledger.besu.ethereum.debug.TraceFrame; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonPropertyOrder({"gas", "failed", "returnValue", "structLogs"}) +public class DebugTraceTransactionDetails { + + private final List structLogs; + private final String returnValue; + private final long gas; + private final boolean failed; + + public DebugTraceTransactionDetails(final TransactionTrace transactionTrace) { + gas = transactionTrace.getGas(); + returnValue = transactionTrace.getResult().getOutput().toString().substring(2); + structLogs = new ArrayList<>(transactionTrace.getTraceFrames().size()); + transactionTrace.getTraceFrames().parallelStream() + .map(DebugTraceTransactionDetails::createStructLog) + .forEachOrdered(structLogs::add); + failed = !transactionTrace.getResult().isSuccessful(); + } + + public static Collection of( + final Collection traces) { + return traces.stream().map(DebugTraceTransactionResult::new).collect(Collectors.toList()); + } + + private static StructLog createStructLog(final TraceFrame frame) { + return frame + .getExceptionalHaltReason() + .map(__ -> (StructLog) new StructLogWithError(frame)) + .orElse(new StructLog(frame)); + } + + @JsonGetter(value = "structLogs") + public List getStructLogs() { + return structLogs; + } + + @JsonGetter(value = "returnValue") + public String getReturnValue() { + return returnValue; + } + + @JsonGetter(value = "gas") + public long getGas() { + return gas; + } + + @JsonGetter(value = "failed") + public boolean failed() { + return failed; + } +} diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/DebugTraceTransactionResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/DebugTraceTransactionResult.java index acec389ab21..4932ccd80d6 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/DebugTraceTransactionResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/DebugTraceTransactionResult.java @@ -1,5 +1,5 @@ /* - * Copyright ConsenSys AG. + * Copyright contributors to Besu. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -15,32 +15,23 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; -import org.hyperledger.besu.ethereum.debug.TraceFrame; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import java.util.stream.Collectors; import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -@JsonPropertyOrder({"gas", "failed", "returnValue", "structLogs"}) +@JsonPropertyOrder({"txHash", "result"}) public class DebugTraceTransactionResult { - private final List structLogs; - private final String returnValue; - private final long gas; - private final boolean failed; + private final String txHash; + + private final DebugTraceTransactionDetails result; public DebugTraceTransactionResult(final TransactionTrace transactionTrace) { - gas = transactionTrace.getGas(); - returnValue = transactionTrace.getResult().getOutput().toString().substring(2); - structLogs = new ArrayList<>(transactionTrace.getTraceFrames().size()); - transactionTrace.getTraceFrames().parallelStream() - .map(DebugTraceTransactionResult::createStructLog) - .forEachOrdered(structLogs::add); - failed = !transactionTrace.getResult().isSuccessful(); + this.txHash = transactionTrace.getTransaction().getHash().toHexString(); + this.result = new DebugTraceTransactionDetails(transactionTrace); } public static Collection of( @@ -48,30 +39,13 @@ public static Collection of( return traces.stream().map(DebugTraceTransactionResult::new).collect(Collectors.toList()); } - private static StructLog createStructLog(final TraceFrame frame) { - return frame - .getExceptionalHaltReason() - .map(__ -> (StructLog) new StructLogWithError(frame)) - .orElse(new StructLog(frame)); - } - - @JsonGetter(value = "structLogs") - public List getStructLogs() { - return structLogs; - } - - @JsonGetter(value = "returnValue") - public String getReturnValue() { - return returnValue; - } - - @JsonGetter(value = "gas") - public long getGas() { - return gas; + @JsonGetter(value = "txHash") + public String getTxHash() { + return txHash; } - @JsonGetter(value = "failed") - public boolean failed() { - return failed; + @JsonGetter(value = "result") + public DebugTraceTransactionDetails getResult() { + return result; } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHashTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHashTest.java index 04aae980d14..b4cecb16713 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHashTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHashTest.java @@ -28,7 +28,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; 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.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.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; @@ -90,10 +90,10 @@ public void shouldReturnCorrectResponse() { when(blockchainQueries.getBlockchain()).thenReturn(blockchain); when(blockchain.getBlockByHash(block.getHash())).thenReturn(Optional.of(block)); - DebugTraceTransactionResult result1 = mock(DebugTraceTransactionResult.class); - DebugTraceTransactionResult result2 = mock(DebugTraceTransactionResult.class); + DebugTraceTransactionDetails result1 = mock(DebugTraceTransactionDetails.class); + DebugTraceTransactionDetails result2 = mock(DebugTraceTransactionDetails.class); - List resultList = Arrays.asList(result1, result2); + List resultList = Arrays.asList(result1, result2); try (MockedStatic mockedTracer = mockStatic(Tracer.class)) { mockedTracer @@ -109,7 +109,7 @@ public void shouldReturnCorrectResponse() { assertThat(jsonRpcResponse).isInstanceOf(JsonRpcSuccessResponse.class); JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) jsonRpcResponse; - final Collection traceResult = getResult(response); + final Collection traceResult = getResult(response); assertThat(traceResult).isNotEmpty(); assertThat(traceResult).isInstanceOf(Collection.class).hasSize(2); assertThat(traceResult).containsExactly(result1, result2); @@ -117,8 +117,9 @@ public void shouldReturnCorrectResponse() { } @SuppressWarnings("unchecked") - private Collection getResult(final JsonRpcSuccessResponse response) { - return (Collection) response.getResult(); + private Collection getResult( + final JsonRpcSuccessResponse response) { + return (Collection) response.getResult(); } @Test diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumberTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumberTest.java index 3f2e39b5423..1a92c1fe6ac 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumberTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumberTest.java @@ -28,7 +28,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; 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.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.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; @@ -88,10 +88,10 @@ public void shouldReturnCorrectResponse() { when(blockchain.getBlockByNumber(blockNumber)).thenReturn(Optional.of(block)); when(block.getHeader()).thenReturn(blockHeader); - DebugTraceTransactionResult result1 = mock(DebugTraceTransactionResult.class); - DebugTraceTransactionResult result2 = mock(DebugTraceTransactionResult.class); + DebugTraceTransactionDetails result1 = mock(DebugTraceTransactionDetails.class); + DebugTraceTransactionDetails result2 = mock(DebugTraceTransactionDetails.class); - List resultList = Arrays.asList(result1, result2); + List resultList = Arrays.asList(result1, result2); try (MockedStatic mockedTracer = mockStatic(Tracer.class)) { mockedTracer @@ -105,7 +105,7 @@ public void shouldReturnCorrectResponse() { assertThat(jsonRpcResponse).isInstanceOf(JsonRpcSuccessResponse.class); JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) jsonRpcResponse; - final Collection traceResult = getResult(response); + final Collection traceResult = getResult(response); assertThat(traceResult).isNotEmpty(); assertThat(traceResult).isInstanceOf(Collection.class).hasSize(2); assertThat(traceResult).containsExactly(result1, result2); @@ -113,8 +113,9 @@ public void shouldReturnCorrectResponse() { } @SuppressWarnings("unchecked") - private Collection getResult(final JsonRpcSuccessResponse response) { - return (Collection) response.getResult(); + private Collection getResult( + final JsonRpcSuccessResponse response) { + return (Collection) response.getResult(); } @Test diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockTest.java index a8499d5ebed..a7c5bd877d1 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockTest.java @@ -29,7 +29,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.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.Blockchain; @@ -144,10 +144,10 @@ public void shouldReturnCorrectResponse() { when(blockchain.getBlockByHash(block.getHeader().getParentHash())) .thenReturn(Optional.of(parentBlock)); - DebugTraceTransactionResult result1 = mock(DebugTraceTransactionResult.class); - DebugTraceTransactionResult result2 = mock(DebugTraceTransactionResult.class); + DebugTraceTransactionDetails result1 = mock(DebugTraceTransactionDetails.class); + DebugTraceTransactionDetails result2 = mock(DebugTraceTransactionDetails.class); - List resultList = Arrays.asList(result1, result2); + List resultList = Arrays.asList(result1, result2); try (MockedStatic mockedTracer = mockStatic(Tracer.class)) { mockedTracer @@ -163,7 +163,7 @@ public void shouldReturnCorrectResponse() { assertThat(jsonRpcResponse).isInstanceOf(JsonRpcSuccessResponse.class); JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) jsonRpcResponse; - final Collection traceResult = getResult(response); + final Collection traceResult = getResult(response); assertThat(traceResult).isNotEmpty(); assertThat(traceResult).isInstanceOf(Collection.class).hasSize(2); assertThat(traceResult).containsExactly(result1, result2); @@ -171,8 +171,9 @@ public void shouldReturnCorrectResponse() { } @SuppressWarnings("unchecked") - private Collection getResult(final JsonRpcSuccessResponse response) { - return (Collection) response.getResult(); + private Collection getResult( + final JsonRpcSuccessResponse response) { + return (Collection) response.getResult(); } @Test diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransactionTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransactionTest.java index 107abf5b2d4..87a3de8d25f 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransactionTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransactionTest.java @@ -30,7 +30,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTracer; 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.results.DebugTraceTransactionResult; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionDetails; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.StructLog; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.TransactionWithMetadata; @@ -155,8 +155,8 @@ public void shouldTraceTheTransactionUsingTheTransactionTracer() { .thenReturn(Optional.of(transactionTrace)); final JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) debugTraceTransaction.response(request); - final DebugTraceTransactionResult transactionResult = - (DebugTraceTransactionResult) response.getResult(); + final DebugTraceTransactionDetails transactionResult = + (DebugTraceTransactionDetails) response.getResult(); assertThat(transactionResult.getGas()).isEqualTo(73); assertThat(transactionResult.getReturnValue()).isEqualTo("1234"); diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_all.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_all.json index 3f6849d4533..1f8329b0dfa 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_all.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_all.json @@ -17,175 +17,206 @@ "id" : 1 }, "response": { - "jsonrpc": "2.0", - "id": 1, - "result": { - "gas" : 22070, - "failed" : false, - "returnValue" : "f000000000000000000000000000000000000000000000000000000000000002", - "structLogs" : [ { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16755910, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 2, - "op" : "PUSH1", - "gas" : 16755907, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 4, - "op" : "PUSH1", - "gas" : 16755904, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 6, - "op" : "CALLDATASIZE", - "gas" : 16755901, - "gasCost" : 2, - "depth" : 1 - }, { - "pc" : 7, - "op" : "SUB", - "gas" : 16755899, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 8, - "op" : "DUP1", - "gas" : 16755896, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16755893, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16755890, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 13, - "op" : "CALLDATACOPY", - "gas" : 16755887, - "gasCost" : 9, - "depth" : 1 - }, { - "pc" : 14, - "op" : "PUSH1", - "gas" : 16755878, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 16, - "op" : "CALLVALUE", - "gas" : 16755875, - "gasCost" : 2, - "depth" : 1 - }, { - "pc" : 17, - "op" : "PUSH1", - "gas" : 16755873, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 19, - "op" : "CALLDATALOAD", - "gas" : 16755870, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 20, - "op" : "GAS", - "gas" : 16755867, - "gasCost" : 2, - "depth" : 1 - }, { - "pc" : 21, - "op" : "CALLCODE", - "gas" : 16755865, - "gasCost" : 16494066, - "depth" : 1 - }, { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16493366, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 2, - "op" : "CALLDATALOAD", - "gas" : 16493363, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 3, - "op" : "PUSH1", - "gas" : 16493360, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 5, - "op" : "ADD", - "gas" : 16493357, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 6, - "op" : "PUSH1", - "gas" : 16493354, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 8, - "op" : "MSTORE", - "gas" : 16493351, - "gasCost" : 6, - "depth" : 2 - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16493345, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16493342, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 13, - "op" : "RETURN", - "gas" : 16493339, - "gasCost" : 0, - "depth" : 2 - }, { - "pc" : 22, - "op" : "PUSH1", - "gas" : 16755138, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 24, - "op" : "PUSH1", - "gas" : 16755135, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 26, - "op" : "RETURN", - "gas" : 16755132, - "gasCost" : 0, - "depth" : 1 - } ] + "jsonrpc":"2.0", + "id":1, + "result":{ + "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", + "result":{ + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1 + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1 + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1 + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1 + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1 + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1 + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1 + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1 + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1 + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1 + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1 + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1 + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1 + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1 + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1 + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2 + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2 + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2 + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2 + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2 + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2 + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2 + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2 + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2 + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1 + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1 + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1 + } + ] + } } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_default.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_default.json index da6d2b78009..5dbca78cb5a 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_default.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_default.json @@ -14,202 +14,338 @@ "id" : 1 }, "response": { - "jsonrpc": "2.0", - "id": 1, - "result": { - "gas" : 22070, - "failed" : false, - "returnValue" : "f000000000000000000000000000000000000000000000000000000000000002", - "structLogs" : [ { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16755910, - "gasCost" : 3, - "depth" : 1, - "stack" : [ ] - }, { - "pc" : 2, - "op" : "PUSH1", - "gas" : 16755907, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20" ] - }, { - "pc" : 4, - "op" : "PUSH1", - "gas" : 16755904, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0" ] - }, { - "pc" : 6, - "op" : "CALLDATASIZE", - "gas" : 16755901, - "gasCost" : 2, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20" ] - }, { - "pc" : 7, - "op" : "SUB", - "gas" : 16755899, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x40" ] - }, { - "pc" : 8, - "op" : "DUP1", - "gas" : 16755896, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20" ] - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16755893, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x20" ] - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16755890, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20" ] - }, { - "pc" : 13, - "op" : "CALLDATACOPY", - "gas" : 16755887, - "gasCost" : 9, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20", "0x0" ] - }, { - "pc" : 14, - "op" : "PUSH1", - "gas" : 16755878, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20" ] - }, { - "pc" : 16, - "op" : "CALLVALUE", - "gas" : 16755875, - "gasCost" : 2, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0" ] - }, { - "pc" : 17, - "op" : "PUSH1", - "gas" : 16755873, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0" ] - }, { - "pc" : 19, - "op" : "CALLDATALOAD", - "gas" : 16755870, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x0" ] - }, { - "pc" : 20, - "op" : "GAS", - "gas" : 16755867, - "gasCost" : 2, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000" ] - }, { - "pc" : 21, - "op" : "CALLCODE", - "gas" : 16755865, - "gasCost" : 16494066, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000", "0xffac99" ] - }, { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16493366, - "gasCost" : 3, - "depth" : 2, - "stack" : [ ] - }, { - "pc" : 2, - "op" : "CALLDATALOAD", - "gas" : 16493363, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0x0" ] - }, { - "pc" : 3, - "op" : "PUSH1", - "gas" : 16493360, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 5, - "op" : "ADD", - "gas" : 16493357, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001", "0x1" ] - }, { - "pc" : 6, - "op" : "PUSH1", - "gas" : 16493354, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 8, - "op" : "MSTORE", - "gas" : 16493351, - "gasCost" : 6, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002", "0x0" ] - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16493345, - "gasCost" : 3, - "depth" : 2, - "stack" : [ ] - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16493342, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0x20" ] - }, { - "pc" : 13, - "op" : "RETURN", - "gas" : 16493339, - "gasCost" : 0, - "depth" : 2, - "stack" : [ "0x20", "0x0" ] - }, { - "pc" : 22, - "op" : "PUSH1", - "gas" : 16755138, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x1" ] - }, { - "pc" : 24, - "op" : "PUSH1", - "gas" : 16755135, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x1", "0x20" ] - }, { - "pc" : 26, - "op" : "RETURN", - "gas" : 16755132, - "gasCost" : 0, - "depth" : 1, - "stack" : [ "0x1", "0x20", "0x0" ] - } ] + "jsonrpc":"2.0", + "id":1, + "result":{ + "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", + "result":{ + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x40" + ] + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20" + ] + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20", + "0x0" + ] + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0" + ] + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0" + ] + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x0" + ] + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000" + ] + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000", + "0xffac99" + ] + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2, + "stack":[ + "0x0" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001", + "0x1" + ] + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002", + "0x0" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2, + "stack":[ + + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2, + "stack":[ + "0x20" + ] + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1, + "stack":[ + "0x1" + ] + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1, + "stack":[ + "0x1", + "0x20" + ] + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1, + "stack":[ + "0x1", + "0x20", + "0x0" + ] + } + ] + } } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableMemory.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableMemory.json index af3d29f847d..af5c8089085 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableMemory.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableMemory.json @@ -17,202 +17,338 @@ "id" : 1 }, "response": { - "jsonrpc": "2.0", - "id": 1, - "result": { - "gas" : 22070, - "failed" : false, - "returnValue" : "f000000000000000000000000000000000000000000000000000000000000002", - "structLogs" : [ { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16755910, - "gasCost" : 3, - "depth" : 1, - "stack" : [ ] - }, { - "pc" : 2, - "op" : "PUSH1", - "gas" : 16755907, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20" ] - }, { - "pc" : 4, - "op" : "PUSH1", - "gas" : 16755904, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0" ] - }, { - "pc" : 6, - "op" : "CALLDATASIZE", - "gas" : 16755901, - "gasCost" : 2, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20" ] - }, { - "pc" : 7, - "op" : "SUB", - "gas" : 16755899, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x40" ] - }, { - "pc" : 8, - "op" : "DUP1", - "gas" : 16755896, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20" ] - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16755893, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x20" ] - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16755890, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20" ] - }, { - "pc" : 13, - "op" : "CALLDATACOPY", - "gas" : 16755887, - "gasCost" : 9, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20", "0x0" ] - }, { - "pc" : 14, - "op" : "PUSH1", - "gas" : 16755878, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20" ] - }, { - "pc" : 16, - "op" : "CALLVALUE", - "gas" : 16755875, - "gasCost" : 2, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0" ] - }, { - "pc" : 17, - "op" : "PUSH1", - "gas" : 16755873, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0" ] - }, { - "pc" : 19, - "op" : "CALLDATALOAD", - "gas" : 16755870, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x0" ] - }, { - "pc" : 20, - "op" : "GAS", - "gas" : 16755867, - "gasCost" : 2, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000" ] - }, { - "pc" : 21, - "op" : "CALLCODE", - "gas" : 16755865, - "gasCost" : 16494066, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000", "0xffac99" ] - }, { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16493366, - "gasCost" : 3, - "depth" : 2, - "stack" : [ ] - }, { - "pc" : 2, - "op" : "CALLDATALOAD", - "gas" : 16493363, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0x0" ] - }, { - "pc" : 3, - "op" : "PUSH1", - "gas" : 16493360, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 5, - "op" : "ADD", - "gas" : 16493357, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001", "0x1" ] - }, { - "pc" : 6, - "op" : "PUSH1", - "gas" : 16493354, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 8, - "op" : "MSTORE", - "gas" : 16493351, - "gasCost" : 6, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002", "0x0" ] - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16493345, - "gasCost" : 3, - "depth" : 2, - "stack" : [ ] - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16493342, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0x20" ] - }, { - "pc" : 13, - "op" : "RETURN", - "gas" : 16493339, - "gasCost" : 0, - "depth" : 2, - "stack" : [ "0x20", "0x0" ] - }, { - "pc" : 22, - "op" : "PUSH1", - "gas" : 16755138, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x1" ] - }, { - "pc" : 24, - "op" : "PUSH1", - "gas" : 16755135, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x1", "0x20" ] - }, { - "pc" : 26, - "op" : "RETURN", - "gas" : 16755132, - "gasCost" : 0, - "depth" : 1, - "stack" : [ "0x1", "0x20", "0x0" ] - } ] + "jsonrpc":"2.0", + "id":1, + "result":{ + "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", + "result":{ + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x40" + ] + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20" + ] + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20", + "0x0" + ] + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0" + ] + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0" + ] + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x0" + ] + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000" + ] + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000", + "0xffac99" + ] + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2, + "stack":[ + "0x0" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001", + "0x1" + ] + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002", + "0x0" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2, + "stack":[ + + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2, + "stack":[ + "0x20" + ] + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1, + "stack":[ + "0x1" + ] + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1, + "stack":[ + "0x1", + "0x20" + ] + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1, + "stack":[ + "0x1", + "0x20", + "0x0" + ] + } + ] + } } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStack.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStack.json index 43ad0da8ff2..9afa1afef62 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStack.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStack.json @@ -16,190 +16,249 @@ } ], "id" : 1 }, - "response": { - "jsonrpc": "2.0", - "id": 1, - "result": { - "gas" : 22070, - "failed" : false, - "returnValue" : "f000000000000000000000000000000000000000000000000000000000000002", - "structLogs" : [ { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16755910, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 2, - "op" : "PUSH1", - "gas" : 16755907, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 4, - "op" : "PUSH1", - "gas" : 16755904, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 6, - "op" : "CALLDATASIZE", - "gas" : 16755901, - "gasCost" : 2, - "depth" : 1 - }, { - "pc" : 7, - "op" : "SUB", - "gas" : 16755899, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 8, - "op" : "DUP1", - "gas" : 16755896, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16755893, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16755890, - "gasCost" : 3, - "depth" : 1 - }, { - "pc" : 13, - "op" : "CALLDATACOPY", - "gas" : 16755887, - "gasCost" : 9, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 14, - "op" : "PUSH1", - "gas" : 16755878, - "gasCost" : 3, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 16, - "op" : "CALLVALUE", - "gas" : 16755875, - "gasCost" : 2, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 17, - "op" : "PUSH1", - "gas" : 16755873, - "gasCost" : 3, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 19, - "op" : "CALLDATALOAD", - "gas" : 16755870, - "gasCost" : 3, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 20, - "op" : "GAS", - "gas" : 16755867, - "gasCost" : 2, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 21, - "op" : "CALLCODE", - "gas" : 16755865, - "gasCost" : 16494066, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16493366, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 2, - "op" : "CALLDATALOAD", - "gas" : 16493363, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 3, - "op" : "PUSH1", - "gas" : 16493360, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 5, - "op" : "ADD", - "gas" : 16493357, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 6, - "op" : "PUSH1", - "gas" : 16493354, - "gasCost" : 3, - "depth" : 2 - }, { - "pc" : 8, - "op" : "MSTORE", - "gas" : 16493351, - "gasCost" : 6, - "depth" : 2, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16493345, - "gasCost" : 3, - "depth" : 2, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16493342, - "gasCost" : 3, - "depth" : 2, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 13, - "op" : "RETURN", - "gas" : 16493339, - "gasCost" : 0, - "depth" : 2, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 22, - "op" : "PUSH1", - "gas" : 16755138, - "gasCost" : 3, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 24, - "op" : "PUSH1", - "gas" : 16755135, - "gasCost" : 3, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 26, - "op" : "RETURN", - "gas" : 16755132, - "gasCost" : 0, - "depth" : 1, - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - } ] + "response":{ + "jsonrpc":"2.0", + "id":1, + "result":{ + "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", + "result":{ + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1 + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1 + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1 + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1 + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1 + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1 + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1 + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1 + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2 + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2 + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2 + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2 + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2 + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + } + ] + } } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStorage.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStorage.json index 2c5bb7a5afe..d668e60b3df 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStorage.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStorage.json @@ -17,216 +17,380 @@ "id" : 1 }, "response": { - "jsonrpc": "2.0", - "id": 1, - "result": { - "gas" : 22070, - "failed" : false, - "returnValue" : "f000000000000000000000000000000000000000000000000000000000000002", - "structLogs" : [ { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16755910, - "gasCost" : 3, - "depth" : 1, - "stack" : [ ] - }, { - "pc" : 2, - "op" : "PUSH1", - "gas" : 16755907, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20" ] - }, { - "pc" : 4, - "op" : "PUSH1", - "gas" : 16755904, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0" ] - }, { - "pc" : 6, - "op" : "CALLDATASIZE", - "gas" : 16755901, - "gasCost" : 2, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20" ] - }, { - "pc" : 7, - "op" : "SUB", - "gas" : 16755899, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x40" ] - }, { - "pc" : 8, - "op" : "DUP1", - "gas" : 16755896, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20" ] - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16755893, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x20" ] - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16755890, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20" ] - }, { - "pc" : 13, - "op" : "CALLDATACOPY", - "gas" : 16755887, - "gasCost" : 9, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20", "0x0" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 14, - "op" : "PUSH1", - "gas" : 16755878, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 16, - "op" : "CALLVALUE", - "gas" : 16755875, - "gasCost" : 2, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 17, - "op" : "PUSH1", - "gas" : 16755873, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 19, - "op" : "CALLDATALOAD", - "gas" : 16755870, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x0" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 20, - "op" : "GAS", - "gas" : 16755867, - "gasCost" : 2, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 21, - "op" : "CALLCODE", - "gas" : 16755865, - "gasCost" : 16494066, - "depth" : 1, - "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000", "0xffac99" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 0, - "op" : "PUSH1", - "gas" : 16493366, - "gasCost" : 3, - "depth" : 2, - "stack" : [ ] - }, { - "pc" : 2, - "op" : "CALLDATALOAD", - "gas" : 16493363, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0x0" ] - }, { - "pc" : 3, - "op" : "PUSH1", - "gas" : 16493360, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] - }, { - "pc" : 5, - "op" : "ADD", - "gas" : 16493357, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001", "0x1" ] - }, { - "pc" : 6, - "op" : "PUSH1", - "gas" : 16493354, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 8, - "op" : "MSTORE", - "gas" : 16493351, - "gasCost" : 6, - "depth" : 2, - "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002", "0x0" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 9, - "op" : "PUSH1", - "gas" : 16493345, - "gasCost" : 3, - "depth" : 2, - "stack" : [ ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 11, - "op" : "PUSH1", - "gas" : 16493342, - "gasCost" : 3, - "depth" : 2, - "stack" : [ "0x20" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 13, - "op" : "RETURN", - "gas" : 16493339, - "gasCost" : 0, - "depth" : 2, - "stack" : [ "0x20", "0x0" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 22, - "op" : "PUSH1", - "gas" : 16755138, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x1" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 24, - "op" : "PUSH1", - "gas" : 16755135, - "gasCost" : 3, - "depth" : 1, - "stack" : [ "0x1", "0x20" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - }, { - "pc" : 26, - "op" : "RETURN", - "gas" : 16755132, - "gasCost" : 0, - "depth" : 1, - "stack" : [ "0x1", "0x20", "0x0" ], - "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] - } ] + "jsonrpc":"2.0", + "id":1, + "result":{ + "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", + "result":{ + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1, + "stack":[ + + ] + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x40" + ] + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20" + ] + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000", + "0xffac99" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2, + "stack":[ + + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2, + "stack":[ + "0x0" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001", + "0x1" + ] + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2, + "stack":[ + + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2, + "stack":[ + "0x20" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2, + "stack":[ + "0x20", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1, + "stack":[ + "0x1" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1, + "stack":[ + "0x1", + "0x20" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1, + "stack":[ + "0x1", + "0x20", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + } + ] + } } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_noGasPrice.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_noGasPrice.json index f7262f79e3c..c140ac5583c 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_noGasPrice.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_noGasPrice.json @@ -17,19 +17,24 @@ "id": 1 }, "response": { - "jsonrpc": "2.0", - "id": 1, - "result": { - "gas" : 21164, - "failed" : false, - "returnValue" : "", - "structLogs" : [ { - "pc" : 0, - "op" : "STOP", - "gas" : 17592186023252, - "gasCost" : 0, - "depth" : 1 - } ] + "jsonrpc":"2.0", + "id":1, + "result":{ + "txHash":"0x49f505ed122c398287e1558275ccfcaa2d22df98df5b55e6c70635e6aa3a6ecc", + "result":{ + "gas":21164, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"STOP", + "gas":17592186023252, + "gasCost":0, + "depth":1 + } + ] + } } }, "statusCode": 200 From 52aaf221e17d21455ef0ad6a1618f3896cb48450 Mon Sep 17 00:00:00 2001 From: Karim Taam Date: Thu, 30 Jan 2025 16:46:07 +0100 Subject: [PATCH 2/6] fix tests Signed-off-by: Karim Taam --- .../DebugTraceTransactionIntegrationTest.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java index 47802df69c8..5feb6709923 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java @@ -25,6 +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.results.DebugTraceTransactionDetails; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionResult; import org.hyperledger.besu.plugin.services.rpc.RpcResponseType; import org.hyperledger.besu.testutil.BlockTestUtil; @@ -60,22 +61,25 @@ public void setUp() { @Test public void debugTraceTransactionSuccessTest() { final Map map = Map.of("disableStorage", true); - final Object[] params = - new Object[] { - Hash.fromHexString("0xcef53f2311d7c80e9086d661e69ac11a5f3d081e28e02a9ba9b66749407ac310"), - map - }; + final Hash trxHash = + Hash.fromHexString("0xcef53f2311d7c80e9086d661e69ac11a5f3d081e28e02a9ba9b66749407ac310"); + final Object[] params = new Object[] {trxHash, map}; final JsonRpcRequestContext request = new JsonRpcRequestContext(new JsonRpcRequest("2.0", DEBUG_TRACE_TRANSACTION, params)); final JsonRpcResponse response = method.response(request); assertThat(response.getType()).isEqualTo(RpcResponseType.SUCCESS); - DebugTraceTransactionDetails debugTraceTransactionResult = - (DebugTraceTransactionDetails) ((JsonRpcSuccessResponse) response).getResult(); - assertThat(debugTraceTransactionResult.getGas()).isEqualTo(23705L); - assertThat(debugTraceTransactionResult.getReturnValue()).isEmpty(); - assertThat(debugTraceTransactionResult.failed()).isFalse(); - assertThat(debugTraceTransactionResult.getStructLogs()).hasSize(106); + DebugTraceTransactionResult debugTraceTransactionResult = + (DebugTraceTransactionResult) ((JsonRpcSuccessResponse) response).getResult(); + + ; + final DebugTraceTransactionDetails debugTraceTransactionDetails = + debugTraceTransactionResult.getResult(); + assertThat(debugTraceTransactionResult.getTxHash()).isEqualTo(trxHash.toHexString()); + assertThat(debugTraceTransactionDetails.getGas()).isEqualTo(23705L); + assertThat(debugTraceTransactionDetails.getReturnValue()).isEmpty(); + assertThat(debugTraceTransactionDetails.failed()).isFalse(); + assertThat(debugTraceTransactionDetails.getStructLogs()).hasSize(106); } @Test From 5eb91fa85c4d28dbcbc8af73dec45cc8a747b180 Mon Sep 17 00:00:00 2001 From: Karim Taam Date: Thu, 30 Jan 2025 17:11:12 +0100 Subject: [PATCH 3/6] remove useless comma Signed-off-by: Karim Taam --- .../jsonrpc/methods/DebugTraceTransactionIntegrationTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java index 5feb6709923..68ebf378eb6 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java @@ -72,7 +72,6 @@ public void debugTraceTransactionSuccessTest() { DebugTraceTransactionResult debugTraceTransactionResult = (DebugTraceTransactionResult) ((JsonRpcSuccessResponse) response).getResult(); - ; final DebugTraceTransactionDetails debugTraceTransactionDetails = debugTraceTransactionResult.getResult(); assertThat(debugTraceTransactionResult.getTxHash()).isEqualTo(trxHash.toHexString()); From c089e73456f7818f6f496a50428d7fd1d9ee385a Mon Sep 17 00:00:00 2001 From: Karim Taam Date: Fri, 31 Jan 2025 15:40:55 +0100 Subject: [PATCH 4/6] 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 From 450d103e03af0ba3566ec209d4831d8917f81fd4 Mon Sep 17 00:00:00 2001 From: Karim Taam Date: Fri, 31 Jan 2025 15:53:05 +0100 Subject: [PATCH 5/6] fix tests Signed-off-by: Karim Taam --- .../methods/DebugTraceTransactionIntegrationTest.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java index 68ebf378eb6..d0ef9d77370 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugTraceTransactionIntegrationTest.java @@ -25,7 +25,6 @@ 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.results.DebugTraceTransactionDetails; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionResult; import org.hyperledger.besu.plugin.services.rpc.RpcResponseType; import org.hyperledger.besu.testutil.BlockTestUtil; @@ -69,12 +68,8 @@ public void debugTraceTransactionSuccessTest() { final JsonRpcResponse response = method.response(request); assertThat(response.getType()).isEqualTo(RpcResponseType.SUCCESS); - DebugTraceTransactionResult debugTraceTransactionResult = - (DebugTraceTransactionResult) ((JsonRpcSuccessResponse) response).getResult(); - - final DebugTraceTransactionDetails debugTraceTransactionDetails = - debugTraceTransactionResult.getResult(); - assertThat(debugTraceTransactionResult.getTxHash()).isEqualTo(trxHash.toHexString()); + DebugTraceTransactionDetails debugTraceTransactionDetails = + (DebugTraceTransactionDetails) ((JsonRpcSuccessResponse) response).getResult(); assertThat(debugTraceTransactionDetails.getGas()).isEqualTo(23705L); assertThat(debugTraceTransactionDetails.getReturnValue()).isEmpty(); assertThat(debugTraceTransactionDetails.failed()).isFalse(); From 56025d4b97d6503776f4bf356571650f3d8f9875 Mon Sep 17 00:00:00 2001 From: Karim Taam Date: Tue, 4 Feb 2025 11:45:56 +0100 Subject: [PATCH 6/6] fix trace_all response Signed-off-by: Karim Taam --- .../internal/methods/DebugTraceCall.java | 4 +- .../debug/trace-call/debug_traceCall_all.json | 391 +++++----- .../trace-call/debug_traceCall_default.json | 649 ++++++++-------- .../debug_traceCall_disableMemory.json | 649 ++++++++-------- .../debug_traceCall_disableStack.json | 475 ++++++------ .../debug_traceCall_disableStorage.json | 733 +++++++++--------- .../debug_traceCall_noGasPrice.json | 27 +- 7 files changed, 1455 insertions(+), 1473 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceCall.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceCall.java index 4bfe4f18b47..2a9c6a724fa 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceCall.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceCall.java @@ -26,7 +26,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse; 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.debug.TraceOptions; import org.hyperledger.besu.ethereum.mainnet.ImmutableTransactionValidationParams; @@ -104,7 +104,7 @@ protected PreCloseStateHandler getSimulatorResultHandler( new TransactionTrace( result.transaction(), result.result(), tracer.getTraceFrames()); - return new DebugTraceTransactionResult(transactionTrace); + return new DebugTraceTransactionDetails(transactionTrace); }); } diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_all.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_all.json index 1f8329b0dfa..7b58cd2cfc4 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_all.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_all.json @@ -20,203 +20,200 @@ "jsonrpc":"2.0", "id":1, "result":{ - "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", - "result":{ - "gas":22070, - "failed":false, - "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", - "structLogs":[ - { - "pc":0, - "op":"PUSH1", - "gas":16755910, - "gasCost":3, - "depth":1 - }, - { - "pc":2, - "op":"PUSH1", - "gas":16755907, - "gasCost":3, - "depth":1 - }, - { - "pc":4, - "op":"PUSH1", - "gas":16755904, - "gasCost":3, - "depth":1 - }, - { - "pc":6, - "op":"CALLDATASIZE", - "gas":16755901, - "gasCost":2, - "depth":1 - }, - { - "pc":7, - "op":"SUB", - "gas":16755899, - "gasCost":3, - "depth":1 - }, - { - "pc":8, - "op":"DUP1", - "gas":16755896, - "gasCost":3, - "depth":1 - }, - { - "pc":9, - "op":"PUSH1", - "gas":16755893, - "gasCost":3, - "depth":1 - }, - { - "pc":11, - "op":"PUSH1", - "gas":16755890, - "gasCost":3, - "depth":1 - }, - { - "pc":13, - "op":"CALLDATACOPY", - "gas":16755887, - "gasCost":9, - "depth":1 - }, - { - "pc":14, - "op":"PUSH1", - "gas":16755878, - "gasCost":3, - "depth":1 - }, - { - "pc":16, - "op":"CALLVALUE", - "gas":16755875, - "gasCost":2, - "depth":1 - }, - { - "pc":17, - "op":"PUSH1", - "gas":16755873, - "gasCost":3, - "depth":1 - }, - { - "pc":19, - "op":"CALLDATALOAD", - "gas":16755870, - "gasCost":3, - "depth":1 - }, - { - "pc":20, - "op":"GAS", - "gas":16755867, - "gasCost":2, - "depth":1 - }, - { - "pc":21, - "op":"CALLCODE", - "gas":16755865, - "gasCost":16494066, - "depth":1 - }, - { - "pc":0, - "op":"PUSH1", - "gas":16493366, - "gasCost":3, - "depth":2 - }, - { - "pc":2, - "op":"CALLDATALOAD", - "gas":16493363, - "gasCost":3, - "depth":2 - }, - { - "pc":3, - "op":"PUSH1", - "gas":16493360, - "gasCost":3, - "depth":2 - }, - { - "pc":5, - "op":"ADD", - "gas":16493357, - "gasCost":3, - "depth":2 - }, - { - "pc":6, - "op":"PUSH1", - "gas":16493354, - "gasCost":3, - "depth":2 - }, - { - "pc":8, - "op":"MSTORE", - "gas":16493351, - "gasCost":6, - "depth":2 - }, - { - "pc":9, - "op":"PUSH1", - "gas":16493345, - "gasCost":3, - "depth":2 - }, - { - "pc":11, - "op":"PUSH1", - "gas":16493342, - "gasCost":3, - "depth":2 - }, - { - "pc":13, - "op":"RETURN", - "gas":16493339, - "gasCost":0, - "depth":2 - }, - { - "pc":22, - "op":"PUSH1", - "gas":16755138, - "gasCost":3, - "depth":1 - }, - { - "pc":24, - "op":"PUSH1", - "gas":16755135, - "gasCost":3, - "depth":1 - }, - { - "pc":26, - "op":"RETURN", - "gas":16755132, - "gasCost":0, - "depth":1 - } - ] - } + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1 + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1 + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1 + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1 + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1 + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1 + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1 + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1 + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1 + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1 + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1 + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1 + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1 + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1 + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1 + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2 + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2 + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2 + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2 + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2 + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2 + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2 + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2 + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2 + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1 + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1 + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1 + } + ] } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_default.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_default.json index 5dbca78cb5a..05743484d10 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_default.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_default.json @@ -17,335 +17,332 @@ "jsonrpc":"2.0", "id":1, "result":{ - "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", - "result":{ - "gas":22070, - "failed":false, - "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", - "structLogs":[ - { - "pc":0, - "op":"PUSH1", - "gas":16755910, - "gasCost":3, - "depth":1, - "stack":[ + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1, + "stack":[ - ] - }, - { - "pc":2, - "op":"PUSH1", - "gas":16755907, - "gasCost":3, - "depth":1, - "stack":[ - "0x20" - ] - }, - { - "pc":4, - "op":"PUSH1", - "gas":16755904, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0" - ] - }, - { - "pc":6, - "op":"CALLDATASIZE", - "gas":16755901, - "gasCost":2, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20" - ] - }, - { - "pc":7, - "op":"SUB", - "gas":16755899, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x40" - ] - }, - { - "pc":8, - "op":"DUP1", - "gas":16755896, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20" - ] - }, - { - "pc":9, - "op":"PUSH1", - "gas":16755893, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x20" - ] - }, - { - "pc":11, - "op":"PUSH1", - "gas":16755890, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x20", - "0x20" - ] - }, - { - "pc":13, - "op":"CALLDATACOPY", - "gas":16755887, - "gasCost":9, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x20", - "0x20", - "0x0" - ] - }, - { - "pc":14, - "op":"PUSH1", - "gas":16755878, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20" - ] - }, - { - "pc":16, - "op":"CALLVALUE", - "gas":16755875, - "gasCost":2, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0" - ] - }, - { - "pc":17, - "op":"PUSH1", - "gas":16755873, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0" - ] - }, - { - "pc":19, - "op":"CALLDATALOAD", - "gas":16755870, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0", - "0x0" - ] - }, - { - "pc":20, - "op":"GAS", - "gas":16755867, - "gasCost":2, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0", - "0x30000000000000000000000000000000000000" - ] - }, - { - "pc":21, - "op":"CALLCODE", - "gas":16755865, - "gasCost":16494066, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0", - "0x30000000000000000000000000000000000000", - "0xffac99" - ] - }, - { - "pc":0, - "op":"PUSH1", - "gas":16493366, - "gasCost":3, - "depth":2, - "stack":[ + ] + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x40" + ] + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20" + ] + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20", + "0x0" + ] + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0" + ] + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0" + ] + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x0" + ] + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000" + ] + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000", + "0xffac99" + ] + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2, + "stack":[ - ] - }, - { - "pc":2, - "op":"CALLDATALOAD", - "gas":16493363, - "gasCost":3, - "depth":2, - "stack":[ - "0x0" - ] - }, - { - "pc":3, - "op":"PUSH1", - "gas":16493360, - "gasCost":3, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":5, - "op":"ADD", - "gas":16493357, - "gasCost":3, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000001", - "0x1" - ] - }, - { - "pc":6, - "op":"PUSH1", - "gas":16493354, - "gasCost":3, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":8, - "op":"MSTORE", - "gas":16493351, - "gasCost":6, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000002", - "0x0" - ] - }, - { - "pc":9, - "op":"PUSH1", - "gas":16493345, - "gasCost":3, - "depth":2, - "stack":[ + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2, + "stack":[ + "0x0" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001", + "0x1" + ] + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002", + "0x0" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2, + "stack":[ - ] - }, - { - "pc":11, - "op":"PUSH1", - "gas":16493342, - "gasCost":3, - "depth":2, - "stack":[ - "0x20" - ] - }, - { - "pc":13, - "op":"RETURN", - "gas":16493339, - "gasCost":0, - "depth":2, - "stack":[ - "0x20", - "0x0" - ] - }, - { - "pc":22, - "op":"PUSH1", - "gas":16755138, - "gasCost":3, - "depth":1, - "stack":[ - "0x1" - ] - }, - { - "pc":24, - "op":"PUSH1", - "gas":16755135, - "gasCost":3, - "depth":1, - "stack":[ - "0x1", - "0x20" - ] - }, - { - "pc":26, - "op":"RETURN", - "gas":16755132, - "gasCost":0, - "depth":1, - "stack":[ - "0x1", - "0x20", - "0x0" - ] - } - ] - } + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2, + "stack":[ + "0x20" + ] + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1, + "stack":[ + "0x1" + ] + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1, + "stack":[ + "0x1", + "0x20" + ] + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1, + "stack":[ + "0x1", + "0x20", + "0x0" + ] + } + ] } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableMemory.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableMemory.json index af5c8089085..1909943944c 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableMemory.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableMemory.json @@ -20,335 +20,332 @@ "jsonrpc":"2.0", "id":1, "result":{ - "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", - "result":{ - "gas":22070, - "failed":false, - "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", - "structLogs":[ - { - "pc":0, - "op":"PUSH1", - "gas":16755910, - "gasCost":3, - "depth":1, - "stack":[ + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1, + "stack":[ - ] - }, - { - "pc":2, - "op":"PUSH1", - "gas":16755907, - "gasCost":3, - "depth":1, - "stack":[ - "0x20" - ] - }, - { - "pc":4, - "op":"PUSH1", - "gas":16755904, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0" - ] - }, - { - "pc":6, - "op":"CALLDATASIZE", - "gas":16755901, - "gasCost":2, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20" - ] - }, - { - "pc":7, - "op":"SUB", - "gas":16755899, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x40" - ] - }, - { - "pc":8, - "op":"DUP1", - "gas":16755896, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20" - ] - }, - { - "pc":9, - "op":"PUSH1", - "gas":16755893, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x20" - ] - }, - { - "pc":11, - "op":"PUSH1", - "gas":16755890, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x20", - "0x20" - ] - }, - { - "pc":13, - "op":"CALLDATACOPY", - "gas":16755887, - "gasCost":9, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x20", - "0x20", - "0x0" - ] - }, - { - "pc":14, - "op":"PUSH1", - "gas":16755878, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20" - ] - }, - { - "pc":16, - "op":"CALLVALUE", - "gas":16755875, - "gasCost":2, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0" - ] - }, - { - "pc":17, - "op":"PUSH1", - "gas":16755873, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0" - ] - }, - { - "pc":19, - "op":"CALLDATALOAD", - "gas":16755870, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0", - "0x0" - ] - }, - { - "pc":20, - "op":"GAS", - "gas":16755867, - "gasCost":2, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0", - "0x30000000000000000000000000000000000000" - ] - }, - { - "pc":21, - "op":"CALLCODE", - "gas":16755865, - "gasCost":16494066, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0", - "0x30000000000000000000000000000000000000", - "0xffac99" - ] - }, - { - "pc":0, - "op":"PUSH1", - "gas":16493366, - "gasCost":3, - "depth":2, - "stack":[ + ] + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x40" + ] + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20" + ] + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20", + "0x0" + ] + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0" + ] + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0" + ] + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x0" + ] + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000" + ] + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000", + "0xffac99" + ] + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2, + "stack":[ - ] - }, - { - "pc":2, - "op":"CALLDATALOAD", - "gas":16493363, - "gasCost":3, - "depth":2, - "stack":[ - "0x0" - ] - }, - { - "pc":3, - "op":"PUSH1", - "gas":16493360, - "gasCost":3, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":5, - "op":"ADD", - "gas":16493357, - "gasCost":3, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000001", - "0x1" - ] - }, - { - "pc":6, - "op":"PUSH1", - "gas":16493354, - "gasCost":3, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":8, - "op":"MSTORE", - "gas":16493351, - "gasCost":6, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000002", - "0x0" - ] - }, - { - "pc":9, - "op":"PUSH1", - "gas":16493345, - "gasCost":3, - "depth":2, - "stack":[ + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2, + "stack":[ + "0x0" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001", + "0x1" + ] + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002", + "0x0" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2, + "stack":[ - ] - }, - { - "pc":11, - "op":"PUSH1", - "gas":16493342, - "gasCost":3, - "depth":2, - "stack":[ - "0x20" - ] - }, - { - "pc":13, - "op":"RETURN", - "gas":16493339, - "gasCost":0, - "depth":2, - "stack":[ - "0x20", - "0x0" - ] - }, - { - "pc":22, - "op":"PUSH1", - "gas":16755138, - "gasCost":3, - "depth":1, - "stack":[ - "0x1" - ] - }, - { - "pc":24, - "op":"PUSH1", - "gas":16755135, - "gasCost":3, - "depth":1, - "stack":[ - "0x1", - "0x20" - ] - }, - { - "pc":26, - "op":"RETURN", - "gas":16755132, - "gasCost":0, - "depth":1, - "stack":[ - "0x1", - "0x20", - "0x0" - ] - } - ] - } + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2, + "stack":[ + "0x20" + ] + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1, + "stack":[ + "0x1" + ] + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1, + "stack":[ + "0x1", + "0x20" + ] + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1, + "stack":[ + "0x1", + "0x20", + "0x0" + ] + } + ] } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStack.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStack.json index 9afa1afef62..f502da04ebe 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStack.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStack.json @@ -20,245 +20,242 @@ "jsonrpc":"2.0", "id":1, "result":{ - "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", - "result":{ - "gas":22070, - "failed":false, - "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", - "structLogs":[ - { - "pc":0, - "op":"PUSH1", - "gas":16755910, - "gasCost":3, - "depth":1 - }, - { - "pc":2, - "op":"PUSH1", - "gas":16755907, - "gasCost":3, - "depth":1 - }, - { - "pc":4, - "op":"PUSH1", - "gas":16755904, - "gasCost":3, - "depth":1 - }, - { - "pc":6, - "op":"CALLDATASIZE", - "gas":16755901, - "gasCost":2, - "depth":1 - }, - { - "pc":7, - "op":"SUB", - "gas":16755899, - "gasCost":3, - "depth":1 - }, - { - "pc":8, - "op":"DUP1", - "gas":16755896, - "gasCost":3, - "depth":1 - }, - { - "pc":9, - "op":"PUSH1", - "gas":16755893, - "gasCost":3, - "depth":1 - }, - { - "pc":11, - "op":"PUSH1", - "gas":16755890, - "gasCost":3, - "depth":1 - }, - { - "pc":13, - "op":"CALLDATACOPY", - "gas":16755887, - "gasCost":9, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":14, - "op":"PUSH1", - "gas":16755878, - "gasCost":3, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":16, - "op":"CALLVALUE", - "gas":16755875, - "gasCost":2, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":17, - "op":"PUSH1", - "gas":16755873, - "gasCost":3, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":19, - "op":"CALLDATALOAD", - "gas":16755870, - "gasCost":3, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":20, - "op":"GAS", - "gas":16755867, - "gasCost":2, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":21, - "op":"CALLCODE", - "gas":16755865, - "gasCost":16494066, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":0, - "op":"PUSH1", - "gas":16493366, - "gasCost":3, - "depth":2 - }, - { - "pc":2, - "op":"CALLDATALOAD", - "gas":16493363, - "gasCost":3, - "depth":2 - }, - { - "pc":3, - "op":"PUSH1", - "gas":16493360, - "gasCost":3, - "depth":2 - }, - { - "pc":5, - "op":"ADD", - "gas":16493357, - "gasCost":3, - "depth":2 - }, - { - "pc":6, - "op":"PUSH1", - "gas":16493354, - "gasCost":3, - "depth":2 - }, - { - "pc":8, - "op":"MSTORE", - "gas":16493351, - "gasCost":6, - "depth":2, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":9, - "op":"PUSH1", - "gas":16493345, - "gasCost":3, - "depth":2, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":11, - "op":"PUSH1", - "gas":16493342, - "gasCost":3, - "depth":2, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":13, - "op":"RETURN", - "gas":16493339, - "gasCost":0, - "depth":2, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":22, - "op":"PUSH1", - "gas":16755138, - "gasCost":3, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":24, - "op":"PUSH1", - "gas":16755135, - "gasCost":3, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":26, - "op":"RETURN", - "gas":16755132, - "gasCost":0, - "depth":1, - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - } - ] - } + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1 + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1 + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1 + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1 + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1 + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1 + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1 + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1 + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2 + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2 + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2 + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2 + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2 + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1, + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + } + ] } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStorage.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStorage.json index d668e60b3df..e9401e6f985 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStorage.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStorage.json @@ -20,377 +20,374 @@ "jsonrpc":"2.0", "id":1, "result":{ - "txHash":"0x2d8f594c7a98a9cb3d3a21d551f68e916e7ecd767971b061f2994b9a7426fba8", - "result":{ - "gas":22070, - "failed":false, - "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", - "structLogs":[ - { - "pc":0, - "op":"PUSH1", - "gas":16755910, - "gasCost":3, - "depth":1, - "stack":[ + "gas":22070, + "failed":false, + "returnValue":"f000000000000000000000000000000000000000000000000000000000000002", + "structLogs":[ + { + "pc":0, + "op":"PUSH1", + "gas":16755910, + "gasCost":3, + "depth":1, + "stack":[ - ] - }, - { - "pc":2, - "op":"PUSH1", - "gas":16755907, - "gasCost":3, - "depth":1, - "stack":[ - "0x20" - ] - }, - { - "pc":4, - "op":"PUSH1", - "gas":16755904, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0" - ] - }, - { - "pc":6, - "op":"CALLDATASIZE", - "gas":16755901, - "gasCost":2, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20" - ] - }, - { - "pc":7, - "op":"SUB", - "gas":16755899, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x40" - ] - }, - { - "pc":8, - "op":"DUP1", - "gas":16755896, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20" - ] - }, - { - "pc":9, - "op":"PUSH1", - "gas":16755893, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x20" - ] - }, - { - "pc":11, - "op":"PUSH1", - "gas":16755890, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x20", - "0x20" - ] - }, - { - "pc":13, - "op":"CALLDATACOPY", - "gas":16755887, - "gasCost":9, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x20", - "0x20", - "0x0" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":14, - "op":"PUSH1", - "gas":16755878, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":16, - "op":"CALLVALUE", - "gas":16755875, - "gasCost":2, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":17, - "op":"PUSH1", - "gas":16755873, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":19, - "op":"CALLDATALOAD", - "gas":16755870, - "gasCost":3, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0", - "0x0" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":20, - "op":"GAS", - "gas":16755867, - "gasCost":2, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0", - "0x30000000000000000000000000000000000000" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":21, - "op":"CALLCODE", - "gas":16755865, - "gasCost":16494066, - "depth":1, - "stack":[ - "0x20", - "0x0", - "0x20", - "0x0", - "0x0", - "0x30000000000000000000000000000000000000", - "0xffac99" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":0, - "op":"PUSH1", - "gas":16493366, - "gasCost":3, - "depth":2, - "stack":[ + ] + }, + { + "pc":2, + "op":"PUSH1", + "gas":16755907, + "gasCost":3, + "depth":1, + "stack":[ + "0x20" + ] + }, + { + "pc":4, + "op":"PUSH1", + "gas":16755904, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0" + ] + }, + { + "pc":6, + "op":"CALLDATASIZE", + "gas":16755901, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":7, + "op":"SUB", + "gas":16755899, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x40" + ] + }, + { + "pc":8, + "op":"DUP1", + "gas":16755896, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16755893, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16755890, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20" + ] + }, + { + "pc":13, + "op":"CALLDATACOPY", + "gas":16755887, + "gasCost":9, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x20", + "0x20", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":14, + "op":"PUSH1", + "gas":16755878, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":16, + "op":"CALLVALUE", + "gas":16755875, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":17, + "op":"PUSH1", + "gas":16755873, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":19, + "op":"CALLDATALOAD", + "gas":16755870, + "gasCost":3, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":20, + "op":"GAS", + "gas":16755867, + "gasCost":2, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":21, + "op":"CALLCODE", + "gas":16755865, + "gasCost":16494066, + "depth":1, + "stack":[ + "0x20", + "0x0", + "0x20", + "0x0", + "0x0", + "0x30000000000000000000000000000000000000", + "0xffac99" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":0, + "op":"PUSH1", + "gas":16493366, + "gasCost":3, + "depth":2, + "stack":[ - ] - }, - { - "pc":2, - "op":"CALLDATALOAD", - "gas":16493363, - "gasCost":3, - "depth":2, - "stack":[ - "0x0" - ] - }, - { - "pc":3, - "op":"PUSH1", - "gas":16493360, - "gasCost":3, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000001" - ] - }, - { - "pc":5, - "op":"ADD", - "gas":16493357, - "gasCost":3, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000001", - "0x1" - ] - }, - { - "pc":6, - "op":"PUSH1", - "gas":16493354, - "gasCost":3, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":8, - "op":"MSTORE", - "gas":16493351, - "gasCost":6, - "depth":2, - "stack":[ - "0xf000000000000000000000000000000000000000000000000000000000000002", - "0x0" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":9, - "op":"PUSH1", - "gas":16493345, - "gasCost":3, - "depth":2, - "stack":[ + ] + }, + { + "pc":2, + "op":"CALLDATALOAD", + "gas":16493363, + "gasCost":3, + "depth":2, + "stack":[ + "0x0" + ] + }, + { + "pc":3, + "op":"PUSH1", + "gas":16493360, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001" + ] + }, + { + "pc":5, + "op":"ADD", + "gas":16493357, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000001", + "0x1" + ] + }, + { + "pc":6, + "op":"PUSH1", + "gas":16493354, + "gasCost":3, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":8, + "op":"MSTORE", + "gas":16493351, + "gasCost":6, + "depth":2, + "stack":[ + "0xf000000000000000000000000000000000000000000000000000000000000002", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":9, + "op":"PUSH1", + "gas":16493345, + "gasCost":3, + "depth":2, + "stack":[ - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":11, - "op":"PUSH1", - "gas":16493342, - "gasCost":3, - "depth":2, - "stack":[ - "0x20" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":13, - "op":"RETURN", - "gas":16493339, - "gasCost":0, - "depth":2, - "stack":[ - "0x20", - "0x0" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":22, - "op":"PUSH1", - "gas":16755138, - "gasCost":3, - "depth":1, - "stack":[ - "0x1" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":24, - "op":"PUSH1", - "gas":16755135, - "gasCost":3, - "depth":1, - "stack":[ - "0x1", - "0x20" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - }, - { - "pc":26, - "op":"RETURN", - "gas":16755132, - "gasCost":0, - "depth":1, - "stack":[ - "0x1", - "0x20", - "0x0" - ], - "memory":[ - "0xf000000000000000000000000000000000000000000000000000000000000002" - ] - } - ] - } + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":11, + "op":"PUSH1", + "gas":16493342, + "gasCost":3, + "depth":2, + "stack":[ + "0x20" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":13, + "op":"RETURN", + "gas":16493339, + "gasCost":0, + "depth":2, + "stack":[ + "0x20", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":22, + "op":"PUSH1", + "gas":16755138, + "gasCost":3, + "depth":1, + "stack":[ + "0x1" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":24, + "op":"PUSH1", + "gas":16755135, + "gasCost":3, + "depth":1, + "stack":[ + "0x1", + "0x20" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + }, + { + "pc":26, + "op":"RETURN", + "gas":16755132, + "gasCost":0, + "depth":1, + "stack":[ + "0x1", + "0x20", + "0x0" + ], + "memory":[ + "0xf000000000000000000000000000000000000000000000000000000000000002" + ] + } + ] } }, "statusCode": 200 diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_noGasPrice.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_noGasPrice.json index da333afe12a..059cd3bf9b4 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_noGasPrice.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_noGasPrice.json @@ -20,21 +20,18 @@ "jsonrpc":"2.0", "id":1, "result":{ - "txHash":"0x49f505ed122c398287e1558275ccfcaa2d22df98df5b55e6c70635e6aa3a6ecc", - "result":{ - "gas":21164, - "failed":false, - "returnValue":"", - "structLogs":[ - { - "pc":0, - "op":"STOP", - "gas":17592186023252, - "gasCost":0, - "depth":1 - } - ] - } + "gas":21164, + "failed":false, + "returnValue":"", + "structLogs":[ + { + "pc":0, + "op":"STOP", + "gas":17592186023252, + "gasCost":0, + "depth":1 + } + ] } }, "statusCode": 200