Feature/1559 cleanup remove experimentaleip (#2586)

Signed-off-by: garyschulte <garyschulte@gmail.com>
pull/2623/head
garyschulte 3 years ago committed by GitHub
parent 47a3941467
commit b9e1ce05c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  2. 4
      besu/src/main/java/org/hyperledger/besu/cli/subcommands/RetestethSubCommand.java
  3. 13
      besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java
  4. 6
      besu/src/test/java/org/hyperledger/besu/services/BesuEventsImplTest.java
  5. 7
      config/src/main/java/org/hyperledger/besu/config/GenesisConfigFile.java
  6. 32
      config/src/main/java/org/hyperledger/besu/config/experimental/ExperimentalEIPs.java
  7. 8
      config/src/test/java/org/hyperledger/besu/config/GenesisConfigFileTest.java
  8. 1
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/frontier/EthGetFilterChangesIntegrationTest.java
  9. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthFeeHistoryTest.java
  10. 2
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetTransactionReceiptTest.java
  11. 3
      ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java
  12. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/GenesisState.java
  13. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Transaction.java
  14. 4
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/fees/BaseFee.java
  15. 5
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/fees/EIP1559.java
  16. 14
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/fees/FeeMarketException.java
  17. 4
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/fees/TransactionPriceCalculator.java
  18. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java
  19. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSchedule.java
  20. 19
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpec.java
  21. 9
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpecBuilder.java
  22. 6
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/FeeMarket.java
  23. 18
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/feemarket/LondonFeeMarket.java
  24. 8
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/LondonFeeMarketBlockHeaderGasPriceValidationRule.java
  25. 4
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/PoWSolverTest.java
  26. 32
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java
  27. 12
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolFactory.java
  28. 4
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTest.java
  29. 4
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/AbstractMessageTaskTest.java
  30. 4
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java
  31. 3
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolFactoryTest.java
  32. 12
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolTest.java
  33. 4
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java
  34. 1
      ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/NoRewardProtocolScheduleWrapper.java
  35. 7
      ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/RetestethContext.java
  36. 12
      ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/methods/TestSetChainParams.java
  37. 2
      ethereum/retesteth/src/test/resources/org/hyperledger/besu/ethereum/retesteth/methods/1559ChainParams.json

@ -78,7 +78,6 @@ import org.hyperledger.besu.cli.util.VersionProvider;
import org.hyperledger.besu.config.GenesisConfigFile;
import org.hyperledger.besu.config.GenesisConfigOptions;
import org.hyperledger.besu.config.GoQuorumOptions;
import org.hyperledger.besu.config.experimental.ExperimentalEIPs;
import org.hyperledger.besu.controller.BesuController;
import org.hyperledger.besu.controller.BesuControllerBuilder;
import org.hyperledger.besu.controller.TargetingGasLimitCalculator;
@ -1181,7 +1180,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
.setCaseInsensitiveEnumValuesAllowed(true);
handleStableOptions();
enableExperimentalEIPs();
addSubCommands(resultHandler, in);
registerConverters();
handleUnstableOptions();
@ -1228,11 +1226,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
this.pluginCommonConfiguration = pluginCommonConfiguration;
}
private void enableExperimentalEIPs() {
// Usage of static command line flags is strictly reserved for experimental EIPs
commandLine.addMixin("experimentalEIPs", ExperimentalEIPs.class);
}
private void addSubCommands(
final AbstractParseResultHandler<List<Object>> resultHandler, final InputStream in) {
commandLine.addSubcommand(

@ -19,7 +19,6 @@ import static org.hyperledger.besu.cli.subcommands.RetestethSubCommand.COMMAND_N
import org.hyperledger.besu.BesuInfo;
import org.hyperledger.besu.cli.DefaultCommandValues;
import org.hyperledger.besu.cli.custom.JsonRPCAllowlistHostsProperty;
import org.hyperledger.besu.config.experimental.ExperimentalEIPs;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration;
import org.hyperledger.besu.ethereum.retesteth.RetestethConfiguration;
import org.hyperledger.besu.ethereum.retesteth.RetestethService;
@ -32,7 +31,6 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Configurator;
import picocli.CommandLine.Command;
import picocli.CommandLine.Mixin;
import picocli.CommandLine.Option;
@Command(
@ -53,8 +51,6 @@ public class RetestethSubCommand implements Runnable {
*/
public static final int RETESTETH_PORT = 47710;
@Mixin private final ExperimentalEIPs experimentalEIPs = new ExperimentalEIPs();
@Option(
names = {"--data-path"},
paramLabel = DefaultCommandValues.MANDATORY_PATH_FORMAT_HELP,

@ -17,7 +17,6 @@ package org.hyperledger.besu.controller;
import static com.google.common.base.Preconditions.checkNotNull;
import org.hyperledger.besu.config.GenesisConfigFile;
import org.hyperledger.besu.config.GenesisConfigOptions;
import org.hyperledger.besu.crypto.NodeKey;
import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.methods.JsonRpcMethods;
@ -33,7 +32,6 @@ import org.hyperledger.besu.ethereum.core.Hash;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.core.fees.EIP1559;
import org.hyperledger.besu.ethereum.eth.EthProtocol;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
@ -299,14 +297,6 @@ public abstract class BesuControllerBuilder {
final SyncState syncState = new SyncState(blockchain, ethPeers);
final boolean fastSyncEnabled = SyncMode.FAST.equals(syncConfig.getSyncMode());
final Optional<EIP1559> eip1559;
final GenesisConfigOptions genesisConfigOptions =
genesisConfig.getConfigOptions(genesisConfigOverrides);
if (genesisConfigOptions.getEIP1559BlockNumber().isPresent()) {
eip1559 = Optional.of(new EIP1559(genesisConfigOptions.getEIP1559BlockNumber().getAsLong()));
} else {
eip1559 = Optional.empty();
}
final TransactionPool transactionPool =
TransactionPoolFactory.createTransactionPool(
protocolSchedule,
@ -316,8 +306,7 @@ public abstract class BesuControllerBuilder {
metricsSystem,
syncState,
miningParameters.getMinTransactionGasPrice(),
transactionPoolConfiguration,
eip1559);
transactionPoolConfiguration);
final EthProtocolManager ethProtocolManager =
createEthProtocolManager(

@ -53,6 +53,7 @@ import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionValidator;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
import org.hyperledger.besu.ethereum.mainnet.ValidationResult;
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStoragePrefixedKeyBlockchainStorage;
import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive;
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem;
@ -129,6 +130,8 @@ public class BesuEventsImplTest {
when(mockProtocolContext.getWorldStateArchive()).thenReturn(mockWorldStateArchive);
when(mockProtocolSchedule.getByBlockNumber(anyLong())).thenReturn(mockProtocolSpec);
when(mockProtocolSpec.getTransactionValidator()).thenReturn(mockTransactionValidator);
when(mockProtocolSpec.getEip1559()).thenReturn(Optional.of(new EIP1559(0L)));
when(mockProtocolSpec.getFeeMarket()).thenReturn(Optional.of(FeeMarket.london()));
when(mockTransactionValidator.validate(any(), any(Optional.class), any()))
.thenReturn(ValidationResult.valid());
when(mockTransactionValidator.validateForSender(any(), any(), any()))
@ -150,8 +153,7 @@ public class BesuEventsImplTest {
new NoOpMetricsSystem(),
syncState,
Wei.ZERO,
txPoolConfig,
Optional.of(new EIP1559(0)));
txPoolConfig);
serviceImpl = new BesuEventsImpl(blockchain, blockBroadcaster, transactionPool, syncState);
}

@ -17,8 +17,6 @@ package org.hyperledger.besu.config;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.hyperledger.besu.config.JsonUtil.normalizeKeys;
import org.hyperledger.besu.config.experimental.ExperimentalEIPs;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
@ -129,11 +127,6 @@ public class GenesisConfigFile {
.map(baseFeeStr -> parseLong("baseFeePerGas", baseFeeStr));
}
public Optional<Long> getGenesisBaseFeePerGas() {
return Optional.of(getBaseFeePerGas().orElse(ExperimentalEIPs.initialBasefee))
.filter(z -> 0L == getConfigOptions().getEIP1559BlockNumber().orElse(-1L));
}
public String getMixHash() {
return JsonUtil.getString(configRoot, "mixhash", "");
}

@ -1,32 +0,0 @@
/*
* Copyright ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.hyperledger.besu.config.experimental;
import picocli.CommandLine.Option;
/**
* Flags defined in this class must be used with caution, and strictly reserved to experimental
* EIPs.
*/
public class ExperimentalEIPs {
// To make it easier for tests to reset the value to default
public static final long EIP1559_BASEFEE_DEFAULT_VALUE = 1000000000L;
@Option(
hidden = true,
names = {"--Xeip1559-initial-base-fee"},
arity = "1")
public static Long initialBasefee = EIP1559_BASEFEE_DEFAULT_VALUE;
}

@ -19,8 +19,6 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.hyperledger.besu.config.GenesisConfigFile.fromConfig;
import org.hyperledger.besu.config.experimental.ExperimentalEIPs;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
@ -150,8 +148,6 @@ public class GenesisConfigFileTest {
GenesisConfigFile.fromConfig("{\"config\":{\"londonBlock\":0},\"baseFeePerGas\":\"0xa\"}");
assertThat(withBaseFeeAtGenesis.getBaseFeePerGas()).isPresent();
assertThat(withBaseFeeAtGenesis.getBaseFeePerGas().get()).isEqualTo(10L);
assertThat(withBaseFeeAtGenesis.getGenesisBaseFeePerGas()).isPresent();
assertThat(withBaseFeeAtGenesis.getGenesisBaseFeePerGas().get()).isEqualTo(10L);
}
@Test
@ -159,15 +155,11 @@ public class GenesisConfigFileTest {
GenesisConfigFile withBaseFeeAtGenesis =
GenesisConfigFile.fromConfig("{\"config\":{\"londonBlock\":0}}");
assertThat(withBaseFeeAtGenesis.getBaseFeePerGas()).isNotPresent();
assertThat(withBaseFeeAtGenesis.getGenesisBaseFeePerGas()).isPresent();
assertThat(withBaseFeeAtGenesis.getGenesisBaseFeePerGas().get())
.isEqualTo(ExperimentalEIPs.EIP1559_BASEFEE_DEFAULT_VALUE);
}
@Test
public void shouldNotGetBaseFeeAtGenesis() {
assertThat(EMPTY_CONFIG.getBaseFeePerGas()).isNotPresent();
assertThat(EMPTY_CONFIG.getGenesisBaseFeePerGas()).isNotPresent();
}
@Test

@ -127,7 +127,6 @@ public class EthGetFilterChangesIntegrationTest {
peerPendingTransactionTracker,
Wei.ZERO,
metricsSystem,
Optional.empty(),
TransactionPoolConfiguration.DEFAULT);
final BlockchainQueries blockchainQueries =
new BlockchainQueries(blockchain, protocolContext.getWorldStateArchive());

@ -22,7 +22,6 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.hyperledger.besu.config.experimental.ExperimentalEIPs;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequest;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters;
@ -39,6 +38,7 @@ import org.hyperledger.besu.ethereum.core.BlockDataGenerator;
import org.hyperledger.besu.ethereum.core.fees.EIP1559;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
import java.util.List;
import java.util.Optional;
@ -145,7 +145,7 @@ public class EthFeeHistoryTest {
(FeeHistory.FeeHistoryResult)
((JsonRpcSuccessResponse) feeHistoryRequest(1, "latest")).getResult();
assertThat(Long.decode(result.getBaseFeePerGas().get(1)))
.isEqualTo(ExperimentalEIPs.EIP1559_BASEFEE_DEFAULT_VALUE);
.isEqualTo(FeeMarket.london().getInitialBasefee());
}
@Test

@ -108,6 +108,7 @@ public class EthGetTransactionReceiptTest {
null,
TransactionPriceCalculator.frontier(),
Optional.empty(),
Optional.empty(),
null,
Optional.of(PoWHasher.ETHASH_LIGHT));
private final ProtocolSpec statusTransactionTypeSpec =
@ -133,6 +134,7 @@ public class EthGetTransactionReceiptTest {
null,
TransactionPriceCalculator.frontier(),
Optional.empty(),
Optional.empty(),
null,
Optional.of(PoWHasher.ETHASH_LIGHT));

@ -259,7 +259,8 @@ public abstract class AbstractBlockCreator implements AsyncBlockCreator {
difficultyCalculator.nextDifficulty(timestamp, parentHeader, protocolContext);
Long baseFee = null;
if (protocolSpec.isEip1559()) {
if (protocolSpec.hasFeeMarket()) {
// TODO roll eip1559 into feeMarket
final EIP1559 eip1559 = protocolSpec.getEip1559().orElseThrow();
if (eip1559.isForkBlock(newBlockNumber)) {
gasLimit = gasLimit * eip1559.getFeeMarket().getSlackCoefficient();

@ -156,7 +156,7 @@ public final class GenesisState {
.mixHash(parseMixHash(genesis))
.nonce(parseNonce(genesis))
.blockHeaderFunctions(ScheduleBasedBlockHeaderFunctions.create(protocolSchedule))
.baseFee(genesis.getGenesisBaseFeePerGas().orElse(null))
.baseFee(genesis.getBaseFeePerGas().orElse(null))
.buildBlockHeader();
}

@ -375,7 +375,7 @@ public class Transaction
.map(
maybeNegativeEffectivePriorityFeePerGas ->
Math.max(0, maybeNegativeEffectivePriorityFeePerGas))
.orElseGet(() -> getGasPrice().get().getValue().longValue());
.orElseGet(() -> getGasPrice().map(Wei::getValue).map(Number::longValue).orElse(0L));
}
/**
* Returns the transaction gas limit.

@ -36,13 +36,13 @@ public class BaseFee {
public static Wei minTransactionPriceInNextBlock(
final Transaction transaction,
final FeeMarket feeMarket,
final TransactionPriceCalculator calculator,
final Supplier<Optional<Long>> baseFeeSupplier) {
final Optional<Long> baseFee = baseFeeSupplier.get();
Optional<Long> minBaseFeeInNextBlock = Optional.empty();
if (baseFee.isPresent()) {
minBaseFeeInNextBlock =
Optional.of(new BaseFee(FeeMarket.london(), baseFee.get()).getMinNextValue());
minBaseFeeInNextBlock = Optional.of(new BaseFee(feeMarket, baseFee.get()).getMinNextValue());
}
return calculator.price(transaction, minBaseFeeInNextBlock);
}

@ -29,10 +29,11 @@ public class EIP1559 {
private final long initialForkBlknum;
private final FeeMarket feeMarket = FeeMarket.london();
private final FeeMarket feeMarket;
public EIP1559(final long forkBlockNumber) {
initialForkBlknum = forkBlockNumber;
this.initialForkBlknum = forkBlockNumber;
this.feeMarket = FeeMarket.london();
}
public long computeBaseFee(

@ -14,18 +14,18 @@
*/
package org.hyperledger.besu.ethereum.core.fees;
public class LondonFeeMarketException extends Exception {
public class FeeMarketException extends Exception {
public static LondonFeeMarketException MissingBaseFeeFromBlockHeader() {
return new LondonFeeMarketException("Invalid block header: basefee should be specified");
public static FeeMarketException MissingBaseFeeFromBlockHeader() {
return new FeeMarketException("Invalid block header: basefee should be specified");
}
public static LondonFeeMarketException BaseFeePresentBeforeForkBlock() {
return new LondonFeeMarketException(
"Invalid block header: basefee should not be present before London fork block");
public static FeeMarketException BaseFeePresentBeforeForkBlock() {
return new FeeMarketException(
"Invalid block header: basefee should not be present before fee market fork block");
}
private LondonFeeMarketException(final String reason) {
private FeeMarketException(final String reason) {
super(reason);
}
}

@ -24,14 +24,14 @@ public interface TransactionPriceCalculator {
Wei price(Transaction transaction, Optional<Long> baseFee);
static TransactionPriceCalculator frontier() {
return (transaction, baseFee) -> transaction.getGasPrice().get();
return (transaction, baseFee) -> transaction.getGasPrice().orElse(Wei.ZERO);
}
static TransactionPriceCalculator eip1559() {
return (transaction, maybeBaseFee) -> {
final Wei baseFee = Wei.of(maybeBaseFee.orElseThrow());
if (!transaction.getType().supports1559FeeMarket()) {
return transaction.getGasPrice().get();
return transaction.getGasPrice().orElse(Wei.ZERO);
}
final Wei maxPriorityFeePerGas = transaction.getMaxPriorityFeePerGas().orElseThrow();
final Wei maxFeePerGas = transaction.getMaxFeePerGas().orElseThrow();

@ -37,6 +37,7 @@ import org.hyperledger.besu.ethereum.mainnet.ProtocolSpecBuilder.BlockProcessorB
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpecBuilder.BlockValidatorBuilder;
import org.hyperledger.besu.ethereum.mainnet.contractvalidation.MaxCodeSizeRule;
import org.hyperledger.besu.ethereum.mainnet.contractvalidation.PrefixCodeRule;
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
import org.hyperledger.besu.ethereum.privacy.PrivateTransactionProcessor;
import org.hyperledger.besu.ethereum.privacy.PrivateTransactionValidator;
import org.hyperledger.besu.ethereum.privacy.storage.PrivateMetadataUpdater;
@ -517,6 +518,7 @@ public abstract class MainnetProtocolSpecs {
MainnetEvmRegistries.london(gasCalculator, chainId.orElse(BigInteger.ZERO)))
.transactionPriceCalculator(transactionPriceCalculator.orElseThrow())
.eip1559(Optional.of(eip1559))
.feeMarket(Optional.of(FeeMarket.london()))
.difficultyCalculator(MainnetDifficultyCalculators.LONDON)
.blockHeaderValidatorBuilder(MainnetBlockHeaderValidator.createEip1559Validator(eip1559))
.ommerHeaderValidatorBuilder(

@ -25,7 +25,7 @@ public interface ProtocolSchedule {
ProtocolSpec getByBlockNumber(long number);
public Stream<Long> streamMilestoneBlocks();
Stream<Long> streamMilestoneBlocks();
Optional<BigInteger> getChainId();

@ -21,6 +21,7 @@ import org.hyperledger.besu.ethereum.core.BlockImporter;
import org.hyperledger.besu.ethereum.core.Wei;
import org.hyperledger.besu.ethereum.core.fees.EIP1559;
import org.hyperledger.besu.ethereum.core.fees.TransactionPriceCalculator;
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
import org.hyperledger.besu.ethereum.privacy.PrivateTransactionProcessor;
import org.hyperledger.besu.ethereum.vm.EVM;
import org.hyperledger.besu.ethereum.vm.GasCalculator;
@ -69,6 +70,8 @@ public class ProtocolSpec {
private final TransactionPriceCalculator transactionPriceCalculator;
private final Optional<FeeMarket> feeMarket;
private final Optional<EIP1559> eip1559;
private final BadBlockManager badBlockManager;
@ -98,6 +101,7 @@ public class ProtocolSpec {
* @param skipZeroBlockRewards should rewards be skipped if it is zero
* @param gasCalculator the gas calculator to use.
* @param transactionPriceCalculator the transaction price calculator to use.
* @param feeMarket an {@link Optional} wrapping {@link FeeMarket} class if appropriate.
* @param eip1559 an {@link Optional} wrapping {@link EIP1559} manager class if appropriate.
* @param badBlockManager the cache to use to keep invalid blocks
* @param powHasher the proof-of-work hasher
@ -123,6 +127,7 @@ public class ProtocolSpec {
final boolean skipZeroBlockRewards,
final GasCalculator gasCalculator,
final TransactionPriceCalculator transactionPriceCalculator,
final Optional<FeeMarket> feeMarket,
final Optional<EIP1559> eip1559,
final BadBlockManager badBlockManager,
final Optional<PoWHasher> powHasher) {
@ -146,6 +151,7 @@ public class ProtocolSpec {
this.skipZeroBlockRewards = skipZeroBlockRewards;
this.gasCalculator = gasCalculator;
this.transactionPriceCalculator = transactionPriceCalculator;
this.feeMarket = feeMarket;
this.eip1559 = eip1559;
this.badBlockManager = badBlockManager;
this.powHasher = powHasher;
@ -327,8 +333,17 @@ public class ProtocolSpec {
return eip1559;
}
public boolean isEip1559() {
return eip1559.isPresent();
/**
* Returns the Fee Market used in this specification.
*
* @return the {@link Optional} wrapping Fee Market implementation.
*/
public Optional<FeeMarket> getFeeMarket() {
return feeMarket;
}
public boolean hasFeeMarket() {
return feeMarket.isPresent();
}
/**

@ -27,6 +27,7 @@ import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Wei;
import org.hyperledger.besu.ethereum.core.fees.EIP1559;
import org.hyperledger.besu.ethereum.core.fees.TransactionPriceCalculator;
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.OnChainPrivacyPrecompiledContract;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPluginPrecompiledContract;
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.PrivacyPrecompiledContract;
@ -68,6 +69,7 @@ public class ProtocolSpecBuilder {
private PrivateTransactionValidatorBuilder privateTransactionValidatorBuilder;
private TransactionPriceCalculator transactionPriceCalculator =
TransactionPriceCalculator.frontier();
private Optional<FeeMarket> feeMarket = Optional.empty();
private Optional<EIP1559> eip1559 = Optional.empty();
private BadBlockManager badBlockManager;
private PoWHasher powHasher = PoWHasher.ETHASH_LIGHT;
@ -221,6 +223,11 @@ public class ProtocolSpecBuilder {
return this;
}
public ProtocolSpecBuilder feeMarket(final Optional<FeeMarket> feeMarket) {
this.feeMarket = feeMarket;
return this;
}
public ProtocolSpecBuilder eip1559(final Optional<EIP1559> eip1559) {
this.eip1559 = eip1559;
return this;
@ -260,6 +267,7 @@ public class ProtocolSpecBuilder {
checkNotNull(protocolSchedule, "Missing protocol schedule");
checkNotNull(privacyParameters, "Missing privacy parameters");
checkNotNull(transactionPriceCalculator, "Missing transaction price calculator");
checkNotNull(feeMarket, "Missing fee market optional wrapper");
checkNotNull(eip1559, "Missing eip1559 optional wrapper");
checkNotNull(badBlockManager, "Missing bad blocks manager");
@ -365,6 +373,7 @@ public class ProtocolSpecBuilder {
skipZeroBlockRewards,
gasCalculator,
transactionPriceCalculator,
feeMarket,
eip1559,
badBlockManager,
Optional.ofNullable(powHasher));

@ -14,12 +14,8 @@
*/
package org.hyperledger.besu.ethereum.mainnet.feemarket;
import org.hyperledger.besu.config.experimental.ExperimentalEIPs;
public interface FeeMarket {
long EIP1559_BASEFEE_DEFAULT_VALUE = 1000000000L;
long getBasefeeMaxChangeDenominator();
long getInitialBasefee();
@ -27,6 +23,6 @@ public interface FeeMarket {
long getSlackCoefficient();
static FeeMarket london() {
return new LondonFeeMarket(ExperimentalEIPs.initialBasefee);
return new LondonFeeMarket();
}
}

@ -15,28 +15,22 @@
package org.hyperledger.besu.ethereum.mainnet.feemarket;
public class LondonFeeMarket implements FeeMarket {
private final Long BASEFEE_MAX_CHANGE_DENOMINATOR = 8L;
private final Long SLACK_COEFFICIENT = 2L;
private final Long initialBaseFee;
public LondonFeeMarket(final Long initialBaseFee) {
this.initialBaseFee = initialBaseFee;
}
static final Long DEFAULT_BASEFEE_INITIAL_VALUE = 1000000000L;
static final Long DEFAULT_BASEFEE_MAX_CHANGE_DENOMINATOR = 8L;
static final Long DEFAULT_SLACK_COEFFICIENT = 2L;
@Override
public long getBasefeeMaxChangeDenominator() {
return BASEFEE_MAX_CHANGE_DENOMINATOR;
return DEFAULT_BASEFEE_MAX_CHANGE_DENOMINATOR;
}
@Override
public long getInitialBasefee() {
return initialBaseFee;
return DEFAULT_BASEFEE_INITIAL_VALUE;
}
@Override
public long getSlackCoefficient() {
return SLACK_COEFFICIENT;
return DEFAULT_SLACK_COEFFICIENT;
}
}

@ -14,11 +14,11 @@
*/
package org.hyperledger.besu.ethereum.mainnet.headervalidationrules;
import static org.hyperledger.besu.ethereum.core.fees.LondonFeeMarketException.MissingBaseFeeFromBlockHeader;
import static org.hyperledger.besu.ethereum.core.fees.FeeMarketException.MissingBaseFeeFromBlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.fees.EIP1559;
import org.hyperledger.besu.ethereum.core.fees.LondonFeeMarketException;
import org.hyperledger.besu.ethereum.core.fees.FeeMarketException;
import org.hyperledger.besu.ethereum.mainnet.DetachedBlockHeaderValidationRule;
import org.apache.logging.log4j.LogManager;
@ -38,7 +38,7 @@ public class LondonFeeMarketBlockHeaderGasPriceValidationRule
try {
if (!eip1559.isEIP1559(header.getNumber())) {
if (header.getBaseFee().isPresent()) {
throw LondonFeeMarketException.BaseFeePresentBeforeForkBlock();
throw FeeMarketException.BaseFeePresentBeforeForkBlock();
}
return true;
}
@ -64,7 +64,7 @@ public class LondonFeeMarketBlockHeaderGasPriceValidationRule
}
return true;
} catch (final LondonFeeMarketException e) {
} catch (final FeeMarketException e) {
LOG.info("Invalid block header: " + e.getMessage());
return false;
}

@ -327,8 +327,8 @@ public class PoWSolverTest {
Thread.sleep(200);
assertThat(solver.submitSolution(expectedSecondOutput)).isTrue();
PoWSolution result1 = soln1.get(1, TimeUnit.SECONDS);
PoWSolution result2 = soln2.get(1, TimeUnit.SECONDS);
PoWSolution result1 = soln1.get(3, TimeUnit.SECONDS);
PoWSolution result2 = soln2.get(3, TimeUnit.SECONDS);
assertThat(result1.getMixHash()).isEqualTo(expectedFirstOutput.getMixHash());
assertThat(result2.getMixHash()).isEqualTo(expectedSecondOutput.getMixHash());

@ -38,8 +38,10 @@ import org.hyperledger.besu.ethereum.eth.sync.state.SyncState;
import org.hyperledger.besu.ethereum.eth.transactions.PendingTransactions.TransactionAddedStatus;
import org.hyperledger.besu.ethereum.mainnet.MainnetTransactionValidator;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
import org.hyperledger.besu.ethereum.mainnet.TransactionValidationParams;
import org.hyperledger.besu.ethereum.mainnet.ValidationResult;
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
import org.hyperledger.besu.ethereum.transaction.TransactionInvalidReason;
import org.hyperledger.besu.metrics.BesuMetricCategory;
import org.hyperledger.besu.plugin.data.TransactionType;
@ -78,7 +80,6 @@ public class TransactionPool implements BlockAddedObserver {
private final LabelledMetric<Counter> duplicateTransactionCounter;
private final PeerTransactionTracker peerTransactionTracker;
private final PeerPendingTransactionTracker peerPendingTransactionTracker;
private final Optional<EIP1559> eip1559;
private final TransactionPriceCalculator frontierPriceCalculator =
TransactionPriceCalculator.frontier();
private final TransactionPriceCalculator eip1559PriceCalculator =
@ -97,7 +98,6 @@ public class TransactionPool implements BlockAddedObserver {
final PeerPendingTransactionTracker peerPendingTransactionTracker,
final Wei minTransactionGasPrice,
final MetricsSystem metricsSystem,
final Optional<EIP1559> eip1559,
final TransactionPoolConfiguration configuration) {
this.pendingTransactions = pendingTransactions;
this.protocolSchedule = protocolSchedule;
@ -108,7 +108,6 @@ public class TransactionPool implements BlockAddedObserver {
this.peerTransactionTracker = peerTransactionTracker;
this.peerPendingTransactionTracker = peerPendingTransactionTracker;
this.minTransactionGasPrice = minTransactionGasPrice;
this.eip1559 = eip1559;
this.configuration = configuration;
duplicateTransactionCounter =
@ -259,13 +258,14 @@ public class TransactionPool implements BlockAddedObserver {
"Transaction gas limit of %s exceeds block gas limit of %s",
transaction.getGasLimit(), chainHeadBlockHeader.getGasLimit()));
}
if (transaction.getType().equals(TransactionType.EIP1559)
&& !eip1559
.map(eip1559 -> eip1559.isEIP1559(chainHeadBlockHeader.getNumber()))
.orElse(false)) {
return ValidationResult.invalid(
TransactionInvalidReason.INVALID_TRANSACTION_FORMAT,
"EIP-1559 transaction are not allowed yet");
if (transaction.getType().equals(TransactionType.EIP1559)) {
final long blknum = chainHeadBlockHeader.getNumber();
ProtocolSpec spec = protocolSchedule.getByBlockNumber(blknum);
if (!spec.getEip1559().map(eip1559 -> eip1559.isEIP1559(blknum)).orElse(false)) {
return ValidationResult.invalid(
TransactionInvalidReason.INVALID_TRANSACTION_FORMAT,
"EIP-1559 transaction are not allowed yet");
}
}
return protocolContext
@ -298,9 +298,17 @@ public class TransactionPool implements BlockAddedObserver {
private Wei minTransactionGasPrice(final Transaction transaction) {
final BlockHeader chainHeadBlockHeader = getChainHeadBlockHeader();
// Compute transaction price using EIP-1559 rules if chain head is after fork
if (eip1559.isPresent() && eip1559.get().isEIP1559(chainHeadBlockHeader.getNumber())) {
ProtocolSpec spec = protocolSchedule.getByBlockNumber(chainHeadBlockHeader.getNumber());
Optional<FeeMarket> feeMarket = spec.getFeeMarket();
// TODO: remove once eip1559 is part of FeeMarket
Optional<EIP1559> eip1559 = spec.getEip1559();
if (feeMarket
.flatMap(fm -> eip1559.map(e -> e.isEIP1559(chainHeadBlockHeader.getNumber())))
.orElse(Boolean.FALSE)) {
// TODO: remove eip1559PriceCalculator once it is rolled into fee market
return BaseFee.minTransactionPriceInNextBlock(
transaction, eip1559PriceCalculator, chainHeadBlockHeader::getBaseFee);
transaction, feeMarket.get(), eip1559PriceCalculator, chainHeadBlockHeader::getBaseFee);
} else { // Use frontier rules otherwise
return frontierPriceCalculator.price(transaction, Optional.empty());
}

@ -16,7 +16,6 @@ package org.hyperledger.besu.ethereum.eth.transactions;
import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.core.Wei;
import org.hyperledger.besu.ethereum.core.fees.EIP1559;
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
import org.hyperledger.besu.ethereum.eth.messages.EthPV62;
import org.hyperledger.besu.ethereum.eth.messages.EthPV65;
@ -26,7 +25,6 @@ import org.hyperledger.besu.metrics.BesuMetricCategory;
import org.hyperledger.besu.plugin.services.MetricsSystem;
import java.time.Clock;
import java.util.Optional;
public class TransactionPoolFactory {
@ -38,8 +36,7 @@ public class TransactionPoolFactory {
final MetricsSystem metricsSystem,
final SyncState syncState,
final Wei minTransactionGasPrice,
final TransactionPoolConfiguration transactionPoolConfiguration,
final Optional<EIP1559> eip1559) {
final TransactionPoolConfiguration transactionPoolConfiguration) {
final PendingTransactions pendingTransactions =
new PendingTransactions(
@ -72,8 +69,7 @@ public class TransactionPoolFactory {
transactionTracker,
transactionsMessageSender,
pendingTransactionTracker,
pendingTransactionsMessageSender,
eip1559);
pendingTransactionsMessageSender);
}
static TransactionPool createTransactionPool(
@ -88,8 +84,7 @@ public class TransactionPoolFactory {
final PeerTransactionTracker transactionTracker,
final TransactionsMessageSender transactionsMessageSender,
final PeerPendingTransactionTracker pendingTransactionTracker,
final PendingTransactionsMessageSender pendingTransactionsMessageSender,
final Optional<EIP1559> eip1559) {
final PendingTransactionsMessageSender pendingTransactionsMessageSender) {
final TransactionPool transactionPool =
new TransactionPool(
pendingTransactions,
@ -104,7 +99,6 @@ public class TransactionPoolFactory {
pendingTransactionTracker,
minTransactionGasPrice,
metricsSystem,
eip1559,
transactionPoolConfiguration);
final TransactionsMessageHandler transactionsMessageHandler =
new TransactionsMessageHandler(

@ -76,7 +76,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
@ -1009,8 +1008,7 @@ public final class EthProtocolManagerTest {
metricsSystem,
mock(SyncState.class),
Wei.ZERO,
TransactionPoolConfiguration.DEFAULT,
Optional.empty());
TransactionPoolConfiguration.DEFAULT);
// Send just a transaction message.
final PeerConnection peer = setupPeer(ethManager, (cap, msg, connection) -> {});

@ -43,7 +43,6 @@ import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem;
import org.hyperledger.besu.plugin.services.MetricsSystem;
import org.hyperledger.besu.testutil.TestClock;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@ -101,8 +100,7 @@ public abstract class AbstractMessageTaskTest<T, R> {
metricsSystem,
syncState,
Wei.of(1),
TransactionPoolConfiguration.DEFAULT,
Optional.empty());
TransactionPoolConfiguration.DEFAULT);
ethProtocolManager =
EthProtocolManagerTestUtil.create(
blockchain,

@ -65,7 +65,6 @@ import java.math.BigInteger;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import io.vertx.core.Vertx;
@ -137,8 +136,7 @@ public class TestNode implements Closeable {
metricsSystem,
syncState,
Wei.ZERO,
TransactionPoolConfiguration.DEFAULT,
Optional.empty());
TransactionPoolConfiguration.DEFAULT);
final EthProtocolManager ethProtocolManager =
new EthProtocolManager(

@ -92,8 +92,7 @@ public class TransactionPoolFactoryTest {
peerTransactionTracker,
transactionsMessageSender,
peerPendingTransactionTracker,
pendingTransactionsMessageSender,
Optional.empty());
pendingTransactionsMessageSender);
final EthProtocolManager ethProtocolManager =
new EthProtocolManager(

@ -65,6 +65,7 @@ import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
import org.hyperledger.besu.ethereum.mainnet.TransactionValidationParams;
import org.hyperledger.besu.ethereum.mainnet.ValidationResult;
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
import org.hyperledger.besu.ethereum.transaction.TransactionInvalidReason;
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem;
import org.hyperledger.besu.plugin.data.TransactionType;
@ -133,6 +134,7 @@ public class TransactionPoolTest {
TransactionPoolConfiguration.DEFAULT_PRICE_BUMP);
when(protocolSchedule.getByBlockNumber(anyLong())).thenReturn(protocolSpec);
when(protocolSpec.getTransactionValidator()).thenReturn(transactionValidator);
when(protocolSpec.getFeeMarket()).thenReturn(Optional.of(FeeMarket.london()));
genesisBlockGasLimit = executionContext.getGenesis().getHeader().getGasLimit();
syncState = mock(SyncState.class);
when(syncState.isInSync(anyLong())).thenReturn(true);
@ -154,7 +156,6 @@ public class TransactionPoolTest {
peerPendingTransactionTracker,
Wei.of(2),
metricsSystem,
Optional.empty(),
TransactionPoolConfiguration.DEFAULT);
blockchain.observeBlockAdded(transactionPool);
}
@ -431,7 +432,6 @@ public class TransactionPoolTest {
peerPendingTransactionTracker,
Wei.ZERO,
metricsSystem,
Optional.empty(),
TransactionPoolConfiguration.DEFAULT);
when(pendingTransactions.containsTransaction(transaction1.getHash())).thenReturn(true);
@ -571,7 +571,6 @@ public class TransactionPoolTest {
peerPendingTransactionTracker,
Wei.ZERO,
metricsSystem,
Optional.empty(),
TransactionPoolConfiguration.DEFAULT);
final TransactionTestFixture builder = new TransactionTestFixture();
@ -643,7 +642,6 @@ public class TransactionPoolTest {
peerPendingTransactionTracker,
Wei.ZERO,
metricsSystem,
Optional.empty(),
TransactionPoolConfiguration.DEFAULT);
final TransactionTestFixture builder = new TransactionTestFixture();
@ -705,7 +703,6 @@ public class TransactionPoolTest {
peerPendingTransactionTracker,
Wei.ZERO,
metricsSystem,
Optional.empty(),
ImmutableTransactionPoolConfiguration.builder().txFeeCap(Wei.ZERO).build());
when(transactionValidator.validate(any(Transaction.class), any(Optional.class), any()))
.thenReturn(valid());
@ -743,7 +740,6 @@ public class TransactionPoolTest {
peerPendingTransactionTracker,
Wei.ZERO,
metricsSystem,
Optional.empty(),
ImmutableTransactionPoolConfiguration.builder().txFeeCap(Wei.ONE).build());
when(transactionValidator.validate(any(Transaction.class), any(Optional.class), any()))
.thenReturn(valid());
@ -786,8 +782,8 @@ public class TransactionPoolTest {
peerPendingTransactionTracker,
Wei.ZERO,
metricsSystem,
Optional.of(new EIP1559(100)),
ImmutableTransactionPoolConfiguration.builder().txFeeCap(Wei.ONE).build());
when(protocolSpec.getEip1559()).thenReturn(Optional.of(new EIP1559(100L)));
when(transactionValidator.validate(any(Transaction.class), any(Optional.class), any()))
.thenReturn(valid());
when(transactionValidator.validateForSender(
@ -830,7 +826,6 @@ public class TransactionPoolTest {
peerPendingTransactionTracker,
Wei.ZERO,
metricsSystem,
Optional.empty(),
ImmutableTransactionPoolConfiguration.builder().txFeeCap(twoEthers).build());
final TransactionTestFixture builder = new TransactionTestFixture();
@ -870,7 +865,6 @@ public class TransactionPoolTest {
peerPendingTransactionTracker,
Wei.ZERO,
metricsSystem,
Optional.empty(),
ImmutableTransactionPoolConfiguration.builder().txFeeCap(twoEthers).build());
final Transaction transaction37 =

@ -18,7 +18,6 @@ package org.hyperledger.besu.evmtool;
import static picocli.CommandLine.ScopeType.INHERIT;
import org.hyperledger.besu.cli.config.NetworkName;
import org.hyperledger.besu.config.experimental.ExperimentalEIPs;
import org.hyperledger.besu.ethereum.core.Account;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.BlockHeader;
@ -159,11 +158,8 @@ public class EvmToolCommand implements Runnable {
out = resultHandler.out();
final CommandLine commandLine = new CommandLine(this);
commandLine.addMixin("Dagger Options", daggerOptions);
// Usage of static command line flags is strictly reserved for experimental EIPs
commandLine.addMixin("Experimental EIPs", ExperimentalEIPs.class);
// add sub commands here
commandLine.registerConverter(Address.class, Address::fromHexString);
commandLine.registerConverter(Bytes.class, Bytes::fromHexString);
commandLine.registerConverter(Gas.class, (arg) -> Gas.of(Long.parseUnsignedLong(arg)));

@ -77,6 +77,7 @@ public class NoRewardProtocolScheduleWrapper implements ProtocolSchedule {
original.isSkipZeroBlockRewards(),
original.getGasCalculator(),
original.getTransactionPriceCalculator(),
original.getFeeMarket(),
original.getEip1559(),
original.getBadBlocksManager(),
Optional.empty());

@ -32,7 +32,6 @@ import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions;
import org.hyperledger.besu.ethereum.core.Hash;
import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.core.Wei;
import org.hyperledger.besu.ethereum.core.fees.EIP1559;
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
import org.hyperledger.besu.ethereum.eth.manager.EthMessages;
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
@ -206,11 +205,7 @@ public class RetestethContext {
metricsSystem,
syncState,
Wei.ZERO,
transactionPoolConfiguration,
jsonGenesisConfigOptions.getEIP1559BlockNumber().isPresent()
? Optional.of(
new EIP1559(jsonGenesisConfigOptions.getEIP1559BlockNumber().getAsLong()))
: Optional.empty());
transactionPoolConfiguration);
LOG.trace("Genesis Block {} ", genesisState::getBlock);

@ -14,7 +14,6 @@
*/
package org.hyperledger.besu.ethereum.retesteth.methods;
import org.hyperledger.besu.config.experimental.ExperimentalEIPs;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcError;
@ -133,16 +132,7 @@ public class TestSetChainParams implements JsonRpcMethod {
maybeMove(genesis, "nonce", chainParamsJson, "nonce");
maybeMove(genesis, "timestamp", chainParamsJson, "timestamp");
maybeMove(chainParamsJson, "accounts", chainParamsJson, "alloc");
if (params.containsKey("londonForkBlock")) {
JsonObject genesisConfig = chainParamsJson.getJsonObject("genesis", new JsonObject());
ExperimentalEIPs.initialBasefee =
Optional.ofNullable(
genesisConfig.getString("baseFeePerGas", genesisConfig.getString("baseFee")))
.map(Long::decode)
.orElse(ExperimentalEIPs.EIP1559_BASEFEE_DEFAULT_VALUE);
}
maybeMove(genesis, "baseFeePerGas", chainParamsJson, "baseFeePerGas");
maybeMoveToNumber(params, "londonForkBlock", config, "londonBlock");
// strip out precompiles with zero balance

@ -3,7 +3,7 @@
"author" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"difficulty" : "0x020000",
"gasLimit" : "0x04d2",
"baseFee" : "0x3039",
"baseFeePerGas" : "0x3039",
"extraData" : "0x00",
"timestamp" : "0x00",
"nonce" : "0x0000000000000000",

Loading…
Cancel
Save