use of org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket in project besu by hyperledger.
the class QbftProtocolSchedule method createBlockHeaderRuleset.
@Override
protected BlockHeaderValidator.Builder createBlockHeaderRuleset(final BftConfigOptions config, final FeeMarket feeMarket) {
checkArgument(config instanceof QbftConfigOptions, "QbftProtocolSchedule must use QbftConfigOptions");
final QbftConfigOptions qbftConfigOptions = (QbftConfigOptions) config;
final Optional<BaseFeeMarket> baseFeeMarket = Optional.of(feeMarket).filter(FeeMarket::implementsBaseFee).map(BaseFeeMarket.class::cast);
return QbftBlockHeaderValidationRulesetFactory.blockHeaderValidator(qbftConfigOptions.getBlockPeriodSeconds(), qbftConfigOptions.isValidatorContractMode(), baseFeeMarket);
}
use of org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket in project besu by hyperledger.
the class MainnetProtocolSpecs method londonDefinition.
static ProtocolSpecBuilder londonDefinition(final Optional<BigInteger> chainId, final OptionalInt configContractSizeLimit, final OptionalInt configStackSizeLimit, final boolean enableRevertReason, final GenesisConfigOptions genesisConfigOptions, final boolean quorumCompatibilityMode, final EvmConfiguration evmConfiguration) {
final int contractSizeLimit = configContractSizeLimit.orElse(SPURIOUS_DRAGON_CONTRACT_SIZE_LIMIT);
final int stackSizeLimit = configStackSizeLimit.orElse(MessageFrame.DEFAULT_MAX_STACK_SIZE);
final long londonForkBlockNumber = genesisConfigOptions.getLondonBlockNumber().orElse(Long.MAX_VALUE);
final BaseFeeMarket londonFeeMarket = FeeMarket.london(londonForkBlockNumber, genesisConfigOptions.getBaseFeePerGas());
return berlinDefinition(chainId, configContractSizeLimit, configStackSizeLimit, enableRevertReason, quorumCompatibilityMode, evmConfiguration).gasCalculator(LondonGasCalculator::new).gasLimitCalculator(new LondonTargetingGasLimitCalculator(londonForkBlockNumber, londonFeeMarket)).transactionValidatorBuilder(gasCalculator -> new MainnetTransactionValidator(gasCalculator, londonFeeMarket, true, chainId, Set.of(TransactionType.FRONTIER, TransactionType.ACCESS_LIST, TransactionType.EIP1559), quorumCompatibilityMode)).transactionProcessorBuilder((gasCalculator, transactionValidator, contractCreationProcessor, messageCallProcessor) -> new MainnetTransactionProcessor(gasCalculator, transactionValidator, contractCreationProcessor, messageCallProcessor, true, stackSizeLimit, londonFeeMarket, CoinbaseFeePriceCalculator.eip1559())).contractCreationProcessorBuilder((gasCalculator, evm) -> new ContractCreationProcessor(gasCalculator, evm, true, List.of(MaxCodeSizeRule.of(contractSizeLimit), PrefixCodeRule.of()), 1, SPURIOUS_DRAGON_FORCE_DELETE_WHEN_EMPTY_ADDRESSES)).evmBuilder((gasCalculator, jdCacheConfig) -> MainnetEVMs.london(gasCalculator, chainId.orElse(BigInteger.ZERO), evmConfiguration)).feeMarket(londonFeeMarket).difficultyCalculator(MainnetDifficultyCalculators.LONDON).blockHeaderValidatorBuilder(feeMarket -> MainnetBlockHeaderValidator.createBaseFeeMarketValidator(londonFeeMarket)).ommerHeaderValidatorBuilder(feeMarket -> MainnetBlockHeaderValidator.createBaseFeeMarketOmmerValidator(londonFeeMarket)).blockBodyValidatorBuilder(BaseFeeBlockBodyValidator::new).name(LONDON_FORK_NAME);
}
Aggregations