private Optional<List<TransactionProcessingResult>> trace(
      final Block block, final BlockAwareOperationTracer tracer) {
    LOG.debug("Tracing block {}", block.toLogString());
    final Blockchain blockchain = blockchainQueries.getBlockchain();

    final Optional<List<TransactionProcessingResult>> results =
        Tracer.processTracing(
            blockchainQueries,
            block.getHash(),
            traceableState ->
                Optional.of(trace(blockchain, block, new ChainUpdater(traceableState), tracer)));

    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