diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df8c4991f1..3d2e517ba37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 23.10.3 + +### Breaking Changes + +### Deprecations + +### Additions and Improvements +- Implement debug_traceCall [#5885](https://github.com/hyperledger/besu/pull/5885) + ## 23.10.2 ### Breaking Changes diff --git a/build.gradle b/build.gradle index 63397b210e8..364d969db22 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright ConsenSys AG. + * Copyright Hyperledger Besu contributors. * * 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 diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java index 746224f3a40..d719e5b48b5 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java @@ -44,6 +44,7 @@ public enum RpcMethod { DEBUG_STANDARD_TRACE_BLOCK_TO_FILE("debug_standardTraceBlockToFile"), DEBUG_STANDARD_TRACE_BAD_BLOCK_TO_FILE("debug_standardTraceBadBlockToFile"), DEBUG_TRACE_TRANSACTION("debug_traceTransaction"), + DEBUG_TRACE_CALL("debug_traceCall"), DEBUG_BATCH_RAW_TRANSACTION("debug_batchSendRawTransaction"), DEBUG_GET_BAD_BLOCKS("debug_getBadBlocks"), DEBUG_GET_RAW_HEADER("debug_getRawHeader"), diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceCall.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceCall.java new file mode 100644 index 00000000000..f9a41f353a3 --- /dev/null +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractTraceCall.java @@ -0,0 +1,84 @@ +/* + * Copyright Hyperledger 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.methods; + +import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType.BLOCK_NOT_FOUND; +import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType.INTERNAL_ERROR; + +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonCallParameter; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse; +import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; +import org.hyperledger.besu.ethereum.core.BlockHeader; +import org.hyperledger.besu.ethereum.debug.TraceOptions; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import org.hyperledger.besu.ethereum.transaction.PreCloseStateHandler; +import org.hyperledger.besu.ethereum.transaction.TransactionSimulator; +import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; + +import java.util.Optional; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class AbstractTraceCall extends AbstractTraceByBlock { + private static final Logger LOG = LoggerFactory.getLogger(AbstractTraceCall.class); + + public AbstractTraceCall( + final BlockchainQueries blockchainQueries, + final ProtocolSchedule protocolSchedule, + final TransactionSimulator transactionSimulator) { + super(blockchainQueries, protocolSchedule, transactionSimulator); + } + + @Override + protected Object resultByBlockNumber( + final JsonRpcRequestContext requestContext, final long blockNumber) { + final JsonCallParameter callParams = + JsonCallParameterUtil.validateAndGetCallParams(requestContext); + final TraceOptions traceOptions = getTraceOptions(requestContext); + final String blockNumberString = String.valueOf(blockNumber); + LOG.atTrace() + .setMessage("Received RPC rpcName={} callParams={} block={} traceTypes={}") + .addArgument(this::getName) + .addArgument(callParams) + .addArgument(blockNumberString) + .addArgument(traceOptions) + .log(); + + final Optional maybeBlockHeader = + blockchainQueriesSupplier.get().getBlockHeaderByNumber(blockNumber); + + if (maybeBlockHeader.isEmpty()) { + return new JsonRpcErrorResponse(requestContext.getRequest().getId(), BLOCK_NOT_FOUND); + } + + final DebugOperationTracer tracer = new DebugOperationTracer(traceOptions); + return transactionSimulator + .process( + callParams, + buildTransactionValidationParams(), + tracer, + getSimulatorResultHandler(requestContext, tracer), + maybeBlockHeader.get()) + .orElseGet( + () -> new JsonRpcErrorResponse(requestContext.getRequest().getId(), INTERNAL_ERROR)); + } + + protected abstract TraceOptions getTraceOptions(final JsonRpcRequestContext requestContext); + + protected abstract PreCloseStateHandler getSimulatorResultHandler( + final JsonRpcRequestContext requestContext, final DebugOperationTracer tracer); +} 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 new file mode 100644 index 00000000000..d133aa77524 --- /dev/null +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceCall.java @@ -0,0 +1,91 @@ +/* + * Copyright Hyperledger 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.methods; + +import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType.INTERNAL_ERROR; + +import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TransactionTraceParams; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; +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.results.DebugTraceTransactionResult; +import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; +import org.hyperledger.besu.ethereum.debug.TraceOptions; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import org.hyperledger.besu.ethereum.transaction.PreCloseStateHandler; +import org.hyperledger.besu.ethereum.transaction.TransactionSimulator; +import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; + +import java.util.Optional; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DebugTraceCall extends AbstractTraceCall { + private static final Logger LOG = LoggerFactory.getLogger(DebugTraceCall.class); + + public DebugTraceCall( + final BlockchainQueries blockchainQueries, + final ProtocolSchedule protocolSchedule, + final TransactionSimulator transactionSimulator) { + super(blockchainQueries, protocolSchedule, transactionSimulator); + } + + @Override + public String getName() { + return RpcMethod.DEBUG_TRACE_CALL.getMethodName(); + } + + @Override + protected TraceOptions getTraceOptions(final JsonRpcRequestContext requestContext) { + return requestContext + .getOptionalParameter(2, TransactionTraceParams.class) + .map(TransactionTraceParams::traceOptions) + .orElse(TraceOptions.DEFAULT); + } + + @Override + protected BlockParameter blockParameter(final JsonRpcRequestContext request) { + final Optional maybeBlockParameter = + request.getOptionalParameter(1, BlockParameter.class); + + return maybeBlockParameter.orElse(BlockParameter.LATEST); + } + + @Override + protected PreCloseStateHandler getSimulatorResultHandler( + final JsonRpcRequestContext requestContext, final DebugOperationTracer tracer) { + return (mutableWorldState, maybeSimulatorResult) -> + maybeSimulatorResult.map( + result -> { + if (result.isInvalid()) { + LOG.error("Invalid simulator result {}", result); + final JsonRpcError error = + new JsonRpcError( + INTERNAL_ERROR, result.getValidationResult().getErrorMessage()); + return new JsonRpcErrorResponse(requestContext.getRequest().getId(), error); + } + + final TransactionTrace transactionTrace = + new TransactionTrace( + result.getTransaction(), result.getResult(), tracer.getTraceFrames()); + + return new DebugTraceTransactionResult(transactionTrace); + }); + } +} diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCall.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCall.java index c6f7f24052f..724f3f780f9 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCall.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceCall.java @@ -14,29 +14,27 @@ */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; -import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType.BLOCK_NOT_FOUND; import static org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType.INTERNAL_ERROR; import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonCallParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.core.Block; -import org.hyperledger.besu.ethereum.core.BlockHeader; +import org.hyperledger.besu.ethereum.debug.TraceOptions; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import org.hyperledger.besu.ethereum.transaction.PreCloseStateHandler; import org.hyperledger.besu.ethereum.transaction.TransactionSimulator; import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; -import java.util.Optional; import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class TraceCall extends AbstractTraceByBlock implements JsonRpcMethod { +public class TraceCall extends AbstractTraceCall { private static final Logger LOG = LoggerFactory.getLogger(TraceCall.class); public TraceCall( @@ -52,56 +50,35 @@ public String getName() { } @Override - protected Object resultByBlockNumber( - final JsonRpcRequestContext requestContext, final long blockNumber) { - final JsonCallParameter callParams = - JsonCallParameterUtil.validateAndGetCallParams(requestContext); - final TraceTypeParameter traceTypeParameter = - requestContext.getRequiredParameter(1, TraceTypeParameter.class); - final String blockNumberString = String.valueOf(blockNumber); - LOG.atTrace() - .setMessage("Received RPC rpcName={} callParams={} block={} traceTypes={}") - .addArgument(this::getName) - .addArgument(callParams) - .addArgument(blockNumberString) - .addArgument(traceTypeParameter) - .log(); - - final Optional maybeBlockHeader = - blockchainQueriesSupplier.get().getBlockHeaderByNumber(blockNumber); - - if (maybeBlockHeader.isEmpty()) { - return new JsonRpcErrorResponse(requestContext.getRequest().getId(), BLOCK_NOT_FOUND); - } - - final Set traceTypes = traceTypeParameter.getTraceTypes(); + protected TraceOptions getTraceOptions(final JsonRpcRequestContext requestContext) { + return buildTraceOptions(getTraceTypes(requestContext)); + } - final DebugOperationTracer tracer = new DebugOperationTracer(buildTraceOptions(traceTypes)); - return transactionSimulator - .process( - callParams, - buildTransactionValidationParams(), - tracer, - (mutableWorldState, maybeSimulatorResult) -> - maybeSimulatorResult.map( - result -> { - if (result.isInvalid()) { - LOG.error(String.format("Invalid simulator result %s", result)); - return new JsonRpcErrorResponse( - requestContext.getRequest().getId(), INTERNAL_ERROR); - } + private Set getTraceTypes( + final JsonRpcRequestContext requestContext) { + return requestContext.getRequiredParameter(1, TraceTypeParameter.class).getTraceTypes(); + } - final TransactionTrace transactionTrace = - new TransactionTrace( - result.getTransaction(), result.getResult(), tracer.getTraceFrames()); + @Override + protected PreCloseStateHandler getSimulatorResultHandler( + final JsonRpcRequestContext requestContext, final DebugOperationTracer tracer) { + return (mutableWorldState, maybeSimulatorResult) -> + maybeSimulatorResult.map( + result -> { + if (result.isInvalid()) { + LOG.error("Invalid simulator result {}", result); + return new JsonRpcErrorResponse( + requestContext.getRequest().getId(), INTERNAL_ERROR); + } - final Block block = - blockchainQueriesSupplier.get().getBlockchain().getChainHeadBlock(); + final TransactionTrace transactionTrace = + new TransactionTrace( + result.getTransaction(), result.getResult(), tracer.getTraceFrames()); - return getTraceCallResult( - protocolSchedule, traceTypes, result, transactionTrace, block); - }), - maybeBlockHeader.get()) - .orElse(new JsonRpcErrorResponse(requestContext.getRequest().getId(), INTERNAL_ERROR)); + final Block block = + blockchainQueriesSupplier.get().getBlockchain().getChainHeadBlock(); + return getTraceCallResult( + protocolSchedule, getTraceTypes(requestContext), result, transactionTrace, block); + }); } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugJsonRpcMethods.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugJsonRpcMethods.java index b34af183693..b70e7720a0d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugJsonRpcMethods.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/DebugJsonRpcMethods.java @@ -34,6 +34,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.DebugTraceBlock; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.DebugTraceBlockByHash; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.DebugTraceBlockByNumber; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.DebugTraceCall; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.DebugTraceTransaction; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockReplay; @@ -45,6 +46,7 @@ import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions; +import org.hyperledger.besu.ethereum.transaction.TransactionSimulator; import org.hyperledger.besu.metrics.ObservableMetricsSystem; import java.nio.file.Path; @@ -113,6 +115,13 @@ protected Map create() { new DebugGetRawHeader(blockchainQueries), new DebugGetRawBlock(blockchainQueries), new DebugGetRawReceipts(blockchainQueries), - new DebugGetRawTransaction(blockchainQueries)); + new DebugGetRawTransaction(blockchainQueries), + new DebugTraceCall( + blockchainQueries, + protocolSchedule, + new TransactionSimulator( + blockchainQueries.getBlockchain(), + blockchainQueries.getWorldStateArchive(), + protocolSchedule))); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/DebugJsonRpcHttpBySpecTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/DebugJsonRpcHttpBySpecTest.java index 8757e00d3ec..0ee3388f4e9 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/DebugJsonRpcHttpBySpecTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/DebugJsonRpcHttpBySpecTest.java @@ -28,9 +28,9 @@ public void setup() throws Exception { } public static Object[][] specs() { - return findSpecFiles( - new String[] {"debug"}, - "storageRange", - "accountRange"); // storageRange and accountRange are not working with bonsai trie + return AbstractJsonRpcHttpBySpecTest.findSpecFiles( + new String[] { + "debug/account-at", "debug/batch-send-raw-transaction", "debug/trace-transaction" + }); // storageRange and accountRange are not working with bonsai trie } } 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 new file mode 100644 index 00000000000..acfbcbaf492 --- /dev/null +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/bonsai/DebugTraceJsonRpcHttpBySpecTest.java @@ -0,0 +1,41 @@ +/* + * Copyright contributors to Hyperledger 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.bonsai; + +import org.hyperledger.besu.ethereum.api.jsonrpc.AbstractJsonRpcHttpBySpecTest; +import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil; +import org.hyperledger.besu.ethereum.worldstate.DataStorageFormat; + +import org.junit.jupiter.api.BeforeEach; + +public class DebugTraceJsonRpcHttpBySpecTest extends AbstractJsonRpcHttpBySpecTest { + + @Override + @BeforeEach + public void setup() throws Exception { + setupBonsaiBlockchain(); + startService(); + } + + @Override + protected BlockchainSetupUtil getBlockchainSetupUtil(final DataStorageFormat storageFormat) { + return createBlockchainSetupUtil( + "trace/chain-data/genesis.json", "trace/chain-data/blocks.bin", storageFormat); + } + + public static Object[][] specs() { + return AbstractJsonRpcHttpBySpecTest.findSpecFiles(new String[] {"debug/trace-call"}); + } +} diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/forest/DebugJsonRpcHttpBySpecTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/forest/DebugJsonRpcHttpBySpecTest.java index f6908f88933..562b4c25724 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/forest/DebugJsonRpcHttpBySpecTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/forest/DebugJsonRpcHttpBySpecTest.java @@ -28,6 +28,13 @@ public void setup() throws Exception { } public static Object[][] specs() { - return findSpecFiles(new String[] {"debug"}); + return AbstractJsonRpcHttpBySpecTest.findSpecFiles( + new String[] { + "debug/account-at", + "debug/batch-send-raw-transaction", + "debug/trace-transaction", + "debug/account-range", + "debug/storage-range" + }); } } 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 new file mode 100644 index 00000000000..412a4958c3d --- /dev/null +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/forest/DebugTraceJsonRpcHttpBySpecTest.java @@ -0,0 +1,41 @@ +/* + * Copyright contributors to Hyperledger 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.forest; + +import org.hyperledger.besu.ethereum.api.jsonrpc.AbstractJsonRpcHttpBySpecTest; +import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil; +import org.hyperledger.besu.ethereum.worldstate.DataStorageFormat; + +import org.junit.jupiter.api.BeforeEach; + +public class DebugTraceJsonRpcHttpBySpecTest extends AbstractJsonRpcHttpBySpecTest { + + @Override + @BeforeEach + public void setup() throws Exception { + setupBlockchain(); + startService(); + } + + @Override + protected BlockchainSetupUtil getBlockchainSetupUtil(final DataStorageFormat storageFormat) { + return createBlockchainSetupUtil( + "trace/chain-data/genesis.json", "trace/chain-data/blocks.bin", storageFormat); + } + + public static Object[][] specs() { + return AbstractJsonRpcHttpBySpecTest.findSpecFiles(new String[] {"debug/trace-call"}); + } +} diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_accountAt.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/account-at/debug_accountAt.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_accountAt.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/account-at/debug_accountAt.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_accountRange_blockHash.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/account-range/debug_accountRange_blockHash.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_accountRange_blockHash.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/account-range/debug_accountRange_blockHash.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_accountRange_complete.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/account-range/debug_accountRange_complete.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_accountRange_complete.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/account-range/debug_accountRange_complete.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_accountRange_partial.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/account-range/debug_accountRange_partial.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_accountRange_partial.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/account-range/debug_accountRange_partial.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_multipleTxError.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_multipleTxError.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_multipleTxError.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_multipleTxError.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_multipleTxMixedStatuses.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_multipleTxMixedStatuses.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_multipleTxMixedStatuses.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_multipleTxMixedStatuses.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_multipleTxSuccess.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_multipleTxSuccess.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_multipleTxSuccess.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_multipleTxSuccess.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_singleTxError.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_singleTxError.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_singleTxError.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_singleTxError.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_singleTxErrorInvalidSignatureV.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_singleTxErrorInvalidSignatureV.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_singleTxErrorInvalidSignatureV.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_singleTxErrorInvalidSignatureV.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_singleTxSuccess.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_singleTxSuccess.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_batchSendRawTransaction_singleTxSuccess.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/batch-send-raw-transaction/debug_batchSendRawTransaction_singleTxSuccess.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_storageRangeAt_blockHash.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/storage-range/debug_storageRangeAt_blockHash.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_storageRangeAt_blockHash.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/storage-range/debug_storageRangeAt_blockHash.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_storageRangeAt_blockNumber.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/storage-range/debug_storageRangeAt_blockNumber.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_storageRangeAt_blockNumber.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/storage-range/debug_storageRangeAt_blockNumber.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_storageRangeAt_midBlock.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/storage-range/debug_storageRangeAt_midBlock.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_storageRangeAt_midBlock.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/storage-range/debug_storageRangeAt_midBlock.json 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 new file mode 100644 index 00000000000..cc6696ae142 --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_all.json @@ -0,0 +1,300 @@ +{ + "request" : { + "jsonrpc" : "2.0", + "method" : "debug_traceCall", + "params" : [ { + "from" : "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "to" : "0x0050000000000000000000000000000000000000", + "gas" : "0xfffff2", + "gasPrice" : "0xef", + "value" : "0x0", + "data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001", + "nonce" : "0x0" + }, "latest", + { + "disableMemory": true, "disableStack": true, "disableStorage": true + } ], + "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" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 2, + "op" : "PUSH1", + "gas" : 16755907, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 4, + "op" : "PUSH1", + "gas" : 16755904, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 6, + "op" : "CALLDATASIZE", + "gas" : 16755901, + "gasCost" : 2, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 7, + "op" : "SUB", + "gas" : 16755899, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 8, + "op" : "DUP1", + "gas" : 16755896, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16755893, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16755890, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 13, + "op" : "CALLDATACOPY", + "gas" : 16755887, + "gasCost" : 9, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 14, + "op" : "PUSH1", + "gas" : 16755878, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 16, + "op" : "CALLVALUE", + "gas" : 16755875, + "gasCost" : 2, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 17, + "op" : "PUSH1", + "gas" : 16755873, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 19, + "op" : "CALLDATALOAD", + "gas" : 16755870, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 20, + "op" : "GAS", + "gas" : 16755867, + "gasCost" : 2, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 21, + "op" : "CALLCODE", + "gas" : 16755865, + "gasCost" : 700, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 0, + "op" : "PUSH1", + "gas" : 16493366, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 2, + "op" : "CALLDATALOAD", + "gas" : 16493363, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 3, + "op" : "PUSH1", + "gas" : 16493360, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 5, + "op" : "ADD", + "gas" : 16493357, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 6, + "op" : "PUSH1", + "gas" : 16493354, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 8, + "op" : "MSTORE", + "gas" : 16493351, + "gasCost" : 6, + "depth" : 2, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16493345, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16493342, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 13, + "op" : "RETURN", + "gas" : 16493339, + "gasCost" : 0, + "depth" : 2, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 22, + "op" : "PUSH1", + "gas" : 16755138, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 24, + "op" : "PUSH1", + "gas" : 16755135, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + }, { + "pc" : 26, + "op" : "RETURN", + "gas" : 16755132, + "gasCost" : 0, + "depth" : 1, + "stack" : null, + "memory" : null, + "storage" : null, + "reason" : null + } ] + } + }, + "statusCode": 200 +} \ No newline at end of file diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_complete.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_complete.json new file mode 100644 index 00000000000..ef20e1ae4ce --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_complete.json @@ -0,0 +1,297 @@ +{ + "request" : { + "jsonrpc" : "2.0", + "method" : "debug_traceCall", + "params" : [ { + "from" : "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "to" : "0x0050000000000000000000000000000000000000", + "gas" : "0xfffff2", + "gasPrice" : "0xef", + "value" : "0x0", + "data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001", + "nonce" : "0x0" + }, "latest" ], + "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" : [ ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 2, + "op" : "PUSH1", + "gas" : 16755907, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 4, + "op" : "PUSH1", + "gas" : 16755904, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 6, + "op" : "CALLDATASIZE", + "gas" : 16755901, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 7, + "op" : "SUB", + "gas" : 16755899, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000040" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 8, + "op" : "DUP1", + "gas" : 16755896, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16755893, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16755890, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 13, + "op" : "CALLDATACOPY", + "gas" : 16755887, + "gasCost" : 9, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 14, + "op" : "PUSH1", + "gas" : 16755878, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 16, + "op" : "CALLVALUE", + "gas" : 16755875, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 17, + "op" : "PUSH1", + "gas" : 16755873, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 19, + "op" : "CALLDATALOAD", + "gas" : 16755870, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 20, + "op" : "GAS", + "gas" : 16755867, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 21, + "op" : "CALLCODE", + "gas" : 16755865, + "gasCost" : 700, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000ffac99" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 0, + "op" : "PUSH1", + "gas" : 16493366, + "gasCost" : 3, + "depth" : 2, + "stack" : [ ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 2, + "op" : "CALLDATALOAD", + "gas" : 16493363, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 3, + "op" : "PUSH1", + "gas" : 16493360, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 5, + "op" : "ADD", + "gas" : 16493357, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000001" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 6, + "op" : "PUSH1", + "gas" : 16493354, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 8, + "op" : "MSTORE", + "gas" : 16493351, + "gasCost" : 6, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16493345, + "gasCost" : 3, + "depth" : 2, + "stack" : [ ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16493342, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 13, + "op" : "RETURN", + "gas" : 16493339, + "gasCost" : 0, + "depth" : 2, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 22, + "op" : "PUSH1", + "gas" : 16755138, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 24, + "op" : "PUSH1", + "gas" : 16755135, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 26, + "op" : "RETURN", + "gas" : 16755132, + "gasCost" : 0, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + } ] + } + }, + "statusCode": 200 +} \ No newline at end of file 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 new file mode 100644 index 00000000000..5f1ab990f96 --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableMemory.json @@ -0,0 +1,300 @@ +{ + "request" : { + "jsonrpc" : "2.0", + "method" : "debug_traceCall", + "params" : [ { + "from" : "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "to" : "0x0050000000000000000000000000000000000000", + "gas" : "0xfffff2", + "gasPrice" : "0xef", + "value" : "0x0", + "data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001", + "nonce" : "0x0" + }, "latest", + { + "disableMemory":true + } ], + "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" : [ ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 2, + "op" : "PUSH1", + "gas" : 16755907, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 4, + "op" : "PUSH1", + "gas" : 16755904, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 6, + "op" : "CALLDATASIZE", + "gas" : 16755901, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 7, + "op" : "SUB", + "gas" : 16755899, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000040" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 8, + "op" : "DUP1", + "gas" : 16755896, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16755893, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16755890, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 13, + "op" : "CALLDATACOPY", + "gas" : 16755887, + "gasCost" : 9, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 14, + "op" : "PUSH1", + "gas" : 16755878, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 16, + "op" : "CALLVALUE", + "gas" : 16755875, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 17, + "op" : "PUSH1", + "gas" : 16755873, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 19, + "op" : "CALLDATALOAD", + "gas" : 16755870, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 20, + "op" : "GAS", + "gas" : 16755867, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 21, + "op" : "CALLCODE", + "gas" : 16755865, + "gasCost" : 700, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000ffac99" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 0, + "op" : "PUSH1", + "gas" : 16493366, + "gasCost" : 3, + "depth" : 2, + "stack" : [ ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 2, + "op" : "CALLDATALOAD", + "gas" : 16493363, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 3, + "op" : "PUSH1", + "gas" : 16493360, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 5, + "op" : "ADD", + "gas" : 16493357, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000001" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 6, + "op" : "PUSH1", + "gas" : 16493354, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 8, + "op" : "MSTORE", + "gas" : 16493351, + "gasCost" : 6, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16493345, + "gasCost" : 3, + "depth" : 2, + "stack" : [ ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16493342, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 13, + "op" : "RETURN", + "gas" : 16493339, + "gasCost" : 0, + "depth" : 2, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 22, + "op" : "PUSH1", + "gas" : 16755138, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 24, + "op" : "PUSH1", + "gas" : 16755135, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : null, + "storage" : { }, + "reason" : null + }, { + "pc" : 26, + "op" : "RETURN", + "gas" : 16755132, + "gasCost" : 0, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : null, + "storage" : { }, + "reason" : null + } ] + } + }, + "statusCode": 200 +} \ No newline at end of file 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 new file mode 100644 index 00000000000..38e3d77b250 --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStack.json @@ -0,0 +1,300 @@ +{ + "request" : { + "jsonrpc" : "2.0", + "method" : "debug_traceCall", + "params" : [ { + "from" : "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "to" : "0x0050000000000000000000000000000000000000", + "gas" : "0xfffff2", + "gasPrice" : "0xef", + "value" : "0x0", + "data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001", + "nonce" : "0x0" + }, "latest", + { + "disableStack": true + } ], + "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" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 2, + "op" : "PUSH1", + "gas" : 16755907, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 4, + "op" : "PUSH1", + "gas" : 16755904, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 6, + "op" : "CALLDATASIZE", + "gas" : 16755901, + "gasCost" : 2, + "depth" : 1, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 7, + "op" : "SUB", + "gas" : 16755899, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 8, + "op" : "DUP1", + "gas" : 16755896, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16755893, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16755890, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 13, + "op" : "CALLDATACOPY", + "gas" : 16755887, + "gasCost" : 9, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 14, + "op" : "PUSH1", + "gas" : 16755878, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 16, + "op" : "CALLVALUE", + "gas" : 16755875, + "gasCost" : 2, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 17, + "op" : "PUSH1", + "gas" : 16755873, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 19, + "op" : "CALLDATALOAD", + "gas" : 16755870, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 20, + "op" : "GAS", + "gas" : 16755867, + "gasCost" : 2, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 21, + "op" : "CALLCODE", + "gas" : 16755865, + "gasCost" : 700, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 0, + "op" : "PUSH1", + "gas" : 16493366, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 2, + "op" : "CALLDATALOAD", + "gas" : 16493363, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 3, + "op" : "PUSH1", + "gas" : 16493360, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 5, + "op" : "ADD", + "gas" : 16493357, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 6, + "op" : "PUSH1", + "gas" : 16493354, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : [ ], + "storage" : { }, + "reason" : null + }, { + "pc" : 8, + "op" : "MSTORE", + "gas" : 16493351, + "gasCost" : 6, + "depth" : 2, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16493345, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16493342, + "gasCost" : 3, + "depth" : 2, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 13, + "op" : "RETURN", + "gas" : 16493339, + "gasCost" : 0, + "depth" : 2, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 22, + "op" : "PUSH1", + "gas" : 16755138, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 24, + "op" : "PUSH1", + "gas" : 16755135, + "gasCost" : 3, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + }, { + "pc" : 26, + "op" : "RETURN", + "gas" : 16755132, + "gasCost" : 0, + "depth" : 1, + "stack" : null, + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : { }, + "reason" : null + } ] + } + }, + "statusCode": 200 +} \ No newline at end of file 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 new file mode 100644 index 00000000000..ea6bd930442 --- /dev/null +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-call/debug_traceCall_disableStorage.json @@ -0,0 +1,300 @@ +{ + "request" : { + "jsonrpc" : "2.0", + "method" : "debug_traceCall", + "params" : [ { + "from" : "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "to" : "0x0050000000000000000000000000000000000000", + "gas" : "0xfffff2", + "gasPrice" : "0xef", + "value" : "0x0", + "data" : "0x0000000000000000000000000030000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001", + "nonce" : "0x0" + }, "latest", + { + "disableStorage": true + } ], + "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" : [ ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 2, + "op" : "PUSH1", + "gas" : 16755907, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 4, + "op" : "PUSH1", + "gas" : 16755904, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 6, + "op" : "CALLDATASIZE", + "gas" : 16755901, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 7, + "op" : "SUB", + "gas" : 16755899, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000040" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 8, + "op" : "DUP1", + "gas" : 16755896, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16755893, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16755890, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 13, + "op" : "CALLDATACOPY", + "gas" : 16755887, + "gasCost" : 9, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : null, + "reason" : null + }, { + "pc" : 14, + "op" : "PUSH1", + "gas" : 16755878, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : null, + "reason" : null + }, { + "pc" : 16, + "op" : "CALLVALUE", + "gas" : 16755875, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : null, + "reason" : null + }, { + "pc" : 17, + "op" : "PUSH1", + "gas" : 16755873, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : null, + "reason" : null + }, { + "pc" : 19, + "op" : "CALLDATALOAD", + "gas" : 16755870, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : null, + "reason" : null + }, { + "pc" : 20, + "op" : "GAS", + "gas" : 16755867, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : null, + "reason" : null + }, { + "pc" : 21, + "op" : "CALLCODE", + "gas" : 16755865, + "gasCost" : 700, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000ffac99" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "storage" : null, + "reason" : null + }, { + "pc" : 0, + "op" : "PUSH1", + "gas" : 16493366, + "gasCost" : 3, + "depth" : 2, + "stack" : [ ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 2, + "op" : "CALLDATALOAD", + "gas" : 16493363, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 3, + "op" : "PUSH1", + "gas" : 16493360, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 5, + "op" : "ADD", + "gas" : 16493357, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000001" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 6, + "op" : "PUSH1", + "gas" : 16493354, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "memory" : [ ], + "storage" : null, + "reason" : null + }, { + "pc" : 8, + "op" : "MSTORE", + "gas" : 16493351, + "gasCost" : 6, + "depth" : 2, + "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : null, + "reason" : null + }, { + "pc" : 9, + "op" : "PUSH1", + "gas" : 16493345, + "gasCost" : 3, + "depth" : 2, + "stack" : [ ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : null, + "reason" : null + }, { + "pc" : 11, + "op" : "PUSH1", + "gas" : 16493342, + "gasCost" : 3, + "depth" : 2, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : null, + "reason" : null + }, { + "pc" : 13, + "op" : "RETURN", + "gas" : 16493339, + "gasCost" : 0, + "depth" : 2, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : null, + "reason" : null + }, { + "pc" : 22, + "op" : "PUSH1", + "gas" : 16755138, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : null, + "reason" : null + }, { + "pc" : 24, + "op" : "PUSH1", + "gas" : 16755135, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : null, + "reason" : null + }, { + "pc" : 26, + "op" : "RETURN", + "gas" : 16755132, + "gasCost" : 0, + "depth" : 1, + "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], + "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], + "storage" : null, + "reason" : null + } ] + } + }, + "statusCode": 200 +} \ No newline at end of file diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_traceTransaction_complete.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_complete.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_traceTransaction_complete.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_complete.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_traceTransaction_disableMemory.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableMemory.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_traceTransaction_disableMemory.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableMemory.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_traceTransaction_disableStack.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStack.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_traceTransaction_disableStack.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStack.json diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_traceTransaction_disableStorage.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStorage.json similarity index 100% rename from ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/debug_traceTransaction_disableStorage.json rename to ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStorage.json diff --git a/gradle.properties b/gradle.properties index e94b9a26b5d..df2f0da93de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=23.10.2-SNAPSHOT +version=23.10.3-SNAPSHOT org.gradle.welcome=never # Set exports/opens flags required by Google Java Format and ErrorProne plugins. (JEP-396) diff --git a/settings.gradle b/settings.gradle index 4d954498edd..3a1c245a7f6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,5 @@ /* - * Copyright ConsenSys AG. + * Copyright Hyperledger Besu contributors. * * 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