Search in sources :

Example 1 with DefaultSynchronizer

use of org.hyperledger.besu.ethereum.eth.sync.DefaultSynchronizer in project besu by hyperledger.

the class TransitionBesuControllerBuilder method createSynchronizer.

@Override
protected DefaultSynchronizer createSynchronizer(final ProtocolSchedule protocolSchedule, final WorldStateStorage worldStateStorage, final ProtocolContext protocolContext, final Optional<Pruner> maybePruner, final EthContext ethContext, final SyncState syncState, final EthProtocolManager ethProtocolManager, final PivotBlockSelector pivotBlockSelector) {
    DefaultSynchronizer sync = super.createSynchronizer(protocolSchedule, worldStateStorage, protocolContext, maybePruner, ethContext, syncState, ethProtocolManager, pivotBlockSelector);
    ConsensusContext cc = protocolContext.getConsensusContext(ConsensusContext.class);
    if (cc instanceof MergeContext) {
        protocolContext.getConsensusContext(MergeContext.class).addNewForkchoiceMessageListener(sync);
    }
    return sync;
}
Also used : ConsensusContext(org.hyperledger.besu.ethereum.ConsensusContext) MergeContext(org.hyperledger.besu.consensus.merge.MergeContext) PostMergeContext(org.hyperledger.besu.consensus.merge.PostMergeContext) DefaultSynchronizer(org.hyperledger.besu.ethereum.eth.sync.DefaultSynchronizer)

Aggregations

MergeContext (org.hyperledger.besu.consensus.merge.MergeContext)1 PostMergeContext (org.hyperledger.besu.consensus.merge.PostMergeContext)1 ConsensusContext (org.hyperledger.besu.ethereum.ConsensusContext)1 DefaultSynchronizer (org.hyperledger.besu.ethereum.eth.sync.DefaultSynchronizer)1