From cee113e30056a8ddeb93619c4cdd1a502f1f4c5f Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Thu, 2 Jan 2025 17:43:51 +0100 Subject: [PATCH 01/13] initial commit : - Change debug_traceBlockByNumber implementation by using a pipeline - Change the defaults to match Geth and Nethermind defaults - Improve general performance - Add unit tests Signed-off-by: Ameziane H. --- .../methods/DebugTraceBlockByNumber.java | 113 +++++++-- .../methods/DebugTraceTransactionStep.java | 31 +++ .../results/DebugTraceTransactionResult.java | 9 +- .../jsonrpc/internal/results/StructLog.java | 64 ++++-- .../jsonrpc/methods/DebugJsonRpcMethods.java | 2 +- .../methods/DebugTraceBlockByNumberTest.java | 180 +++++++-------- .../internal/results/StructLogTest.java | 214 ++++++++++++++++++ .../besu/ethereum/debug/TraceOptions.java | 2 +- .../ethereum/vm/DebugOperationTracer.java | 9 +- 9 files changed, 483 insertions(+), 141 deletions(-) create mode 100644 ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransactionStep.java create mode 100644 ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java index 99c96c99be9..8eccdea936d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java @@ -1,5 +1,5 @@ /* - * Copyright ConsenSys AG. + * 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 @@ -14,33 +14,56 @@ */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; -import org.hyperledger.besu.datatypes.Hash; +import static org.hyperledger.besu.services.pipeline.PipelineBuilder.createPipelineFrom; + 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.exception.InvalidJsonRpcParameters; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonRpcParameter.JsonRpcParameterException; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TransactionTraceParams; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTrace; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; 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.query.BlockchainQueries; +import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.debug.TraceOptions; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; +import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; +import org.hyperledger.besu.metrics.BesuMetricCategory; +import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; +import org.hyperledger.besu.plugin.services.metrics.Counter; +import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; +import org.hyperledger.besu.services.pipeline.Pipeline; +import java.util.Collection; import java.util.Optional; -import java.util.function.Supplier; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutionException; public class DebugTraceBlockByNumber extends AbstractBlockParameterMethod { - private final Supplier blockTracerSupplier; + protected final ProtocolSchedule protocolSchedule; + private final LabelledMetric outputCounter; public DebugTraceBlockByNumber( - final Supplier blockTracerSupplier, final BlockchainQueries blockchain) { - super(blockchain); - this.blockTracerSupplier = blockTracerSupplier; + final ProtocolSchedule protocolSchedule, + final BlockchainQueries blockchainQueries, + final ObservableMetricsSystem metricsSystem) { + super(blockchainQueries); + this.protocolSchedule = protocolSchedule; + this.outputCounter = + metricsSystem.createLabelledCounter( + BesuMetricCategory.BLOCKCHAIN, + "transactions_debugTraceblock_pipeline_processed_total", + "Number of transactions processed for each block", + "step", + "action"); } @Override @@ -61,7 +84,7 @@ protected BlockParameter blockParameter(final JsonRpcRequestContext request) { @Override protected Object resultByBlockNumber( final JsonRpcRequestContext request, final long blockNumber) { - final Optional blockHash = getBlockchainQueries().getBlockHashByNumber(blockNumber); + final TraceOptions traceOptions; try { traceOptions = @@ -75,22 +98,68 @@ protected Object resultByBlockNumber( RpcErrorType.INVALID_TRANSACTION_TRACE_PARAMS, e); } + Optional maybeBlock = + getBlockchainQueries().getBlockchain().getBlockByNumber(blockNumber); - return blockHash + return maybeBlock .flatMap( - hash -> + block -> Tracer.processTracing( blockchainQueriesSupplier.get(), - hash, - mutableWorldState -> - blockTracerSupplier - .get() - .trace( - mutableWorldState, - hash, - new DebugOperationTracer(traceOptions, true)) - .map(BlockTrace::getTransactionTraces) - .map(DebugTraceTransactionResult::of))) + Optional.of(block.getHeader()), + traceableState -> { + Collection tracesList = + new CopyOnWriteArrayList<>(); + final ProtocolSpec protocolSpec = + protocolSchedule.getByBlockHeader(block.getHeader()); + final MainnetTransactionProcessor transactionProcessor = + protocolSpec.getTransactionProcessor(); + final TraceBlock.ChainUpdater chainUpdater = + new TraceBlock.ChainUpdater(traceableState); + + TransactionSource transactionSource = new TransactionSource(block); + DebugOperationTracer debugOperationTracer = + new DebugOperationTracer(traceOptions, true); + ExecuteTransactionStep executeTransactionStep = + new ExecuteTransactionStep( + chainUpdater, + transactionProcessor, + getBlockchainQueries().getBlockchain(), + debugOperationTracer, + protocolSpec, + block); + DebugTraceTransactionStep debugTraceTransactionStep = + new DebugTraceTransactionStep(); + Pipeline traceBlockPipeline = + createPipelineFrom( + "getTransactions", + transactionSource, + 4, + outputCounter, + false, + "debug_trace_block_by_number") + .thenProcess("executeTransaction", executeTransactionStep) + .thenProcessAsyncOrdered( + "debugTraceTransactionStep", debugTraceTransactionStep, 4) + .andFinishWith("collect_results", tracesList::add); + + try { + if (getBlockchainQueries().getEthScheduler().isPresent()) { + getBlockchainQueries() + .getEthScheduler() + .get() + .startPipeline(traceBlockPipeline) + .get(); + } else { + EthScheduler ethScheduler = + new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); + ethScheduler.startPipeline(traceBlockPipeline).get(); + } + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + return Optional.of(tracesList); + })) .orElse(null); } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransactionStep.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransactionStep.java new file mode 100644 index 00000000000..62439f8234b --- /dev/null +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceTransactionStep.java @@ -0,0 +1,31 @@ +/* + * 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.internal.methods; + +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionResult; + +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + +public class DebugTraceTransactionStep + implements Function> { + + @Override + public CompletableFuture apply( + final TransactionTrace transactionTrace) { + return CompletableFuture.completedFuture(new DebugTraceTransactionResult(transactionTrace)); + } +} 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 03b5d96259b..acec389ab21 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 @@ -17,6 +17,7 @@ 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; @@ -35,10 +36,10 @@ public class DebugTraceTransactionResult { public DebugTraceTransactionResult(final TransactionTrace transactionTrace) { gas = transactionTrace.getGas(); returnValue = transactionTrace.getResult().getOutput().toString().substring(2); - structLogs = - transactionTrace.getTraceFrames().stream() - .map(DebugTraceTransactionResult::createStructLog) - .collect(Collectors.toList()); + structLogs = new ArrayList<>(transactionTrace.getTraceFrames().size()); + transactionTrace.getTraceFrames().parallelStream() + .map(DebugTraceTransactionResult::createStructLog) + .forEachOrdered(structLogs::add); failed = !transactionTrace.getResult().isSuccessful(); } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLog.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLog.java index 50ec093576d..af773fc6119 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLog.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLog.java @@ -22,14 +22,15 @@ import java.util.TreeMap; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.apache.tuweni.bytes.Bytes; -import org.apache.tuweni.bytes.Bytes32; import org.apache.tuweni.units.bigints.UInt256; @JsonPropertyOrder({"pc", "op", "gas", "gasCost", "depth", "stack", "memory", "storage"}) public class StructLog { + private static final String HEX_DIGITS = "0123456789abcdef"; private final int depth; private final long gas; private final long gasCost; @@ -39,7 +40,6 @@ public class StructLog { private final String[] stack; private final Object storage; private final String reason; - static final String bytes32ZeroString = Bytes32.ZERO.toUnprefixedHexString(); public StructLog(final TraceFrame traceFrame) { depth = traceFrame.getDepth() + 1; @@ -48,7 +48,9 @@ public StructLog(final TraceFrame traceFrame) { memory = traceFrame .getMemory() - .map(a -> Arrays.stream(a).map(Bytes::toUnprefixedHexString).toArray(String[]::new)) + .map( + a -> + Arrays.stream(a).map(bytes -> toCompactHex(bytes, true)).toArray(String[]::new)) .orElse(null); op = traceFrame.getOpcode(); pc = traceFrame.getPc(); @@ -57,28 +59,17 @@ public StructLog(final TraceFrame traceFrame) { .getStack() .map( a -> - Arrays.stream(a) - .map(Bytes::toUnprefixedHexString) - .map(this::stringLeftPadTo64) - .toArray(String[]::new)) + Arrays.stream(a).map(bytes -> toCompactHex(bytes, true)).toArray(String[]::new)) .orElse(null); storage = traceFrame.getStorage().map(StructLog::formatStorage).orElse(null); - reason = traceFrame.getRevertReason().map(Bytes::toShortHexString).orElse(null); - } - - private String stringLeftPadTo64(final String unPaddedHexString) { - StringBuilder sb = new StringBuilder(64); - sb.append(bytes32ZeroString, 0, 64 - unPaddedHexString.length()); - sb.append(unPaddedHexString); - return sb.toString(); + reason = traceFrame.getRevertReason().map(bytes -> toCompactHex(bytes, true)).orElse(null); } private static Map formatStorage(final Map storage) { final Map formattedStorage = new TreeMap<>(); storage.forEach( - (key, value) -> - formattedStorage.put(key.toUnprefixedHexString(), value.toUnprefixedHexString())); + (key, value) -> formattedStorage.put(toCompactHex(key, false), toCompactHex(value, false))); return formattedStorage; } @@ -98,6 +89,7 @@ public long gasCost() { } @JsonGetter("memory") + @JsonInclude(JsonInclude.Include.NON_NULL) public String[] memory() { return memory; } @@ -113,16 +105,19 @@ public int pc() { } @JsonGetter("stack") + @JsonInclude(JsonInclude.Include.NON_NULL) public String[] stack() { return stack; } @JsonGetter("storage") + @JsonInclude(JsonInclude.Include.NON_NULL) public Object storage() { return storage; } @JsonGetter("reason") + @JsonInclude(JsonInclude.Include.NON_NULL) public String reason() { return reason; } @@ -153,4 +148,39 @@ public int hashCode() { result = 31 * result + Arrays.hashCode(stack); return result; } + + public static String toCompactHex(final Bytes abytes, final boolean prefix) { + if (abytes.isEmpty()) { + if (prefix) return "0x0"; + else return "0"; + } + final char[] hexChars = HEX_DIGITS.toCharArray(); + byte[] bytes = abytes.toArrayUnsafe(); + final int size = bytes.length; + final StringBuilder result = new StringBuilder(prefix ? (size * 2) + 2 : size * 2); + + if (prefix) { + result.append("0x"); + } + + boolean leadingZero = true; + + for (int i = 0; i < size; i++) { + byte b = bytes[i]; + + int highNibble = (b >> 4) & 0xF; + if (!leadingZero || highNibble != 0) { + result.append(hexChars[highNibble]); + leadingZero = false; + } + + int lowNibble = b & 0xF; + if (!leadingZero || lowNibble != 0 || i == size - 1) { + result.append(hexChars[lowNibble]); + leadingZero = false; + } + } + + return result.toString(); + } } 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 9ca0bb6c1a4..8322b618094 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 @@ -106,7 +106,7 @@ protected Map create() { blockchainQueries), new DebugSetHead(blockchainQueries, protocolContext), new DebugReplayBlock(blockchainQueries, protocolContext, protocolSchedule), - new DebugTraceBlockByNumber(() -> new BlockTracer(blockReplay), blockchainQueries), + new DebugTraceBlockByNumber(protocolSchedule, blockchainQueries, metricsSystem), new DebugTraceBlockByHash(() -> new BlockTracer(blockReplay), () -> blockchainQueries), new DebugBatchSendRawTransaction(transactionPool), new DebugGetBadBlocks(protocolContext, blockResult), 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 99e599ec110..56ce7fc526c 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 @@ -14,131 +14,127 @@ */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; -import static java.util.Arrays.asList; -import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.doAnswer; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockStatic; import static org.mockito.Mockito.when; - -import org.hyperledger.besu.datatypes.Hash; -import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequest; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTrace; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; -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.query.BlockchainQueries; +import org.hyperledger.besu.ethereum.chain.Blockchain; +import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeader; -import org.hyperledger.besu.ethereum.core.MutableWorldState; -import org.hyperledger.besu.ethereum.debug.TraceFrame; -import org.hyperledger.besu.ethereum.processing.TransactionProcessingResult; - +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import java.util.Arrays; import java.util.Collection; +import java.util.List; import java.util.Optional; -import java.util.OptionalLong; import java.util.function.Function; - -import org.apache.tuweni.bytes.Bytes; +import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.mockito.Answers; +import org.mockito.Mock; + +import org.mockito.MockedStatic; +import org.mockito.MockitoAnnotations; public class DebugTraceBlockByNumberTest { - private final BlockchainQueries blockchainQueries = - mock(BlockchainQueries.class, Answers.RETURNS_DEEP_STUBS); + @Mock + private BlockchainQueries blockchainQueries; + + @Mock + private Blockchain blockchain; + + @Mock + private Block block; + + @Mock + private BlockHeader blockHeader; - private final Tracer.TraceableState worldState = mock(Tracer.TraceableState.class); - private final BlockTracer blockTracer = mock(BlockTracer.class, Answers.RETURNS_DEEP_STUBS); - private final DebugTraceBlockByNumber debugTraceBlockByNumber = - new DebugTraceBlockByNumber(() -> blockTracer, blockchainQueries); + @Mock + private ProtocolSchedule protocolSchedule; - private final Hash blockHash = - Hash.fromHexString("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); + @Mock + private EthScheduler ethScheduler; + + @Mock + private ObservableMetricsSystem metricsSystem; + + private DebugTraceBlockByNumber debugTraceBlockByNumber; + + @BeforeEach + public void setUp() { + MockitoAnnotations.openMocks(this); + when(blockchainQueries.getEthScheduler()).thenReturn(Optional.of(ethScheduler)); + debugTraceBlockByNumber = new DebugTraceBlockByNumber(protocolSchedule, blockchainQueries, metricsSystem); + } @Test public void nameShouldBeDebugTraceBlockByNumber() { assertThat(debugTraceBlockByNumber.getName()).isEqualTo("debug_traceBlockByNumber"); } + @SuppressWarnings("unchecked") @Test - public void shouldReturnCorrectResponse() { + public void shouldReturnCollectionOfTwoDebugTraceTransactionResults() { + final long blockNumber = 1L; final Object[] params = new Object[] {Long.toHexString(blockNumber)}; final JsonRpcRequestContext request = - new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlockByNumber", params)); - - final TraceFrame traceFrame = - new TraceFrame( - 12, - Optional.of("NONE"), - Integer.MAX_VALUE, - 45L, - OptionalLong.of(56L), - 0L, - 2, - Optional.empty(), - null, - Wei.ZERO, - Bytes.EMPTY, - Bytes.EMPTY, - Optional.empty(), - Optional.empty(), - Optional.empty(), - null, - Optional.empty(), - Optional.empty(), - Optional.empty(), - 0, - Optional.empty(), - false, - Optional.empty(), - Optional.empty()); - - final TransactionProcessingResult transaction1Result = mock(TransactionProcessingResult.class); - final TransactionProcessingResult transaction2Result = mock(TransactionProcessingResult.class); - - final TransactionTrace transaction1Trace = mock(TransactionTrace.class); - final TransactionTrace transaction2Trace = mock(TransactionTrace.class); - - final BlockTrace blockTrace = new BlockTrace(asList(transaction1Trace, transaction2Trace)); - - when(transaction1Trace.getTraceFrames()).thenReturn(singletonList(traceFrame)); - when(transaction2Trace.getTraceFrames()).thenReturn(singletonList(traceFrame)); - when(transaction1Trace.getResult()).thenReturn(transaction1Result); - when(transaction2Trace.getResult()).thenReturn(transaction2Result); - when(transaction1Result.getOutput()).thenReturn(Bytes.fromHexString("1234")); - when(transaction2Result.getOutput()).thenReturn(Bytes.fromHexString("1234")); - when(blockchainQueries.getBlockHashByNumber(blockNumber)).thenReturn(Optional.of(blockHash)); - when(blockchainQueries.getBlockHeaderByHash(any(Hash.class))) - .thenReturn(Optional.of(mock(BlockHeader.class, Answers.RETURNS_DEEP_STUBS))); - - doAnswer( - invocation -> - invocation - .>> - getArgument(1) - .apply(worldState)) - .when(blockchainQueries) - .getAndMapWorldState(any(), any()); - when(blockTracer.trace(any(Tracer.TraceableState.class), any(Hash.class), any())) - .thenReturn(Optional.of(blockTrace)); - - final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) debugTraceBlockByNumber.response(request); - final Collection result = getResult(response); - assertThat(result) - .usingFieldByFieldElementComparator() - .isEqualTo(DebugTraceTransactionResult.of(blockTrace.getTransactionTraces())); + new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlockByNumber", params)); + when(blockchainQueries.getBlockchain()).thenReturn(blockchain); + when(blockchain.getBlockByNumber(blockNumber)).thenReturn(Optional.of(block)); + when(block.getHeader()).thenReturn(blockHeader); + + + DebugTraceTransactionResult result1 = mock(DebugTraceTransactionResult.class); + DebugTraceTransactionResult result2 = mock(DebugTraceTransactionResult.class); + + List resultList = Arrays.asList(result1, result2); + + try (MockedStatic mockedTracer = mockStatic(Tracer.class)) { + mockedTracer.when(() -> Tracer.processTracing( + eq(blockchainQueries), + eq(Optional.of(blockHeader)), + any(Function.class))) + .thenReturn(Optional.of(resultList)); + + final JsonRpcSuccessResponse response = + (JsonRpcSuccessResponse) debugTraceBlockByNumber.response(request); + final Collection traceResult = getResult(response); + + assertThat(traceResult).isNotEmpty(); + assertThat(traceResult) + .isInstanceOf(Collection.class).hasSize(2); + assertThat(traceResult).containsExactly(result1, result2); // Check that the result contains both elements + } } @SuppressWarnings("unchecked") private Collection getResult(final JsonRpcSuccessResponse response) { return (Collection) response.getResult(); } -} + + @Test + public void shouldHandleInvalidParametersGracefully() { + // Simulate a JsonRpcRequestContext with invalid block number or trace options + final Object[] invalidParams = new Object[] {"invalid-block-number"}; + final JsonRpcRequestContext request = + new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlockByNumber", invalidParams)); + + // Expect an exception to be thrown when invalid parameters are given + assertThatThrownBy(() -> debugTraceBlockByNumber.response(request)) + .isInstanceOf(InvalidJsonRpcParameters.class) + .hasMessageContaining("Invalid block parameter"); + } + +} \ No newline at end of file diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java new file mode 100644 index 00000000000..9cb53792d05 --- /dev/null +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java @@ -0,0 +1,214 @@ +/* + * 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.internal.results; + + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.when; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.tuweni.units.bigints.UInt256; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.hyperledger.besu.ethereum.debug.TraceFrame; +import org.apache.tuweni.bytes.Bytes; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.Arrays; +import java.util.OptionalLong; + +public class StructLogTest { + + @Mock + private TraceFrame traceFrame; + + private StructLog structLog; + private ObjectMapper objectMapper; + + @BeforeEach + public void setUp() { + MockitoAnnotations.openMocks(this); + objectMapper = new ObjectMapper(); + } + + @Test + public void constructorShouldInitializeFields() throws Exception { + // Given + final String op = "PUSH1"; + final int depth = 0; + final long gas = 100L; + final OptionalLong gasCost = OptionalLong.of(10L); + final String[] memory = new String[] {"0x01", "0x02", "0x0003", "0x04", "0x00000005", "0x000000"}; + final String[] stack = new String[] {"0x00000000000000", "0x01", "0x000002", "0x03"}; + final Map storage = Map.of( + "0x01", "0x2233333", + "0x02", "0x4455667" + ); + final String reason = "0x0001"; + + // Mock TraceFrame behaviors + when(traceFrame.getDepth()).thenReturn(depth); + when(traceFrame.getGasRemaining()).thenReturn(gas); + when(traceFrame.getGasCost()).thenReturn(gasCost); + when(traceFrame.getMemory()).thenReturn(Optional.of(Arrays.stream(memory) + .map(Bytes::fromHexString) // Convert each string to Bytes + .toArray(Bytes[]::new))); + when(traceFrame.getOpcode()).thenReturn(op); + when(traceFrame.getPc()).thenReturn(1); + when(traceFrame.getStack()).thenReturn(Optional.of(Arrays.stream(stack) + .map(Bytes::fromHexString) // Convert each string to Bytes + .toArray(Bytes[]::new))); + Map storageMap = new HashMap<>(); + for (Map.Entry entry : storage.entrySet()) { + storageMap.put(UInt256.fromHexString(entry.getKey()), UInt256.fromHexString(entry.getValue())); + } + when(traceFrame.getStorage()).thenReturn(Optional.of(storageMap)); + when(traceFrame.getRevertReason()).thenReturn(Optional.of(Bytes.fromHexString(reason))); + + // When + structLog = new StructLog(traceFrame); + + // Then + assertThat(structLog.depth()).isEqualTo(depth+1); + assertThat(structLog.gas()).isEqualTo(gas); + assertThat(structLog.gasCost()).isEqualTo(gasCost.getAsLong()); + assertThat(structLog.memory()).isEqualTo(new String[] {"0x1", "0x2", "0x3", "0x4", "0x5", "0x0"}); + assertThat(structLog.op()).isEqualTo(op); + assertThat(structLog.pc()).isEqualTo(1); + assertThat(structLog.stack()).isEqualTo(new String[] {"0x0", "0x1", "0x2", "0x3"}); + assertThat(structLog.storage()).isEqualTo(Map.of( + "1", "2233333", + "2", "4455667" + )); + assertThat(structLog.reason()).isEqualTo("0x1"); + } + + @Test + public void shouldGenerateJsonCorrectly() throws Exception { + final String op = "PUSH1"; + final int depth = 0; + final long gas = 100L; + final OptionalLong gasCost = OptionalLong.of(10L); + final String[] memory = new String[] {"0x01", "0x02", "0x0023", "0x04", "0x000000e5", "0x000000"}; + final String[] stack = new String[] {"0x00000000000000", "0x01", "0x000002", "0x03"}; + final Map storage = Map.of( + "0x01", "0x2233333", + "0x02", "0x4455667" + ); + final String reason = "0x53756e696665642066756e6473"; + + // Mock TraceFrame behaviors + when(traceFrame.getDepth()).thenReturn(depth); + when(traceFrame.getGasRemaining()).thenReturn(gas); + when(traceFrame.getGasCost()).thenReturn(gasCost); + when(traceFrame.getMemory()).thenReturn(Optional.of(Arrays.stream(memory) + .map(Bytes::fromHexString) // Convert each string to Bytes + .toArray(Bytes[]::new))); + when(traceFrame.getOpcode()).thenReturn(op); + when(traceFrame.getPc()).thenReturn(1); + when(traceFrame.getStack()).thenReturn(Optional.of(Arrays.stream(stack) + .map(Bytes::fromHexString) // Convert each string to Bytes + .toArray(Bytes[]::new))); + Map storageMap = new HashMap<>(); + for (Map.Entry entry : storage.entrySet()) { + storageMap.put(UInt256.fromHexString(entry.getKey()), UInt256.fromHexString(entry.getValue())); + } + when(traceFrame.getStorage()).thenReturn(Optional.of(storageMap)); + when(traceFrame.getRevertReason()).thenReturn(Optional.of(Bytes.fromHexString(reason))); + + // When + structLog = new StructLog(traceFrame); + + // Use Jackson to serialize the StructLog object to a JSON string + String json = objectMapper.writeValueAsString(structLog); + + // Define the expected JSON output + String expectedJson = "{" + + "\"pc\":1," + + "\"op\":\"PUSH1\"," + + "\"gas\":100," + + "\"gasCost\":10," + + "\"depth\":1," + + "\"stack\":[\"0x0\",\"0x1\",\"0x2\",\"0x3\"]," + + "\"memory\":[\"0x1\",\"0x2\",\"0x23\",\"0x4\",\"0xe5\",\"0x0\"]," + + "\"storage\":{\"1\":\"2233333\",\"2\":\"4455667\"}," + + "\"reason\":\"0x53756e696665642066756e6473\"" + + "}"; + + // Then + assertThat(json).isEqualTo(expectedJson); // Verify the generated JSON matches the expected JSON + } + + @Test + public void testToCompactHexEmptyWithPrefix() { + Bytes emptyBytes = Bytes.EMPTY; + String result = StructLog.toCompactHex(emptyBytes, true); + assertEquals("0x0", result, "Expected '0x0' for an empty byte array with prefix"); + } + + @Test + public void testToCompactHexEmptyWithoutPrefix() { + Bytes emptyBytes = Bytes.EMPTY; + String result = StructLog.toCompactHex(emptyBytes, false); + assertEquals("0", result, "Expected '0' for an empty byte array without prefix"); + } + + @Test + public void testToCompactHexSingleByteWithPrefix() { + Bytes bytes = Bytes.fromHexString("0x01"); + String result = StructLog.toCompactHex(bytes, true); + assertEquals("0x1", result, "Expected '0x1' for the byte 0x01 with prefix"); + } + + @Test + public void testToCompactHexSingleByteWithoutPrefix() { + Bytes bytes = Bytes.fromHexString("0x01"); + String result = StructLog.toCompactHex(bytes, false); + assertEquals("1", result, "Expected '1' for the byte 0x01 without prefix"); + } + + @Test + public void testToCompactHexMultipleBytesWithPrefix() { + Bytes bytes = Bytes.fromHexString("0x010203"); + String result = StructLog.toCompactHex(bytes, true); + assertEquals("0x10203", result, "Expected '0x10203' for the byte array 0x010203 with prefix"); + } + + @Test + public void testToCompactHexMultipleBytesWithoutPrefix() { + Bytes bytes = Bytes.fromHexString("0x010203"); + String result = StructLog.toCompactHex(bytes, false); + assertEquals("10203", result, "Expected '10203' for the byte array 0x010203 without prefix"); + } + + @Test + public void testToCompactHexWithLeadingZeros() { + Bytes bytes = Bytes.fromHexString("0x0001"); + String result = StructLog.toCompactHex(bytes, true); + assertEquals("0x1", result, "Expected '0x1' for the byte array 0x0001 with prefix (leading zeros removed)"); + } + + @Test + public void testToCompactHexWithLargeData() { + Bytes bytes = Bytes.fromHexString("0x0102030405060708090a"); + String result = StructLog.toCompactHex(bytes, true); + assertEquals("0x102030405060708090a", result, "Expected correct hex output for large data"); + } +} \ No newline at end of file diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/debug/TraceOptions.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/debug/TraceOptions.java index 012c1b9e1c1..91aa09db00d 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/debug/TraceOptions.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/debug/TraceOptions.java @@ -20,7 +20,7 @@ public class TraceOptions { private final boolean traceMemory; private final boolean traceStack; - public static final TraceOptions DEFAULT = new TraceOptions(true, true, true); + public static final TraceOptions DEFAULT = new TraceOptions(true, false, true); public TraceOptions( final boolean traceStorage, final boolean traceMemory, final boolean traceStack) { diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/DebugOperationTracer.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/DebugOperationTracer.java index 485420df772..798dac47f7d 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/DebugOperationTracer.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/DebugOperationTracer.java @@ -218,9 +218,10 @@ private Optional> captureStorage(final MessageFrame frame) return Optional.empty(); } try { - final Map storageContents = - new TreeMap<>( - frame.getWorldUpdater().getAccount(frame.getRecipientAddress()).getUpdatedStorage()); + Map updatedStorage = + frame.getWorldUpdater().getAccount(frame.getRecipientAddress()).getUpdatedStorage(); + if (updatedStorage.isEmpty()) return Optional.empty(); + final Map storageContents = new TreeMap<>(updatedStorage); return Optional.of(storageContents); } catch (final ModificationNotAllowedException e) { @@ -229,7 +230,7 @@ private Optional> captureStorage(final MessageFrame frame) } private Optional captureMemory(final MessageFrame frame) { - if (!options.isMemoryEnabled()) { + if (!options.isMemoryEnabled() || frame.memoryWordSize() == 0) { return Optional.empty(); } final Bytes[] memoryContents = new Bytes[frame.memoryWordSize()]; From 66a9714eab2ef78e34913842b952895fa1ac2a06 Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Fri, 3 Jan 2025 10:46:03 +0100 Subject: [PATCH 02/13] Add pipeline implementation for debug_traceBlockByHash Signed-off-by: Ameziane H. --- .../methods/DebugTraceBlockByHash.java | 113 ++++- .../methods/DebugTraceBlockByNumber.java | 2 +- .../jsonrpc/methods/DebugJsonRpcMethods.java | 2 +- .../methods/DebugTraceBlockByHashTest.java | 142 +++---- .../methods/DebugTraceBlockByNumberTest.java | 67 ++- .../internal/results/StructLogTest.java | 385 +++++++++--------- 6 files changed, 391 insertions(+), 320 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java index d98e8abd8df..d276541f7a6 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java @@ -14,36 +14,62 @@ */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; +import static org.hyperledger.besu.services.pipeline.PipelineBuilder.createPipelineFrom; + import org.hyperledger.besu.datatypes.Hash; 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.exception.InvalidJsonRpcParameters; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonRpcParameter.JsonRpcParameterException; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TransactionTraceParams; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTrace; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; 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.query.BlockchainQueries; +import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.debug.TraceOptions; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; +import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; +import org.hyperledger.besu.metrics.BesuMetricCategory; +import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; +import org.hyperledger.besu.plugin.services.metrics.Counter; +import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; +import org.hyperledger.besu.services.pipeline.Pipeline; import java.util.Collection; +import java.util.Optional; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutionException; import java.util.function.Supplier; +import com.google.common.base.Suppliers; + public class DebugTraceBlockByHash implements JsonRpcMethod { - private final Supplier blockTracerSupplier; private final Supplier blockchainQueries; + private final ProtocolSchedule protocolSchedule; + private final LabelledMetric outputCounter; public DebugTraceBlockByHash( - final Supplier blockTracerSupplier, - final Supplier blockchainQueriesSupplier) { - this.blockTracerSupplier = blockTracerSupplier; - this.blockchainQueries = blockchainQueriesSupplier; + final ProtocolSchedule protocolSchedule, + final BlockchainQueries blockchainQueries, + final ObservableMetricsSystem metricsSystem) { + this.blockchainQueries = Suppliers.ofInstance(blockchainQueries); + this.protocolSchedule = protocolSchedule; + this.outputCounter = + metricsSystem.createLabelledCounter( + BesuMetricCategory.BLOCKCHAIN, + "transactions_debugTraceblock_pipeline_processed_total", + "Number of transactions processed for each block", + "step", + "action"); } @Override @@ -73,20 +99,69 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { RpcErrorType.INVALID_TRANSACTION_TRACE_PARAMS, e); } + Optional maybeBlock = blockchainQueries.get().getBlockchain().getBlockByHash(blockHash); final Collection results = - Tracer.processTracing( - blockchainQueries.get(), - blockHash, - mutableWorldState -> - blockTracerSupplier - .get() - .trace( - mutableWorldState, - blockHash, - new DebugOperationTracer(traceOptions, true)) - .map(BlockTrace::getTransactionTraces) - .map(DebugTraceTransactionResult::of)) + maybeBlock + .flatMap( + block -> + Tracer.processTracing( + blockchainQueries.get(), + blockHash, + traceableState -> { + Collection tracesList = + new CopyOnWriteArrayList<>(); + final ProtocolSpec protocolSpec = + protocolSchedule.getByBlockHeader(block.getHeader()); + final MainnetTransactionProcessor transactionProcessor = + protocolSpec.getTransactionProcessor(); + final TraceBlock.ChainUpdater chainUpdater = + new TraceBlock.ChainUpdater(traceableState); + + TransactionSource transactionSource = new TransactionSource(block); + DebugOperationTracer debugOperationTracer = + new DebugOperationTracer(traceOptions, true); + ExecuteTransactionStep executeTransactionStep = + new ExecuteTransactionStep( + chainUpdater, + transactionProcessor, + blockchainQueries.get().getBlockchain(), + debugOperationTracer, + protocolSpec, + block); + DebugTraceTransactionStep debugTraceTransactionStep = + new DebugTraceTransactionStep(); + Pipeline traceBlockPipeline = + createPipelineFrom( + "getTransactions", + transactionSource, + 4, + outputCounter, + false, + "debug_trace_block_by_number") + .thenProcess("executeTransaction", executeTransactionStep) + .thenProcessAsyncOrdered( + "debugTraceTransactionStep", debugTraceTransactionStep, 4) + .andFinishWith("collect_results", tracesList::add); + + try { + if (blockchainQueries.get().getEthScheduler().isPresent()) { + blockchainQueries + .get() + .getEthScheduler() + .get() + .startPipeline(traceBlockPipeline) + .get(); + } else { + EthScheduler ethScheduler = + new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); + ethScheduler.startPipeline(traceBlockPipeline).get(); + } + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + return Optional.of(tracesList); + })) .orElse(null); return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), results); } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java index 8eccdea936d..e597900d603 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java @@ -48,7 +48,7 @@ public class DebugTraceBlockByNumber extends AbstractBlockParameterMethod { - protected final ProtocolSchedule protocolSchedule; + private final ProtocolSchedule protocolSchedule; private final LabelledMetric outputCounter; public DebugTraceBlockByNumber( 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 8322b618094..07e03d52b24 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 @@ -107,7 +107,7 @@ protected Map create() { new DebugSetHead(blockchainQueries, protocolContext), new DebugReplayBlock(blockchainQueries, protocolContext, protocolSchedule), new DebugTraceBlockByNumber(protocolSchedule, blockchainQueries, metricsSystem), - new DebugTraceBlockByHash(() -> new BlockTracer(blockReplay), () -> blockchainQueries), + new DebugTraceBlockByHash(protocolSchedule, blockchainQueries, metricsSystem), new DebugBatchSendRawTransaction(transactionPool), new DebugGetBadBlocks(protocolContext, blockResult), new DebugStandardTraceBlockToFile( 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 75d7ae26a95..5e21316573a 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 @@ -15,65 +15,59 @@ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockStatic; import static org.mockito.Mockito.when; import org.hyperledger.besu.datatypes.Hash; -import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequest; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTrace; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; -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.query.BlockchainQueries; -import org.hyperledger.besu.ethereum.core.BlockHeader; -import org.hyperledger.besu.ethereum.core.MutableWorldState; -import org.hyperledger.besu.ethereum.debug.TraceFrame; -import org.hyperledger.besu.ethereum.processing.TransactionProcessingResult; +import org.hyperledger.besu.ethereum.chain.Blockchain; +import org.hyperledger.besu.ethereum.core.Block; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import org.hyperledger.besu.metrics.ObservableMetricsSystem; import java.util.Arrays; import java.util.Collection; +import java.util.List; import java.util.Optional; -import java.util.OptionalLong; import java.util.function.Function; -import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.mockito.Answers; +import org.mockito.Mock; +import org.mockito.MockedStatic; +import org.mockito.MockitoAnnotations; public class DebugTraceBlockByHashTest { + @Mock private ProtocolSchedule protocolSchedule; - private final BlockTracer blockTracer = mock(BlockTracer.class); + @Mock private BlockchainQueries blockchainQueries; - private final BlockchainQueries blockchainQueries = - mock(BlockchainQueries.class, Answers.RETURNS_DEEP_STUBS); - private final MutableWorldState mutableWorldState = mock(MutableWorldState.class); - private final BlockHeader blockHeader = mock(BlockHeader.class, Answers.RETURNS_DEEP_STUBS); - private final DebugTraceBlockByHash debugTraceBlockByHash = - new DebugTraceBlockByHash(() -> blockTracer, () -> blockchainQueries); + @Mock private ObservableMetricsSystem metricsSystem; + + @Mock private Blockchain blockchain; + + @Mock private Block block; + + private DebugTraceBlockByHash debugTraceBlockByHash; private final Hash blockHash = Hash.fromHexString("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); @BeforeEach public void setUp() { - doAnswer( - invocation -> - invocation - .>>getArgument( - 1) - .apply(mutableWorldState)) - .when(blockchainQueries) - .getAndMapWorldState(any(), any()); - when(blockchainQueries.getBlockHeaderByHash(any(Hash.class))) - .thenReturn(Optional.of(blockHeader)); + MockitoAnnotations.openMocks(this); + debugTraceBlockByHash = + new DebugTraceBlockByHash(protocolSchedule, blockchainQueries, metricsSystem); } @Test @@ -81,59 +75,51 @@ public void nameShouldBeDebugTraceBlockByHash() { assertThat(debugTraceBlockByHash.getName()).isEqualTo("debug_traceBlockByHash"); } + @SuppressWarnings("unchecked") @Test public void shouldReturnCorrectResponse() { final Object[] params = new Object[] {blockHash}; final JsonRpcRequestContext request = new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlockByHash", params)); - final TraceFrame traceFrame = - new TraceFrame( - 12, - Optional.of("NONE"), - Integer.MAX_VALUE, - 45L, - OptionalLong.of(56L), - 0L, - 2, - Optional.empty(), - null, - Wei.ZERO, - Bytes.EMPTY, - Bytes.EMPTY, - Optional.empty(), - Optional.empty(), - Optional.empty(), - null, - Optional.empty(), - Optional.empty(), - Optional.empty(), - 0, - Optional.empty(), - false, - Optional.empty(), - Optional.empty()); - - final TransactionProcessingResult transaction1Result = mock(TransactionProcessingResult.class); - final TransactionProcessingResult transaction2Result = mock(TransactionProcessingResult.class); - - final TransactionTrace transaction1Trace = mock(TransactionTrace.class); - final TransactionTrace transaction2Trace = mock(TransactionTrace.class); - - BlockTrace blockTrace = new BlockTrace(Arrays.asList(transaction1Trace, transaction2Trace)); - - when(transaction1Trace.getTraceFrames()).thenReturn(Arrays.asList(traceFrame)); - when(transaction2Trace.getTraceFrames()).thenReturn(Arrays.asList(traceFrame)); - when(transaction1Trace.getResult()).thenReturn(transaction1Result); - when(transaction2Trace.getResult()).thenReturn(transaction2Result); - when(transaction1Result.getOutput()).thenReturn(Bytes.fromHexString("1234")); - when(transaction2Result.getOutput()).thenReturn(Bytes.fromHexString("1234")); - when(blockTracer.trace(any(Tracer.TraceableState.class), eq(blockHash), any())) - .thenReturn(Optional.of(blockTrace)); - - final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) debugTraceBlockByHash.response(request); - final Collection result = (Collection) response.getResult(); - assertThat(result).hasSize(2); + when(blockchainQueries.getBlockchain()).thenReturn(blockchain); + when(blockchain.getBlockByHash(blockHash)).thenReturn(Optional.of(block)); + + DebugTraceTransactionResult result1 = mock(DebugTraceTransactionResult.class); + DebugTraceTransactionResult result2 = mock(DebugTraceTransactionResult.class); + + List resultList = Arrays.asList(result1, result2); + + try (MockedStatic mockedTracer = mockStatic(Tracer.class)) { + mockedTracer + .when( + () -> + Tracer.processTracing(eq(blockchainQueries), eq(blockHash), any(Function.class))) + .thenReturn(Optional.of(resultList)); + + final JsonRpcSuccessResponse response = + (JsonRpcSuccessResponse) debugTraceBlockByHash.response(request); + final Collection traceResult = getResult(response); + assertThat(traceResult).isNotEmpty(); + assertThat(traceResult).isInstanceOf(Collection.class).hasSize(2); + assertThat(traceResult).containsExactly(result1, result2); + } + } + + @SuppressWarnings("unchecked") + private Collection getResult(final JsonRpcSuccessResponse response) { + return (Collection) response.getResult(); + } + + @Test + public void shouldHandleInvalidParametersGracefully() { + final Object[] invalidParams = new Object[] {"aaaa"}; + final JsonRpcRequestContext request = + new JsonRpcRequestContext( + new JsonRpcRequest("2.0", "debug_traceBlockByHash", invalidParams)); + + assertThatThrownBy(() -> debugTraceBlockByHash.response(request)) + .isInstanceOf(InvalidJsonRpcParameters.class) + .hasMessageContaining("Invalid block hash parameter"); } } 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 56ce7fc526c..8df427fb3bc 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 @@ -21,6 +21,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mockStatic; import static org.mockito.Mockito.when; + import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequest; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters; @@ -31,51 +32,42 @@ import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeader; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import org.hyperledger.besu.metrics.ObservableMetricsSystem; + import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Optional; import java.util.function.Function; -import org.hyperledger.besu.metrics.ObservableMetricsSystem; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mock; - import org.mockito.MockedStatic; import org.mockito.MockitoAnnotations; public class DebugTraceBlockByNumberTest { - @Mock - private BlockchainQueries blockchainQueries; - - @Mock - private Blockchain blockchain; + @Mock private BlockchainQueries blockchainQueries; - @Mock - private Block block; + @Mock private Blockchain blockchain; - @Mock - private BlockHeader blockHeader; + @Mock private Block block; - @Mock - private ProtocolSchedule protocolSchedule; + @Mock private BlockHeader blockHeader; - @Mock - private EthScheduler ethScheduler; + @Mock private ProtocolSchedule protocolSchedule; - @Mock - private ObservableMetricsSystem metricsSystem; + @Mock private ObservableMetricsSystem metricsSystem; private DebugTraceBlockByNumber debugTraceBlockByNumber; @BeforeEach public void setUp() { MockitoAnnotations.openMocks(this); - when(blockchainQueries.getEthScheduler()).thenReturn(Optional.of(ethScheduler)); - debugTraceBlockByNumber = new DebugTraceBlockByNumber(protocolSchedule, blockchainQueries, metricsSystem); + debugTraceBlockByNumber = + new DebugTraceBlockByNumber(protocolSchedule, blockchainQueries, metricsSystem); } @Test @@ -85,37 +77,36 @@ public void nameShouldBeDebugTraceBlockByNumber() { @SuppressWarnings("unchecked") @Test - public void shouldReturnCollectionOfTwoDebugTraceTransactionResults() { + public void shouldReturnCorrectResponse() { final long blockNumber = 1L; final Object[] params = new Object[] {Long.toHexString(blockNumber)}; final JsonRpcRequestContext request = - new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlockByNumber", params)); + new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlockByNumber", params)); when(blockchainQueries.getBlockchain()).thenReturn(blockchain); when(blockchain.getBlockByNumber(blockNumber)).thenReturn(Optional.of(block)); when(block.getHeader()).thenReturn(blockHeader); - DebugTraceTransactionResult result1 = mock(DebugTraceTransactionResult.class); DebugTraceTransactionResult result2 = mock(DebugTraceTransactionResult.class); List resultList = Arrays.asList(result1, result2); try (MockedStatic mockedTracer = mockStatic(Tracer.class)) { - mockedTracer.when(() -> Tracer.processTracing( - eq(blockchainQueries), - eq(Optional.of(blockHeader)), - any(Function.class))) - .thenReturn(Optional.of(resultList)); + mockedTracer + .when( + () -> + Tracer.processTracing( + eq(blockchainQueries), eq(Optional.of(blockHeader)), any(Function.class))) + .thenReturn(Optional.of(resultList)); final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) debugTraceBlockByNumber.response(request); + (JsonRpcSuccessResponse) debugTraceBlockByNumber.response(request); final Collection traceResult = getResult(response); assertThat(traceResult).isNotEmpty(); - assertThat(traceResult) - .isInstanceOf(Collection.class).hasSize(2); - assertThat(traceResult).containsExactly(result1, result2); // Check that the result contains both elements + assertThat(traceResult).isInstanceOf(Collection.class).hasSize(2); + assertThat(traceResult).containsExactly(result1, result2); } } @@ -126,15 +117,13 @@ private Collection getResult(final JsonRpcSuccessRe @Test public void shouldHandleInvalidParametersGracefully() { - // Simulate a JsonRpcRequestContext with invalid block number or trace options final Object[] invalidParams = new Object[] {"invalid-block-number"}; final JsonRpcRequestContext request = - new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlockByNumber", invalidParams)); + new JsonRpcRequestContext( + new JsonRpcRequest("2.0", "debug_traceBlockByNumber", invalidParams)); - // Expect an exception to be thrown when invalid parameters are given assertThatThrownBy(() -> debugTraceBlockByNumber.response(request)) - .isInstanceOf(InvalidJsonRpcParameters.class) - .hasMessageContaining("Invalid block parameter"); + .isInstanceOf(InvalidJsonRpcParameters.class) + .hasMessageContaining("Invalid block parameter"); } - -} \ No newline at end of file +} diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java index 9cb53792d05..e383cb27750 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java @@ -14,201 +14,222 @@ */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.results; - import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.when; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.tuweni.units.bigints.UInt256; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; import org.hyperledger.besu.ethereum.debug.TraceFrame; -import org.apache.tuweni.bytes.Bytes; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Optional; -import java.util.Arrays; import java.util.OptionalLong; -public class StructLogTest { - - @Mock - private TraceFrame traceFrame; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.tuweni.bytes.Bytes; +import org.apache.tuweni.units.bigints.UInt256; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; - private StructLog structLog; - private ObjectMapper objectMapper; +public class StructLogTest { - @BeforeEach - public void setUp() { - MockitoAnnotations.openMocks(this); - objectMapper = new ObjectMapper(); + @Mock private TraceFrame traceFrame; + + private StructLog structLog; + private ObjectMapper objectMapper; + + @BeforeEach + public void setUp() { + MockitoAnnotations.openMocks(this); + objectMapper = new ObjectMapper(); + } + + @Test + public void constructorShouldInitializeFields() throws Exception { + // Given + final String op = "PUSH1"; + final int depth = 0; + final long gas = 100L; + final OptionalLong gasCost = OptionalLong.of(10L); + final String[] memory = + new String[] {"0x01", "0x02", "0x0003", "0x04", "0x00000005", "0x000000"}; + final String[] stack = new String[] {"0x00000000000000", "0x01", "0x000002", "0x03"}; + final Map storage = + Map.of( + "0x01", "0x2233333", + "0x02", "0x4455667"); + final String reason = "0x0001"; + + // Mock TraceFrame behaviors + when(traceFrame.getDepth()).thenReturn(depth); + when(traceFrame.getGasRemaining()).thenReturn(gas); + when(traceFrame.getGasCost()).thenReturn(gasCost); + when(traceFrame.getMemory()) + .thenReturn( + Optional.of( + Arrays.stream(memory) + .map(Bytes::fromHexString) // Convert each string to Bytes + .toArray(Bytes[]::new))); + when(traceFrame.getOpcode()).thenReturn(op); + when(traceFrame.getPc()).thenReturn(1); + when(traceFrame.getStack()) + .thenReturn( + Optional.of( + Arrays.stream(stack) + .map(Bytes::fromHexString) // Convert each string to Bytes + .toArray(Bytes[]::new))); + Map storageMap = new HashMap<>(); + for (Map.Entry entry : storage.entrySet()) { + storageMap.put( + UInt256.fromHexString(entry.getKey()), UInt256.fromHexString(entry.getValue())); } - - @Test - public void constructorShouldInitializeFields() throws Exception { - // Given - final String op = "PUSH1"; - final int depth = 0; - final long gas = 100L; - final OptionalLong gasCost = OptionalLong.of(10L); - final String[] memory = new String[] {"0x01", "0x02", "0x0003", "0x04", "0x00000005", "0x000000"}; - final String[] stack = new String[] {"0x00000000000000", "0x01", "0x000002", "0x03"}; - final Map storage = Map.of( - "0x01", "0x2233333", - "0x02", "0x4455667" - ); - final String reason = "0x0001"; - - // Mock TraceFrame behaviors - when(traceFrame.getDepth()).thenReturn(depth); - when(traceFrame.getGasRemaining()).thenReturn(gas); - when(traceFrame.getGasCost()).thenReturn(gasCost); - when(traceFrame.getMemory()).thenReturn(Optional.of(Arrays.stream(memory) - .map(Bytes::fromHexString) // Convert each string to Bytes - .toArray(Bytes[]::new))); - when(traceFrame.getOpcode()).thenReturn(op); - when(traceFrame.getPc()).thenReturn(1); - when(traceFrame.getStack()).thenReturn(Optional.of(Arrays.stream(stack) - .map(Bytes::fromHexString) // Convert each string to Bytes - .toArray(Bytes[]::new))); - Map storageMap = new HashMap<>(); - for (Map.Entry entry : storage.entrySet()) { - storageMap.put(UInt256.fromHexString(entry.getKey()), UInt256.fromHexString(entry.getValue())); - } - when(traceFrame.getStorage()).thenReturn(Optional.of(storageMap)); - when(traceFrame.getRevertReason()).thenReturn(Optional.of(Bytes.fromHexString(reason))); - - // When - structLog = new StructLog(traceFrame); - - // Then - assertThat(structLog.depth()).isEqualTo(depth+1); - assertThat(structLog.gas()).isEqualTo(gas); - assertThat(structLog.gasCost()).isEqualTo(gasCost.getAsLong()); - assertThat(structLog.memory()).isEqualTo(new String[] {"0x1", "0x2", "0x3", "0x4", "0x5", "0x0"}); - assertThat(structLog.op()).isEqualTo(op); - assertThat(structLog.pc()).isEqualTo(1); - assertThat(structLog.stack()).isEqualTo(new String[] {"0x0", "0x1", "0x2", "0x3"}); - assertThat(structLog.storage()).isEqualTo(Map.of( + when(traceFrame.getStorage()).thenReturn(Optional.of(storageMap)); + when(traceFrame.getRevertReason()).thenReturn(Optional.of(Bytes.fromHexString(reason))); + + // When + structLog = new StructLog(traceFrame); + + // Then + assertThat(structLog.depth()).isEqualTo(depth + 1); + assertThat(structLog.gas()).isEqualTo(gas); + assertThat(structLog.gasCost()).isEqualTo(gasCost.getAsLong()); + assertThat(structLog.memory()) + .isEqualTo(new String[] {"0x1", "0x2", "0x3", "0x4", "0x5", "0x0"}); + assertThat(structLog.op()).isEqualTo(op); + assertThat(structLog.pc()).isEqualTo(1); + assertThat(structLog.stack()).isEqualTo(new String[] {"0x0", "0x1", "0x2", "0x3"}); + assertThat(structLog.storage()) + .isEqualTo( + Map.of( "1", "2233333", - "2", "4455667" - )); - assertThat(structLog.reason()).isEqualTo("0x1"); - } - - @Test - public void shouldGenerateJsonCorrectly() throws Exception { - final String op = "PUSH1"; - final int depth = 0; - final long gas = 100L; - final OptionalLong gasCost = OptionalLong.of(10L); - final String[] memory = new String[] {"0x01", "0x02", "0x0023", "0x04", "0x000000e5", "0x000000"}; - final String[] stack = new String[] {"0x00000000000000", "0x01", "0x000002", "0x03"}; - final Map storage = Map.of( - "0x01", "0x2233333", - "0x02", "0x4455667" - ); - final String reason = "0x53756e696665642066756e6473"; - - // Mock TraceFrame behaviors - when(traceFrame.getDepth()).thenReturn(depth); - when(traceFrame.getGasRemaining()).thenReturn(gas); - when(traceFrame.getGasCost()).thenReturn(gasCost); - when(traceFrame.getMemory()).thenReturn(Optional.of(Arrays.stream(memory) - .map(Bytes::fromHexString) // Convert each string to Bytes - .toArray(Bytes[]::new))); - when(traceFrame.getOpcode()).thenReturn(op); - when(traceFrame.getPc()).thenReturn(1); - when(traceFrame.getStack()).thenReturn(Optional.of(Arrays.stream(stack) - .map(Bytes::fromHexString) // Convert each string to Bytes - .toArray(Bytes[]::new))); - Map storageMap = new HashMap<>(); - for (Map.Entry entry : storage.entrySet()) { - storageMap.put(UInt256.fromHexString(entry.getKey()), UInt256.fromHexString(entry.getValue())); - } - when(traceFrame.getStorage()).thenReturn(Optional.of(storageMap)); - when(traceFrame.getRevertReason()).thenReturn(Optional.of(Bytes.fromHexString(reason))); - - // When - structLog = new StructLog(traceFrame); - - // Use Jackson to serialize the StructLog object to a JSON string - String json = objectMapper.writeValueAsString(structLog); - - // Define the expected JSON output - String expectedJson = "{" - + "\"pc\":1," - + "\"op\":\"PUSH1\"," - + "\"gas\":100," - + "\"gasCost\":10," - + "\"depth\":1," - + "\"stack\":[\"0x0\",\"0x1\",\"0x2\",\"0x3\"]," - + "\"memory\":[\"0x1\",\"0x2\",\"0x23\",\"0x4\",\"0xe5\",\"0x0\"]," - + "\"storage\":{\"1\":\"2233333\",\"2\":\"4455667\"}," - + "\"reason\":\"0x53756e696665642066756e6473\"" - + "}"; - - // Then - assertThat(json).isEqualTo(expectedJson); // Verify the generated JSON matches the expected JSON - } - - @Test - public void testToCompactHexEmptyWithPrefix() { - Bytes emptyBytes = Bytes.EMPTY; - String result = StructLog.toCompactHex(emptyBytes, true); - assertEquals("0x0", result, "Expected '0x0' for an empty byte array with prefix"); - } - - @Test - public void testToCompactHexEmptyWithoutPrefix() { - Bytes emptyBytes = Bytes.EMPTY; - String result = StructLog.toCompactHex(emptyBytes, false); - assertEquals("0", result, "Expected '0' for an empty byte array without prefix"); - } - - @Test - public void testToCompactHexSingleByteWithPrefix() { - Bytes bytes = Bytes.fromHexString("0x01"); - String result = StructLog.toCompactHex(bytes, true); - assertEquals("0x1", result, "Expected '0x1' for the byte 0x01 with prefix"); - } - - @Test - public void testToCompactHexSingleByteWithoutPrefix() { - Bytes bytes = Bytes.fromHexString("0x01"); - String result = StructLog.toCompactHex(bytes, false); - assertEquals("1", result, "Expected '1' for the byte 0x01 without prefix"); - } - - @Test - public void testToCompactHexMultipleBytesWithPrefix() { - Bytes bytes = Bytes.fromHexString("0x010203"); - String result = StructLog.toCompactHex(bytes, true); - assertEquals("0x10203", result, "Expected '0x10203' for the byte array 0x010203 with prefix"); - } - - @Test - public void testToCompactHexMultipleBytesWithoutPrefix() { - Bytes bytes = Bytes.fromHexString("0x010203"); - String result = StructLog.toCompactHex(bytes, false); - assertEquals("10203", result, "Expected '10203' for the byte array 0x010203 without prefix"); - } - - @Test - public void testToCompactHexWithLeadingZeros() { - Bytes bytes = Bytes.fromHexString("0x0001"); - String result = StructLog.toCompactHex(bytes, true); - assertEquals("0x1", result, "Expected '0x1' for the byte array 0x0001 with prefix (leading zeros removed)"); - } - - @Test - public void testToCompactHexWithLargeData() { - Bytes bytes = Bytes.fromHexString("0x0102030405060708090a"); - String result = StructLog.toCompactHex(bytes, true); - assertEquals("0x102030405060708090a", result, "Expected correct hex output for large data"); + "2", "4455667")); + assertThat(structLog.reason()).isEqualTo("0x1"); + } + + @Test + public void shouldGenerateJsonCorrectly() throws Exception { + final String op = "PUSH1"; + final int depth = 0; + final long gas = 100L; + final OptionalLong gasCost = OptionalLong.of(10L); + final String[] memory = + new String[] {"0x01", "0x02", "0x0023", "0x04", "0x000000e5", "0x000000"}; + final String[] stack = new String[] {"0x00000000000000", "0x01", "0x000002", "0x03"}; + final Map storage = + Map.of( + "0x01", "0x2233333", + "0x02", "0x4455667"); + final String reason = "0x53756e696665642066756e6473"; + + // Mock TraceFrame behaviors + when(traceFrame.getDepth()).thenReturn(depth); + when(traceFrame.getGasRemaining()).thenReturn(gas); + when(traceFrame.getGasCost()).thenReturn(gasCost); + when(traceFrame.getMemory()) + .thenReturn( + Optional.of( + Arrays.stream(memory) + .map(Bytes::fromHexString) // Convert each string to Bytes + .toArray(Bytes[]::new))); + when(traceFrame.getOpcode()).thenReturn(op); + when(traceFrame.getPc()).thenReturn(1); + when(traceFrame.getStack()) + .thenReturn( + Optional.of( + Arrays.stream(stack) + .map(Bytes::fromHexString) // Convert each string to Bytes + .toArray(Bytes[]::new))); + Map storageMap = new HashMap<>(); + for (Map.Entry entry : storage.entrySet()) { + storageMap.put( + UInt256.fromHexString(entry.getKey()), UInt256.fromHexString(entry.getValue())); } -} \ No newline at end of file + when(traceFrame.getStorage()).thenReturn(Optional.of(storageMap)); + when(traceFrame.getRevertReason()).thenReturn(Optional.of(Bytes.fromHexString(reason))); + + // When + structLog = new StructLog(traceFrame); + + // Use Jackson to serialize the StructLog object to a JSON string + String json = objectMapper.writeValueAsString(structLog); + + // Define the expected JSON output + String expectedJson = + "{" + + "\"pc\":1," + + "\"op\":\"PUSH1\"," + + "\"gas\":100," + + "\"gasCost\":10," + + "\"depth\":1," + + "\"stack\":[\"0x0\",\"0x1\",\"0x2\",\"0x3\"]," + + "\"memory\":[\"0x1\",\"0x2\",\"0x23\",\"0x4\",\"0xe5\",\"0x0\"]," + + "\"storage\":{\"1\":\"2233333\",\"2\":\"4455667\"}," + + "\"reason\":\"0x53756e696665642066756e6473\"" + + "}"; + + // Then + assertThat(json).isEqualTo(expectedJson); // Verify the generated JSON matches the expected JSON + } + + @Test + public void testToCompactHexEmptyWithPrefix() { + Bytes emptyBytes = Bytes.EMPTY; + String result = StructLog.toCompactHex(emptyBytes, true); + assertEquals("0x0", result, "Expected '0x0' for an empty byte array with prefix"); + } + + @Test + public void testToCompactHexEmptyWithoutPrefix() { + Bytes emptyBytes = Bytes.EMPTY; + String result = StructLog.toCompactHex(emptyBytes, false); + assertEquals("0", result, "Expected '0' for an empty byte array without prefix"); + } + + @Test + public void testToCompactHexSingleByteWithPrefix() { + Bytes bytes = Bytes.fromHexString("0x01"); + String result = StructLog.toCompactHex(bytes, true); + assertEquals("0x1", result, "Expected '0x1' for the byte 0x01 with prefix"); + } + + @Test + public void testToCompactHexSingleByteWithoutPrefix() { + Bytes bytes = Bytes.fromHexString("0x01"); + String result = StructLog.toCompactHex(bytes, false); + assertEquals("1", result, "Expected '1' for the byte 0x01 without prefix"); + } + + @Test + public void testToCompactHexMultipleBytesWithPrefix() { + Bytes bytes = Bytes.fromHexString("0x010203"); + String result = StructLog.toCompactHex(bytes, true); + assertEquals("0x10203", result, "Expected '0x10203' for the byte array 0x010203 with prefix"); + } + + @Test + public void testToCompactHexMultipleBytesWithoutPrefix() { + Bytes bytes = Bytes.fromHexString("0x010203"); + String result = StructLog.toCompactHex(bytes, false); + assertEquals("10203", result, "Expected '10203' for the byte array 0x010203 without prefix"); + } + + @Test + public void testToCompactHexWithLeadingZeros() { + Bytes bytes = Bytes.fromHexString("0x0001"); + String result = StructLog.toCompactHex(bytes, true); + assertEquals( + "0x1", + result, + "Expected '0x1' for the byte array 0x0001 with prefix (leading zeros removed)"); + } + + @Test + public void testToCompactHexWithLargeData() { + Bytes bytes = Bytes.fromHexString("0x0102030405060708090a"); + String result = StructLog.toCompactHex(bytes, true); + assertEquals("0x102030405060708090a", result, "Expected correct hex output for large data"); + } +} From 9bcbda3b62c8915a6be3db851f5406259db00194 Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Fri, 3 Jan 2025 15:10:39 +0100 Subject: [PATCH 03/13] Add pipeline implementation for debug_traceBlock Signed-off-by: Ameziane H. --- .../internal/methods/DebugTraceBlock.java | 117 ++++++++-- .../jsonrpc/methods/DebugJsonRpcMethods.java | 6 +- .../methods/DebugTraceBlockByHashTest.java | 13 +- .../methods/DebugTraceBlockByNumberTest.java | 14 +- .../internal/methods/DebugTraceBlockTest.java | 204 +++++++++++------- 5 files changed, 227 insertions(+), 127 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java index edfb816bb9d..5545b2aa155 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java @@ -14,14 +14,15 @@ */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; +import static org.hyperledger.besu.services.pipeline.PipelineBuilder.createPipelineFrom; + 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.exception.InvalidJsonRpcParameters; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonRpcParameter.JsonRpcParameterException; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TransactionTraceParams; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTrace; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; +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.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; @@ -31,14 +32,28 @@ import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; import org.hyperledger.besu.ethereum.debug.TraceOptions; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; +import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; +import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions; import org.hyperledger.besu.ethereum.rlp.RLP; import org.hyperledger.besu.ethereum.rlp.RLPException; import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; +import org.hyperledger.besu.metrics.BesuMetricCategory; +import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; +import org.hyperledger.besu.plugin.services.metrics.Counter; +import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; +import org.hyperledger.besu.services.pipeline.Pipeline; import java.util.Collection; import java.util.Optional; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutionException; import java.util.function.Supplier; +import com.google.common.base.Suppliers; import org.apache.tuweni.bytes.Bytes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,17 +61,26 @@ public class DebugTraceBlock implements JsonRpcMethod { private static final Logger LOG = LoggerFactory.getLogger(DebugTraceBlock.class); - private final Supplier blockTracerSupplier; private final BlockHeaderFunctions blockHeaderFunctions; - private final BlockchainQueries blockchainQueries; + private final Supplier blockchainQueries; + private final ProtocolSchedule protocolSchedule; + private final LabelledMetric outputCounter; public DebugTraceBlock( - final Supplier blockTracerSupplier, - final BlockHeaderFunctions blockHeaderFunctions, - final BlockchainQueries blockchainQueries) { - this.blockTracerSupplier = blockTracerSupplier; - this.blockHeaderFunctions = blockHeaderFunctions; - this.blockchainQueries = blockchainQueries; + final ProtocolSchedule protocolSchedule, + final BlockchainQueries blockchainQueries, + final ObservableMetricsSystem metricsSystem) { + this.blockHeaderFunctions = ScheduleBasedBlockHeaderFunctions.create(protocolSchedule); + this.blockchainQueries = Suppliers.ofInstance(blockchainQueries); + ; + this.protocolSchedule = protocolSchedule; + this.outputCounter = + metricsSystem.createLabelledCounter( + BesuMetricCategory.BLOCKCHAIN, + "transactions_debugTraceblock_pipeline_processed_total", + "Number of transactions processed for each block", + "step", + "action"); } @Override @@ -70,7 +94,7 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { try { final String input = requestContext.getRequiredParameter(0, String.class); block = Block.readFrom(RLP.input(Bytes.fromHexString(input)), this.blockHeaderFunctions); - } catch (final RLPException e) { + } catch (final RLPException | IllegalArgumentException e) { LOG.debug("Failed to parse block RLP (index 0)", e); return new JsonRpcErrorResponse( requestContext.getRequest().getId(), RpcErrorType.INVALID_BLOCK_PARAMS); @@ -92,20 +116,69 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { e); } - if (this.blockchainQueries.blockByHash(block.getHeader().getParentHash()).isPresent()) { + if (blockchainQueries + .get() + .getBlockchain() + .getBlockByHash(block.getHeader().getParentHash()) + .isPresent()) { final Collection results = Tracer.processTracing( - blockchainQueries, + blockchainQueries.get(), Optional.of(block.getHeader()), - mutableWorldState -> - blockTracerSupplier - .get() - .trace( - mutableWorldState, - block, - new DebugOperationTracer(traceOptions, true)) - .map(BlockTrace::getTransactionTraces) - .map(DebugTraceTransactionResult::of)) + traceableState -> { + Collection tracesList = + new CopyOnWriteArrayList<>(); + final ProtocolSpec protocolSpec = + protocolSchedule.getByBlockHeader(block.getHeader()); + final MainnetTransactionProcessor transactionProcessor = + protocolSpec.getTransactionProcessor(); + final TraceBlock.ChainUpdater chainUpdater = + new TraceBlock.ChainUpdater(traceableState); + + TransactionSource transactionSource = new TransactionSource(block); + DebugOperationTracer debugOperationTracer = + new DebugOperationTracer(traceOptions, true); + ExecuteTransactionStep executeTransactionStep = + new ExecuteTransactionStep( + chainUpdater, + transactionProcessor, + blockchainQueries.get().getBlockchain(), + debugOperationTracer, + protocolSpec, + block); + DebugTraceTransactionStep debugTraceTransactionStep = + new DebugTraceTransactionStep(); + Pipeline traceBlockPipeline = + createPipelineFrom( + "getTransactions", + transactionSource, + 4, + outputCounter, + false, + "debug_trace_block_by_number") + .thenProcess("executeTransaction", executeTransactionStep) + .thenProcessAsyncOrdered( + "debugTraceTransactionStep", debugTraceTransactionStep, 4) + .andFinishWith("collect_results", tracesList::add); + + try { + if (blockchainQueries.get().getEthScheduler().isPresent()) { + blockchainQueries + .get() + .getEthScheduler() + .get() + .startPipeline(traceBlockPipeline) + .get(); + } else { + EthScheduler ethScheduler = + new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); + ethScheduler.startPipeline(traceBlockPipeline).get(); + } + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + return Optional.of(tracesList); + }) .orElse(null); return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), results); } else { 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 07e03d52b24..9a1513f7a82 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 @@ -45,7 +45,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; 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; @@ -100,10 +99,7 @@ protected Map create() { new DebugStorageRangeAt(blockchainQueries, blockReplay), new DebugMetrics(metricsSystem), new DebugResyncWorldstate(protocolContext, synchronizer), - new DebugTraceBlock( - () -> new BlockTracer(blockReplay), - ScheduleBasedBlockHeaderFunctions.create(protocolSchedule), - blockchainQueries), + new DebugTraceBlock(protocolSchedule, blockchainQueries, metricsSystem), new DebugSetHead(blockchainQueries, protocolContext), new DebugReplayBlock(blockchainQueries, protocolContext, protocolSchedule), new DebugTraceBlockByNumber(protocolSchedule, blockchainQueries, metricsSystem), 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 5e21316573a..55f3def1cba 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 @@ -27,6 +27,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters; 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.query.BlockchainQueries; @@ -49,17 +50,11 @@ public class DebugTraceBlockByHashTest { @Mock private ProtocolSchedule protocolSchedule; - @Mock private BlockchainQueries blockchainQueries; - @Mock private ObservableMetricsSystem metricsSystem; - @Mock private Blockchain blockchain; - @Mock private Block block; - private DebugTraceBlockByHash debugTraceBlockByHash; - private final Hash blockHash = Hash.fromHexString("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); @@ -97,8 +92,10 @@ public void shouldReturnCorrectResponse() { Tracer.processTracing(eq(blockchainQueries), eq(blockHash), any(Function.class))) .thenReturn(Optional.of(resultList)); - final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) debugTraceBlockByHash.response(request); + final JsonRpcResponse jsonRpcResponse = debugTraceBlockByHash.response(request); + assertThat(jsonRpcResponse).isInstanceOf(JsonRpcSuccessResponse.class); + JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) jsonRpcResponse; + final Collection traceResult = getResult(response); assertThat(traceResult).isNotEmpty(); assertThat(traceResult).isInstanceOf(Collection.class).hasSize(2); 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 8df427fb3bc..3441881f53f 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 @@ -26,6 +26,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters; 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.query.BlockchainQueries; @@ -50,17 +51,11 @@ public class DebugTraceBlockByNumberTest { @Mock private BlockchainQueries blockchainQueries; - @Mock private Blockchain blockchain; - @Mock private Block block; - @Mock private BlockHeader blockHeader; - @Mock private ProtocolSchedule protocolSchedule; - @Mock private ObservableMetricsSystem metricsSystem; - private DebugTraceBlockByNumber debugTraceBlockByNumber; @BeforeEach @@ -100,10 +95,11 @@ public void shouldReturnCorrectResponse() { eq(blockchainQueries), eq(Optional.of(blockHeader)), any(Function.class))) .thenReturn(Optional.of(resultList)); - final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) debugTraceBlockByNumber.response(request); - final Collection traceResult = getResult(response); + final JsonRpcResponse jsonRpcResponse = debugTraceBlockByNumber.response(request); + assertThat(jsonRpcResponse).isInstanceOf(JsonRpcSuccessResponse.class); + JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) jsonRpcResponse; + final Collection traceResult = getResult(response); assertThat(traceResult).isNotEmpty(); assertThat(traceResult).isInstanceOf(Collection.class).hasSize(2); assertThat(traceResult).containsExactly(result1, result2); 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 f35f3d1a16a..9f9ae1383a5 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 @@ -14,53 +14,106 @@ */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; -import static java.util.Arrays.asList; -import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockStatic; import static org.mockito.Mockito.when; -import org.hyperledger.besu.datatypes.Wei; +import org.hyperledger.besu.config.GenesisConfig; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequest; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTrace; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; -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.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.query.BlockWithMetadata; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.DebugTraceTransactionResult; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; +import org.hyperledger.besu.ethereum.chain.BadBlockManager; +import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockDataGenerator; -import org.hyperledger.besu.ethereum.debug.TraceFrame; +import org.hyperledger.besu.ethereum.core.ExecutionContextTestFixture; +import org.hyperledger.besu.ethereum.core.MiningConfiguration; +import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions; -import org.hyperledger.besu.ethereum.processing.TransactionProcessingResult; - +import org.hyperledger.besu.ethereum.mainnet.ProtocolScheduleBuilder; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSpecAdapters; +import org.hyperledger.besu.ethereum.mainnet.TransactionValidatorFactory; +import org.hyperledger.besu.ethereum.mainnet.WithdrawalsProcessor; +import org.hyperledger.besu.evm.internal.EvmConfiguration; +import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; + +import java.math.BigInteger; +import java.util.Arrays; import java.util.Collection; -import java.util.Collections; +import java.util.List; import java.util.Optional; -import java.util.OptionalLong; import java.util.function.Function; -import org.apache.tuweni.bytes.Bytes; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.mockito.Mock; +import org.mockito.MockedStatic; +import org.mockito.MockitoAnnotations; public class DebugTraceBlockTest { - - private final BlockTracer blockTracer = mock(BlockTracer.class); - private final BlockchainQueries blockchainQueries = mock(BlockchainQueries.class); - private final DebugTraceBlock debugTraceBlock = - new DebugTraceBlock(() -> blockTracer, new MainnetBlockHeaderFunctions(), blockchainQueries); + @Mock private BlockchainQueries blockchainQueries; + @Mock private Blockchain blockchain; + @Mock private ObservableMetricsSystem metricsSystem; + @Mock private WithdrawalsProcessor withdrawalsProcessor; + @Mock private TransactionValidatorFactory alwaysValidTransactionValidatorFactory; + private DebugTraceBlock debugTraceBlock; + + @BeforeEach + public void setUp() { + MockitoAnnotations.openMocks(this); + // As we build the block from RLP in DebugTraceBlock, we need to have non mocked + // protocolSchedule (and ProtocolSpec) + // to be able to get the hash of the block + final var genesisConfig = + GenesisConfig.fromResource( + "/org/hyperledger/besu/ethereum/api/jsonrpc/trace/chain-data/genesis.json"); + final ProtocolSpecAdapters protocolSpecAdapters = + ProtocolSpecAdapters.create( + 0, + specBuilder -> { + specBuilder.isReplayProtectionSupported(true); + specBuilder.withdrawalsProcessor(withdrawalsProcessor); + specBuilder.transactionValidatorFactoryBuilder( + (evm, gasLimitCalculator, feeMarket) -> alwaysValidTransactionValidatorFactory); + return specBuilder; + }); + final ExecutionContextTestFixture executionContextTestFixture = + ExecutionContextTestFixture.builder(genesisConfig) + .protocolSchedule( + new ProtocolScheduleBuilder( + genesisConfig.getConfigOptions(), + Optional.of(BigInteger.valueOf(42)), + protocolSpecAdapters, + PrivacyParameters.DEFAULT, + false, + EvmConfiguration.DEFAULT, + MiningConfiguration.MINING_DISABLED, + new BadBlockManager(), + false, + new NoOpMetricsSystem()) + .createProtocolSchedule()) + .build(); + debugTraceBlock = + new DebugTraceBlock( + executionContextTestFixture.getProtocolSchedule(), blockchainQueries, metricsSystem); + } @Test public void nameShouldBeDebugTraceBlock() { assertThat(debugTraceBlock.getName()).isEqualTo("debug_traceBlock"); } + @SuppressWarnings("unchecked") @Test public void shouldReturnCorrectResponse() { final Block parentBlock = @@ -79,71 +132,39 @@ public void shouldReturnCorrectResponse() { final JsonRpcRequestContext request = new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlock", params)); - final TraceFrame traceFrame = - new TraceFrame( - 12, - Optional.of("NONE"), - Integer.MAX_VALUE, - 45L, - OptionalLong.of(56L), - 0L, - 2, - Optional.empty(), - null, - Wei.ZERO, - Bytes.EMPTY, - Bytes.EMPTY, - Optional.empty(), - Optional.empty(), - Optional.empty(), - null, - Optional.empty(), - Optional.empty(), - Optional.empty(), - 0, - Optional.empty(), - false, - Optional.empty(), - Optional.empty()); - - final TransactionProcessingResult transaction1Result = mock(TransactionProcessingResult.class); - final TransactionProcessingResult transaction2Result = mock(TransactionProcessingResult.class); - - final TransactionTrace transaction1Trace = mock(TransactionTrace.class); - final TransactionTrace transaction2Trace = mock(TransactionTrace.class); - - final BlockTrace blockTrace = new BlockTrace(asList(transaction1Trace, transaction2Trace)); - - when(transaction1Trace.getTraceFrames()).thenReturn(singletonList(traceFrame)); - when(transaction2Trace.getTraceFrames()).thenReturn(singletonList(traceFrame)); - when(transaction1Trace.getResult()).thenReturn(transaction1Result); - when(transaction2Trace.getResult()).thenReturn(transaction2Result); - when(transaction1Result.getOutput()).thenReturn(Bytes.fromHexString("1234")); - when(transaction2Result.getOutput()).thenReturn(Bytes.fromHexString("1234")); - when(blockTracer.trace(any(Tracer.TraceableState.class), eq(block), any())) - .thenReturn(Optional.of(blockTrace)); - - when(blockchainQueries.blockByHash(parentBlock.getHash())) - .thenReturn( - Optional.of( - new BlockWithMetadata<>( - parentBlock.getHeader(), - Collections.emptyList(), - Collections.emptyList(), - parentBlock.getHeader().getDifficulty(), - parentBlock.calculateSize()))); - when(blockchainQueries.getAndMapWorldState(eq(parentBlock.getHash()), any())) - .thenAnswer( - invocationOnMock -> { - Function> mapper = - invocationOnMock.getArgument(1); - return mapper.apply(mock(Tracer.TraceableState.class)); - }); + when(blockchainQueries.getBlockchain()).thenReturn(blockchain); + when(blockchain.getBlockByHash(block.getHeader().getParentHash())) + .thenReturn(Optional.of(parentBlock)); + + DebugTraceTransactionResult result1 = mock(DebugTraceTransactionResult.class); + DebugTraceTransactionResult result2 = mock(DebugTraceTransactionResult.class); + + List resultList = Arrays.asList(result1, result2); + + try (MockedStatic mockedTracer = mockStatic(Tracer.class)) { + mockedTracer + .when( + () -> + Tracer.processTracing( + eq(blockchainQueries), + eq(Optional.of(block.getHeader())), + any(Function.class))) + .thenReturn(Optional.of(resultList)); + + final JsonRpcResponse jsonRpcResponse = debugTraceBlock.response(request); + assertThat(jsonRpcResponse).isInstanceOf(JsonRpcSuccessResponse.class); + JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) jsonRpcResponse; + + final Collection traceResult = getResult(response); + assertThat(traceResult).isNotEmpty(); + assertThat(traceResult).isInstanceOf(Collection.class).hasSize(2); + assertThat(traceResult).containsExactly(result1, result2); + } + } - final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) debugTraceBlock.response(request); - final Collection result = (Collection) response.getResult(); - assertThat(result).hasSize(2); + @SuppressWarnings("unchecked") + private Collection getResult(final JsonRpcSuccessResponse response) { + return (Collection) response.getResult(); } @Test @@ -158,9 +179,26 @@ public void shouldReturnErrorResponseWhenParentBlockMissing() { final JsonRpcRequestContext request = new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlock", params)); - when(blockchainQueries.blockByHash(any())).thenReturn(Optional.empty()); + when(blockchainQueries.getBlockchain()).thenReturn(blockchain); + when(blockchain.getBlockByHash(block.getHeader().getParentHash())).thenReturn(Optional.empty()); + final JsonRpcResponse jsonRpcResponse = debugTraceBlock.response(request); + assertThat(jsonRpcResponse).isInstanceOf(JsonRpcErrorResponse.class); final JsonRpcErrorResponse response = (JsonRpcErrorResponse) debugTraceBlock.response(request); + assertThat(response.getErrorType()).isEqualByComparingTo(RpcErrorType.PARENT_BLOCK_NOT_FOUND); } + + @Test + public void shouldHandleInvalidParametersGracefully() { + final Object[] invalidParams = new Object[] {"invalid RLP"}; + final JsonRpcRequestContext request = + new JsonRpcRequestContext(new JsonRpcRequest("2.0", "debug_traceBlock", invalidParams)); + + final JsonRpcResponse jsonRpcResponse = debugTraceBlock.response(request); + assertThat(jsonRpcResponse).isInstanceOf(JsonRpcErrorResponse.class); + final JsonRpcErrorResponse response = (JsonRpcErrorResponse) debugTraceBlock.response(request); + + assertThat(response.getError().getMessage()).contains("Invalid block, unable to parse RLP"); + } } From 3a7695d04a35ef9699386db35f9b1bd73dc31e69 Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Fri, 3 Jan 2025 16:36:18 +0100 Subject: [PATCH 04/13] Fix unit and integration tests. Some checks were deleted from the integration test because they were not relevant. Signed-off-by: Ameziane H. --- .../methods/DebugTraceTransactionTest.java | 5 +- .../debug_traceTransaction_complete.json | 2355 ++++++---------- .../debug_traceTransaction_disableMemory.json | 2312 ++++++---------- .../debug_traceTransaction_disableStack.json | 1869 +++++-------- ...debug_traceTransaction_disableStorage.json | 2371 ++++++----------- .../vm/TraceTransactionIntegrationTest.java | 8 +- 6 files changed, 2914 insertions(+), 6006 deletions(-) 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 f57fd716c06..19f49cdf179 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 @@ -165,10 +165,11 @@ public void shouldTraceTheTransactionUsingTheTransactionTracer() { assertThat(transactionResult.getStructLogs().size()).isEqualTo(1); assertThat(transactionResult.getStructLogs().get(0).stack().length).isEqualTo(1); assertThat(transactionResult.getStructLogs().get(0).stack()[0]) - .isEqualTo(stackBytes[0].toUnprefixedHexString()); + .isEqualTo( + StructLog.toCompactHex(stackBytes[0], true)); assertThat(transactionResult.getStructLogs().get(0).memory().length).isEqualTo(1); assertThat(transactionResult.getStructLogs().get(0).memory()[0]) - .isEqualTo(memoryBytes[0].toUnprefixedHexString()); + .isEqualTo(StructLog.toCompactHex(memoryBytes[0], true)); } @Test diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_complete.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_complete.json index c9737df6ce8..9523d43bb0d 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_complete.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_complete.json @@ -11,1615 +11,752 @@ "jsonrpc": "2.0", "id": 1, "result": { - "gas": 23705, - "failed": false, - "returnValue": "", - "structLogs": [ - { - "pc": 0, - "op": "PUSH1", - "gas": 292887, - "gasCost": 3, - "depth": 1, - "stack": [], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 2, - "op": "CALLDATALOAD", - "gas": 292884, - "gasCost": 3, - "depth": 1, - "stack": [ - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 3, - "op": "PUSH29", - "gas": 292881, - "gasCost": 3, - "depth": 1, - "stack": [ - "9dc2c8f500000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 33, - "op": "SWAP1", - "gas": 292878, - "gasCost": 3, - "depth": 1, - "stack": [ - "9dc2c8f500000000000000000000000000000000000000000000000000000000", - "0000000100000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 34, - "op": "DIV", - "gas": 292875, - "gasCost": 5, - "depth": 1, - "stack": [ - "0000000100000000000000000000000000000000000000000000000000000000", - "9dc2c8f500000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 35, - "op": "DUP1", - "gas": 292870, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 36, - "op": "PUSH4", - "gas": 292867, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 41, - "op": "EQ", - "gas": 292864, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "00000000000000000000000000000000000000000000000000000000102accc1" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 42, - "op": "PUSH2", - "gas": 292861, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 45, - "op": "JUMPI", - "gas": 292858, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000012c" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 46, - "op": "DUP1", - "gas": 292848, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 47, - "op": "PUSH4", - "gas": 292845, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 52, - "op": "EQ", - "gas": 292842, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000012a7b914" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 53, - "op": "PUSH2", - "gas": 292839, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 56, - "op": "JUMPI", - "gas": 292836, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000013a" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 57, - "op": "DUP1", - "gas": 292826, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 58, - "op": "PUSH4", - "gas": 292823, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 63, - "op": "EQ", - "gas": 292820, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000001774e646" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 64, - "op": "PUSH2", - "gas": 292817, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 67, - "op": "JUMPI", - "gas": 292814, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000014c" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 68, - "op": "DUP1", - "gas": 292804, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 69, - "op": "PUSH4", - "gas": 292801, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 74, - "op": "EQ", - "gas": 292798, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000001e26fd33" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 75, - "op": "PUSH2", - "gas": 292795, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 78, - "op": "JUMPI", - "gas": 292792, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000015d" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 79, - "op": "DUP1", - "gas": 292782, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 80, - "op": "PUSH4", - "gas": 292779, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 85, - "op": "EQ", - "gas": 292776, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000001f903037" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 86, - "op": "PUSH2", - "gas": 292773, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 89, - "op": "JUMPI", - "gas": 292770, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000016e" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 90, - "op": "DUP1", - "gas": 292760, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 91, - "op": "PUSH4", - "gas": 292757, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 96, - "op": "EQ", - "gas": 292754, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "00000000000000000000000000000000000000000000000000000000343a875d" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 97, - "op": "PUSH2", - "gas": 292751, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 100, - "op": "JUMPI", - "gas": 292748, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000180" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 101, - "op": "DUP1", - "gas": 292738, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 102, - "op": "PUSH4", - "gas": 292735, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 107, - "op": "EQ", - "gas": 292732, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000038cc4831" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 108, - "op": "PUSH2", - "gas": 292729, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 111, - "op": "JUMPI", - "gas": 292726, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000195" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 112, - "op": "DUP1", - "gas": 292716, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 113, - "op": "PUSH4", - "gas": 292713, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 118, - "op": "EQ", - "gas": 292710, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000004e7ad367" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 119, - "op": "PUSH2", - "gas": 292707, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 122, - "op": "JUMPI", - "gas": 292704, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001bd" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 123, - "op": "DUP1", - "gas": 292694, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 124, - "op": "PUSH4", - "gas": 292691, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 129, - "op": "EQ", - "gas": 292688, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000057cb2fc4" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 130, - "op": "PUSH2", - "gas": 292685, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 133, - "op": "JUMPI", - "gas": 292682, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001cb" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 134, - "op": "DUP1", - "gas": 292672, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 135, - "op": "PUSH4", - "gas": 292669, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 140, - "op": "EQ", - "gas": 292666, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000065538c73" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 141, - "op": "PUSH2", - "gas": 292663, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 144, - "op": "JUMPI", - "gas": 292660, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001e0" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 145, - "op": "DUP1", - "gas": 292650, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 146, - "op": "PUSH4", - "gas": 292647, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 151, - "op": "EQ", - "gas": 292644, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000068895979" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 152, - "op": "PUSH2", - "gas": 292641, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 155, - "op": "JUMPI", - "gas": 292638, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001ee" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 156, - "op": "DUP1", - "gas": 292628, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 157, - "op": "PUSH4", - "gas": 292625, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 162, - "op": "EQ", - "gas": 292622, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000076bc21d9" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 163, - "op": "PUSH2", - "gas": 292619, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 166, - "op": "JUMPI", - "gas": 292616, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000200" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 167, - "op": "DUP1", - "gas": 292606, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 168, - "op": "PUSH4", - "gas": 292603, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 173, - "op": "EQ", - "gas": 292600, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009a19a953" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 174, - "op": "PUSH2", - "gas": 292597, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 177, - "op": "JUMPI", - "gas": 292594, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000020e" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 178, - "op": "DUP1", - "gas": 292584, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 179, - "op": "PUSH4", - "gas": 292581, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 184, - "op": "EQ", - "gas": 292578, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 185, - "op": "PUSH2", - "gas": 292575, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 188, - "op": "JUMPI", - "gas": 292572, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000001", - "000000000000000000000000000000000000000000000000000000000000021f" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 543, - "op": "JUMPDEST", - "gas": 292562, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 544, - "op": "PUSH2", - "gas": 292561, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 547, - "op": "PUSH2", - "gas": 292558, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 550, - "op": "JUMP", - "gas": 292555, - "gasCost": 8, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "0000000000000000000000000000000000000000000000000000000000000693" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1683, - "op": "JUMPDEST", - "gas": 292547, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1684, - "op": "PUSH32", - "gas": 292546, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1717, - "op": "PUSH1", - "gas": 292543, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1719, - "op": "MUL", - "gas": 292540, - "gasCost": 5, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1720, - "op": "CALLER", - "gas": 292535, - "gasCost": 2, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1721, - "op": "PUSH20", - "gas": 292533, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1742, - "op": "AND", - "gas": 292530, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1743, - "op": "PUSH1", - "gas": 292527, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1745, - "op": "PUSH1", - "gas": 292524, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1747, - "op": "PUSH32", - "gas": 292521, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1780, - "op": "DUP2", - "gas": 292518, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1781, - "op": "MSTORE", - "gas": 292515, - "gasCost": 6, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1782, - "op": "PUSH1", - "gas": 292509, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1784, - "op": "ADD", - "gas": 292506, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1785, - "op": "PUSH1", - "gas": 292503, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1787, - "op": "DUP2", - "gas": 292500, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1788, - "op": "MSTORE", - "gas": 292497, - "gasCost": 6, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020", - "000000000000000000000000000000000000000000000000000000000000002a", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1789, - "op": "PUSH1", - "gas": 292491, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1791, - "op": "ADD", - "gas": 292488, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1792, - "op": "PUSH1", - "gas": 292485, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1794, - "op": "LOG3", - "gas": 292482, - "gasCost": 2012, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000040", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1795, - "op": "JUMPDEST", - "gas": 290470, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1796, - "op": "JUMP", - "gas": 290469, - "gasCost": 8, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 551, - "op": "JUMPDEST", - "gas": 290461, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 552, - "op": "PUSH1", - "gas": 290460, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 554, - "op": "PUSH1", - "gas": 290457, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 556, - "op": "RETURN", - "gas": 290454, - "gasCost": 0, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - } + "gas" : 23705, + "failed" : false, + "returnValue" : "", + "structLogs" : [ { + "pc" : 0, + "op" : "PUSH1", + "gas" : 292887, + "gasCost" : 3, + "depth" : 1, + "stack" : [ ] + }, { + "pc" : 2, + "op" : "CALLDATALOAD", + "gas" : 292884, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x0" ] + }, { + "pc" : 3, + "op" : "PUSH29", + "gas" : 292881, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f500000000000000000000000000000000000000000000000000000000" ] + }, { + "pc" : 33, + "op" : "SWAP1", + "gas" : 292878, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f500000000000000000000000000000000000000000000000000000000", "0x100000000000000000000000000000000000000000000000000000000" ] + }, { + "pc" : 34, + "op" : "DIV", + "gas" : 292875, + "gasCost" : 5, + "depth" : 1, + "stack" : [ "0x100000000000000000000000000000000000000000000000000000000", "0x9dc2c8f500000000000000000000000000000000000000000000000000000000" ] + }, { + "pc" : 35, + "op" : "DUP1", + "gas" : 292870, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 36, + "op" : "PUSH4", + "gas" : 292867, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 41, + "op" : "EQ", + "gas" : 292864, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x102accc1" ] + }, { + "pc" : 42, + "op" : "PUSH2", + "gas" : 292861, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 45, + "op" : "JUMPI", + "gas" : 292858, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x12c" ] + }, { + "pc" : 46, + "op" : "DUP1", + "gas" : 292848, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 47, + "op" : "PUSH4", + "gas" : 292845, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 52, + "op" : "EQ", + "gas" : 292842, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x12a7b914" ] + }, { + "pc" : 53, + "op" : "PUSH2", + "gas" : 292839, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 56, + "op" : "JUMPI", + "gas" : 292836, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x13a" ] + }, { + "pc" : 57, + "op" : "DUP1", + "gas" : 292826, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 58, + "op" : "PUSH4", + "gas" : 292823, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 63, + "op" : "EQ", + "gas" : 292820, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x1774e646" ] + }, { + "pc" : 64, + "op" : "PUSH2", + "gas" : 292817, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 67, + "op" : "JUMPI", + "gas" : 292814, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x14c" ] + }, { + "pc" : 68, + "op" : "DUP1", + "gas" : 292804, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 69, + "op" : "PUSH4", + "gas" : 292801, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 74, + "op" : "EQ", + "gas" : 292798, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x1e26fd33" ] + }, { + "pc" : 75, + "op" : "PUSH2", + "gas" : 292795, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 78, + "op" : "JUMPI", + "gas" : 292792, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x15d" ] + }, { + "pc" : 79, + "op" : "DUP1", + "gas" : 292782, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 80, + "op" : "PUSH4", + "gas" : 292779, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 85, + "op" : "EQ", + "gas" : 292776, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x1f903037" ] + }, { + "pc" : 86, + "op" : "PUSH2", + "gas" : 292773, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 89, + "op" : "JUMPI", + "gas" : 292770, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x16e" ] + }, { + "pc" : 90, + "op" : "DUP1", + "gas" : 292760, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 91, + "op" : "PUSH4", + "gas" : 292757, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 96, + "op" : "EQ", + "gas" : 292754, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x343a875d" ] + }, { + "pc" : 97, + "op" : "PUSH2", + "gas" : 292751, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 100, + "op" : "JUMPI", + "gas" : 292748, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x180" ] + }, { + "pc" : 101, + "op" : "DUP1", + "gas" : 292738, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 102, + "op" : "PUSH4", + "gas" : 292735, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 107, + "op" : "EQ", + "gas" : 292732, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x38cc4831" ] + }, { + "pc" : 108, + "op" : "PUSH2", + "gas" : 292729, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 111, + "op" : "JUMPI", + "gas" : 292726, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x195" ] + }, { + "pc" : 112, + "op" : "DUP1", + "gas" : 292716, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 113, + "op" : "PUSH4", + "gas" : 292713, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 118, + "op" : "EQ", + "gas" : 292710, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x4e7ad367" ] + }, { + "pc" : 119, + "op" : "PUSH2", + "gas" : 292707, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 122, + "op" : "JUMPI", + "gas" : 292704, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1bd" ] + }, { + "pc" : 123, + "op" : "DUP1", + "gas" : 292694, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 124, + "op" : "PUSH4", + "gas" : 292691, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 129, + "op" : "EQ", + "gas" : 292688, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x57cb2fc4" ] + }, { + "pc" : 130, + "op" : "PUSH2", + "gas" : 292685, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 133, + "op" : "JUMPI", + "gas" : 292682, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1cb" ] + }, { + "pc" : 134, + "op" : "DUP1", + "gas" : 292672, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 135, + "op" : "PUSH4", + "gas" : 292669, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 140, + "op" : "EQ", + "gas" : 292666, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x65538c73" ] + }, { + "pc" : 141, + "op" : "PUSH2", + "gas" : 292663, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 144, + "op" : "JUMPI", + "gas" : 292660, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1e0" ] + }, { + "pc" : 145, + "op" : "DUP1", + "gas" : 292650, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 146, + "op" : "PUSH4", + "gas" : 292647, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 151, + "op" : "EQ", + "gas" : 292644, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x68895979" ] + }, { + "pc" : 152, + "op" : "PUSH2", + "gas" : 292641, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 155, + "op" : "JUMPI", + "gas" : 292638, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1ee" ] + }, { + "pc" : 156, + "op" : "DUP1", + "gas" : 292628, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 157, + "op" : "PUSH4", + "gas" : 292625, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 162, + "op" : "EQ", + "gas" : 292622, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x76bc21d9" ] + }, { + "pc" : 163, + "op" : "PUSH2", + "gas" : 292619, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 166, + "op" : "JUMPI", + "gas" : 292616, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x200" ] + }, { + "pc" : 167, + "op" : "DUP1", + "gas" : 292606, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 168, + "op" : "PUSH4", + "gas" : 292603, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 173, + "op" : "EQ", + "gas" : 292600, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x9a19a953" ] + }, { + "pc" : 174, + "op" : "PUSH2", + "gas" : 292597, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 177, + "op" : "JUMPI", + "gas" : 292594, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x20e" ] + }, { + "pc" : 178, + "op" : "DUP1", + "gas" : 292584, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 179, + "op" : "PUSH4", + "gas" : 292581, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 184, + "op" : "EQ", + "gas" : 292578, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 185, + "op" : "PUSH2", + "gas" : 292575, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x1" ] + }, { + "pc" : 188, + "op" : "JUMPI", + "gas" : 292572, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x1", "0x21f" ] + }, { + "pc" : 543, + "op" : "JUMPDEST", + "gas" : 292562, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 544, + "op" : "PUSH2", + "gas" : 292561, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 547, + "op" : "PUSH2", + "gas" : 292558, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 550, + "op" : "JUMP", + "gas" : 292555, + "gasCost" : 8, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0x693" ] + }, { + "pc" : 1683, + "op" : "JUMPDEST", + "gas" : 292547, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 1684, + "op" : "PUSH32", + "gas" : 292546, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 1717, + "op" : "PUSH1", + "gas" : 292543, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] + }, { + "pc" : 1719, + "op" : "MUL", + "gas" : 292540, + "gasCost" : 5, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0x1" ] + }, { + "pc" : 1720, + "op" : "CALLER", + "gas" : 292535, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] + }, { + "pc" : 1721, + "op" : "PUSH20", + "gas" : 292533, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" ] + }, { + "pc" : 1742, + "op" : "AND", + "gas" : 292530, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0xffffffffffffffffffffffffffffffffffffffff" ] + }, { + "pc" : 1743, + "op" : "PUSH1", + "gas" : 292527, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" ] + }, { + "pc" : 1745, + "op" : "PUSH1", + "gas" : 292524, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1" ] + }, { + "pc" : 1747, + "op" : "PUSH32", + "gas" : 292521, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0" ] + }, { + "pc" : 1780, + "op" : "DUP2", + "gas" : 292518, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1781, + "op" : "MSTORE", + "gas" : 292515, + "gasCost" : 6, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x0" ] + }, { + "pc" : 1782, + "op" : "PUSH1", + "gas" : 292509, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0" ] + }, { + "pc" : 1784, + "op" : "ADD", + "gas" : 292506, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0", "0x20" ] + }, { + "pc" : 1785, + "op" : "PUSH1", + "gas" : 292503, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20" ] + }, { + "pc" : 1787, + "op" : "DUP2", + "gas" : 292500, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20", "0x2a" ] + }, { + "pc" : 1788, + "op" : "MSTORE", + "gas" : 292497, + "gasCost" : 6, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20", "0x2a", "0x20" ] + }, { + "pc" : 1789, + "op" : "PUSH1", + "gas" : 292491, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20" ] + }, { + "pc" : 1791, + "op" : "ADD", + "gas" : 292488, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20", "0x20" ] + }, { + "pc" : 1792, + "op" : "PUSH1", + "gas" : 292485, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x40" ] + }, { + "pc" : 1794, + "op" : "LOG3", + "gas" : 292482, + "gasCost" : 2012, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x40", "0x0" ] + }, { + "pc" : 1795, + "op" : "JUMPDEST", + "gas" : 290470, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 1796, + "op" : "JUMP", + "gas" : 290469, + "gasCost" : 8, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 551, + "op" : "JUMPDEST", + "gas" : 290461, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 552, + "op" : "PUSH1", + "gas" : 290460, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 554, + "op" : "PUSH1", + "gas" : 290457, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 556, + "op" : "RETURN", + "gas" : 290454, + "gasCost" : 0, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x0" ] + } ] } }, diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableMemory.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableMemory.json index cdd21f5f180..8f96dbe9c45 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableMemory.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableMemory.json @@ -14,1572 +14,752 @@ "jsonrpc": "2.0", "id": 1, "result": { - "gas": 23705, - "failed": false, - "returnValue": "", - "structLogs": [ - { - "pc": 0, - "op": "PUSH1", - "gas": 292887, - "gasCost": 3, - "depth": 1, - "stack": [], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 2, - "op": "CALLDATALOAD", - "gas": 292884, - "gasCost": 3, - "depth": 1, - "stack": [ - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 3, - "op": "PUSH29", - "gas": 292881, - "gasCost": 3, - "depth": 1, - "stack": [ - "9dc2c8f500000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 33, - "op": "SWAP1", - "gas": 292878, - "gasCost": 3, - "depth": 1, - "stack": [ - "9dc2c8f500000000000000000000000000000000000000000000000000000000", - "0000000100000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 34, - "op": "DIV", - "gas": 292875, - "gasCost": 5, - "depth": 1, - "stack": [ - "0000000100000000000000000000000000000000000000000000000000000000", - "9dc2c8f500000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 35, - "op": "DUP1", - "gas": 292870, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 36, - "op": "PUSH4", - "gas": 292867, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 41, - "op": "EQ", - "gas": 292864, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "00000000000000000000000000000000000000000000000000000000102accc1" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 42, - "op": "PUSH2", - "gas": 292861, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 45, - "op": "JUMPI", - "gas": 292858, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000012c" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 46, - "op": "DUP1", - "gas": 292848, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 47, - "op": "PUSH4", - "gas": 292845, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 52, - "op": "EQ", - "gas": 292842, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000012a7b914" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 53, - "op": "PUSH2", - "gas": 292839, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 56, - "op": "JUMPI", - "gas": 292836, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000013a" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 57, - "op": "DUP1", - "gas": 292826, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 58, - "op": "PUSH4", - "gas": 292823, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 63, - "op": "EQ", - "gas": 292820, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000001774e646" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 64, - "op": "PUSH2", - "gas": 292817, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 67, - "op": "JUMPI", - "gas": 292814, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000014c" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 68, - "op": "DUP1", - "gas": 292804, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 69, - "op": "PUSH4", - "gas": 292801, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 74, - "op": "EQ", - "gas": 292798, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000001e26fd33" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 75, - "op": "PUSH2", - "gas": 292795, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 78, - "op": "JUMPI", - "gas": 292792, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000015d" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 79, - "op": "DUP1", - "gas": 292782, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 80, - "op": "PUSH4", - "gas": 292779, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 85, - "op": "EQ", - "gas": 292776, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000001f903037" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 86, - "op": "PUSH2", - "gas": 292773, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 89, - "op": "JUMPI", - "gas": 292770, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000016e" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 90, - "op": "DUP1", - "gas": 292760, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 91, - "op": "PUSH4", - "gas": 292757, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 96, - "op": "EQ", - "gas": 292754, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "00000000000000000000000000000000000000000000000000000000343a875d" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 97, - "op": "PUSH2", - "gas": 292751, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 100, - "op": "JUMPI", - "gas": 292748, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000180" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 101, - "op": "DUP1", - "gas": 292738, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 102, - "op": "PUSH4", - "gas": 292735, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 107, - "op": "EQ", - "gas": 292732, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000038cc4831" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 108, - "op": "PUSH2", - "gas": 292729, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 111, - "op": "JUMPI", - "gas": 292726, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000195" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 112, - "op": "DUP1", - "gas": 292716, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 113, - "op": "PUSH4", - "gas": 292713, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 118, - "op": "EQ", - "gas": 292710, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000004e7ad367" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 119, - "op": "PUSH2", - "gas": 292707, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 122, - "op": "JUMPI", - "gas": 292704, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001bd" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 123, - "op": "DUP1", - "gas": 292694, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 124, - "op": "PUSH4", - "gas": 292691, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 129, - "op": "EQ", - "gas": 292688, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000057cb2fc4" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 130, - "op": "PUSH2", - "gas": 292685, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 133, - "op": "JUMPI", - "gas": 292682, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001cb" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 134, - "op": "DUP1", - "gas": 292672, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 135, - "op": "PUSH4", - "gas": 292669, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 140, - "op": "EQ", - "gas": 292666, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000065538c73" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 141, - "op": "PUSH2", - "gas": 292663, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 144, - "op": "JUMPI", - "gas": 292660, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001e0" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 145, - "op": "DUP1", - "gas": 292650, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 146, - "op": "PUSH4", - "gas": 292647, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 151, - "op": "EQ", - "gas": 292644, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000068895979" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 152, - "op": "PUSH2", - "gas": 292641, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 155, - "op": "JUMPI", - "gas": 292638, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001ee" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 156, - "op": "DUP1", - "gas": 292628, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 157, - "op": "PUSH4", - "gas": 292625, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 162, - "op": "EQ", - "gas": 292622, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000076bc21d9" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 163, - "op": "PUSH2", - "gas": 292619, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 166, - "op": "JUMPI", - "gas": 292616, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000200" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 167, - "op": "DUP1", - "gas": 292606, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 168, - "op": "PUSH4", - "gas": 292603, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 173, - "op": "EQ", - "gas": 292600, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009a19a953" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 174, - "op": "PUSH2", - "gas": 292597, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 177, - "op": "JUMPI", - "gas": 292594, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000020e" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 178, - "op": "DUP1", - "gas": 292584, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 179, - "op": "PUSH4", - "gas": 292581, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 184, - "op": "EQ", - "gas": 292578, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 185, - "op": "PUSH2", - "gas": 292575, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 188, - "op": "JUMPI", - "gas": 292572, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000001", - "000000000000000000000000000000000000000000000000000000000000021f" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 543, - "op": "JUMPDEST", - "gas": 292562, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 544, - "op": "PUSH2", - "gas": 292561, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 547, - "op": "PUSH2", - "gas": 292558, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 550, - "op": "JUMP", - "gas": 292555, - "gasCost": 8, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "0000000000000000000000000000000000000000000000000000000000000693" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1683, - "op": "JUMPDEST", - "gas": 292547, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1684, - "op": "PUSH32", - "gas": 292546, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1717, - "op": "PUSH1", - "gas": 292543, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1719, - "op": "MUL", - "gas": 292540, - "gasCost": 5, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1720, - "op": "CALLER", - "gas": 292535, - "gasCost": 2, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1721, - "op": "PUSH20", - "gas": 292533, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1742, - "op": "AND", - "gas": 292530, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1743, - "op": "PUSH1", - "gas": 292527, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1745, - "op": "PUSH1", - "gas": 292524, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1747, - "op": "PUSH32", - "gas": 292521, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1780, - "op": "DUP2", - "gas": 292518, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1781, - "op": "MSTORE", - "gas": 292515, - "gasCost": 6, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1782, - "op": "PUSH1", - "gas": 292509, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1784, - "op": "ADD", - "gas": 292506, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1785, - "op": "PUSH1", - "gas": 292503, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1787, - "op": "DUP2", - "gas": 292500, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1788, - "op": "MSTORE", - "gas": 292497, - "gasCost": 6, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020", - "000000000000000000000000000000000000000000000000000000000000002a", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1789, - "op": "PUSH1", - "gas": 292491, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1791, - "op": "ADD", - "gas": 292488, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1792, - "op": "PUSH1", - "gas": 292485, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1794, - "op": "LOG3", - "gas": 292482, - "gasCost": 2012, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000040", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1795, - "op": "JUMPDEST", - "gas": 290470, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 1796, - "op": "JUMP", - "gas": 290469, - "gasCost": 8, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 551, - "op": "JUMPDEST", - "gas": 290461, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 552, - "op": "PUSH1", - "gas": 290460, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 554, - "op": "PUSH1", - "gas": 290457, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - }, - { - "pc": 556, - "op": "RETURN", - "gas": 290454, - "gasCost": 0, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": null, - "storage": {}, - "reason": null - } + "gas" : 23705, + "failed" : false, + "returnValue" : "", + "structLogs" : [ { + "pc" : 0, + "op" : "PUSH1", + "gas" : 292887, + "gasCost" : 3, + "depth" : 1, + "stack" : [ ] + }, { + "pc" : 2, + "op" : "CALLDATALOAD", + "gas" : 292884, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x0" ] + }, { + "pc" : 3, + "op" : "PUSH29", + "gas" : 292881, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f500000000000000000000000000000000000000000000000000000000" ] + }, { + "pc" : 33, + "op" : "SWAP1", + "gas" : 292878, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f500000000000000000000000000000000000000000000000000000000", "0x100000000000000000000000000000000000000000000000000000000" ] + }, { + "pc" : 34, + "op" : "DIV", + "gas" : 292875, + "gasCost" : 5, + "depth" : 1, + "stack" : [ "0x100000000000000000000000000000000000000000000000000000000", "0x9dc2c8f500000000000000000000000000000000000000000000000000000000" ] + }, { + "pc" : 35, + "op" : "DUP1", + "gas" : 292870, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 36, + "op" : "PUSH4", + "gas" : 292867, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 41, + "op" : "EQ", + "gas" : 292864, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x102accc1" ] + }, { + "pc" : 42, + "op" : "PUSH2", + "gas" : 292861, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 45, + "op" : "JUMPI", + "gas" : 292858, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x12c" ] + }, { + "pc" : 46, + "op" : "DUP1", + "gas" : 292848, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 47, + "op" : "PUSH4", + "gas" : 292845, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 52, + "op" : "EQ", + "gas" : 292842, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x12a7b914" ] + }, { + "pc" : 53, + "op" : "PUSH2", + "gas" : 292839, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 56, + "op" : "JUMPI", + "gas" : 292836, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x13a" ] + }, { + "pc" : 57, + "op" : "DUP1", + "gas" : 292826, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 58, + "op" : "PUSH4", + "gas" : 292823, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 63, + "op" : "EQ", + "gas" : 292820, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x1774e646" ] + }, { + "pc" : 64, + "op" : "PUSH2", + "gas" : 292817, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 67, + "op" : "JUMPI", + "gas" : 292814, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x14c" ] + }, { + "pc" : 68, + "op" : "DUP1", + "gas" : 292804, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 69, + "op" : "PUSH4", + "gas" : 292801, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 74, + "op" : "EQ", + "gas" : 292798, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x1e26fd33" ] + }, { + "pc" : 75, + "op" : "PUSH2", + "gas" : 292795, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 78, + "op" : "JUMPI", + "gas" : 292792, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x15d" ] + }, { + "pc" : 79, + "op" : "DUP1", + "gas" : 292782, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 80, + "op" : "PUSH4", + "gas" : 292779, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 85, + "op" : "EQ", + "gas" : 292776, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x1f903037" ] + }, { + "pc" : 86, + "op" : "PUSH2", + "gas" : 292773, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 89, + "op" : "JUMPI", + "gas" : 292770, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x16e" ] + }, { + "pc" : 90, + "op" : "DUP1", + "gas" : 292760, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 91, + "op" : "PUSH4", + "gas" : 292757, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 96, + "op" : "EQ", + "gas" : 292754, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x343a875d" ] + }, { + "pc" : 97, + "op" : "PUSH2", + "gas" : 292751, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 100, + "op" : "JUMPI", + "gas" : 292748, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x180" ] + }, { + "pc" : 101, + "op" : "DUP1", + "gas" : 292738, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 102, + "op" : "PUSH4", + "gas" : 292735, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 107, + "op" : "EQ", + "gas" : 292732, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x38cc4831" ] + }, { + "pc" : 108, + "op" : "PUSH2", + "gas" : 292729, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 111, + "op" : "JUMPI", + "gas" : 292726, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x195" ] + }, { + "pc" : 112, + "op" : "DUP1", + "gas" : 292716, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 113, + "op" : "PUSH4", + "gas" : 292713, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 118, + "op" : "EQ", + "gas" : 292710, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x4e7ad367" ] + }, { + "pc" : 119, + "op" : "PUSH2", + "gas" : 292707, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 122, + "op" : "JUMPI", + "gas" : 292704, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1bd" ] + }, { + "pc" : 123, + "op" : "DUP1", + "gas" : 292694, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 124, + "op" : "PUSH4", + "gas" : 292691, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 129, + "op" : "EQ", + "gas" : 292688, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x57cb2fc4" ] + }, { + "pc" : 130, + "op" : "PUSH2", + "gas" : 292685, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 133, + "op" : "JUMPI", + "gas" : 292682, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1cb" ] + }, { + "pc" : 134, + "op" : "DUP1", + "gas" : 292672, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 135, + "op" : "PUSH4", + "gas" : 292669, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 140, + "op" : "EQ", + "gas" : 292666, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x65538c73" ] + }, { + "pc" : 141, + "op" : "PUSH2", + "gas" : 292663, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 144, + "op" : "JUMPI", + "gas" : 292660, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1e0" ] + }, { + "pc" : 145, + "op" : "DUP1", + "gas" : 292650, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 146, + "op" : "PUSH4", + "gas" : 292647, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 151, + "op" : "EQ", + "gas" : 292644, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x68895979" ] + }, { + "pc" : 152, + "op" : "PUSH2", + "gas" : 292641, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 155, + "op" : "JUMPI", + "gas" : 292638, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1ee" ] + }, { + "pc" : 156, + "op" : "DUP1", + "gas" : 292628, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 157, + "op" : "PUSH4", + "gas" : 292625, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 162, + "op" : "EQ", + "gas" : 292622, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x76bc21d9" ] + }, { + "pc" : 163, + "op" : "PUSH2", + "gas" : 292619, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 166, + "op" : "JUMPI", + "gas" : 292616, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x200" ] + }, { + "pc" : 167, + "op" : "DUP1", + "gas" : 292606, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 168, + "op" : "PUSH4", + "gas" : 292603, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 173, + "op" : "EQ", + "gas" : 292600, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x9a19a953" ] + }, { + "pc" : 174, + "op" : "PUSH2", + "gas" : 292597, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 177, + "op" : "JUMPI", + "gas" : 292594, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x20e" ] + }, { + "pc" : 178, + "op" : "DUP1", + "gas" : 292584, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 179, + "op" : "PUSH4", + "gas" : 292581, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 184, + "op" : "EQ", + "gas" : 292578, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 185, + "op" : "PUSH2", + "gas" : 292575, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x1" ] + }, { + "pc" : 188, + "op" : "JUMPI", + "gas" : 292572, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x1", "0x21f" ] + }, { + "pc" : 543, + "op" : "JUMPDEST", + "gas" : 292562, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 544, + "op" : "PUSH2", + "gas" : 292561, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 547, + "op" : "PUSH2", + "gas" : 292558, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 550, + "op" : "JUMP", + "gas" : 292555, + "gasCost" : 8, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0x693" ] + }, { + "pc" : 1683, + "op" : "JUMPDEST", + "gas" : 292547, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 1684, + "op" : "PUSH32", + "gas" : 292546, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 1717, + "op" : "PUSH1", + "gas" : 292543, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] + }, { + "pc" : 1719, + "op" : "MUL", + "gas" : 292540, + "gasCost" : 5, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0x1" ] + }, { + "pc" : 1720, + "op" : "CALLER", + "gas" : 292535, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] + }, { + "pc" : 1721, + "op" : "PUSH20", + "gas" : 292533, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" ] + }, { + "pc" : 1742, + "op" : "AND", + "gas" : 292530, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0xffffffffffffffffffffffffffffffffffffffff" ] + }, { + "pc" : 1743, + "op" : "PUSH1", + "gas" : 292527, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" ] + }, { + "pc" : 1745, + "op" : "PUSH1", + "gas" : 292524, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1" ] + }, { + "pc" : 1747, + "op" : "PUSH32", + "gas" : 292521, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0" ] + }, { + "pc" : 1780, + "op" : "DUP2", + "gas" : 292518, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1781, + "op" : "MSTORE", + "gas" : 292515, + "gasCost" : 6, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x0" ] + }, { + "pc" : 1782, + "op" : "PUSH1", + "gas" : 292509, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0" ] + }, { + "pc" : 1784, + "op" : "ADD", + "gas" : 292506, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0", "0x20" ] + }, { + "pc" : 1785, + "op" : "PUSH1", + "gas" : 292503, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20" ] + }, { + "pc" : 1787, + "op" : "DUP2", + "gas" : 292500, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20", "0x2a" ] + }, { + "pc" : 1788, + "op" : "MSTORE", + "gas" : 292497, + "gasCost" : 6, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20", "0x2a", "0x20" ] + }, { + "pc" : 1789, + "op" : "PUSH1", + "gas" : 292491, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20" ] + }, { + "pc" : 1791, + "op" : "ADD", + "gas" : 292488, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20", "0x20" ] + }, { + "pc" : 1792, + "op" : "PUSH1", + "gas" : 292485, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x40" ] + }, { + "pc" : 1794, + "op" : "LOG3", + "gas" : 292482, + "gasCost" : 2012, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x40", "0x0" ] + }, { + "pc" : 1795, + "op" : "JUMPDEST", + "gas" : 290470, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 1796, + "op" : "JUMP", + "gas" : 290469, + "gasCost" : 8, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 551, + "op" : "JUMPDEST", + "gas" : 290461, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 552, + "op" : "PUSH1", + "gas" : 290460, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 554, + "op" : "PUSH1", + "gas" : 290457, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 556, + "op" : "RETURN", + "gas" : 290454, + "gasCost" : 0, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x0" ] + } ] } }, diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStack.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStack.json index 0218602589d..bbf6e05916d 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStack.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStack.json @@ -14,1219 +14,662 @@ "jsonrpc": "2.0", "id": 1, "result": { - "gas": 23705, - "failed": false, - "returnValue": "", - "structLogs": [ - { - "pc": 0, - "op": "PUSH1", - "gas": 292887, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 2, - "op": "CALLDATALOAD", - "gas": 292884, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 3, - "op": "PUSH29", - "gas": 292881, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 33, - "op": "SWAP1", - "gas": 292878, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 34, - "op": "DIV", - "gas": 292875, - "gasCost": 5, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 35, - "op": "DUP1", - "gas": 292870, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 36, - "op": "PUSH4", - "gas": 292867, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 41, - "op": "EQ", - "gas": 292864, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 42, - "op": "PUSH2", - "gas": 292861, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 45, - "op": "JUMPI", - "gas": 292858, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 46, - "op": "DUP1", - "gas": 292848, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 47, - "op": "PUSH4", - "gas": 292845, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 52, - "op": "EQ", - "gas": 292842, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 53, - "op": "PUSH2", - "gas": 292839, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 56, - "op": "JUMPI", - "gas": 292836, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 57, - "op": "DUP1", - "gas": 292826, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 58, - "op": "PUSH4", - "gas": 292823, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 63, - "op": "EQ", - "gas": 292820, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 64, - "op": "PUSH2", - "gas": 292817, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 67, - "op": "JUMPI", - "gas": 292814, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 68, - "op": "DUP1", - "gas": 292804, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 69, - "op": "PUSH4", - "gas": 292801, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 74, - "op": "EQ", - "gas": 292798, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 75, - "op": "PUSH2", - "gas": 292795, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 78, - "op": "JUMPI", - "gas": 292792, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 79, - "op": "DUP1", - "gas": 292782, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 80, - "op": "PUSH4", - "gas": 292779, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 85, - "op": "EQ", - "gas": 292776, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 86, - "op": "PUSH2", - "gas": 292773, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 89, - "op": "JUMPI", - "gas": 292770, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 90, - "op": "DUP1", - "gas": 292760, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 91, - "op": "PUSH4", - "gas": 292757, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 96, - "op": "EQ", - "gas": 292754, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 97, - "op": "PUSH2", - "gas": 292751, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 100, - "op": "JUMPI", - "gas": 292748, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 101, - "op": "DUP1", - "gas": 292738, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 102, - "op": "PUSH4", - "gas": 292735, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 107, - "op": "EQ", - "gas": 292732, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 108, - "op": "PUSH2", - "gas": 292729, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 111, - "op": "JUMPI", - "gas": 292726, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 112, - "op": "DUP1", - "gas": 292716, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 113, - "op": "PUSH4", - "gas": 292713, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 118, - "op": "EQ", - "gas": 292710, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 119, - "op": "PUSH2", - "gas": 292707, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 122, - "op": "JUMPI", - "gas": 292704, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 123, - "op": "DUP1", - "gas": 292694, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 124, - "op": "PUSH4", - "gas": 292691, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 129, - "op": "EQ", - "gas": 292688, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 130, - "op": "PUSH2", - "gas": 292685, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 133, - "op": "JUMPI", - "gas": 292682, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 134, - "op": "DUP1", - "gas": 292672, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 135, - "op": "PUSH4", - "gas": 292669, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 140, - "op": "EQ", - "gas": 292666, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 141, - "op": "PUSH2", - "gas": 292663, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 144, - "op": "JUMPI", - "gas": 292660, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 145, - "op": "DUP1", - "gas": 292650, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 146, - "op": "PUSH4", - "gas": 292647, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 151, - "op": "EQ", - "gas": 292644, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 152, - "op": "PUSH2", - "gas": 292641, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 155, - "op": "JUMPI", - "gas": 292638, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 156, - "op": "DUP1", - "gas": 292628, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 157, - "op": "PUSH4", - "gas": 292625, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 162, - "op": "EQ", - "gas": 292622, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 163, - "op": "PUSH2", - "gas": 292619, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 166, - "op": "JUMPI", - "gas": 292616, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 167, - "op": "DUP1", - "gas": 292606, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 168, - "op": "PUSH4", - "gas": 292603, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 173, - "op": "EQ", - "gas": 292600, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 174, - "op": "PUSH2", - "gas": 292597, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 177, - "op": "JUMPI", - "gas": 292594, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 178, - "op": "DUP1", - "gas": 292584, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 179, - "op": "PUSH4", - "gas": 292581, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 184, - "op": "EQ", - "gas": 292578, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 185, - "op": "PUSH2", - "gas": 292575, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 188, - "op": "JUMPI", - "gas": 292572, - "gasCost": 10, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 543, - "op": "JUMPDEST", - "gas": 292562, - "gasCost": 1, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 544, - "op": "PUSH2", - "gas": 292561, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 547, - "op": "PUSH2", - "gas": 292558, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 550, - "op": "JUMP", - "gas": 292555, - "gasCost": 8, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1683, - "op": "JUMPDEST", - "gas": 292547, - "gasCost": 1, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1684, - "op": "PUSH32", - "gas": 292546, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1717, - "op": "PUSH1", - "gas": 292543, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1719, - "op": "MUL", - "gas": 292540, - "gasCost": 5, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1720, - "op": "CALLER", - "gas": 292535, - "gasCost": 2, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1721, - "op": "PUSH20", - "gas": 292533, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1742, - "op": "AND", - "gas": 292530, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1743, - "op": "PUSH1", - "gas": 292527, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1745, - "op": "PUSH1", - "gas": 292524, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1747, - "op": "PUSH32", - "gas": 292521, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1780, - "op": "DUP2", - "gas": 292518, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [], - "storage": {}, - "reason": null - }, - { - "pc": 1781, - "op": "MSTORE", - "gas": 292515, - "gasCost": 6, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1782, - "op": "PUSH1", - "gas": 292509, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1784, - "op": "ADD", - "gas": 292506, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1785, - "op": "PUSH1", - "gas": 292503, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1787, - "op": "DUP2", - "gas": 292500, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1788, - "op": "MSTORE", - "gas": 292497, - "gasCost": 6, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1789, - "op": "PUSH1", - "gas": 292491, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1791, - "op": "ADD", - "gas": 292488, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1792, - "op": "PUSH1", - "gas": 292485, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1794, - "op": "LOG3", - "gas": 292482, - "gasCost": 2012, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1795, - "op": "JUMPDEST", - "gas": 290470, - "gasCost": 1, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 1796, - "op": "JUMP", - "gas": 290469, - "gasCost": 8, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 551, - "op": "JUMPDEST", - "gas": 290461, - "gasCost": 1, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 552, - "op": "PUSH1", - "gas": 290460, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 554, - "op": "PUSH1", - "gas": 290457, - "gasCost": 3, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - }, - { - "pc": 556, - "op": "RETURN", - "gas": 290454, - "gasCost": 0, - "depth": 1, - "stack": null, - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": {}, - "reason": null - } + "gas" : 23705, + "failed" : false, + "returnValue" : "", + "structLogs" : [ { + "pc" : 0, + "op" : "PUSH1", + "gas" : 292887, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 2, + "op" : "CALLDATALOAD", + "gas" : 292884, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 3, + "op" : "PUSH29", + "gas" : 292881, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 33, + "op" : "SWAP1", + "gas" : 292878, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 34, + "op" : "DIV", + "gas" : 292875, + "gasCost" : 5, + "depth" : 1 + }, { + "pc" : 35, + "op" : "DUP1", + "gas" : 292870, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 36, + "op" : "PUSH4", + "gas" : 292867, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 41, + "op" : "EQ", + "gas" : 292864, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 42, + "op" : "PUSH2", + "gas" : 292861, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 45, + "op" : "JUMPI", + "gas" : 292858, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 46, + "op" : "DUP1", + "gas" : 292848, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 47, + "op" : "PUSH4", + "gas" : 292845, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 52, + "op" : "EQ", + "gas" : 292842, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 53, + "op" : "PUSH2", + "gas" : 292839, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 56, + "op" : "JUMPI", + "gas" : 292836, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 57, + "op" : "DUP1", + "gas" : 292826, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 58, + "op" : "PUSH4", + "gas" : 292823, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 63, + "op" : "EQ", + "gas" : 292820, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 64, + "op" : "PUSH2", + "gas" : 292817, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 67, + "op" : "JUMPI", + "gas" : 292814, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 68, + "op" : "DUP1", + "gas" : 292804, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 69, + "op" : "PUSH4", + "gas" : 292801, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 74, + "op" : "EQ", + "gas" : 292798, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 75, + "op" : "PUSH2", + "gas" : 292795, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 78, + "op" : "JUMPI", + "gas" : 292792, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 79, + "op" : "DUP1", + "gas" : 292782, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 80, + "op" : "PUSH4", + "gas" : 292779, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 85, + "op" : "EQ", + "gas" : 292776, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 86, + "op" : "PUSH2", + "gas" : 292773, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 89, + "op" : "JUMPI", + "gas" : 292770, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 90, + "op" : "DUP1", + "gas" : 292760, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 91, + "op" : "PUSH4", + "gas" : 292757, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 96, + "op" : "EQ", + "gas" : 292754, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 97, + "op" : "PUSH2", + "gas" : 292751, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 100, + "op" : "JUMPI", + "gas" : 292748, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 101, + "op" : "DUP1", + "gas" : 292738, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 102, + "op" : "PUSH4", + "gas" : 292735, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 107, + "op" : "EQ", + "gas" : 292732, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 108, + "op" : "PUSH2", + "gas" : 292729, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 111, + "op" : "JUMPI", + "gas" : 292726, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 112, + "op" : "DUP1", + "gas" : 292716, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 113, + "op" : "PUSH4", + "gas" : 292713, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 118, + "op" : "EQ", + "gas" : 292710, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 119, + "op" : "PUSH2", + "gas" : 292707, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 122, + "op" : "JUMPI", + "gas" : 292704, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 123, + "op" : "DUP1", + "gas" : 292694, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 124, + "op" : "PUSH4", + "gas" : 292691, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 129, + "op" : "EQ", + "gas" : 292688, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 130, + "op" : "PUSH2", + "gas" : 292685, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 133, + "op" : "JUMPI", + "gas" : 292682, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 134, + "op" : "DUP1", + "gas" : 292672, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 135, + "op" : "PUSH4", + "gas" : 292669, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 140, + "op" : "EQ", + "gas" : 292666, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 141, + "op" : "PUSH2", + "gas" : 292663, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 144, + "op" : "JUMPI", + "gas" : 292660, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 145, + "op" : "DUP1", + "gas" : 292650, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 146, + "op" : "PUSH4", + "gas" : 292647, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 151, + "op" : "EQ", + "gas" : 292644, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 152, + "op" : "PUSH2", + "gas" : 292641, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 155, + "op" : "JUMPI", + "gas" : 292638, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 156, + "op" : "DUP1", + "gas" : 292628, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 157, + "op" : "PUSH4", + "gas" : 292625, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 162, + "op" : "EQ", + "gas" : 292622, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 163, + "op" : "PUSH2", + "gas" : 292619, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 166, + "op" : "JUMPI", + "gas" : 292616, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 167, + "op" : "DUP1", + "gas" : 292606, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 168, + "op" : "PUSH4", + "gas" : 292603, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 173, + "op" : "EQ", + "gas" : 292600, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 174, + "op" : "PUSH2", + "gas" : 292597, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 177, + "op" : "JUMPI", + "gas" : 292594, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 178, + "op" : "DUP1", + "gas" : 292584, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 179, + "op" : "PUSH4", + "gas" : 292581, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 184, + "op" : "EQ", + "gas" : 292578, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 185, + "op" : "PUSH2", + "gas" : 292575, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 188, + "op" : "JUMPI", + "gas" : 292572, + "gasCost" : 10, + "depth" : 1 + }, { + "pc" : 543, + "op" : "JUMPDEST", + "gas" : 292562, + "gasCost" : 1, + "depth" : 1 + }, { + "pc" : 544, + "op" : "PUSH2", + "gas" : 292561, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 547, + "op" : "PUSH2", + "gas" : 292558, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 550, + "op" : "JUMP", + "gas" : 292555, + "gasCost" : 8, + "depth" : 1 + }, { + "pc" : 1683, + "op" : "JUMPDEST", + "gas" : 292547, + "gasCost" : 1, + "depth" : 1 + }, { + "pc" : 1684, + "op" : "PUSH32", + "gas" : 292546, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 1717, + "op" : "PUSH1", + "gas" : 292543, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 1719, + "op" : "MUL", + "gas" : 292540, + "gasCost" : 5, + "depth" : 1 + }, { + "pc" : 1720, + "op" : "CALLER", + "gas" : 292535, + "gasCost" : 2, + "depth" : 1 + }, { + "pc" : 1721, + "op" : "PUSH20", + "gas" : 292533, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 1742, + "op" : "AND", + "gas" : 292530, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 1743, + "op" : "PUSH1", + "gas" : 292527, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 1745, + "op" : "PUSH1", + "gas" : 292524, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 1747, + "op" : "PUSH32", + "gas" : 292521, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 1780, + "op" : "DUP2", + "gas" : 292518, + "gasCost" : 3, + "depth" : 1 + }, { + "pc" : 1781, + "op" : "MSTORE", + "gas" : 292515, + "gasCost" : 6, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1782, + "op" : "PUSH1", + "gas" : 292509, + "gasCost" : 3, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1784, + "op" : "ADD", + "gas" : 292506, + "gasCost" : 3, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1785, + "op" : "PUSH1", + "gas" : 292503, + "gasCost" : 3, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1787, + "op" : "DUP2", + "gas" : 292500, + "gasCost" : 3, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1788, + "op" : "MSTORE", + "gas" : 292497, + "gasCost" : 6, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1789, + "op" : "PUSH1", + "gas" : 292491, + "gasCost" : 3, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1791, + "op" : "ADD", + "gas" : 292488, + "gasCost" : 3, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1792, + "op" : "PUSH1", + "gas" : 292485, + "gasCost" : 3, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1794, + "op" : "LOG3", + "gas" : 292482, + "gasCost" : 2012, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1795, + "op" : "JUMPDEST", + "gas" : 290470, + "gasCost" : 1, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1796, + "op" : "JUMP", + "gas" : 290469, + "gasCost" : 8, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 551, + "op" : "JUMPDEST", + "gas" : 290461, + "gasCost" : 1, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 552, + "op" : "PUSH1", + "gas" : 290460, + "gasCost" : 3, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 554, + "op" : "PUSH1", + "gas" : 290457, + "gasCost" : 3, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 556, + "op" : "RETURN", + "gas" : 290454, + "gasCost" : 0, + "depth" : 1, + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + } ] } }, diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStorage.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStorage.json index c0e2f0f2f06..7302c10fefd 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStorage.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/debug/trace-transaction/debug_traceTransaction_disableStorage.json @@ -14,1615 +14,768 @@ "jsonrpc": "2.0", "id": 1, "result": { - "gas": 23705, - "failed": false, - "returnValue": "", - "structLogs": [ - { - "pc": 0, - "op": "PUSH1", - "gas": 292887, - "gasCost": 3, - "depth": 1, - "stack": [], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 2, - "op": "CALLDATALOAD", - "gas": 292884, - "gasCost": 3, - "depth": 1, - "stack": [ - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 3, - "op": "PUSH29", - "gas": 292881, - "gasCost": 3, - "depth": 1, - "stack": [ - "9dc2c8f500000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 33, - "op": "SWAP1", - "gas": 292878, - "gasCost": 3, - "depth": 1, - "stack": [ - "9dc2c8f500000000000000000000000000000000000000000000000000000000", - "0000000100000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 34, - "op": "DIV", - "gas": 292875, - "gasCost": 5, - "depth": 1, - "stack": [ - "0000000100000000000000000000000000000000000000000000000000000000", - "9dc2c8f500000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 35, - "op": "DUP1", - "gas": 292870, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 36, - "op": "PUSH4", - "gas": 292867, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 41, - "op": "EQ", - "gas": 292864, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "00000000000000000000000000000000000000000000000000000000102accc1" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 42, - "op": "PUSH2", - "gas": 292861, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 45, - "op": "JUMPI", - "gas": 292858, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000012c" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 46, - "op": "DUP1", - "gas": 292848, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 47, - "op": "PUSH4", - "gas": 292845, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 52, - "op": "EQ", - "gas": 292842, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000012a7b914" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 53, - "op": "PUSH2", - "gas": 292839, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 56, - "op": "JUMPI", - "gas": 292836, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000013a" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 57, - "op": "DUP1", - "gas": 292826, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 58, - "op": "PUSH4", - "gas": 292823, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 63, - "op": "EQ", - "gas": 292820, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000001774e646" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 64, - "op": "PUSH2", - "gas": 292817, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 67, - "op": "JUMPI", - "gas": 292814, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000014c" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 68, - "op": "DUP1", - "gas": 292804, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 69, - "op": "PUSH4", - "gas": 292801, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 74, - "op": "EQ", - "gas": 292798, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000001e26fd33" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 75, - "op": "PUSH2", - "gas": 292795, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 78, - "op": "JUMPI", - "gas": 292792, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000015d" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 79, - "op": "DUP1", - "gas": 292782, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 80, - "op": "PUSH4", - "gas": 292779, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 85, - "op": "EQ", - "gas": 292776, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000001f903037" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 86, - "op": "PUSH2", - "gas": 292773, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 89, - "op": "JUMPI", - "gas": 292770, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000016e" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 90, - "op": "DUP1", - "gas": 292760, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 91, - "op": "PUSH4", - "gas": 292757, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 96, - "op": "EQ", - "gas": 292754, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "00000000000000000000000000000000000000000000000000000000343a875d" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 97, - "op": "PUSH2", - "gas": 292751, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 100, - "op": "JUMPI", - "gas": 292748, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000180" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 101, - "op": "DUP1", - "gas": 292738, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 102, - "op": "PUSH4", - "gas": 292735, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 107, - "op": "EQ", - "gas": 292732, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000038cc4831" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 108, - "op": "PUSH2", - "gas": 292729, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 111, - "op": "JUMPI", - "gas": 292726, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000195" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 112, - "op": "DUP1", - "gas": 292716, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 113, - "op": "PUSH4", - "gas": 292713, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 118, - "op": "EQ", - "gas": 292710, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000004e7ad367" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 119, - "op": "PUSH2", - "gas": 292707, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 122, - "op": "JUMPI", - "gas": 292704, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001bd" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 123, - "op": "DUP1", - "gas": 292694, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 124, - "op": "PUSH4", - "gas": 292691, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 129, - "op": "EQ", - "gas": 292688, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000057cb2fc4" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 130, - "op": "PUSH2", - "gas": 292685, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 133, - "op": "JUMPI", - "gas": 292682, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001cb" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 134, - "op": "DUP1", - "gas": 292672, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 135, - "op": "PUSH4", - "gas": 292669, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 140, - "op": "EQ", - "gas": 292666, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000065538c73" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 141, - "op": "PUSH2", - "gas": 292663, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 144, - "op": "JUMPI", - "gas": 292660, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001e0" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 145, - "op": "DUP1", - "gas": 292650, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 146, - "op": "PUSH4", - "gas": 292647, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 151, - "op": "EQ", - "gas": 292644, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000068895979" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 152, - "op": "PUSH2", - "gas": 292641, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 155, - "op": "JUMPI", - "gas": 292638, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "00000000000000000000000000000000000000000000000000000000000001ee" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 156, - "op": "DUP1", - "gas": 292628, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 157, - "op": "PUSH4", - "gas": 292625, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 162, - "op": "EQ", - "gas": 292622, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000076bc21d9" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 163, - "op": "PUSH2", - "gas": 292619, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 166, - "op": "JUMPI", - "gas": 292616, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000200" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 167, - "op": "DUP1", - "gas": 292606, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 168, - "op": "PUSH4", - "gas": 292603, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 173, - "op": "EQ", - "gas": 292600, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009a19a953" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 174, - "op": "PUSH2", - "gas": 292597, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 177, - "op": "JUMPI", - "gas": 292594, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "000000000000000000000000000000000000000000000000000000000000020e" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 178, - "op": "DUP1", - "gas": 292584, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 179, - "op": "PUSH4", - "gas": 292581, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 184, - "op": "EQ", - "gas": 292578, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 185, - "op": "PUSH2", - "gas": 292575, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 188, - "op": "JUMPI", - "gas": 292572, - "gasCost": 10, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000001", - "000000000000000000000000000000000000000000000000000000000000021f" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 543, - "op": "JUMPDEST", - "gas": 292562, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 544, - "op": "PUSH2", - "gas": 292561, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 547, - "op": "PUSH2", - "gas": 292558, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 550, - "op": "JUMP", - "gas": 292555, - "gasCost": 8, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "0000000000000000000000000000000000000000000000000000000000000693" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1683, - "op": "JUMPDEST", - "gas": 292547, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1684, - "op": "PUSH32", - "gas": 292546, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1717, - "op": "PUSH1", - "gas": 292543, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1719, - "op": "MUL", - "gas": 292540, - "gasCost": 5, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1720, - "op": "CALLER", - "gas": 292535, - "gasCost": 2, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1721, - "op": "PUSH20", - "gas": 292533, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1742, - "op": "AND", - "gas": 292530, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "000000000000000000000000ffffffffffffffffffffffffffffffffffffffff" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1743, - "op": "PUSH1", - "gas": 292527, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1745, - "op": "PUSH1", - "gas": 292524, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1747, - "op": "PUSH32", - "gas": 292521, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1780, - "op": "DUP2", - "gas": 292518, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "memory": [], - "storage": null, - "reason": null - }, - { - "pc": 1781, - "op": "MSTORE", - "gas": 292515, - "gasCost": 6, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": null, - "reason": null - }, - { - "pc": 1782, - "op": "PUSH1", - "gas": 292509, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": null, - "reason": null - }, - { - "pc": 1784, - "op": "ADD", - "gas": 292506, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": null, - "reason": null - }, - { - "pc": 1785, - "op": "PUSH1", - "gas": 292503, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": null, - "reason": null - }, - { - "pc": 1787, - "op": "DUP2", - "gas": 292500, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" - ], - "storage": null, - "reason": null - }, - { - "pc": 1788, - "op": "MSTORE", - "gas": 292497, - "gasCost": 6, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020", - "000000000000000000000000000000000000000000000000000000000000002a", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 1789, - "op": "PUSH1", - "gas": 292491, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 1791, - "op": "ADD", - "gas": 292488, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000020", - "0000000000000000000000000000000000000000000000000000000000000020" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 1792, - "op": "PUSH1", - "gas": 292485, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000040" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 1794, - "op": "LOG3", - "gas": 292482, - "gasCost": 2012, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227", - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", - "000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000040", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 1795, - "op": "JUMPDEST", - "gas": 290470, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 1796, - "op": "JUMP", - "gas": 290469, - "gasCost": 8, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000227" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 551, - "op": "JUMPDEST", - "gas": 290461, - "gasCost": 1, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 552, - "op": "PUSH1", - "gas": 290460, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 554, - "op": "PUSH1", - "gas": 290457, - "gasCost": 3, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - }, - { - "pc": 556, - "op": "RETURN", - "gas": 290454, - "gasCost": 0, - "depth": 1, - "stack": [ - "000000000000000000000000000000000000000000000000000000009dc2c8f5", - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000000" - ], - "memory": [ - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", - "000000000000000000000000000000000000000000000000000000000000002a" - ], - "storage": null, - "reason": null - } + "gas" : 23705, + "failed" : false, + "returnValue" : "", + "structLogs" : [ { + "pc" : 0, + "op" : "PUSH1", + "gas" : 292887, + "gasCost" : 3, + "depth" : 1, + "stack" : [ ] + }, { + "pc" : 2, + "op" : "CALLDATALOAD", + "gas" : 292884, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x0" ] + }, { + "pc" : 3, + "op" : "PUSH29", + "gas" : 292881, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f500000000000000000000000000000000000000000000000000000000" ] + }, { + "pc" : 33, + "op" : "SWAP1", + "gas" : 292878, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f500000000000000000000000000000000000000000000000000000000", "0x100000000000000000000000000000000000000000000000000000000" ] + }, { + "pc" : 34, + "op" : "DIV", + "gas" : 292875, + "gasCost" : 5, + "depth" : 1, + "stack" : [ "0x100000000000000000000000000000000000000000000000000000000", "0x9dc2c8f500000000000000000000000000000000000000000000000000000000" ] + }, { + "pc" : 35, + "op" : "DUP1", + "gas" : 292870, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 36, + "op" : "PUSH4", + "gas" : 292867, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 41, + "op" : "EQ", + "gas" : 292864, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x102accc1" ] + }, { + "pc" : 42, + "op" : "PUSH2", + "gas" : 292861, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 45, + "op" : "JUMPI", + "gas" : 292858, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x12c" ] + }, { + "pc" : 46, + "op" : "DUP1", + "gas" : 292848, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 47, + "op" : "PUSH4", + "gas" : 292845, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 52, + "op" : "EQ", + "gas" : 292842, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x12a7b914" ] + }, { + "pc" : 53, + "op" : "PUSH2", + "gas" : 292839, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 56, + "op" : "JUMPI", + "gas" : 292836, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x13a" ] + }, { + "pc" : 57, + "op" : "DUP1", + "gas" : 292826, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 58, + "op" : "PUSH4", + "gas" : 292823, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 63, + "op" : "EQ", + "gas" : 292820, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x1774e646" ] + }, { + "pc" : 64, + "op" : "PUSH2", + "gas" : 292817, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 67, + "op" : "JUMPI", + "gas" : 292814, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x14c" ] + }, { + "pc" : 68, + "op" : "DUP1", + "gas" : 292804, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 69, + "op" : "PUSH4", + "gas" : 292801, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 74, + "op" : "EQ", + "gas" : 292798, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x1e26fd33" ] + }, { + "pc" : 75, + "op" : "PUSH2", + "gas" : 292795, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 78, + "op" : "JUMPI", + "gas" : 292792, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x15d" ] + }, { + "pc" : 79, + "op" : "DUP1", + "gas" : 292782, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 80, + "op" : "PUSH4", + "gas" : 292779, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 85, + "op" : "EQ", + "gas" : 292776, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x1f903037" ] + }, { + "pc" : 86, + "op" : "PUSH2", + "gas" : 292773, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 89, + "op" : "JUMPI", + "gas" : 292770, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x16e" ] + }, { + "pc" : 90, + "op" : "DUP1", + "gas" : 292760, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 91, + "op" : "PUSH4", + "gas" : 292757, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 96, + "op" : "EQ", + "gas" : 292754, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x343a875d" ] + }, { + "pc" : 97, + "op" : "PUSH2", + "gas" : 292751, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 100, + "op" : "JUMPI", + "gas" : 292748, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x180" ] + }, { + "pc" : 101, + "op" : "DUP1", + "gas" : 292738, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 102, + "op" : "PUSH4", + "gas" : 292735, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 107, + "op" : "EQ", + "gas" : 292732, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x38cc4831" ] + }, { + "pc" : 108, + "op" : "PUSH2", + "gas" : 292729, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 111, + "op" : "JUMPI", + "gas" : 292726, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x195" ] + }, { + "pc" : 112, + "op" : "DUP1", + "gas" : 292716, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 113, + "op" : "PUSH4", + "gas" : 292713, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 118, + "op" : "EQ", + "gas" : 292710, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x4e7ad367" ] + }, { + "pc" : 119, + "op" : "PUSH2", + "gas" : 292707, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 122, + "op" : "JUMPI", + "gas" : 292704, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1bd" ] + }, { + "pc" : 123, + "op" : "DUP1", + "gas" : 292694, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 124, + "op" : "PUSH4", + "gas" : 292691, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 129, + "op" : "EQ", + "gas" : 292688, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x57cb2fc4" ] + }, { + "pc" : 130, + "op" : "PUSH2", + "gas" : 292685, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 133, + "op" : "JUMPI", + "gas" : 292682, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1cb" ] + }, { + "pc" : 134, + "op" : "DUP1", + "gas" : 292672, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 135, + "op" : "PUSH4", + "gas" : 292669, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 140, + "op" : "EQ", + "gas" : 292666, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x65538c73" ] + }, { + "pc" : 141, + "op" : "PUSH2", + "gas" : 292663, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 144, + "op" : "JUMPI", + "gas" : 292660, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1e0" ] + }, { + "pc" : 145, + "op" : "DUP1", + "gas" : 292650, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 146, + "op" : "PUSH4", + "gas" : 292647, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 151, + "op" : "EQ", + "gas" : 292644, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x68895979" ] + }, { + "pc" : 152, + "op" : "PUSH2", + "gas" : 292641, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 155, + "op" : "JUMPI", + "gas" : 292638, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x1ee" ] + }, { + "pc" : 156, + "op" : "DUP1", + "gas" : 292628, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 157, + "op" : "PUSH4", + "gas" : 292625, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 162, + "op" : "EQ", + "gas" : 292622, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x76bc21d9" ] + }, { + "pc" : 163, + "op" : "PUSH2", + "gas" : 292619, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 166, + "op" : "JUMPI", + "gas" : 292616, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x200" ] + }, { + "pc" : 167, + "op" : "DUP1", + "gas" : 292606, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 168, + "op" : "PUSH4", + "gas" : 292603, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 173, + "op" : "EQ", + "gas" : 292600, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x9a19a953" ] + }, { + "pc" : 174, + "op" : "PUSH2", + "gas" : 292597, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ] + }, { + "pc" : 177, + "op" : "JUMPI", + "gas" : 292594, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x20e" ] + }, { + "pc" : 178, + "op" : "DUP1", + "gas" : 292584, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 179, + "op" : "PUSH4", + "gas" : 292581, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 184, + "op" : "EQ", + "gas" : 292578, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x9dc2c8f5", "0x9dc2c8f5" ] + }, { + "pc" : 185, + "op" : "PUSH2", + "gas" : 292575, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x1" ] + }, { + "pc" : 188, + "op" : "JUMPI", + "gas" : 292572, + "gasCost" : 10, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x1", "0x21f" ] + }, { + "pc" : 543, + "op" : "JUMPDEST", + "gas" : 292562, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 544, + "op" : "PUSH2", + "gas" : 292561, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ] + }, { + "pc" : 547, + "op" : "PUSH2", + "gas" : 292558, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 550, + "op" : "JUMP", + "gas" : 292555, + "gasCost" : 8, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0x693" ] + }, { + "pc" : 1683, + "op" : "JUMPDEST", + "gas" : 292547, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 1684, + "op" : "PUSH32", + "gas" : 292546, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ] + }, { + "pc" : 1717, + "op" : "PUSH1", + "gas" : 292543, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] + }, { + "pc" : 1719, + "op" : "MUL", + "gas" : 292540, + "gasCost" : 5, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0x1" ] + }, { + "pc" : 1720, + "op" : "CALLER", + "gas" : 292535, + "gasCost" : 2, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] + }, { + "pc" : 1721, + "op" : "PUSH20", + "gas" : 292533, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" ] + }, { + "pc" : 1742, + "op" : "AND", + "gas" : 292530, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0xffffffffffffffffffffffffffffffffffffffff" ] + }, { + "pc" : 1743, + "op" : "PUSH1", + "gas" : 292527, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" ] + }, { + "pc" : 1745, + "op" : "PUSH1", + "gas" : 292524, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1" ] + }, { + "pc" : 1747, + "op" : "PUSH32", + "gas" : 292521, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0" ] + }, { + "pc" : 1780, + "op" : "DUP2", + "gas" : 292518, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1781, + "op" : "MSTORE", + "gas" : 292515, + "gasCost" : 6, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x0" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1782, + "op" : "PUSH1", + "gas" : 292509, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1784, + "op" : "ADD", + "gas" : 292506, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x0", "0x20" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1785, + "op" : "PUSH1", + "gas" : 292503, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1787, + "op" : "DUP2", + "gas" : 292500, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20", "0x2a" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9" ] + }, { + "pc" : 1788, + "op" : "MSTORE", + "gas" : 292497, + "gasCost" : 6, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20", "0x2a", "0x20" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1789, + "op" : "PUSH1", + "gas" : 292491, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1791, + "op" : "ADD", + "gas" : 292488, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x20", "0x20" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1792, + "op" : "PUSH1", + "gas" : 292485, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x40" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1794, + "op" : "LOG3", + "gas" : 292482, + "gasCost" : 2012, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x1", "0x40", "0x0" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1795, + "op" : "JUMPDEST", + "gas" : 290470, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 1796, + "op" : "JUMP", + "gas" : 290469, + "gasCost" : 8, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x227" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 551, + "op" : "JUMPDEST", + "gas" : 290461, + "gasCost" : 1, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 552, + "op" : "PUSH1", + "gas" : 290460, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 554, + "op" : "PUSH1", + "gas" : 290457, + "gasCost" : 3, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + }, { + "pc" : 556, + "op" : "RETURN", + "gas" : 290454, + "gasCost" : 0, + "depth" : 1, + "stack" : [ "0x9dc2c8f5", "0x0", "0x0" ], + "memory" : [ "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9", "0x2a" ] + } ] } }, diff --git a/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java b/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java index 6ea4a25f5fa..e465981a86d 100644 --- a/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java +++ b/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java @@ -153,7 +153,7 @@ public void shouldTraceSStoreOperation() { // No storage changes before the SSTORE call. TraceFrame frame = tracer.getTraceFrames().get(170); assertThat(frame.getOpcode()).isEqualTo("DUP6"); - assertStorageContainsExactly(frame); + //assertStorageContainsExactly(frame); // Storage changes show up in the SSTORE frame. frame = tracer.getTraceFrames().get(171); @@ -201,8 +201,6 @@ public void shouldTraceContractCreation() { assertThat(frame.getOpcode()).isEqualTo("PUSH1"); assertThat(frame.getPc()).isEqualTo(0); assertStackContainsExactly(frame); - assertMemoryContainsExactly(frame); - assertStorageContainsExactly(frame); frame = traceFrames.get(1); assertThat(frame.getDepth()).isEqualTo(expectedDepth); @@ -211,8 +209,6 @@ public void shouldTraceContractCreation() { assertThat(frame.getOpcode()).isEqualTo("PUSH1"); assertThat(frame.getPc()).isEqualTo(2); assertStackContainsExactly(frame, "0x80"); - assertMemoryContainsExactly(frame); - assertStorageContainsExactly(frame); frame = traceFrames.get(2); assertThat(frame.getDepth()).isEqualTo(expectedDepth); @@ -226,7 +222,6 @@ public void shouldTraceContractCreation() { "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000080"); - assertStorageContainsExactly(frame); // Reference implementation actually records the memory after expansion but before the store. // assertMemoryContainsExactly(frame, // "0000000000000000000000000000000000000000000000000000000000000000", @@ -245,7 +240,6 @@ public void shouldTraceContractCreation() { "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000080"); - assertStorageContainsExactly(frame); } private void assertStackContainsExactly( From 846bfd719d9785b22259b83ea8f3e78bccddd9f1 Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Fri, 3 Jan 2025 16:44:35 +0100 Subject: [PATCH 05/13] Spotless Signed-off-by: Ameziane H. --- .../jsonrpc/internal/methods/DebugTraceTransactionTest.java | 3 +-- .../besu/ethereum/vm/TraceTransactionIntegrationTest.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) 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 19f49cdf179..107abf5b2d4 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 @@ -165,8 +165,7 @@ public void shouldTraceTheTransactionUsingTheTransactionTracer() { assertThat(transactionResult.getStructLogs().size()).isEqualTo(1); assertThat(transactionResult.getStructLogs().get(0).stack().length).isEqualTo(1); assertThat(transactionResult.getStructLogs().get(0).stack()[0]) - .isEqualTo( - StructLog.toCompactHex(stackBytes[0], true)); + .isEqualTo(StructLog.toCompactHex(stackBytes[0], true)); assertThat(transactionResult.getStructLogs().get(0).memory().length).isEqualTo(1); assertThat(transactionResult.getStructLogs().get(0).memory()[0]) .isEqualTo(StructLog.toCompactHex(memoryBytes[0], true)); diff --git a/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java b/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java index e465981a86d..655ccda796b 100644 --- a/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java +++ b/ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/vm/TraceTransactionIntegrationTest.java @@ -153,7 +153,6 @@ public void shouldTraceSStoreOperation() { // No storage changes before the SSTORE call. TraceFrame frame = tracer.getTraceFrames().get(170); assertThat(frame.getOpcode()).isEqualTo("DUP6"); - //assertStorageContainsExactly(frame); // Storage changes show up in the SSTORE frame. frame = tracer.getTraceFrames().get(171); From e080e99716b62a40c9ed6dfbd5eb813a47291c3f Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Fri, 3 Jan 2025 17:16:05 +0100 Subject: [PATCH 06/13] Fix unit tests Signed-off-by: Ameziane H. --- .../debug/trace-call/debug_traceCall_all.json | 162 +++--------------- .../trace-call/debug_traceCall_complete.json | 135 +++------------ .../debug_traceCall_disableMemory.json | 135 +++------------ .../debug_traceCall_disableStack.json | 148 +++------------- .../debug_traceCall_disableStorage.json | 147 +++++----------- .../debug_traceCall_noGasPrice.json | 26 ++- 6 files changed, 158 insertions(+), 595 deletions(-) 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 69d19bb5e6d..34a3fecb9d1 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 @@ -28,271 +28,163 @@ "op" : "PUSH1", "gas" : 16755910, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 2, "op" : "PUSH1", "gas" : 16755907, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 4, "op" : "PUSH1", "gas" : 16755904, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 6, "op" : "CALLDATASIZE", "gas" : 16755901, "gasCost" : 2, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 7, "op" : "SUB", "gas" : 16755899, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 8, "op" : "DUP1", "gas" : 16755896, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 9, "op" : "PUSH1", "gas" : 16755893, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 11, "op" : "PUSH1", "gas" : 16755890, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 13, "op" : "CALLDATACOPY", "gas" : 16755887, "gasCost" : 9, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 14, "op" : "PUSH1", "gas" : 16755878, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 16, "op" : "CALLVALUE", "gas" : 16755875, "gasCost" : 2, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 17, "op" : "PUSH1", "gas" : 16755873, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 19, "op" : "CALLDATALOAD", "gas" : 16755870, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 20, "op" : "GAS", "gas" : 16755867, "gasCost" : 2, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 21, "op" : "CALLCODE", "gas" : 16755865, "gasCost" : 16494066, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 0, "op" : "PUSH1", "gas" : 16493366, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 2 }, { "pc" : 2, "op" : "CALLDATALOAD", "gas" : 16493363, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 2 }, { "pc" : 3, "op" : "PUSH1", "gas" : 16493360, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 2 }, { "pc" : 5, "op" : "ADD", "gas" : 16493357, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 2 }, { "pc" : 6, "op" : "PUSH1", "gas" : 16493354, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 2 }, { "pc" : 8, "op" : "MSTORE", "gas" : 16493351, "gasCost" : 6, - "depth" : 2, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 2 }, { "pc" : 9, "op" : "PUSH1", "gas" : 16493345, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 2 }, { "pc" : 11, "op" : "PUSH1", "gas" : 16493342, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 2 }, { "pc" : 13, "op" : "RETURN", "gas" : 16493339, "gasCost" : 0, - "depth" : 2, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 2 }, { "pc" : 22, "op" : "PUSH1", "gas" : 16755138, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 24, "op" : "PUSH1", "gas" : 16755135, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 }, { "pc" : 26, "op" : "RETURN", "gas" : 16755132, "gasCost" : 0, - "depth" : 1, - "stack" : null, - "memory" : null, - "storage" : null, - "reason" : null + "depth" : 1 } ] } }, 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 index fb84953c078..286cd61d1bd 100644 --- 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 @@ -26,270 +26,189 @@ "gas" : 16755910, "gasCost" : 3, "depth" : 1, - "stack" : [ ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ ] }, { "pc" : 2, "op" : "PUSH1", "gas" : 16755907, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20" ] }, { "pc" : 4, "op" : "PUSH1", "gas" : 16755904, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0" ] }, { "pc" : 6, "op" : "CALLDATASIZE", "gas" : 16755901, "gasCost" : 2, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20" ] }, { "pc" : 7, "op" : "SUB", "gas" : 16755899, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000040" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x40" ] }, { "pc" : 8, "op" : "DUP1", "gas" : 16755896, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20" ] }, { "pc" : 9, "op" : "PUSH1", "gas" : 16755893, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x20" ] }, { "pc" : 11, "op" : "PUSH1", "gas" : 16755890, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20" ] }, { "pc" : 13, "op" : "CALLDATACOPY", "gas" : 16755887, "gasCost" : 9, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20", "0x0" ] }, { "pc" : 14, "op" : "PUSH1", "gas" : 16755878, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20" ] }, { "pc" : 16, "op" : "CALLVALUE", "gas" : 16755875, "gasCost" : 2, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0" ] }, { "pc" : 17, "op" : "PUSH1", "gas" : 16755873, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0" ] }, { "pc" : 19, "op" : "CALLDATALOAD", "gas" : 16755870, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x0" ] }, { "pc" : 20, "op" : "GAS", "gas" : 16755867, "gasCost" : 2, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000" ] }, { "pc" : 21, "op" : "CALLCODE", "gas" : 16755865, "gasCost" : 16494066, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000ffac99" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000", "0xffac99" ] }, { "pc" : 0, "op" : "PUSH1", "gas" : 16493366, "gasCost" : 3, "depth" : 2, - "stack" : [ ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ ] }, { "pc" : 2, "op" : "CALLDATALOAD", "gas" : 16493363, "gasCost" : 3, "depth" : 2, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0x0" ] }, { "pc" : 3, "op" : "PUSH1", "gas" : 16493360, "gasCost" : 3, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 5, "op" : "ADD", "gas" : 16493357, "gasCost" : 3, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000001" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001", "0x1" ] }, { "pc" : 6, "op" : "PUSH1", "gas" : 16493354, "gasCost" : 3, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "memory" : [ ], - "storage" : { }, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 8, "op" : "MSTORE", "gas" : 16493351, "gasCost" : 6, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002", "0x0" ] }, { "pc" : 9, "op" : "PUSH1", "gas" : 16493345, "gasCost" : 3, "depth" : 2, - "stack" : [ ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "stack" : [ ] }, { "pc" : 11, "op" : "PUSH1", "gas" : 16493342, "gasCost" : 3, "depth" : 2, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20" ] }, { "pc" : 13, "op" : "RETURN", "gas" : 16493339, "gasCost" : 0, "depth" : 2, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0" ] }, { "pc" : 22, "op" : "PUSH1", "gas" : 16755138, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x1" ] }, { "pc" : 24, "op" : "PUSH1", "gas" : 16755135, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x1", "0x20" ] }, { "pc" : 26, "op" : "RETURN", "gas" : 16755132, "gasCost" : 0, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "stack" : [ "0x1", "0x20", "0x0" ] } ] } }, 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 73b391f022a..d19605c5a03 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 @@ -29,270 +29,189 @@ "gas" : 16755910, "gasCost" : 3, "depth" : 1, - "stack" : [ ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ ] }, { "pc" : 2, "op" : "PUSH1", "gas" : 16755907, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20" ] }, { "pc" : 4, "op" : "PUSH1", "gas" : 16755904, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0" ] }, { "pc" : 6, "op" : "CALLDATASIZE", "gas" : 16755901, "gasCost" : 2, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20" ] }, { "pc" : 7, "op" : "SUB", "gas" : 16755899, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000040" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x40" ] }, { "pc" : 8, "op" : "DUP1", "gas" : 16755896, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20" ] }, { "pc" : 9, "op" : "PUSH1", "gas" : 16755893, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x20" ] }, { "pc" : 11, "op" : "PUSH1", "gas" : 16755890, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20" ] }, { "pc" : 13, "op" : "CALLDATACOPY", "gas" : 16755887, "gasCost" : 9, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20", "0x0" ] }, { "pc" : 14, "op" : "PUSH1", "gas" : 16755878, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20" ] }, { "pc" : 16, "op" : "CALLVALUE", "gas" : 16755875, "gasCost" : 2, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0" ] }, { "pc" : 17, "op" : "PUSH1", "gas" : 16755873, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0" ] }, { "pc" : 19, "op" : "CALLDATALOAD", "gas" : 16755870, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x0" ] }, { "pc" : 20, "op" : "GAS", "gas" : 16755867, "gasCost" : 2, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000" ] }, { "pc" : 21, "op" : "CALLCODE", "gas" : 16755865, "gasCost" : 16494066, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000ffac99" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000", "0xffac99" ] }, { "pc" : 0, "op" : "PUSH1", "gas" : 16493366, "gasCost" : 3, "depth" : 2, - "stack" : [ ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ ] }, { "pc" : 2, "op" : "CALLDATALOAD", "gas" : 16493363, "gasCost" : 3, "depth" : 2, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x0" ] }, { "pc" : 3, "op" : "PUSH1", "gas" : 16493360, "gasCost" : 3, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 5, "op" : "ADD", "gas" : 16493357, "gasCost" : 3, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000001" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001", "0x1" ] }, { "pc" : 6, "op" : "PUSH1", "gas" : 16493354, "gasCost" : 3, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 8, "op" : "MSTORE", "gas" : 16493351, "gasCost" : 6, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002", "0x0" ] }, { "pc" : 9, "op" : "PUSH1", "gas" : 16493345, "gasCost" : 3, "depth" : 2, - "stack" : [ ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ ] }, { "pc" : 11, "op" : "PUSH1", "gas" : 16493342, "gasCost" : 3, "depth" : 2, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20" ] }, { "pc" : 13, "op" : "RETURN", "gas" : 16493339, "gasCost" : 0, "depth" : 2, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x20", "0x0" ] }, { "pc" : 22, "op" : "PUSH1", "gas" : 16755138, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x1" ] }, { "pc" : 24, "op" : "PUSH1", "gas" : 16755135, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x1", "0x20" ] }, { "pc" : 26, "op" : "RETURN", "gas" : 16755132, "gasCost" : 0, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : null, - "storage" : { }, - "reason" : null + "stack" : [ "0x1", "0x20", "0x0" ] } ] } }, 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 226fcb2cd0f..e1408198e93 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 @@ -28,271 +28,177 @@ "op" : "PUSH1", "gas" : 16755910, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 1 }, { "pc" : 2, "op" : "PUSH1", "gas" : 16755907, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 1 }, { "pc" : 4, "op" : "PUSH1", "gas" : 16755904, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 1 }, { "pc" : 6, "op" : "CALLDATASIZE", "gas" : 16755901, "gasCost" : 2, - "depth" : 1, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 1 }, { "pc" : 7, "op" : "SUB", "gas" : 16755899, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 1 }, { "pc" : 8, "op" : "DUP1", "gas" : 16755896, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 1 }, { "pc" : 9, "op" : "PUSH1", "gas" : 16755893, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 1 }, { "pc" : 11, "op" : "PUSH1", "gas" : 16755890, "gasCost" : 3, - "depth" : 1, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 1 }, { "pc" : 13, "op" : "CALLDATACOPY", "gas" : 16755887, "gasCost" : 9, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 14, "op" : "PUSH1", "gas" : 16755878, "gasCost" : 3, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 16, "op" : "CALLVALUE", "gas" : 16755875, "gasCost" : 2, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 17, "op" : "PUSH1", "gas" : 16755873, "gasCost" : 3, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 19, "op" : "CALLDATALOAD", "gas" : 16755870, "gasCost" : 3, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 20, "op" : "GAS", "gas" : 16755867, "gasCost" : 2, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 21, "op" : "CALLCODE", "gas" : 16755865, "gasCost" : 16494066, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 0, "op" : "PUSH1", "gas" : 16493366, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 2 }, { "pc" : 2, "op" : "CALLDATALOAD", "gas" : 16493363, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 2 }, { "pc" : 3, "op" : "PUSH1", "gas" : 16493360, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 2 }, { "pc" : 5, "op" : "ADD", "gas" : 16493357, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 2 }, { "pc" : 6, "op" : "PUSH1", "gas" : 16493354, "gasCost" : 3, - "depth" : 2, - "stack" : null, - "memory" : [ ], - "storage" : { }, - "reason" : null + "depth" : 2 }, { "pc" : 8, "op" : "MSTORE", "gas" : 16493351, "gasCost" : 6, "depth" : 2, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 9, "op" : "PUSH1", "gas" : 16493345, "gasCost" : 3, "depth" : 2, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 11, "op" : "PUSH1", "gas" : 16493342, "gasCost" : 3, "depth" : 2, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 13, "op" : "RETURN", "gas" : 16493339, "gasCost" : 0, "depth" : 2, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 22, "op" : "PUSH1", "gas" : 16755138, "gasCost" : 3, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 24, "op" : "PUSH1", "gas" : 16755135, "gasCost" : 3, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 26, "op" : "RETURN", "gas" : 16755132, "gasCost" : 0, "depth" : 1, - "stack" : null, - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : { }, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] } ] } }, 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 a515b46b744..58e4f48c4f4 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 @@ -29,210 +29,155 @@ "gas" : 16755910, "gasCost" : 3, "depth" : 1, - "stack" : [ ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ ] }, { "pc" : 2, "op" : "PUSH1", "gas" : 16755907, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0x20" ] }, { "pc" : 4, "op" : "PUSH1", "gas" : 16755904, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0" ] }, { "pc" : 6, "op" : "CALLDATASIZE", "gas" : 16755901, "gasCost" : 2, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20" ] }, { "pc" : 7, "op" : "SUB", "gas" : 16755899, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000040" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x40" ] }, { "pc" : 8, "op" : "DUP1", "gas" : 16755896, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20" ] }, { "pc" : 9, "op" : "PUSH1", "gas" : 16755893, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x20" ] }, { "pc" : 11, "op" : "PUSH1", "gas" : 16755890, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20" ] }, { "pc" : 13, "op" : "CALLDATACOPY", "gas" : 16755887, "gasCost" : 9, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x20", "0x20", "0x0" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 14, "op" : "PUSH1", "gas" : 16755878, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 16, "op" : "CALLVALUE", "gas" : 16755875, "gasCost" : 2, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 17, "op" : "PUSH1", "gas" : 16755873, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 19, "op" : "CALLDATALOAD", "gas" : 16755870, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x0" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 20, "op" : "GAS", "gas" : 16755867, "gasCost" : 2, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 21, "op" : "CALLCODE", "gas" : 16755865, "gasCost" : 16494066, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000030000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000ffac99" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0", "0x20", "0x0", "0x0", "0x30000000000000000000000000000000000000", "0xffac99" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 0, "op" : "PUSH1", "gas" : 16493366, "gasCost" : 3, "depth" : 2, - "stack" : [ ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ ] }, { "pc" : 2, "op" : "CALLDATALOAD", "gas" : 16493363, "gasCost" : 3, "depth" : 2, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0x0" ] }, { "pc" : 3, "op" : "PUSH1", "gas" : 16493360, "gasCost" : 3, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001" ] }, { "pc" : 5, "op" : "ADD", "gas" : 16493357, "gasCost" : 3, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000001" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000001", "0x1" ] }, { "pc" : 6, "op" : "PUSH1", "gas" : 16493354, "gasCost" : 3, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "memory" : [ ], - "storage" : null, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 8, "op" : "MSTORE", "gas" : 16493351, "gasCost" : 6, "depth" : 2, - "stack" : [ "f000000000000000000000000000000000000000000000000000000000000002", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : null, - "reason" : null + "stack" : [ "0xf000000000000000000000000000000000000000000000000000000000000002", "0x0" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 9, "op" : "PUSH1", @@ -240,59 +185,47 @@ "gasCost" : 3, "depth" : 2, "stack" : [ ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : null, - "reason" : null + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 11, "op" : "PUSH1", "gas" : 16493342, "gasCost" : 3, "depth" : 2, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : null, - "reason" : null + "stack" : [ "0x20" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 13, "op" : "RETURN", "gas" : 16493339, "gasCost" : 0, "depth" : 2, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : null, - "reason" : null + "stack" : [ "0x20", "0x0" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 22, "op" : "PUSH1", "gas" : 16755138, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : null, - "reason" : null + "stack" : [ "0x1" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 24, "op" : "PUSH1", "gas" : 16755135, "gasCost" : 3, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : null, - "reason" : null + "stack" : [ "0x1", "0x20" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] }, { "pc" : 26, "op" : "RETURN", "gas" : 16755132, "gasCost" : 0, "depth" : 1, - "stack" : [ "0000000000000000000000000000000000000000000000000000000000000001", "0000000000000000000000000000000000000000000000000000000000000020", "0000000000000000000000000000000000000000000000000000000000000000" ], - "memory" : [ "f000000000000000000000000000000000000000000000000000000000000002" ], - "storage" : null, - "reason" : null + "stack" : [ "0x1", "0x20", "0x0" ], + "memory" : [ "0xf000000000000000000000000000000000000000000000000000000000000002" ] } ] } }, 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 18fe53baa16..4cd59d6e19e 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,22 +20,16 @@ "jsonrpc": "2.0", "id": 1, "result": { - "gas": 21164, - "failed": false, - "returnValue": "", - "structLogs": [ - { - "pc": 0, - "op": "STOP", - "gas": 17592186023252, - "gasCost": 0, - "depth": 1, - "stack": null, - "memory": null, - "storage": null, - "reason": null - } - ] + "gas" : 21164, + "failed" : false, + "returnValue" : "", + "structLogs" : [ { + "pc" : 0, + "op" : "STOP", + "gas" : 17592186023252, + "gasCost" : 0, + "depth" : 1 + } ] } }, "statusCode": 200 From d7babddf7b945339ccbcf59adf95f6d9043d12a4 Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Mon, 6 Jan 2025 12:29:26 +0100 Subject: [PATCH 07/13] Refactoring Signed-off-by: Ameziane H. --- .../methods/AbstractDebugTraceBlock.java | 157 ++++++++++++++++++ .../internal/methods/DebugTraceBlock.java | 110 +----------- .../methods/DebugTraceBlockByHash.java | 114 +------------ .../methods/DebugTraceBlockByNumber.java | 4 +- .../methods/DebugTraceBlockByHashTest.java | 1 + .../internal/methods/DebugTraceBlockTest.java | 4 +- 6 files changed, 172 insertions(+), 218 deletions(-) create mode 100644 ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractDebugTraceBlock.java diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractDebugTraceBlock.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractDebugTraceBlock.java new file mode 100644 index 00000000000..348798af836 --- /dev/null +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractDebugTraceBlock.java @@ -0,0 +1,157 @@ +/* + * 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.methods; + +import static org.hyperledger.besu.services.pipeline.PipelineBuilder.createPipelineFrom; + +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonRpcParameter; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TransactionTraceParams; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; +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.query.BlockchainQueries; +import org.hyperledger.besu.ethereum.core.Block; +import org.hyperledger.besu.ethereum.debug.TraceOptions; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; +import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; +import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; +import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; +import org.hyperledger.besu.metrics.BesuMetricCategory; +import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; +import org.hyperledger.besu.plugin.services.metrics.Counter; +import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; +import org.hyperledger.besu.services.pipeline.Pipeline; + +import java.util.Collection; +import java.util.Optional; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutionException; +import java.util.function.Supplier; + +import com.google.common.base.Suppliers; + +public abstract class AbstractDebugTraceBlock implements JsonRpcMethod { + + private final ProtocolSchedule protocolSchedule; + private final LabelledMetric outputCounter; + private final Supplier blockchainQueriesSupplier; + + public AbstractDebugTraceBlock( + final ProtocolSchedule protocolSchedule, + final BlockchainQueries blockchainQueries, + final ObservableMetricsSystem metricsSystem) { + this.blockchainQueriesSupplier = Suppliers.ofInstance(blockchainQueries); + this.protocolSchedule = protocolSchedule; + this.outputCounter = + metricsSystem.createLabelledCounter( + BesuMetricCategory.BLOCKCHAIN, + "transactions_debugTraceblock_pipeline_processed_total", + "Number of transactions processed for each block", + "step", + "action"); + } + + protected BlockchainQueries getBlockchainQueries() { + return blockchainQueriesSupplier.get(); + } + + protected TraceOptions getTraceOptions(final JsonRpcRequestContext requestContext) { + final TraceOptions traceOptions; + try { + traceOptions = + requestContext + .getOptionalParameter(1, TransactionTraceParams.class) + .map(TransactionTraceParams::traceOptions) + .orElse(TraceOptions.DEFAULT); + } catch (JsonRpcParameter.JsonRpcParameterException e) { + throw new InvalidJsonRpcParameters( + "Invalid transaction trace parameter (index 1)", + RpcErrorType.INVALID_TRANSACTION_TRACE_PARAMS, + e); + } + return traceOptions; + } + + protected Collection getTraces( + final JsonRpcRequestContext requestContext, + final TraceOptions traceOptions, + final Optional maybeBlock) { + return maybeBlock + .flatMap( + block -> + Tracer.processTracing( + getBlockchainQueries(), + block.getHash(), + traceableState -> { + Collection tracesList = + new CopyOnWriteArrayList<>(); + final ProtocolSpec protocolSpec = + protocolSchedule.getByBlockHeader(block.getHeader()); + final MainnetTransactionProcessor transactionProcessor = + protocolSpec.getTransactionProcessor(); + final TraceBlock.ChainUpdater chainUpdater = + new TraceBlock.ChainUpdater(traceableState); + + TransactionSource transactionSource = new TransactionSource(block); + DebugOperationTracer debugOperationTracer = + new DebugOperationTracer(traceOptions, true); + ExecuteTransactionStep executeTransactionStep = + new ExecuteTransactionStep( + chainUpdater, + transactionProcessor, + getBlockchainQueries().getBlockchain(), + debugOperationTracer, + protocolSpec, + block); + DebugTraceTransactionStep debugTraceTransactionStep = + new DebugTraceTransactionStep(); + Pipeline traceBlockPipeline = + createPipelineFrom( + "getTransactions", + transactionSource, + 4, + outputCounter, + false, + "debug_trace_block") + .thenProcess("executeTransaction", executeTransactionStep) + .thenProcessAsyncOrdered( + "debugTraceTransactionStep", debugTraceTransactionStep, 4) + .andFinishWith("collect_results", tracesList::add); + + try { + if (getBlockchainQueries().getEthScheduler().isPresent()) { + getBlockchainQueries() + .getEthScheduler() + .get() + .startPipeline(traceBlockPipeline) + .get(); + } else { + EthScheduler ethScheduler = + new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); + ethScheduler.startPipeline(traceBlockPipeline).get(); + } + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + return Optional.of(tracesList); + })) + .orElse(null); + } +} diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java index 5545b2aa155..4bb8b23bf31 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java @@ -14,15 +14,10 @@ */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; -import static org.hyperledger.besu.services.pipeline.PipelineBuilder.createPipelineFrom; - 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.exception.InvalidJsonRpcParameters; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonRpcParameter.JsonRpcParameterException; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TransactionTraceParams; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; -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.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; @@ -32,55 +27,30 @@ import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; import org.hyperledger.besu.ethereum.debug.TraceOptions; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; -import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; -import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions; import org.hyperledger.besu.ethereum.rlp.RLP; import org.hyperledger.besu.ethereum.rlp.RLPException; -import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; -import org.hyperledger.besu.metrics.BesuMetricCategory; import org.hyperledger.besu.metrics.ObservableMetricsSystem; -import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; -import org.hyperledger.besu.plugin.services.metrics.Counter; -import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; -import org.hyperledger.besu.services.pipeline.Pipeline; import java.util.Collection; import java.util.Optional; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.ExecutionException; -import java.util.function.Supplier; -import com.google.common.base.Suppliers; import org.apache.tuweni.bytes.Bytes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class DebugTraceBlock implements JsonRpcMethod { +public class DebugTraceBlock extends AbstractDebugTraceBlock { private static final Logger LOG = LoggerFactory.getLogger(DebugTraceBlock.class); private final BlockHeaderFunctions blockHeaderFunctions; - private final Supplier blockchainQueries; - private final ProtocolSchedule protocolSchedule; - private final LabelledMetric outputCounter; public DebugTraceBlock( final ProtocolSchedule protocolSchedule, final BlockchainQueries blockchainQueries, final ObservableMetricsSystem metricsSystem) { + super(protocolSchedule, blockchainQueries, metricsSystem); this.blockHeaderFunctions = ScheduleBasedBlockHeaderFunctions.create(protocolSchedule); - this.blockchainQueries = Suppliers.ofInstance(blockchainQueries); - ; - this.protocolSchedule = protocolSchedule; - this.outputCounter = - metricsSystem.createLabelledCounter( - BesuMetricCategory.BLOCKCHAIN, - "transactions_debugTraceblock_pipeline_processed_total", - "Number of transactions processed for each block", - "step", - "action"); } @Override @@ -102,84 +72,14 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { throw new InvalidJsonRpcParameters( "Invalid block params (index 0)", RpcErrorType.INVALID_BLOCK_PARAMS, e); } - final TraceOptions traceOptions; - try { - traceOptions = - requestContext - .getOptionalParameter(1, TransactionTraceParams.class) - .map(TransactionTraceParams::traceOptions) - .orElse(TraceOptions.DEFAULT); - } catch (JsonRpcParameterException e) { - throw new InvalidJsonRpcParameters( - "Invalid transaction trace parameter (index 1)", - RpcErrorType.INVALID_TRANSACTION_TRACE_PARAMS, - e); - } + final TraceOptions traceOptions = getTraceOptions(requestContext); - if (blockchainQueries - .get() + if (getBlockchainQueries() .getBlockchain() .getBlockByHash(block.getHeader().getParentHash()) .isPresent()) { final Collection results = - Tracer.processTracing( - blockchainQueries.get(), - Optional.of(block.getHeader()), - traceableState -> { - Collection tracesList = - new CopyOnWriteArrayList<>(); - final ProtocolSpec protocolSpec = - protocolSchedule.getByBlockHeader(block.getHeader()); - final MainnetTransactionProcessor transactionProcessor = - protocolSpec.getTransactionProcessor(); - final TraceBlock.ChainUpdater chainUpdater = - new TraceBlock.ChainUpdater(traceableState); - - TransactionSource transactionSource = new TransactionSource(block); - DebugOperationTracer debugOperationTracer = - new DebugOperationTracer(traceOptions, true); - ExecuteTransactionStep executeTransactionStep = - new ExecuteTransactionStep( - chainUpdater, - transactionProcessor, - blockchainQueries.get().getBlockchain(), - debugOperationTracer, - protocolSpec, - block); - DebugTraceTransactionStep debugTraceTransactionStep = - new DebugTraceTransactionStep(); - Pipeline traceBlockPipeline = - createPipelineFrom( - "getTransactions", - transactionSource, - 4, - outputCounter, - false, - "debug_trace_block_by_number") - .thenProcess("executeTransaction", executeTransactionStep) - .thenProcessAsyncOrdered( - "debugTraceTransactionStep", debugTraceTransactionStep, 4) - .andFinishWith("collect_results", tracesList::add); - - try { - if (blockchainQueries.get().getEthScheduler().isPresent()) { - blockchainQueries - .get() - .getEthScheduler() - .get() - .startPipeline(traceBlockPipeline) - .get(); - } else { - EthScheduler ethScheduler = - new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); - ethScheduler.startPipeline(traceBlockPipeline).get(); - } - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - return Optional.of(tracesList); - }) - .orElse(null); + getTraces(requestContext, traceOptions, Optional.ofNullable(block)); return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), results); } else { return new JsonRpcErrorResponse( diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java index d276541f7a6..9bbaad3d996 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java @@ -14,16 +14,11 @@ */ package org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods; -import static org.hyperledger.besu.services.pipeline.PipelineBuilder.createPipelineFrom; - import org.hyperledger.besu.datatypes.Hash; 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.exception.InvalidJsonRpcParameters; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonRpcParameter.JsonRpcParameterException; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TransactionTraceParams; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.Tracer; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace; 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; @@ -31,45 +26,19 @@ import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.debug.TraceOptions; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; -import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; -import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; -import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; -import org.hyperledger.besu.metrics.BesuMetricCategory; import org.hyperledger.besu.metrics.ObservableMetricsSystem; -import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; -import org.hyperledger.besu.plugin.services.metrics.Counter; -import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; -import org.hyperledger.besu.services.pipeline.Pipeline; import java.util.Collection; import java.util.Optional; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.ExecutionException; -import java.util.function.Supplier; - -import com.google.common.base.Suppliers; - -public class DebugTraceBlockByHash implements JsonRpcMethod { - private final Supplier blockchainQueries; - private final ProtocolSchedule protocolSchedule; - private final LabelledMetric outputCounter; +public class DebugTraceBlockByHash extends AbstractDebugTraceBlock { public DebugTraceBlockByHash( final ProtocolSchedule protocolSchedule, final BlockchainQueries blockchainQueries, final ObservableMetricsSystem metricsSystem) { - this.blockchainQueries = Suppliers.ofInstance(blockchainQueries); - this.protocolSchedule = protocolSchedule; - this.outputCounter = - metricsSystem.createLabelledCounter( - BesuMetricCategory.BLOCKCHAIN, - "transactions_debugTraceblock_pipeline_processed_total", - "Number of transactions processed for each block", - "step", - "action"); + super(protocolSchedule, blockchainQueries, metricsSystem); } @Override @@ -86,83 +55,12 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { throw new InvalidJsonRpcParameters( "Invalid block hash parameter (index 0)", RpcErrorType.INVALID_BLOCK_HASH_PARAMS, e); } - final TraceOptions traceOptions; - try { - traceOptions = - requestContext - .getOptionalParameter(1, TransactionTraceParams.class) - .map(TransactionTraceParams::traceOptions) - .orElse(TraceOptions.DEFAULT); - } catch (JsonRpcParameterException e) { - throw new InvalidJsonRpcParameters( - "Invalid transaction trace parameter (index 1)", - RpcErrorType.INVALID_TRANSACTION_TRACE_PARAMS, - e); - } - Optional maybeBlock = blockchainQueries.get().getBlockchain().getBlockByHash(blockHash); - final Collection results = - maybeBlock - .flatMap( - block -> - Tracer.processTracing( - blockchainQueries.get(), - blockHash, - traceableState -> { - Collection tracesList = - new CopyOnWriteArrayList<>(); - final ProtocolSpec protocolSpec = - protocolSchedule.getByBlockHeader(block.getHeader()); - final MainnetTransactionProcessor transactionProcessor = - protocolSpec.getTransactionProcessor(); - final TraceBlock.ChainUpdater chainUpdater = - new TraceBlock.ChainUpdater(traceableState); + TraceOptions traceOptions = getTraceOptions(requestContext); + Optional maybeBlock = getBlockchainQueries().getBlockchain().getBlockByHash(blockHash); - TransactionSource transactionSource = new TransactionSource(block); - DebugOperationTracer debugOperationTracer = - new DebugOperationTracer(traceOptions, true); - ExecuteTransactionStep executeTransactionStep = - new ExecuteTransactionStep( - chainUpdater, - transactionProcessor, - blockchainQueries.get().getBlockchain(), - debugOperationTracer, - protocolSpec, - block); - DebugTraceTransactionStep debugTraceTransactionStep = - new DebugTraceTransactionStep(); - Pipeline traceBlockPipeline = - createPipelineFrom( - "getTransactions", - transactionSource, - 4, - outputCounter, - false, - "debug_trace_block_by_number") - .thenProcess("executeTransaction", executeTransactionStep) - .thenProcessAsyncOrdered( - "debugTraceTransactionStep", debugTraceTransactionStep, 4) - .andFinishWith("collect_results", tracesList::add); - - try { - if (blockchainQueries.get().getEthScheduler().isPresent()) { - blockchainQueries - .get() - .getEthScheduler() - .get() - .startPipeline(traceBlockPipeline) - .get(); - } else { - EthScheduler ethScheduler = - new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); - ethScheduler.startPipeline(traceBlockPipeline).get(); - } - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - return Optional.of(tracesList); - })) - .orElse(null); + final Collection results = + getTraces(requestContext, traceOptions, maybeBlock); return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), results); } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java index e597900d603..150c9fa13d6 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java @@ -48,7 +48,7 @@ public class DebugTraceBlockByNumber extends AbstractBlockParameterMethod { - private final ProtocolSchedule protocolSchedule; + protected final ProtocolSchedule protocolSchedule; private final LabelledMetric outputCounter; public DebugTraceBlockByNumber( @@ -105,7 +105,7 @@ protected Object resultByBlockNumber( .flatMap( block -> Tracer.processTracing( - blockchainQueriesSupplier.get(), + getBlockchainQueries(), Optional.of(block.getHeader()), traceableState -> { Collection tracesList = 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 55f3def1cba..32463a22c9b 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 @@ -79,6 +79,7 @@ public void shouldReturnCorrectResponse() { when(blockchainQueries.getBlockchain()).thenReturn(blockchain); when(blockchain.getBlockByHash(blockHash)).thenReturn(Optional.of(block)); + when(block.getHash()).thenReturn(blockHash); DebugTraceTransactionResult result1 = mock(DebugTraceTransactionResult.class); DebugTraceTransactionResult result2 = mock(DebugTraceTransactionResult.class); 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 9f9ae1383a5..cc1f65ea072 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 @@ -146,9 +146,7 @@ public void shouldReturnCorrectResponse() { .when( () -> Tracer.processTracing( - eq(blockchainQueries), - eq(Optional.of(block.getHeader())), - any(Function.class))) + eq(blockchainQueries), eq(block.getHash()), any(Function.class))) .thenReturn(Optional.of(resultList)); final JsonRpcResponse jsonRpcResponse = debugTraceBlock.response(request); From 6a541e5798cccfe8bcc580658c85f8809599ea03 Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Tue, 7 Jan 2025 14:50:05 +0100 Subject: [PATCH 08/13] Share with RPC tracing methods ethscheduler from Besu Controller. Signed-off-by: Ameziane H. --- .../org/hyperledger/besu/RunnerBuilder.java | 24 +++++++++----- .../jsonrpc/JsonRpcTestMethodsFactory.java | 6 ++-- .../methods/AbstractBlockParameterMethod.java | 2 +- .../methods/AbstractDebugTraceBlock.java | 26 ++++++---------- .../internal/methods/DebugTraceBlock.java | 8 +++-- .../methods/DebugTraceBlockByHash.java | 8 +++-- .../methods/DebugTraceBlockByNumber.java | 31 +++++++------------ .../jsonrpc/internal/methods/TraceBlock.java | 19 ++++-------- .../jsonrpc/internal/methods/TraceCall.java | 2 +- .../jsonrpc/internal/methods/TraceFilter.java | 17 +++------- .../methods/TraceReplayBlockTransactions.java | 19 ++++-------- .../jsonrpc/methods/DebugJsonRpcMethods.java | 15 ++++++--- .../methods/JsonRpcMethodsFactory.java | 12 ++++--- .../jsonrpc/methods/TraceJsonRpcMethods.java | 16 +++++++--- .../AbstractJsonRpcHttpServiceTest.java | 6 ++-- .../JsonRpcHttpServiceHostAllowlistTest.java | 6 ++-- .../jsonrpc/JsonRpcHttpServiceLoginTest.java | 6 ++-- .../JsonRpcHttpServiceRpcApisTest.java | 9 ++++-- .../jsonrpc/JsonRpcHttpServiceTestBase.java | 30 +++++++++--------- .../JsonRpcHttpServiceTlsClientAuthTest.java | 6 ++-- ...RpcHttpServiceTlsMisconfigurationTest.java | 6 ++-- .../jsonrpc/JsonRpcHttpServiceTlsTest.java | 6 ++-- .../methods/DebugTraceBlockByHashTest.java | 17 +++++++--- .../methods/DebugTraceBlockByNumberTest.java | 17 +++++++--- .../internal/methods/DebugTraceBlockTest.java | 16 +++++++--- .../internal/results/StructLogTest.java | 10 ++++-- .../websocket/WebSocketServiceLoginTest.java | 5 +-- 27 files changed, 194 insertions(+), 151 deletions(-) diff --git a/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java b/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java index 9a9eb64fc82..36977546fff 100644 --- a/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.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 @@ -74,6 +74,7 @@ import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.FlexiblePrivacyPrecompiledContract; @@ -836,7 +837,8 @@ public Runner build() { besuPluginContext.getNamedPlugins(), dataDir, rpcEndpointServiceImpl, - transactionSimulator); + transactionSimulator, + besuController.getProtocolManager().ethContext().getScheduler()); jsonRpcHttpService = Optional.of( @@ -882,7 +884,8 @@ public Runner build() { besuPluginContext.getNamedPlugins(), dataDir, rpcEndpointServiceImpl, - transactionSimulator); + transactionSimulator, + besuController.getProtocolManager().ethContext().getScheduler()); final Optional authToUse = engineJsonRpcConfiguration.get().isAuthenticationEnabled() @@ -978,7 +981,8 @@ public Runner build() { besuPluginContext.getNamedPlugins(), dataDir, rpcEndpointServiceImpl, - transactionSimulator); + transactionSimulator, + besuController.getProtocolManager().ethContext().getScheduler()); createLogsSubscriptionService( context.getBlockchain(), subscriptionManager, privacyParameters, blockchainQueries); @@ -1059,7 +1063,8 @@ public Runner build() { besuPluginContext.getNamedPlugins(), dataDir, rpcEndpointServiceImpl, - transactionSimulator); + transactionSimulator, + besuController.getProtocolManager().ethContext().getScheduler()); jsonRpcIpcService = Optional.of( @@ -1099,7 +1104,8 @@ public Runner build() { besuPluginContext.getNamedPlugins(), dataDir, rpcEndpointServiceImpl, - transactionSimulator); + transactionSimulator, + besuController.getProtocolManager().ethContext().getScheduler()); } else { inProcessRpcMethods = Map.of(); } @@ -1262,7 +1268,8 @@ private Map jsonRpcMethods( final Map namedPlugins, final Path dataDir, final RpcEndpointServiceImpl rpcEndpointServiceImpl, - final TransactionSimulator transactionSimulator) { + final TransactionSimulator transactionSimulator, + final EthScheduler ethScheduler) { // sync vertx for engine consensus API, to process requests in FIFO order; final Vertx consensusEngineServer = Vertx.vertx(new VertxOptions().setWorkerPoolSize(1)); @@ -1300,7 +1307,8 @@ private Map jsonRpcMethods( consensusEngineServer, apiConfiguration, enodeDnsConfiguration, - transactionSimulator); + transactionSimulator, + ethScheduler); methods.putAll(besuController.getAdditionalJsonRpcMethods(jsonRpcApis)); final var pluginMethods = diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java index 63554577c4b..9aad5355397 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.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 @@ -38,6 +38,7 @@ import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.HeaderValidationMode; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; @@ -228,6 +229,7 @@ public Map methods() { Vertx.vertx(new VertxOptions().setWorkerPoolSize(1)), ImmutableApiConfiguration.builder().build(), Optional.empty(), - transactionSimulator); + transactionSimulator, + new EthScheduler(1,1,1,new NoOpMetricsSystem())); } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractBlockParameterMethod.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractBlockParameterMethod.java index dd8256d8c80..bb58ef64fd2 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractBlockParameterMethod.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractBlockParameterMethod.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 diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractDebugTraceBlock.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractDebugTraceBlock.java index 348798af836..87a239d6a94 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractDebugTraceBlock.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractDebugTraceBlock.java @@ -34,14 +34,15 @@ import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; import org.hyperledger.besu.metrics.BesuMetricCategory; import org.hyperledger.besu.metrics.ObservableMetricsSystem; -import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.plugin.services.metrics.Counter; import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; import org.hyperledger.besu.services.pipeline.Pipeline; +import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; +import java.util.List; import java.util.Optional; -import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ExecutionException; import java.util.function.Supplier; @@ -52,11 +53,13 @@ public abstract class AbstractDebugTraceBlock implements JsonRpcMethod { private final ProtocolSchedule protocolSchedule; private final LabelledMetric outputCounter; private final Supplier blockchainQueriesSupplier; + private final EthScheduler ethScheduler; public AbstractDebugTraceBlock( final ProtocolSchedule protocolSchedule, final BlockchainQueries blockchainQueries, - final ObservableMetricsSystem metricsSystem) { + final ObservableMetricsSystem metricsSystem, + final EthScheduler ethScheduler) { this.blockchainQueriesSupplier = Suppliers.ofInstance(blockchainQueries); this.protocolSchedule = protocolSchedule; this.outputCounter = @@ -66,6 +69,7 @@ public AbstractDebugTraceBlock( "Number of transactions processed for each block", "step", "action"); + this.ethScheduler = ethScheduler; } protected BlockchainQueries getBlockchainQueries() { @@ -100,8 +104,8 @@ protected Collection getTraces( getBlockchainQueries(), block.getHash(), traceableState -> { - Collection tracesList = - new CopyOnWriteArrayList<>(); + List tracesList = + Collections.synchronizedList(new ArrayList<>()); final ProtocolSpec protocolSpec = protocolSchedule.getByBlockHeader(block.getHeader()); final MainnetTransactionProcessor transactionProcessor = @@ -136,17 +140,7 @@ protected Collection getTraces( .andFinishWith("collect_results", tracesList::add); try { - if (getBlockchainQueries().getEthScheduler().isPresent()) { - getBlockchainQueries() - .getEthScheduler() - .get() - .startPipeline(traceBlockPipeline) - .get(); - } else { - EthScheduler ethScheduler = - new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); - ethScheduler.startPipeline(traceBlockPipeline).get(); - } + ethScheduler.startPipeline(traceBlockPipeline).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java index 4bb8b23bf31..9111d3c6ebe 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlock.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 @@ -27,6 +27,7 @@ import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; import org.hyperledger.besu.ethereum.debug.TraceOptions; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions; import org.hyperledger.besu.ethereum.rlp.RLP; @@ -48,8 +49,9 @@ public class DebugTraceBlock extends AbstractDebugTraceBlock { public DebugTraceBlock( final ProtocolSchedule protocolSchedule, final BlockchainQueries blockchainQueries, - final ObservableMetricsSystem metricsSystem) { - super(protocolSchedule, blockchainQueries, metricsSystem); + final ObservableMetricsSystem metricsSystem, + final EthScheduler ethScheduler) { + super(protocolSchedule, blockchainQueries, metricsSystem, ethScheduler); this.blockHeaderFunctions = ScheduleBasedBlockHeaderFunctions.create(protocolSchedule); } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java index 9bbaad3d996..0a1cb902aaf 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByHash.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 @@ -26,6 +26,7 @@ import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.debug.TraceOptions; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.ObservableMetricsSystem; @@ -37,8 +38,9 @@ public class DebugTraceBlockByHash extends AbstractDebugTraceBlock { public DebugTraceBlockByHash( final ProtocolSchedule protocolSchedule, final BlockchainQueries blockchainQueries, - final ObservableMetricsSystem metricsSystem) { - super(protocolSchedule, blockchainQueries, metricsSystem); + final ObservableMetricsSystem metricsSystem, + final EthScheduler ethScheduler) { + super(protocolSchedule, blockchainQueries, metricsSystem, ethScheduler); } @Override diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java index 150c9fa13d6..2ccde9cfdb1 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu. + * 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 @@ -36,34 +36,37 @@ import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; import org.hyperledger.besu.metrics.BesuMetricCategory; import org.hyperledger.besu.metrics.ObservableMetricsSystem; -import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.plugin.services.metrics.Counter; import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; import org.hyperledger.besu.services.pipeline.Pipeline; -import java.util.Collection; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import java.util.Optional; -import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ExecutionException; public class DebugTraceBlockByNumber extends AbstractBlockParameterMethod { protected final ProtocolSchedule protocolSchedule; private final LabelledMetric outputCounter; + private final EthScheduler ethScheduler; public DebugTraceBlockByNumber( final ProtocolSchedule protocolSchedule, final BlockchainQueries blockchainQueries, - final ObservableMetricsSystem metricsSystem) { + final ObservableMetricsSystem metricsSystem, + final EthScheduler ethScheduler) { super(blockchainQueries); this.protocolSchedule = protocolSchedule; this.outputCounter = metricsSystem.createLabelledCounter( BesuMetricCategory.BLOCKCHAIN, - "transactions_debugTraceblock_pipeline_processed_total", + "transactions_debugtraceblock_pipeline_processed_total", "Number of transactions processed for each block", "step", "action"); + this.ethScheduler = ethScheduler; } @Override @@ -108,8 +111,8 @@ protected Object resultByBlockNumber( getBlockchainQueries(), Optional.of(block.getHeader()), traceableState -> { - Collection tracesList = - new CopyOnWriteArrayList<>(); + List tracesList = + Collections.synchronizedList(new ArrayList<>()); final ProtocolSpec protocolSpec = protocolSchedule.getByBlockHeader(block.getHeader()); final MainnetTransactionProcessor transactionProcessor = @@ -144,17 +147,7 @@ protected Object resultByBlockNumber( .andFinishWith("collect_results", tracesList::add); try { - if (getBlockchainQueries().getEthScheduler().isPresent()) { - getBlockchainQueries() - .getEthScheduler() - .get() - .startPipeline(traceBlockPipeline) - .get(); - } else { - EthScheduler ethScheduler = - new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); - ethScheduler.startPipeline(traceBlockPipeline).get(); - } + ethScheduler.startPipeline(traceBlockPipeline).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceBlock.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceBlock.java index 16798160d8e..ede7f39b234 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceBlock.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceBlock.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 @@ -39,7 +39,6 @@ import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; import org.hyperledger.besu.evm.worldstate.WorldUpdater; import org.hyperledger.besu.metrics.BesuMetricCategory; -import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.plugin.services.MetricsSystem; import org.hyperledger.besu.plugin.services.metrics.Counter; import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; @@ -57,11 +56,13 @@ public class TraceBlock extends AbstractBlockParameterMethod { private static final ObjectMapper MAPPER = new ObjectMapper(); protected final ProtocolSchedule protocolSchedule; private final LabelledMetric outputCounter; + protected final EthScheduler ethScheduler; public TraceBlock( final ProtocolSchedule protocolSchedule, final BlockchainQueries queries, - final MetricsSystem metricsSystem) { + final MetricsSystem metricsSystem, + final EthScheduler ethScheduler) { super(queries); this.protocolSchedule = protocolSchedule; this.outputCounter = @@ -71,6 +72,7 @@ public TraceBlock( "Number of transactions processed for each block", "step", "action"); + this.ethScheduler = ethScheduler; } @Override @@ -153,16 +155,7 @@ protected ArrayNodeWrapper traceBlock( traceStream -> traceStream.forEachOrdered(buildArrayNodeStep)); try { - if (getBlockchainQueries().getEthScheduler().isPresent()) { - getBlockchainQueries() - .getEthScheduler() - .get() - .startPipeline(traceBlockPipeline) - .get(); - } else { - EthScheduler ethScheduler = new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); - ethScheduler.startPipeline(traceBlockPipeline).get(); - } + ethScheduler.startPipeline(traceBlockPipeline).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } 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 082283a8158..7508ac1ff44 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 @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu. + * 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 diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilter.java index 6be65149cb9..fb5d86c28c7 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilter.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 @@ -43,7 +43,6 @@ import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; import org.hyperledger.besu.metrics.BesuMetricCategory; -import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.plugin.services.MetricsSystem; import org.hyperledger.besu.plugin.services.metrics.Counter; import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; @@ -74,8 +73,9 @@ public TraceFilter( final ProtocolSchedule protocolSchedule, final BlockchainQueries blockchainQueries, final Long maxRange, - final MetricsSystem metricsSystem) { - super(protocolSchedule, blockchainQueries, metricsSystem); + final MetricsSystem metricsSystem, + final EthScheduler ethScheduler) { + super(protocolSchedule, blockchainQueries, metricsSystem, ethScheduler); this.maxRange = maxRange; this.outputCounter = metricsSystem.createLabelledCounter( @@ -196,14 +196,7 @@ private JsonRpcResponse traceFilterWithPipeline( traceStream -> traceStream.forEachOrdered(buildArrayNodeStep)); try { - Optional ethSchedulerOpt = - getBlockchainQueries().getEthScheduler(); - - ethSchedulerOpt - .orElse(new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem())) - .startPipeline(traceBlockPipeline) - .get(); - + ethScheduler.startPipeline(traceBlockPipeline).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceReplayBlockTransactions.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceReplayBlockTransactions.java index 51eeebb9592..76325f26dff 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceReplayBlockTransactions.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceReplayBlockTransactions.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 @@ -38,7 +38,6 @@ import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.vm.DebugOperationTracer; import org.hyperledger.besu.metrics.BesuMetricCategory; -import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.plugin.services.MetricsSystem; import org.hyperledger.besu.plugin.services.metrics.Counter; import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; @@ -60,11 +59,13 @@ public class TraceReplayBlockTransactions extends AbstractBlockParameterMethod { private static final ObjectMapper MAPPER = new ObjectMapper(); private final ProtocolSchedule protocolSchedule; private final LabelledMetric outputCounter; + private final EthScheduler ethScheduler; public TraceReplayBlockTransactions( final ProtocolSchedule protocolSchedule, final BlockchainQueries queries, - final MetricsSystem metricsSystem) { + final MetricsSystem metricsSystem, + final EthScheduler ethScheduler) { super(queries); this.protocolSchedule = protocolSchedule; this.outputCounter = @@ -74,6 +75,7 @@ public TraceReplayBlockTransactions( "Number of transactions processed for each block", "step", "action"); + this.ethScheduler = ethScheduler; } @Override @@ -173,16 +175,7 @@ private ArrayNode traceBlock(final Block block, final TraceTypeParameter traceTy "traceReplayTransaction", traceReplayTransactionStep, 4) .andFinishWith("buildArrayNode", buildArrayNodeStep::accept); try { - if (getBlockchainQueries().getEthScheduler().isPresent()) { - getBlockchainQueries() - .getEthScheduler() - .get() - .startPipeline(traceBlockPipeline) - .get(); - } else { - EthScheduler ethScheduler = new EthScheduler(1, 1, 1, 1, new NoOpMetricsSystem()); - ethScheduler.startPipeline(traceBlockPipeline).get(); - } + ethScheduler.startPipeline(traceBlockPipeline).get(); } catch (final InterruptedException | ExecutionException e) { throw new RuntimeException(e); } 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 9a1513f7a82..b71ccec1853 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 @@ -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 @@ -43,6 +43,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.BlockResultFactory; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.core.Synchronizer; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.transaction.TransactionSimulator; @@ -63,6 +64,7 @@ public class DebugJsonRpcMethods extends ApiGroupJsonRpcMethods { private final Synchronizer synchronizer; private final Path dataDir; private final TransactionSimulator transactionSimulator; + private final EthScheduler ethScheduler; DebugJsonRpcMethods( final BlockchainQueries blockchainQueries, @@ -72,7 +74,8 @@ public class DebugJsonRpcMethods extends ApiGroupJsonRpcMethods { final TransactionPool transactionPool, final Synchronizer synchronizer, final Path dataDir, - final TransactionSimulator transactionSimulator) { + final TransactionSimulator transactionSimulator, + final EthScheduler ethScheduler) { this.blockchainQueries = blockchainQueries; this.protocolContext = protocolContext; this.protocolSchedule = protocolSchedule; @@ -81,6 +84,7 @@ public class DebugJsonRpcMethods extends ApiGroupJsonRpcMethods { this.synchronizer = synchronizer; this.dataDir = dataDir; this.transactionSimulator = transactionSimulator; + this.ethScheduler = ethScheduler; } @Override @@ -99,11 +103,12 @@ protected Map create() { new DebugStorageRangeAt(blockchainQueries, blockReplay), new DebugMetrics(metricsSystem), new DebugResyncWorldstate(protocolContext, synchronizer), - new DebugTraceBlock(protocolSchedule, blockchainQueries, metricsSystem), + new DebugTraceBlock(protocolSchedule, blockchainQueries, metricsSystem, ethScheduler), new DebugSetHead(blockchainQueries, protocolContext), new DebugReplayBlock(blockchainQueries, protocolContext, protocolSchedule), - new DebugTraceBlockByNumber(protocolSchedule, blockchainQueries, metricsSystem), - new DebugTraceBlockByHash(protocolSchedule, blockchainQueries, metricsSystem), + new DebugTraceBlockByNumber( + protocolSchedule, blockchainQueries, metricsSystem, ethScheduler), + new DebugTraceBlockByHash(protocolSchedule, blockchainQueries, metricsSystem, ethScheduler), new DebugBatchSendRawTransaction(transactionPool), new DebugGetBadBlocks(protocolContext, blockResult), new DebugStandardTraceBlockToFile( diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/JsonRpcMethodsFactory.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/JsonRpcMethodsFactory.java index 476da3ee304..bea30b2f4e0 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/JsonRpcMethodsFactory.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/JsonRpcMethodsFactory.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 @@ -29,6 +29,7 @@ import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -87,7 +88,8 @@ public Map methods( final Vertx consensusEngineServer, final ApiConfiguration apiConfiguration, final Optional enodeDnsConfiguration, - final TransactionSimulator transactionSimulator) { + final TransactionSimulator transactionSimulator, + final EthScheduler ethScheduler) { final Map enabled = new HashMap<>(); if (!rpcApis.isEmpty()) { final JsonRpcMethod modules = new RpcModules(rpcApis); @@ -113,7 +115,8 @@ public Map methods( transactionPool, synchronizer, dataDir, - transactionSimulator), + transactionSimulator, + ethScheduler), new EeaJsonRpcMethods( blockchainQueries, protocolSchedule, transactionPool, privacyParameters), new ExecutionEngineJsonRpcMethods( @@ -159,7 +162,8 @@ public Map methods( protocolContext, apiConfiguration, transactionSimulator, - metricsSystem), + metricsSystem, + ethScheduler), new TxPoolJsonRpcMethods(transactionPool), new PluginsJsonRpcMethods(namedPlugins)); diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/TraceJsonRpcMethods.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/TraceJsonRpcMethods.java index 0a2c090e5a5..9aa886b64c5 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/TraceJsonRpcMethods.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/TraceJsonRpcMethods.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 @@ -29,6 +29,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockReplay; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.transaction.TransactionSimulator; import org.hyperledger.besu.plugin.services.MetricsSystem; @@ -43,6 +44,7 @@ public class TraceJsonRpcMethods extends ApiGroupJsonRpcMethods { private final ProtocolContext protocolContext; private final TransactionSimulator transactionSimulator; private final MetricsSystem metricsSystem; + private final EthScheduler ethScheduler; TraceJsonRpcMethods( final BlockchainQueries blockchainQueries, @@ -50,13 +52,15 @@ public class TraceJsonRpcMethods extends ApiGroupJsonRpcMethods { final ProtocolContext protocolContext, final ApiConfiguration apiConfiguration, final TransactionSimulator transactionSimulator, - final MetricsSystem metricsSystem) { + final MetricsSystem metricsSystem, + final EthScheduler ethScheduler) { this.blockchainQueries = blockchainQueries; this.protocolSchedule = protocolSchedule; this.protocolContext = protocolContext; this.apiConfiguration = apiConfiguration; this.transactionSimulator = transactionSimulator; this.metricsSystem = metricsSystem; + this.ethScheduler = ethScheduler; } @Override @@ -69,16 +73,18 @@ protected Map create() { final BlockReplay blockReplay = new BlockReplay(protocolSchedule, protocolContext, blockchainQueries.getBlockchain()); return mapOf( - new TraceReplayBlockTransactions(protocolSchedule, blockchainQueries, metricsSystem), + new TraceReplayBlockTransactions( + protocolSchedule, blockchainQueries, metricsSystem, ethScheduler), new TraceFilter( protocolSchedule, blockchainQueries, apiConfiguration.getMaxTraceFilterRange(), - metricsSystem), + metricsSystem, + ethScheduler), new TraceGet(() -> new BlockTracer(blockReplay), blockchainQueries, protocolSchedule), new TraceTransaction( () -> new BlockTracer(blockReplay), protocolSchedule, blockchainQueries), - new TraceBlock(protocolSchedule, blockchainQueries, metricsSystem), + new TraceBlock(protocolSchedule, blockchainQueries, metricsSystem, ethScheduler), new TraceCall(blockchainQueries, protocolSchedule, transactionSimulator), new TraceCallMany(blockchainQueries, protocolSchedule, transactionSimulator), new TraceRawTransaction(protocolSchedule, blockchainQueries, transactionSimulator)); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java index 5afbbbfebd8..4d97859eca7 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.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 @@ -42,6 +42,7 @@ import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.ValidationResult; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -214,7 +215,8 @@ protected Map getRpcMethods( syncVertx, mock(ApiConfiguration.class), Optional.empty(), - transactionSimulator); + transactionSimulator, + new EthScheduler(1,1,1,new NoOpMetricsSystem())); } protected void startService() throws Exception { diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java index b3f650302a9..2273419d083 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.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 @@ -35,6 +35,7 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -140,7 +141,8 @@ public void initServerAndClient() throws Exception { vertx, mock(ApiConfiguration.class), Optional.empty(), - mock(TransactionSimulator.class)); + mock(TransactionSimulator.class), + new EthScheduler(1,1,1,new NoOpMetricsSystem())); service = createJsonRpcHttpService(); service.start().join(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java index 72e947436dd..8596ee723ce 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu. + * 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 @@ -42,6 +42,7 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -171,7 +172,8 @@ public static void initServerAndClient() throws Exception { vertx, mock(ApiConfiguration.class), Optional.empty(), - mock(TransactionSimulator.class)); + mock(TransactionSimulator.class), + new EthScheduler(1,1,1,new NoOpMetricsSystem())); service = createJsonRpcHttpService(); jwtAuth = service.authenticationService.get().getJwtAuthProvider(); service.start().join(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java index 4db5c019c3e..9498d5cfbfd 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.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 @@ -42,6 +42,7 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration; import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration; @@ -237,7 +238,8 @@ private JsonRpcHttpService createJsonRpcHttpServiceWithRpcApis(final JsonRpcConf vertx, mock(ApiConfiguration.class), Optional.empty(), - mock(TransactionSimulator.class)); + mock(TransactionSimulator.class), + new EthScheduler(1,1,1,new NoOpMetricsSystem())); final JsonRpcHttpService jsonRpcHttpService = new JsonRpcHttpService( vertx, @@ -349,7 +351,8 @@ private JsonRpcHttpService createJsonRpcHttpService( vertx, mock(ApiConfiguration.class), Optional.empty(), - mock(TransactionSimulator.class)); + mock(TransactionSimulator.class), + new EthScheduler(1,1,1,new NoOpMetricsSystem())); final JsonRpcHttpService jsonRpcHttpService = new JsonRpcHttpService( vertx, diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java index 6f67cdeb3f9..5832e63f184 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java @@ -1,17 +1,17 @@ /* - * Copyright ConsenSys AG. - * - * 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 - */ +* 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; import static org.mockito.Mockito.mock; @@ -35,6 +35,7 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -149,7 +150,8 @@ public static void initServerAndClient() throws Exception { vertx, mock(ApiConfiguration.class), Optional.empty(), - mock(TransactionSimulator.class)); + mock(TransactionSimulator.class), + new EthScheduler(1,1,1,new NoOpMetricsSystem())); disabledRpcMethods = new HashMap<>(); addedRpcMethods = new HashSet<>(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java index c2b1f4e3285..94a6ac61d1f 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.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 @@ -42,6 +42,7 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -156,7 +157,8 @@ public void initServer() throws Exception { vertx, mock(ApiConfiguration.class), Optional.empty(), - mock(TransactionSimulator.class)); + mock(TransactionSimulator.class), + new EthScheduler(1,1,1,new NoOpMetricsSystem())); System.setProperty("javax.net.ssl.trustStore", CLIENT_AS_CA_CERT.getKeyStoreFile().toString()); System.setProperty( diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java index dfa519f7464..5888ed62c52 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.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 @@ -41,6 +41,7 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -142,7 +143,8 @@ public void beforeEach() { vertx, mock(ApiConfiguration.class), Optional.empty(), - mock(TransactionSimulator.class)); + mock(TransactionSimulator.class), + new EthScheduler(1,1,1,new NoOpMetricsSystem())); } @AfterEach diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java index 705ccdd994c..1cb1f554b5a 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.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 @@ -41,6 +41,7 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -143,7 +144,8 @@ public void initServer() throws Exception { vertx, mock(ApiConfiguration.class), Optional.empty(), - mock(TransactionSimulator.class)); + mock(TransactionSimulator.class), + new EthScheduler(1,1,1,new NoOpMetricsSystem())); service = createJsonRpcHttpService(createJsonRpcConfig()); service.start().join(); baseUrl = service.url(); 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 32463a22c9b..c240c8bd604 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 @@ -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 @@ -33,6 +33,7 @@ import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.ObservableMetricsSystem; @@ -44,10 +45,15 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.MockedStatic; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) public class DebugTraceBlockByHashTest { @Mock private ProtocolSchedule protocolSchedule; @Mock private BlockchainQueries blockchainQueries; @@ -60,9 +66,12 @@ public class DebugTraceBlockByHashTest { @BeforeEach public void setUp() { - MockitoAnnotations.openMocks(this); debugTraceBlockByHash = - new DebugTraceBlockByHash(protocolSchedule, blockchainQueries, metricsSystem); + new DebugTraceBlockByHash( + protocolSchedule, + blockchainQueries, + metricsSystem, + new EthScheduler(1, 1, 1, metricsSystem)); } @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 3441881f53f..986bd926971 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 @@ -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 @@ -33,6 +33,7 @@ import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeader; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.ObservableMetricsSystem; @@ -44,10 +45,15 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.MockedStatic; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) public class DebugTraceBlockByNumberTest { @Mock private BlockchainQueries blockchainQueries; @@ -60,9 +66,12 @@ public class DebugTraceBlockByNumberTest { @BeforeEach public void setUp() { - MockitoAnnotations.openMocks(this); debugTraceBlockByNumber = - new DebugTraceBlockByNumber(protocolSchedule, blockchainQueries, metricsSystem); + new DebugTraceBlockByNumber( + protocolSchedule, + blockchainQueries, + metricsSystem, + new EthScheduler(1, 1, 1, metricsSystem)); } @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 cc1f65ea072..f040c2da323 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 @@ -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 @@ -38,6 +38,7 @@ import org.hyperledger.besu.ethereum.core.ExecutionContextTestFixture; import org.hyperledger.besu.ethereum.core.MiningConfiguration; import org.hyperledger.besu.ethereum.core.PrivacyParameters; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions; import org.hyperledger.besu.ethereum.mainnet.ProtocolScheduleBuilder; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpecAdapters; @@ -56,10 +57,15 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.MockedStatic; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) public class DebugTraceBlockTest { @Mock private BlockchainQueries blockchainQueries; @Mock private Blockchain blockchain; @@ -70,7 +76,6 @@ public class DebugTraceBlockTest { @BeforeEach public void setUp() { - MockitoAnnotations.openMocks(this); // As we build the block from RLP in DebugTraceBlock, we need to have non mocked // protocolSchedule (and ProtocolSpec) // to be able to get the hash of the block @@ -105,7 +110,10 @@ public void setUp() { .build(); debugTraceBlock = new DebugTraceBlock( - executionContextTestFixture.getProtocolSchedule(), blockchainQueries, metricsSystem); + executionContextTestFixture.getProtocolSchedule(), + blockchainQueries, + metricsSystem, + new EthScheduler(1, 1, 1, metricsSystem)); } @Test diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java index e383cb27750..264904ec20c 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/StructLogTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu. + * 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 @@ -31,9 +31,14 @@ import org.apache.tuweni.units.bigints.UInt256; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) public class StructLogTest { @Mock private TraceFrame traceFrame; @@ -43,7 +48,6 @@ public class StructLogTest { @BeforeEach public void setUp() { - MockitoAnnotations.openMocks(this); objectMapper = new ObjectMapper(); } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java index e1a5b1a75fd..59782efcf0a 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java @@ -1,5 +1,5 @@ /* - * Copyright contributors to Hyperledger Besu. + * 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 @@ -207,7 +207,8 @@ public void before() throws URISyntaxException { vertx, mock(ApiConfiguration.class), Optional.empty(), - mock(TransactionSimulator.class))); + mock(TransactionSimulator.class), + new EthScheduler(1,1,1, new NoOpMetricsSystem()))); websocketMethods.putAll(rpcMethods); webSocketMessageHandlerSpy = From 5d399c25382b07971d221900e79a6122a7c48298 Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Tue, 7 Jan 2025 15:04:13 +0100 Subject: [PATCH 09/13] spotless Signed-off-by: Ameziane H. --- .../jsonrpc/JsonRpcTestMethodsFactory.java | 2 +- .../AbstractJsonRpcHttpServiceTest.java | 2 +- .../JsonRpcHttpServiceHostAllowlistTest.java | 2 +- .../jsonrpc/JsonRpcHttpServiceLoginTest.java | 2 +- .../JsonRpcHttpServiceRpcApisTest.java | 4 +-- .../jsonrpc/JsonRpcHttpServiceTestBase.java | 28 +++++++++---------- .../JsonRpcHttpServiceTlsClientAuthTest.java | 2 +- ...RpcHttpServiceTlsMisconfigurationTest.java | 2 +- .../jsonrpc/JsonRpcHttpServiceTlsTest.java | 2 +- .../internal/methods/TraceFilterTest.java | 7 ++++- .../websocket/WebSocketServiceLoginTest.java | 2 +- 11 files changed, 30 insertions(+), 25 deletions(-) diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java index 9aad5355397..e0b47b56f1b 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java @@ -230,6 +230,6 @@ public Map methods() { ImmutableApiConfiguration.builder().build(), Optional.empty(), transactionSimulator, - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java index 4d97859eca7..900744f1a27 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java @@ -216,7 +216,7 @@ protected Map getRpcMethods( mock(ApiConfiguration.class), Optional.empty(), transactionSimulator, - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); } protected void startService() throws Exception { diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java index 2273419d083..7afc43f259c 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java @@ -142,7 +142,7 @@ public void initServerAndClient() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); service = createJsonRpcHttpService(); service.start().join(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java index 8596ee723ce..fdae2d34cab 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java @@ -173,7 +173,7 @@ public static void initServerAndClient() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); service = createJsonRpcHttpService(); jwtAuth = service.authenticationService.get().getJwtAuthProvider(); service.start().join(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java index 9498d5cfbfd..f90233fe015 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java @@ -239,7 +239,7 @@ private JsonRpcHttpService createJsonRpcHttpServiceWithRpcApis(final JsonRpcConf mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); final JsonRpcHttpService jsonRpcHttpService = new JsonRpcHttpService( vertx, @@ -352,7 +352,7 @@ private JsonRpcHttpService createJsonRpcHttpService( mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); final JsonRpcHttpService jsonRpcHttpService = new JsonRpcHttpService( vertx, diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java index 5832e63f184..aabd447c476 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java @@ -1,17 +1,17 @@ /* -* 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 - */ + * 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; import static org.mockito.Mockito.mock; @@ -151,7 +151,7 @@ public static void initServerAndClient() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); disabledRpcMethods = new HashMap<>(); addedRpcMethods = new HashSet<>(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java index 94a6ac61d1f..24cffa66b9a 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java @@ -158,7 +158,7 @@ public void initServer() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); System.setProperty("javax.net.ssl.trustStore", CLIENT_AS_CA_CERT.getKeyStoreFile().toString()); System.setProperty( diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java index 5888ed62c52..6f51e6cb6fc 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java @@ -144,7 +144,7 @@ public void beforeEach() { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); } @AfterEach diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java index 1cb1f554b5a..3fc450934fb 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java @@ -145,7 +145,7 @@ public void initServer() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1,1,1,new NoOpMetricsSystem())); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); service = createJsonRpcHttpService(createJsonRpcConfig()); service.start().join(); baseUrl = service.url(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java index 8f64d2cb0bd..08a8ac30780 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java @@ -25,6 +25,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; @@ -71,7 +72,11 @@ public void shouldFailIfParamsExceedMaxRange( method = new TraceFilter( - protocolSchedule, blockchainQueries, maxFilterRange, new NoOpMetricsSystem()); + protocolSchedule, + blockchainQueries, + maxFilterRange, + new NoOpMetricsSystem(), + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); final JsonRpcResponse response = method.response(request); assertThat(response).isInstanceOf(JsonRpcErrorResponse.class); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java index 59782efcf0a..7b39d37887c 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java @@ -208,7 +208,7 @@ public void before() throws URISyntaxException { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1,1,1, new NoOpMetricsSystem()))); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem()))); websocketMethods.putAll(rpcMethods); webSocketMessageHandlerSpy = From 50a50b7a57432118162a5e2374282116b5e2c53e Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Wed, 8 Jan 2025 10:32:55 +0100 Subject: [PATCH 10/13] Use DeterministicEthScheduler in unit tests Signed-off-by: Ameziane H. --- .../jsonrpc/internal/methods/DebugTraceBlockByNumber.java | 2 +- .../api/jsonrpc/AbstractJsonRpcHttpServiceTest.java | 4 ++-- .../api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java | 4 ++-- .../ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java | 4 ++-- .../api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java | 6 +++--- .../ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java | 4 ++-- .../api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java | 4 ++-- .../jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java | 4 ++-- .../ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java | 4 ++-- .../internal/methods/DebugTraceBlockByHashTest.java | 7 ++----- .../internal/methods/DebugTraceBlockByNumberTest.java | 7 ++----- .../api/jsonrpc/internal/methods/DebugTraceBlockTest.java | 4 ++-- .../api/jsonrpc/internal/methods/TraceFilterTest.java | 4 ++-- .../api/jsonrpc/websocket/WebSocketServiceLoginTest.java | 3 ++- 14 files changed, 28 insertions(+), 33 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java index 2ccde9cfdb1..25a1a25a024 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java @@ -153,6 +153,6 @@ protected Object resultByBlockNumber( } return Optional.of(tracesList); })) - .orElse(null); + .orElse(Collections.emptyList()); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java index 900744f1a27..a51483ce1e3 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java @@ -42,7 +42,6 @@ import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.ValidationResult; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -54,6 +53,7 @@ import org.hyperledger.besu.nat.NatService; import org.hyperledger.besu.plugin.services.storage.DataStorageFormat; import org.hyperledger.besu.testutil.BlockTestUtil.ChainResources; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.net.URL; @@ -216,7 +216,7 @@ protected Map getRpcMethods( mock(ApiConfiguration.class), Optional.empty(), transactionSimulator, - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); } protected void startService() throws Exception { diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java index 7afc43f259c..466269ab169 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java @@ -35,7 +35,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -46,6 +45,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.IOException; import java.math.BigInteger; @@ -142,7 +142,7 @@ public void initServerAndClient() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); service = createJsonRpcHttpService(); service.start().join(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java index fdae2d34cab..1d8189f3d15 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java @@ -42,7 +42,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -51,6 +50,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.IOException; import java.math.BigInteger; @@ -173,7 +173,7 @@ public static void initServerAndClient() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); service = createJsonRpcHttpService(); jwtAuth = service.authenticationService.get().getJwtAuthProvider(); service.start().join(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java index f90233fe015..2653f206496 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java @@ -42,7 +42,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration; import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration; @@ -56,6 +55,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.nio.file.Path; @@ -239,7 +239,7 @@ private JsonRpcHttpService createJsonRpcHttpServiceWithRpcApis(final JsonRpcConf mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); final JsonRpcHttpService jsonRpcHttpService = new JsonRpcHttpService( vertx, @@ -352,7 +352,7 @@ private JsonRpcHttpService createJsonRpcHttpService( mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); final JsonRpcHttpService jsonRpcHttpService = new JsonRpcHttpService( vertx, diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java index aabd447c476..b9d4a8adc11 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java @@ -35,7 +35,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -47,6 +46,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.nio.file.Path; @@ -151,7 +151,7 @@ public static void initServerAndClient() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); disabledRpcMethods = new HashMap<>(); addedRpcMethods = new HashSet<>(); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java index 24cffa66b9a..36682145bd8 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java @@ -42,7 +42,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -53,6 +52,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.FileOutputStream; import java.io.IOException; @@ -158,7 +158,7 @@ public void initServer() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); System.setProperty("javax.net.ssl.trustStore", CLIENT_AS_CA_CERT.getKeyStoreFile().toString()); System.setProperty( diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java index 6f51e6cb6fc..a8664638a2d 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java @@ -41,7 +41,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -52,6 +51,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.IOException; import java.math.BigInteger; @@ -144,7 +144,7 @@ public void beforeEach() { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); } @AfterEach diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java index 3fc450934fb..95fba300709 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java @@ -41,7 +41,6 @@ import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -52,6 +51,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.io.IOException; import java.io.UncheckedIOException; @@ -145,7 +145,7 @@ public void initServer() throws Exception { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); service = createJsonRpcHttpService(createJsonRpcConfig()); service.start().join(); baseUrl = service.url(); 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 c240c8bd604..6c17661f6a5 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 @@ -33,9 +33,9 @@ import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.util.Arrays; import java.util.Collection; @@ -68,10 +68,7 @@ public class DebugTraceBlockByHashTest { public void setUp() { debugTraceBlockByHash = new DebugTraceBlockByHash( - protocolSchedule, - blockchainQueries, - metricsSystem, - new EthScheduler(1, 1, 1, metricsSystem)); + protocolSchedule, blockchainQueries, metricsSystem, new DeterministicEthScheduler()); } @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 986bd926971..3f2e39b5423 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 @@ -33,9 +33,9 @@ import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeader; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.ObservableMetricsSystem; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.util.Arrays; import java.util.Collection; @@ -68,10 +68,7 @@ public class DebugTraceBlockByNumberTest { public void setUp() { debugTraceBlockByNumber = new DebugTraceBlockByNumber( - protocolSchedule, - blockchainQueries, - metricsSystem, - new EthScheduler(1, 1, 1, metricsSystem)); + protocolSchedule, blockchainQueries, metricsSystem, new DeterministicEthScheduler()); } @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 f040c2da323..04405b50fdc 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 @@ -38,7 +38,6 @@ import org.hyperledger.besu.ethereum.core.ExecutionContextTestFixture; import org.hyperledger.besu.ethereum.core.MiningConfiguration; import org.hyperledger.besu.ethereum.core.PrivacyParameters; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions; import org.hyperledger.besu.ethereum.mainnet.ProtocolScheduleBuilder; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpecAdapters; @@ -47,6 +46,7 @@ import org.hyperledger.besu.evm.internal.EvmConfiguration; import org.hyperledger.besu.metrics.ObservableMetricsSystem; import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.util.Arrays; @@ -113,7 +113,7 @@ public void setUp() { executionContextTestFixture.getProtocolSchedule(), blockchainQueries, metricsSystem, - new EthScheduler(1, 1, 1, metricsSystem)); + new DeterministicEthScheduler()); } @Test diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java index 08a8ac30780..9f0104a30e3 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceFilterTest.java @@ -25,9 +25,9 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.util.function.Supplier; @@ -76,7 +76,7 @@ public void shouldFailIfParamsExceedMaxRange( blockchainQueries, maxFilterRange, new NoOpMetricsSystem(), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); final JsonRpcResponse response = method.response(request); assertThat(response).isInstanceOf(JsonRpcErrorResponse.class); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java index 7b39d37887c..fa9748432cf 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/WebSocketServiceLoginTest.java @@ -58,6 +58,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.net.URISyntaxException; @@ -208,7 +209,7 @@ public void before() throws URISyntaxException { mock(ApiConfiguration.class), Optional.empty(), mock(TransactionSimulator.class), - new EthScheduler(1, 1, 1, new NoOpMetricsSystem()))); + new DeterministicEthScheduler())); websocketMethods.putAll(rpcMethods); webSocketMessageHandlerSpy = From 7d46e54fe7ed1deb3a9a0cedce2ad403070c9aab Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Wed, 8 Jan 2025 11:38:30 +0100 Subject: [PATCH 11/13] Add a changelog Signed-off-by: Ameziane H. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efaca489248..93b318ad6b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ - Retrieve all transaction receipts for a block in one request [#6646](https://github.com/hyperledger/besu/pull/6646) - Implement EIP-7840: Add blob schedule to config files [#8042](https://github.com/hyperledger/besu/pull/8042) - Allow gasPrice (legacy) and 1559 gasPrice params to be specified simultaneously for `eth_call`, `eth_createAccessList`, and `eth_estimateGas` [#8059](https://github.com/hyperledger/besu/pull/8059) - +- Improve debug_traceBlock calls performance and reduce output size [#8076](https://github.com/hyperledger/besu/pull/8076) ### Bug fixes - Fix serialization of state overrides when `movePrecompileToAddress` is present [#8204](https://github.com/hyperledger/besu/pull/8024) From bc433e53f0157491604b08cef633f996d618dce7 Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Wed, 8 Jan 2025 13:14:48 +0100 Subject: [PATCH 12/13] Use DeterministicEthScheduler instead of EthScheduler in JsonRpcTestMethodsFactory Signed-off-by: Ameziane H. --- .../besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java index e0b47b56f1b..57100943e36 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java @@ -38,7 +38,6 @@ import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; -import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.HeaderValidationMode; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; @@ -52,6 +51,7 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.nat.NatService; +import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.nio.file.Path; @@ -230,6 +230,6 @@ public Map methods() { ImmutableApiConfiguration.builder().build(), Optional.empty(), transactionSimulator, - new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); + new DeterministicEthScheduler()); } } From 447907b3bec0fb3f7e95c87cf9942505ea99f651 Mon Sep 17 00:00:00 2001 From: "Ameziane H." Date: Thu, 9 Jan 2025 10:38:27 +0100 Subject: [PATCH 13/13] Fix unit tests, remove DeterministicEthScheduler for trace tests as it not performant enough Signed-off-by: Ameziane H. --- .../api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java | 2 +- .../ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java index 25a1a25a024..2ccde9cfdb1 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugTraceBlockByNumber.java @@ -153,6 +153,6 @@ protected Object resultByBlockNumber( } return Optional.of(tracesList); })) - .orElse(Collections.emptyList()); + .orElse(null); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java index a51483ce1e3..900744f1a27 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java @@ -42,6 +42,7 @@ import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.manager.EthPeers; +import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.mainnet.ValidationResult; import org.hyperledger.besu.ethereum.p2p.network.P2PNetwork; @@ -53,7 +54,6 @@ import org.hyperledger.besu.nat.NatService; import org.hyperledger.besu.plugin.services.storage.DataStorageFormat; import org.hyperledger.besu.testutil.BlockTestUtil.ChainResources; -import org.hyperledger.besu.testutil.DeterministicEthScheduler; import java.math.BigInteger; import java.net.URL; @@ -216,7 +216,7 @@ protected Map getRpcMethods( mock(ApiConfiguration.class), Optional.empty(), transactionSimulator, - new DeterministicEthScheduler()); + new EthScheduler(1, 1, 1, new NoOpMetricsSystem())); } protected void startService() throws Exception {