use of org.hyperledger.besu.evm.MainnetEVMs in project besu by hyperledger.
the class MainnetProtocolSpecs method frontierDefinition.
public static ProtocolSpecBuilder frontierDefinition(final OptionalInt configContractSizeLimit, final OptionalInt configStackSizeLimit, final boolean goQuorumMode, final EvmConfiguration evmConfiguration) {
final int contractSizeLimit = configContractSizeLimit.orElse(FRONTIER_CONTRACT_SIZE_LIMIT);
final int stackSizeLimit = configStackSizeLimit.orElse(MessageFrame.DEFAULT_MAX_STACK_SIZE);
return new ProtocolSpecBuilder().gasCalculator(FrontierGasCalculator::new).gasLimitCalculator(new FrontierTargetingGasLimitCalculator()).evmBuilder(MainnetEVMs::frontier).precompileContractRegistryBuilder(MainnetPrecompiledContractRegistries::frontier).messageCallProcessorBuilder(MessageCallProcessor::new).contractCreationProcessorBuilder((gasCalculator, evm) -> new ContractCreationProcessor(gasCalculator, evm, false, Collections.singletonList(MaxCodeSizeRule.of(contractSizeLimit)), 0)).transactionValidatorBuilder(gasCalculator -> new MainnetTransactionValidator(gasCalculator, false, Optional.empty(), goQuorumMode)).transactionProcessorBuilder((gasCalculator, transactionValidator, contractCreationProcessor, messageCallProcessor) -> new MainnetTransactionProcessor(gasCalculator, transactionValidator, contractCreationProcessor, messageCallProcessor, false, stackSizeLimit, FeeMarket.legacy(), CoinbaseFeePriceCalculator.frontier())).privateTransactionProcessorBuilder((gasCalculator, transactionValidator, contractCreationProcessor, messageCallProcessor, privateTransactionValidator) -> new PrivateTransactionProcessor(gasCalculator, transactionValidator, contractCreationProcessor, messageCallProcessor, false, stackSizeLimit, new PrivateTransactionValidator(Optional.empty()))).difficultyCalculator(MainnetDifficultyCalculators.FRONTIER).blockHeaderValidatorBuilder(feeMarket -> MainnetBlockHeaderValidator.create()).ommerHeaderValidatorBuilder(feeMarket -> MainnetBlockHeaderValidator.createLegacyFeeMarketOmmerValidator()).blockBodyValidatorBuilder(MainnetBlockBodyValidator::new).transactionReceiptFactory(MainnetProtocolSpecs::frontierTransactionReceiptFactory).blockReward(FRONTIER_BLOCK_REWARD).skipZeroBlockRewards(false).blockProcessorBuilder(MainnetProtocolSpecs.blockProcessorBuilder(goQuorumMode)).blockValidatorBuilder(MainnetProtocolSpecs.blockValidatorBuilder(goQuorumMode)).blockImporterBuilder(MainnetBlockImporter::new).blockHeaderFunctions(new MainnetBlockHeaderFunctions()).miningBeneficiaryCalculator(BlockHeader::getCoinbase).evmConfiguration(evmConfiguration).name("Frontier");
}
use of org.hyperledger.besu.evm.MainnetEVMs in project besu by hyperledger.
the class ClassicProtocolSpecs method atlantisDefinition.
public static ProtocolSpecBuilder atlantisDefinition(final Optional<BigInteger> chainId, final OptionalInt configContractSizeLimit, final OptionalInt configStackSizeLimit, final boolean enableRevertReason, final OptionalLong ecip1017EraRounds, final boolean quorumCompatibilityMode, final EvmConfiguration evmConfiguration) {
final int contractSizeLimit = configContractSizeLimit.orElse(MainnetProtocolSpecs.SPURIOUS_DRAGON_CONTRACT_SIZE_LIMIT);
final int stackSizeLimit = configStackSizeLimit.orElse(MessageFrame.DEFAULT_MAX_STACK_SIZE);
return gothamDefinition(chainId, configContractSizeLimit, configStackSizeLimit, ecip1017EraRounds, quorumCompatibilityMode, evmConfiguration).evmBuilder(MainnetEVMs::byzantium).evmConfiguration(evmConfiguration).gasCalculator(SpuriousDragonGasCalculator::new).skipZeroBlockRewards(true).messageCallProcessorBuilder(MessageCallProcessor::new).precompileContractRegistryBuilder(MainnetPrecompiledContractRegistries::byzantium).difficultyCalculator(ClassicDifficultyCalculators.EIP100).transactionReceiptFactory(enableRevertReason ? ClassicProtocolSpecs::byzantiumTransactionReceiptFactoryWithReasonEnabled : ClassicProtocolSpecs::byzantiumTransactionReceiptFactory).contractCreationProcessorBuilder((gasCalculator, evm) -> new ContractCreationProcessor(gasCalculator, evm, true, Collections.singletonList(MaxCodeSizeRule.of(contractSizeLimit)), 1)).transactionProcessorBuilder((gasCalculator, transactionValidator, contractCreationProcessor, messageCallProcessor) -> new MainnetTransactionProcessor(gasCalculator, transactionValidator, contractCreationProcessor, messageCallProcessor, true, stackSizeLimit, FeeMarket.legacy(), CoinbaseFeePriceCalculator.frontier())).name("Atlantis");
}
Aggregations