private ChainDataPruner createChainPruner(
      final BlockchainStorage blockchainStorage,
      final Runnable unsubscribeRunnable,
      final SyncState syncState) {
    return new ChainDataPruner(
        blockchainStorage,
        unsubscribeRunnable,
        new ChainDataPrunerStorage(
            storageProvider.getStorageBySegmentIdentifier(
                KeyValueSegmentIdentifier.CHAIN_PRUNER_STATE)),
        syncState.getCheckpoint().map(Checkpoint::blockNumber).orElse(0L),
        chainPrunerConfiguration.chainPruningEnabled()
            ? ChainDataPruner.Mode.CHAIN_PRUNING
            : (dataStorageConfiguration.getHistoryExpiryPruneEnabled()
                ? ChainDataPruner.Mode.PRE_MERGE_PRUNING
                : null),
        chainPrunerConfiguration.chainPruningBlocksRetained(),
        chainPrunerConfiguration.blocksFrequency(),
        chainPrunerConfiguration.preMergePruningBlocksQuantity(),
        MonitoredExecutors.newBoundedThreadPool(
            EthScheduler.class.getSimpleName() + "-ChainDataPruner",
            1,
            1,
            ChainDataPruner.MAX_PRUNING_THREAD_QUEUE_SIZE,
            metricsSystem));
  }
Create protocol context protocol context.

@param blockchain the blockchain
@param worldStateArchive the world state archive
@param consensusContext the consensus context
@param serviceManager plugin service manager
@return the protocol context
app/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java