private List<TransactionProcessingResult> trace(
      final Blockchain blockchain,
      final Block block,
      final ChainUpdater chainUpdater,
      final BlockAwareOperationTracer tracer) {
    final List<TransactionProcessingResult> results = new ArrayList<>();
    final ProtocolSpec protocolSpec = protocolSchedule.getByBlockHeader(block.getHeader());
    final MainnetTransactionProcessor transactionProcessor = protocolSpec.getTransactionProcessor();
    final BlockHeader header = block.getHeader();
    final Address miningBeneficiary =
        protocolSpec.getMiningBeneficiaryCalculator().calculateBeneficiary(block.getHeader());
    tracer.traceStartBlock(block.getHeader(), block.getBody(), miningBeneficiary);

    block
        .getBody()
        .getTransactions()
        .forEach(
            transaction -> {
              final Optional<BlockHeader> maybeParentHeader =
                  blockchain.getBlockHeader(header.getParentHash());
              final Wei blobGasPrice =
                  protocolSpec
                      .getFeeMarket()
                      .blobGasPricePerGas(
                          maybeParentHeader
                              .map(parent -> calculateExcessBlobGasForParent(protocolSpec, parent))
                              .orElse(BlobGas.ZERO));

              final WorldUpdater worldUpdater = chainUpdater.getNextUpdater();
              final TransactionProcessingResult result =
                  transactionProcessor.processTransaction(
                      worldUpdater,
                      header,
                      transaction,
                      protocolSpec.getMiningBeneficiaryCalculator().calculateBeneficiary(header),
                      tracer,
                      protocolSpec
                          .getBlockHashProcessor()
                          .createBlockHashLookup(blockchain, header),
                      blobGasPrice);

              results.add(result);
            });

    tracer.traceEndBlock(block.getHeader(), block.getBody());

    return results;
  }
Traces range of blocks

@param fromBlockNumber the beginning of the range (inclusive)
@param toBlockNumber the end of the range (inclusive)
@param beforeTracing Function which performs an operation on a MutableWorldState before tracing
@param afterTracing Function which performs an operation on a MutableWorldState after tracing
@param tracer an instance of OperationTracer
app/src/main/java/org/hyperledger/besu/services/TraceServiceImpl.java