Search in sources :

Example 1 with ProtocolSpecBuilder

use of org.hyperledger.besu.ethereum.mainnet.ProtocolSpecBuilder in project besu by hyperledger.

the class BaseBftProtocolSchedule method createProtocolSchedule.

public ProtocolSchedule createProtocolSchedule(final GenesisConfigOptions config, final ForksSchedule<? extends BftConfigOptions> forksSchedule, final PrivacyParameters privacyParameters, final boolean isRevertReasonEnabled, final BftExtraDataCodec bftExtraDataCodec, final EvmConfiguration evmConfiguration) {
    final Map<Long, Function<ProtocolSpecBuilder, ProtocolSpecBuilder>> specMap = new HashMap<>();
    forksSchedule.getForks().forEach(forkSpec -> specMap.put(forkSpec.getBlock(), builder -> applyBftChanges(builder, forkSpec.getValue(), config.isQuorum(), bftExtraDataCodec)));
    final ProtocolSpecAdapters specAdapters = new ProtocolSpecAdapters(specMap);
    return new ProtocolScheduleBuilder(config, DEFAULT_CHAIN_ID, specAdapters, privacyParameters, isRevertReasonEnabled, config.isQuorum(), evmConfiguration).createProtocolSchedule();
}
Also used : MainnetProtocolSpecs(org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSpecs) ProtocolSpecBuilder(org.hyperledger.besu.ethereum.mainnet.ProtocolSpecBuilder) ProtocolSpecAdapters(org.hyperledger.besu.ethereum.mainnet.ProtocolSpecAdapters) ProtocolScheduleBuilder(org.hyperledger.besu.ethereum.mainnet.ProtocolScheduleBuilder) FeeMarket(org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket) HashMap(java.util.HashMap) GenesisConfigOptions(org.hyperledger.besu.config.GenesisConfigOptions) EvmConfiguration(org.hyperledger.besu.evm.internal.EvmConfiguration) Function(java.util.function.Function) ProtocolSchedule(org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule) BftConfigOptions(org.hyperledger.besu.config.BftConfigOptions) MainnetBlockBodyValidator(org.hyperledger.besu.ethereum.mainnet.MainnetBlockBodyValidator) MainnetBlockImporter(org.hyperledger.besu.ethereum.mainnet.MainnetBlockImporter) ForksSchedule(org.hyperledger.besu.consensus.common.ForksSchedule) BlockHeaderValidator(org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator) Map(java.util.Map) Wei(org.hyperledger.besu.datatypes.Wei) BigInteger(java.math.BigInteger) PrivacyParameters(org.hyperledger.besu.ethereum.core.PrivacyParameters) Function(java.util.function.Function) HashMap(java.util.HashMap) ProtocolSpecAdapters(org.hyperledger.besu.ethereum.mainnet.ProtocolSpecAdapters) ProtocolScheduleBuilder(org.hyperledger.besu.ethereum.mainnet.ProtocolScheduleBuilder)

Aggregations

BigInteger (java.math.BigInteger)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Function (java.util.function.Function)1 BftConfigOptions (org.hyperledger.besu.config.BftConfigOptions)1 GenesisConfigOptions (org.hyperledger.besu.config.GenesisConfigOptions)1 ForksSchedule (org.hyperledger.besu.consensus.common.ForksSchedule)1 Wei (org.hyperledger.besu.datatypes.Wei)1 PrivacyParameters (org.hyperledger.besu.ethereum.core.PrivacyParameters)1 BlockHeaderValidator (org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator)1 MainnetBlockBodyValidator (org.hyperledger.besu.ethereum.mainnet.MainnetBlockBodyValidator)1 MainnetBlockImporter (org.hyperledger.besu.ethereum.mainnet.MainnetBlockImporter)1 MainnetProtocolSpecs (org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSpecs)1 ProtocolSchedule (org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule)1 ProtocolScheduleBuilder (org.hyperledger.besu.ethereum.mainnet.ProtocolScheduleBuilder)1 ProtocolSpecAdapters (org.hyperledger.besu.ethereum.mainnet.ProtocolSpecAdapters)1 ProtocolSpecBuilder (org.hyperledger.besu.ethereum.mainnet.ProtocolSpecBuilder)1 FeeMarket (org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket)1 EvmConfiguration (org.hyperledger.besu.evm.internal.EvmConfiguration)1