Search in sources :

Example 1 with TraceType

use of org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter.TraceType in project besu by hyperledger.

the class TraceReplayBlockTransactions method resultByBlockNumber.

@Override
protected Object resultByBlockNumber(final JsonRpcRequestContext request, final long blockNumber) {
    final TraceTypeParameter traceTypeParameter = request.getRequiredParameter(1, TraceTypeParameter.class);
    LOG.trace("Received RPC rpcName={} block={} traceType={}", getName(), blockNumber, traceTypeParameter);
    if (blockNumber == BlockHeader.GENESIS_BLOCK_NUMBER) {
        // Nothing to trace for the genesis block
        return emptyResult();
    }
    return getBlockchainQueries().getBlockchain().getBlockByNumber(blockNumber).map((block) -> traceBlock(block, traceTypeParameter)).orElse(null);
}
Also used : TRACE(org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter.TraceType.TRACE) TraceType(org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter.TraceType) TraceOptions(org.hyperledger.besu.ethereum.debug.TraceOptions) Arrays(java.util.Arrays) TraceTypeParameter(org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter) LoggerFactory(org.slf4j.LoggerFactory) TraceFormatter(org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.TraceFormatter) Supplier(java.util.function.Supplier) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ProtocolSchedule(org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BlockParameter(org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter) JsonRpcRequestContext(org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext) BlockTrace(org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTrace) Suppliers(com.google.common.base.Suppliers) JsonNode(com.fasterxml.jackson.databind.JsonNode) Block(org.hyperledger.besu.ethereum.core.Block) FlatTraceGenerator(org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.flat.FlatTraceGenerator) TraceWriter(org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.TraceWriter) TransactionTrace(org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTrace) Logger(org.slf4j.Logger) VmTraceGenerator(org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.vm.VmTraceGenerator) BlockHeader(org.hyperledger.besu.ethereum.core.BlockHeader) BlockchainQueries(org.hyperledger.besu.ethereum.api.query.BlockchainQueries) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Set(java.util.Set) DebugOperationTracer(org.hyperledger.besu.ethereum.vm.DebugOperationTracer) TransactionProcessingResult(org.hyperledger.besu.ethereum.processing.TransactionProcessingResult) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) List(java.util.List) RpcMethod(org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod) Optional(java.util.Optional) StateDiffGenerator(org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.tracing.diff.StateDiffGenerator) VM_TRACE(org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter.TraceType.VM_TRACE) BlockTracer(org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer) TraceTypeParameter(org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 Suppliers (com.google.common.base.Suppliers)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Optional (java.util.Optional)1 Set (java.util.Set)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Supplier (java.util.function.Supplier)1 RpcMethod (org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod)1 JsonRpcRequestContext (org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext)1 BlockParameter (org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.BlockParameter)1 TraceTypeParameter (org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter)1 TraceType (org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter.TraceType)1 TRACE (org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter.TraceType.TRACE)1 VM_TRACE (org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.TraceTypeParameter.TraceType.VM_TRACE)1 BlockTrace (org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTrace)1 BlockTracer (org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer)1