mirror of
https://github.com/vacp2p/status-linea-besu.git
synced 2026-01-08 21:38:15 -05:00
Merge branch 'main' into zkbesu
This commit is contained in:
@@ -2132,6 +2132,13 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
|
||||
getGenesisBlockPeriodSeconds(genesisConfigOptionsSupplier.get())
|
||||
.ifPresent(miningParameters::setBlockPeriodSeconds);
|
||||
initMiningParametersMetrics(miningParameters);
|
||||
// if network = holesky, set targetGasLimit to 36,000,000 unless otherwise specified
|
||||
if (miningParameters.getTargetGasLimit().isEmpty() && NetworkName.HOLESKY.equals(network)) {
|
||||
logger.info(
|
||||
"Setting target gas limit for holesky: {}",
|
||||
MiningConfiguration.DEFAULT_TARGET_GAS_LIMIT_HOLESKY);
|
||||
miningParameters.setTargetGasLimit(MiningConfiguration.DEFAULT_TARGET_GAS_LIMIT_HOLESKY);
|
||||
}
|
||||
return miningParameters;
|
||||
}
|
||||
|
||||
|
||||
@@ -1911,6 +1911,58 @@ public class BesuCommandTest extends CommandTestAbstract {
|
||||
verify(mockLogger, never()).warn(contains("Holesky is deprecated and will be shutdown"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void holeskyTargetGasLimitIsSetToHoleskyDefaultWhenNoValueSpecified() {
|
||||
parseCommand("--network", "holesky");
|
||||
|
||||
final ArgumentCaptor<EthNetworkConfig> networkArg =
|
||||
ArgumentCaptor.forClass(EthNetworkConfig.class);
|
||||
|
||||
final ArgumentCaptor<MiningConfiguration> miningArg =
|
||||
ArgumentCaptor.forClass(MiningConfiguration.class);
|
||||
|
||||
verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any());
|
||||
verify(mockControllerBuilder).miningParameters(miningArg.capture());
|
||||
verify(mockControllerBuilder).build();
|
||||
|
||||
assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(HOLESKY));
|
||||
|
||||
assertThat(miningArg.getValue().getCoinbase()).isEqualTo(Optional.empty());
|
||||
assertThat(miningArg.getValue().getMinTransactionGasPrice()).isEqualTo(Wei.of(1000));
|
||||
assertThat(miningArg.getValue().getExtraData()).isEqualTo(Bytes.EMPTY);
|
||||
assertThat(miningArg.getValue().getTargetGasLimit().getAsLong())
|
||||
.isEqualTo(MiningConfiguration.DEFAULT_TARGET_GAS_LIMIT_HOLESKY);
|
||||
|
||||
assertThat(commandOutput.toString(UTF_8)).isEmpty();
|
||||
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void holeskyTargetGasLimitIsSetToSpecifiedValueWhenValueSpecified() {
|
||||
long customGasLimit = 99000000;
|
||||
parseCommand("--network", "holesky", "--target-gas-limit", String.valueOf(customGasLimit));
|
||||
|
||||
final ArgumentCaptor<EthNetworkConfig> networkArg =
|
||||
ArgumentCaptor.forClass(EthNetworkConfig.class);
|
||||
|
||||
final ArgumentCaptor<MiningConfiguration> miningArg =
|
||||
ArgumentCaptor.forClass(MiningConfiguration.class);
|
||||
|
||||
verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any());
|
||||
verify(mockControllerBuilder).miningParameters(miningArg.capture());
|
||||
verify(mockControllerBuilder).build();
|
||||
|
||||
assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(HOLESKY));
|
||||
|
||||
assertThat(miningArg.getValue().getCoinbase()).isEqualTo(Optional.empty());
|
||||
assertThat(miningArg.getValue().getMinTransactionGasPrice()).isEqualTo(Wei.of(1000));
|
||||
assertThat(miningArg.getValue().getExtraData()).isEqualTo(Bytes.EMPTY);
|
||||
assertThat(miningArg.getValue().getTargetGasLimit().getAsLong()).isEqualTo(customGasLimit);
|
||||
|
||||
assertThat(commandOutput.toString(UTF_8)).isEmpty();
|
||||
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void luksoValuesAreUsed() {
|
||||
parseCommand("--network", "lukso");
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions;
|
||||
import org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket;
|
||||
import org.hyperledger.besu.ethereum.mainnet.feemarket.LondonFeeMarket;
|
||||
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
|
||||
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
|
||||
import org.hyperledger.besu.ethereum.storage.StorageProvider;
|
||||
import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStoragePrefixedKeyBlockchainStorage;
|
||||
@@ -106,7 +106,7 @@ public class MergeBesuControllerBuilderTest {
|
||||
|
||||
BigInteger networkId = BigInteger.ONE;
|
||||
private final BlockHeaderTestFixture headerGenerator = new BlockHeaderTestFixture();
|
||||
private final BaseFeeMarket feeMarket = new LondonFeeMarket(0, Optional.of(Wei.of(42)));
|
||||
private final BaseFeeMarket feeMarket = FeeMarket.london(0, Optional.of(Wei.of(42)));
|
||||
private final TransactionPoolConfiguration poolConfiguration =
|
||||
TransactionPoolConfiguration.DEFAULT;
|
||||
private final ObservableMetricsSystem observableMetricsSystem = new NoOpMetricsSystem();
|
||||
|
||||
Reference in New Issue
Block a user