Search in sources :

Example 1 with IbftLegacyConfigOptions

use of org.hyperledger.besu.config.IbftLegacyConfigOptions in project besu by hyperledger.

the class IbftLegacyBesuControllerBuilder method createConsensusContext.

@Override
protected IbftLegacyContext createConsensusContext(final Blockchain blockchain, final WorldStateArchive worldStateArchive, final ProtocolSchedule protocolSchedule) {
    final IbftLegacyConfigOptions ibftConfig = configOptionsSupplier.get().getIbftLegacyConfigOptions();
    final EpochManager epochManager = new EpochManager(ibftConfig.getEpochLength());
    final ValidatorProvider validatorProvider = BlockValidatorProvider.nonForkingValidatorProvider(blockchain, epochManager, blockInterface);
    return new IbftLegacyContext(validatorProvider, epochManager, blockInterface);
}
Also used : IbftLegacyConfigOptions(org.hyperledger.besu.config.IbftLegacyConfigOptions) IbftLegacyContext(org.hyperledger.besu.consensus.ibft.IbftLegacyContext) EpochManager(org.hyperledger.besu.consensus.common.EpochManager) BlockValidatorProvider(org.hyperledger.besu.consensus.common.validator.blockbased.BlockValidatorProvider) ValidatorProvider(org.hyperledger.besu.consensus.common.validator.ValidatorProvider)

Example 2 with IbftLegacyConfigOptions

use of org.hyperledger.besu.config.IbftLegacyConfigOptions in project besu by hyperledger.

the class IbftProtocolSchedule method create.

public static ProtocolSchedule create(final GenesisConfigOptions config, final PrivacyParameters privacyParameters, final boolean isRevertReasonEnabled, final EvmConfiguration evmConfiguration) {
    final IbftLegacyConfigOptions ibftConfig = config.getIbftLegacyConfigOptions();
    final long blockPeriod = ibftConfig.getBlockPeriodSeconds();
    return new ProtocolScheduleBuilder(config, DEFAULT_CHAIN_ID, ProtocolSpecAdapters.create(0, builder -> applyIbftChanges(blockPeriod, builder, config.isQuorum(), ibftConfig.getCeil2Nby3Block())), privacyParameters, isRevertReasonEnabled, config.isQuorum(), evmConfiguration).createProtocolSchedule();
}
Also used : IbftLegacyConfigOptions(org.hyperledger.besu.config.IbftLegacyConfigOptions) ProtocolScheduleBuilder(org.hyperledger.besu.ethereum.mainnet.ProtocolScheduleBuilder)

Aggregations

IbftLegacyConfigOptions (org.hyperledger.besu.config.IbftLegacyConfigOptions)2 EpochManager (org.hyperledger.besu.consensus.common.EpochManager)1 ValidatorProvider (org.hyperledger.besu.consensus.common.validator.ValidatorProvider)1 BlockValidatorProvider (org.hyperledger.besu.consensus.common.validator.blockbased.BlockValidatorProvider)1 IbftLegacyContext (org.hyperledger.besu.consensus.ibft.IbftLegacyContext)1 ProtocolScheduleBuilder (org.hyperledger.besu.ethereum.mainnet.ProtocolScheduleBuilder)1