Skip to content

Commit 7809755

Browse files
authored
Merge branch 'main' into multi-version-flat-db-rebase
Signed-off-by: Matt Whitehead <[email protected]>
2 parents 633fad4 + 5933a2a commit 7809755

File tree

370 files changed

+810
-776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+810
-776
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
- Improve debug_traceBlock calls performance and reduce output size [#8076](https://github.com/hyperledger/besu/pull/8076)
3030
- Add support for EIP-7702 transaction in the txpool [#8018](https://github.com/hyperledger/besu/pull/8018) [#7984](https://github.com/hyperledger/besu/pull/7984)
3131
- Add support for `movePrecompileToAddress` in `StateOverrides` (`eth_call`)[8115](https://github.com/hyperledger/besu/pull/8115)
32+
- Default target-gas-limit to 36M for holesky [#8125](https://github.com/hyperledger/besu/pull/8125)
3233
- Add EIP-7623 - Increase calldata cost [#8093](https://github.com/hyperledger/besu/pull/8093)
34+
- Add nonce to transaction call object [#8139](https://github.com/hyperledger/besu/pull/8139)
3335
- Experimental Bonsai Archive support [#7475](https://github.com/hyperledger/besu/pull/7475)
3436

3537
### Bug fixes

acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/transaction/eth/EthEstimateGasTransaction.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
*/
1515
package org.hyperledger.besu.tests.acceptance.dsl.transaction.eth;
1616

17+
import static org.web3j.protocol.core.DefaultBlockParameterName.LATEST;
18+
1719
import org.hyperledger.besu.tests.acceptance.dsl.transaction.NodeRequests;
1820
import org.hyperledger.besu.tests.acceptance.dsl.transaction.Transaction;
1921

@@ -36,11 +38,13 @@ public EthEstimateGasTransaction(final String contractAddress, final String func
3638
public EthEstimateGas execute(final NodeRequests node) {
3739
try {
3840

41+
var nonce = node.eth().ethGetTransactionCount(from, LATEST).send().getTransactionCount();
42+
3943
return node.eth()
4044
.ethEstimateGas(
4145
new org.web3j.protocol.core.methods.request.Transaction(
4246
from,
43-
BigInteger.ONE,
47+
nonce,
4448
BigInteger.ZERO,
4549
BigInteger.ZERO,
4650
contractAddress,

acceptance-tests/tests/src/test/resources/dev/dev_prague.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@
1818
"blobSchedule": {
1919
"cancun": {
2020
"target": 3,
21-
"max": 6
21+
"max": 6,
22+
"baseFeeUpdateFraction": 3338477
2223
},
2324
"prague": {
2425
"target": 6,
25-
"max": 9
26+
"max": 9,
27+
"baseFeeUpdateFraction": 5007716
2628
},
2729
"osaka": {
2830
"target": 9,
29-
"max": 12
31+
"max": 12,
32+
"baseFeeUpdateFraction": 5007716
3033
}
3134
},
3235
"clique": {

besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java

+7
Original file line numberDiff line numberDiff line change
@@ -2137,6 +2137,13 @@ private MiningConfiguration getMiningParameters() {
21372137
getGenesisBlockPeriodSeconds(genesisConfigOptionsSupplier.get())
21382138
.ifPresent(miningParameters::setBlockPeriodSeconds);
21392139
initMiningParametersMetrics(miningParameters);
2140+
// if network = holesky, set targetGasLimit to 36,000,000 unless otherwise specified
2141+
if (miningParameters.getTargetGasLimit().isEmpty() && NetworkName.HOLESKY.equals(network)) {
2142+
logger.info(
2143+
"Setting target gas limit for holesky: {}",
2144+
MiningConfiguration.DEFAULT_TARGET_GAS_LIMIT_HOLESKY);
2145+
miningParameters.setTargetGasLimit(MiningConfiguration.DEFAULT_TARGET_GAS_LIMIT_HOLESKY);
2146+
}
21402147
return miningParameters;
21412148
}
21422149

besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java

+52
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,58 @@ public void holeskyValuesAreUsed() {
19111911
verify(mockLogger, never()).warn(contains("Holesky is deprecated and will be shutdown"));
19121912
}
19131913

1914+
@Test
1915+
public void holeskyTargetGasLimitIsSetToHoleskyDefaultWhenNoValueSpecified() {
1916+
parseCommand("--network", "holesky");
1917+
1918+
final ArgumentCaptor<EthNetworkConfig> networkArg =
1919+
ArgumentCaptor.forClass(EthNetworkConfig.class);
1920+
1921+
final ArgumentCaptor<MiningConfiguration> miningArg =
1922+
ArgumentCaptor.forClass(MiningConfiguration.class);
1923+
1924+
verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any());
1925+
verify(mockControllerBuilder).miningParameters(miningArg.capture());
1926+
verify(mockControllerBuilder).build();
1927+
1928+
assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(HOLESKY));
1929+
1930+
assertThat(miningArg.getValue().getCoinbase()).isEqualTo(Optional.empty());
1931+
assertThat(miningArg.getValue().getMinTransactionGasPrice()).isEqualTo(Wei.of(1000));
1932+
assertThat(miningArg.getValue().getExtraData()).isEqualTo(Bytes.EMPTY);
1933+
assertThat(miningArg.getValue().getTargetGasLimit().getAsLong())
1934+
.isEqualTo(MiningConfiguration.DEFAULT_TARGET_GAS_LIMIT_HOLESKY);
1935+
1936+
assertThat(commandOutput.toString(UTF_8)).isEmpty();
1937+
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
1938+
}
1939+
1940+
@Test
1941+
public void holeskyTargetGasLimitIsSetToSpecifiedValueWhenValueSpecified() {
1942+
long customGasLimit = 99000000;
1943+
parseCommand("--network", "holesky", "--target-gas-limit", String.valueOf(customGasLimit));
1944+
1945+
final ArgumentCaptor<EthNetworkConfig> networkArg =
1946+
ArgumentCaptor.forClass(EthNetworkConfig.class);
1947+
1948+
final ArgumentCaptor<MiningConfiguration> miningArg =
1949+
ArgumentCaptor.forClass(MiningConfiguration.class);
1950+
1951+
verify(mockControllerBuilderFactory).fromEthNetworkConfig(networkArg.capture(), any());
1952+
verify(mockControllerBuilder).miningParameters(miningArg.capture());
1953+
verify(mockControllerBuilder).build();
1954+
1955+
assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.getNetworkConfig(HOLESKY));
1956+
1957+
assertThat(miningArg.getValue().getCoinbase()).isEqualTo(Optional.empty());
1958+
assertThat(miningArg.getValue().getMinTransactionGasPrice()).isEqualTo(Wei.of(1000));
1959+
assertThat(miningArg.getValue().getExtraData()).isEqualTo(Bytes.EMPTY);
1960+
assertThat(miningArg.getValue().getTargetGasLimit().getAsLong()).isEqualTo(customGasLimit);
1961+
1962+
assertThat(commandOutput.toString(UTF_8)).isEmpty();
1963+
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
1964+
}
1965+
19141966
@Test
19151967
public void luksoValuesAreUsed() {
19161968
parseCommand("--network", "lukso");

besu/src/test/java/org/hyperledger/besu/controller/MergeBesuControllerBuilderTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
5050
import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions;
5151
import org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket;
52-
import org.hyperledger.besu.ethereum.mainnet.feemarket.LondonFeeMarket;
52+
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
5353
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
5454
import org.hyperledger.besu.ethereum.storage.StorageProvider;
5555
import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStoragePrefixedKeyBlockchainStorage;
@@ -106,7 +106,7 @@ public class MergeBesuControllerBuilderTest {
106106

107107
BigInteger networkId = BigInteger.ONE;
108108
private final BlockHeaderTestFixture headerGenerator = new BlockHeaderTestFixture();
109-
private final BaseFeeMarket feeMarket = new LondonFeeMarket(0, Optional.of(Wei.of(42)));
109+
private final BaseFeeMarket feeMarket = FeeMarket.london(0, Optional.of(Wei.of(42)));
110110
private final TransactionPoolConfiguration poolConfiguration =
111111
TransactionPoolConfiguration.DEFAULT;
112112
private final ObservableMetricsSystem observableMetricsSystem = new NoOpMetricsSystem();

config/src/main/java/org/hyperledger/besu/config/BlobScheduleOptions.java

+18-5
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,16 @@ public Map<String, Object> asMap() {
8282
public static class BlobSchedule {
8383
private final int target;
8484
private final int max;
85+
private final int baseFeeUpdateFraction;
8586

8687
/** The constant CANCUN_DEFAULT. */
87-
public static final BlobSchedule CANCUN_DEFAULT = new BlobSchedule(3, 6);
88+
public static final BlobSchedule CANCUN_DEFAULT = new BlobSchedule(3, 6, 3338477);
8889

8990
/** The constant PRAGUE_DEFAULT. */
90-
public static final BlobSchedule PRAGUE_DEFAULT = new BlobSchedule(6, 9);
91+
public static final BlobSchedule PRAGUE_DEFAULT = new BlobSchedule(6, 9, 5007716);
9192

9293
/** The constant OSAKA_DEFAULT. */
93-
public static final BlobSchedule OSAKA_DEFAULT = new BlobSchedule(9, 12);
94+
public static final BlobSchedule OSAKA_DEFAULT = new BlobSchedule(9, 12, 5007716);
9495

9596
/**
9697
* Instantiates a new Blob schedule.
@@ -100,11 +101,14 @@ public static class BlobSchedule {
100101
public BlobSchedule(final ObjectNode blobScheduleConfigRoot) {
101102
this.target = JsonUtil.getInt(blobScheduleConfigRoot, "target").orElseThrow();
102103
this.max = JsonUtil.getInt(blobScheduleConfigRoot, "max").orElseThrow();
104+
this.baseFeeUpdateFraction =
105+
JsonUtil.getInt(blobScheduleConfigRoot, "basefeeupdatefraction").orElseThrow();
103106
}
104107

105-
private BlobSchedule(final int target, final int max) {
108+
private BlobSchedule(final int target, final int max, final int baseFeeUpdateFraction) {
106109
this.target = target;
107110
this.max = max;
111+
this.baseFeeUpdateFraction = baseFeeUpdateFraction;
108112
}
109113

110114
/**
@@ -125,13 +129,22 @@ public int getMax() {
125129
return max;
126130
}
127131

132+
/**
133+
* Gets base fee update fraction.
134+
*
135+
* @return the base fee update fraction
136+
*/
137+
public int getBaseFeeUpdateFraction() {
138+
return baseFeeUpdateFraction;
139+
}
140+
128141
/**
129142
* As map.
130143
*
131144
* @return the map
132145
*/
133146
Map<String, Object> asMap() {
134-
return Map.of("target", target, "max", max);
147+
return Map.of("target", target, "max", max, "baseFeeUpdateFraction", baseFeeUpdateFraction);
135148
}
136149
}
137150
}

config/src/main/resources/holesky.json

+12
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
"terminalTotalDifficulty": 0,
1616
"shanghaiTime": 1696000704,
1717
"cancunTime": 1707305664,
18+
"blobSchedule": {
19+
"cancun": {
20+
"target": 3,
21+
"max": 6,
22+
"baseFeeUpdateFraction": 3338477
23+
},
24+
"prague": {
25+
"target": 6,
26+
"max": 9,
27+
"baseFeeUpdateFraction": 5007716
28+
}
29+
},
1830
"ethash": {},
1931
"discovery": {
2032
"dns": "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.holesky.ethdisco.net",

config/src/main/resources/mainnet.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
"blobSchedule": {
2020
"cancun": {
2121
"target": 3,
22-
"max": 6
22+
"max": 6,
23+
"baseFeeUpdateFraction": 3338477
2324
},
2425
"prague": {
2526
"target": 6,
26-
"max": 9
27+
"max": 9,
28+
"baseFeeUpdateFraction": 5007716
2729
}
2830
},
2931
"ethash": {

config/src/main/resources/sepolia.json

+12
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
"terminalTotalDifficulty": 17000000000000000,
1616
"shanghaiTime": 1677557088,
1717
"cancunTime": 1706655072,
18+
"blobSchedule": {
19+
"cancun": {
20+
"target": 3,
21+
"max": 6,
22+
"baseFeeUpdateFraction": 3338477
23+
},
24+
"prague": {
25+
"target": 6,
26+
"max": 9,
27+
"baseFeeUpdateFraction": 5007716
28+
}
29+
},
1830
"ethash":{},
1931
"discovery": {
2032
"dns": "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net",

config/src/test/java/org/hyperledger/besu/config/BlobScheduleOptionsTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ public void blobScheduleIsParsed() {
3131
assertThat(blobScheduleOptions.getCancun()).isNotEmpty();
3232
assertThat(blobScheduleOptions.getCancun().get().getTarget()).isEqualTo(4);
3333
assertThat(blobScheduleOptions.getCancun().get().getMax()).isEqualTo(7);
34+
assertThat(blobScheduleOptions.getCancun().get().getBaseFeeUpdateFraction()).isEqualTo(3338477);
3435
assertThat(blobScheduleOptions.getPrague()).isNotEmpty();
3536
assertThat(blobScheduleOptions.getPrague().get().getTarget()).isEqualTo(7);
3637
assertThat(blobScheduleOptions.getPrague().get().getMax()).isEqualTo(10);
38+
assertThat(blobScheduleOptions.getPrague().get().getBaseFeeUpdateFraction()).isEqualTo(5007716);
3739
assertThat(blobScheduleOptions.getOsaka()).isNotEmpty();
3840
assertThat(blobScheduleOptions.getOsaka().get().getTarget()).isEqualTo(10);
3941
assertThat(blobScheduleOptions.getOsaka().get().getMax()).isEqualTo(13);
42+
assertThat(blobScheduleOptions.getOsaka().get().getBaseFeeUpdateFraction()).isEqualTo(5007716);
4043
}
4144
}

config/src/test/java/org/hyperledger/besu/config/GenesisConfigOptionsTest.java

+14-11
Original file line numberDiff line numberDiff line change
@@ -418,15 +418,18 @@ void asMapIncludesBlobFeeSchedule() {
418418
+ " \"blobSchedule\": {\n"
419419
+ " \"cancun\": {\n"
420420
+ " \"target\": 1,\n"
421-
+ " \"max\": 2\n"
421+
+ " \"max\": 2,\n"
422+
+ " \"baseFeeUpdateFraction\": 3\n"
422423
+ " },\n"
423424
+ " \"prague\": {\n"
424-
+ " \"target\": 3,\n"
425-
+ " \"max\": 4\n"
425+
+ " \"target\": 4,\n"
426+
+ " \"max\": 5,\n"
427+
+ " \"baseFeeUpdateFraction\": 6\n"
426428
+ " },\n"
427429
+ " \"osaka\": {\n"
428-
+ " \"target\": 4,\n"
429-
+ " \"max\": 5\n"
430+
+ " \"target\": 7,\n"
431+
+ " \"max\": 8,\n"
432+
+ " \"baseFeeUpdateFraction\": 9\n"
430433
+ " }\n"
431434
+ " }\n"
432435
+ " }\n"
@@ -438,14 +441,14 @@ void asMapIncludesBlobFeeSchedule() {
438441
final Map<String, Object> blobSchedule = (Map<String, Object>) map.get("blobSchedule");
439442
assertThat(blobSchedule).containsOnlyKeys("cancun", "prague", "osaka");
440443
assertThat((Map<String, Object>) blobSchedule.get("cancun"))
441-
.containsOnlyKeys("target", "max")
442-
.containsValues(1, 2);
444+
.containsOnlyKeys("target", "max", "baseFeeUpdateFraction")
445+
.containsValues(1, 2, 3);
443446
assertThat((Map<String, Object>) blobSchedule.get("prague"))
444-
.containsOnlyKeys("target", "max")
445-
.containsValues(3, 4);
447+
.containsOnlyKeys("target", "max", "baseFeeUpdateFraction")
448+
.containsValues(4, 5, 6);
446449
assertThat((Map<String, Object>) blobSchedule.get("osaka"))
447-
.containsOnlyKeys("target", "max")
448-
.containsValues(4, 5);
450+
.containsOnlyKeys("target", "max", "baseFeeUpdateFraction")
451+
.containsValues(7, 8, 9);
449452
}
450453

451454
private GenesisConfigOptions fromConfigOptions(final Map<String, Object> configOptions) {

config/src/test/resources/mainnet_with_blob_schedule.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@
1919
"blobSchedule": {
2020
"cancun": {
2121
"target": 4,
22-
"max": 7
22+
"max": 7,
23+
"baseFeeUpdateFraction": 3338477
2324
},
2425
"prague": {
2526
"target": 7,
26-
"max": 10
27+
"max": 10,
28+
"baseFeeUpdateFraction": 5007716
2729
},
2830
"osaka": {
2931
"target": 10,
30-
"max": 13
32+
"max": 13,
33+
"baseFeeUpdateFraction": 5007716
3134
}
3235
},
3336
"depositContractAddress": "0x4242424242424242424242424242424242424242",

consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinatorTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
import org.hyperledger.besu.ethereum.eth.transactions.sorter.BaseFeePendingTransactionsSorter;
7474
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
7575
import org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket;
76-
import org.hyperledger.besu.ethereum.mainnet.feemarket.LondonFeeMarket;
76+
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
7777
import org.hyperledger.besu.ethereum.trie.MerkleTrieException;
7878
import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive;
7979
import org.hyperledger.besu.metrics.StubMetricsSystem;
@@ -158,7 +158,7 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
158158
private final Address suggestedFeeRecipient = Address.ZERO;
159159
private final BlockHeaderTestFixture headerGenerator = new BlockHeaderTestFixture();
160160
private final BaseFeeMarket feeMarket =
161-
new LondonFeeMarket(0, genesisState.getBlock().getHeader().getBaseFee());
161+
FeeMarket.london(0, genesisState.getBlock().getHeader().getBaseFee());
162162

163163
private final org.hyperledger.besu.metrics.StubMetricsSystem metricsSystem =
164164
new StubMetricsSystem();

consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeReorgTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator;
4343
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
4444
import org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket;
45-
import org.hyperledger.besu.ethereum.mainnet.feemarket.LondonFeeMarket;
45+
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
4646
import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive;
4747
import org.hyperledger.besu.testutil.DeterministicEthScheduler;
4848
import org.hyperledger.besu.util.LogConfigurator;
@@ -81,7 +81,7 @@ public class MergeReorgTest implements MergeGenesisConfigHelper {
8181
private final Address coinbase = genesisAllocations(getPowGenesisConfig()).findFirst().get();
8282
private final BlockHeaderTestFixture headerGenerator = new BlockHeaderTestFixture();
8383
private final BaseFeeMarket feeMarket =
84-
new LondonFeeMarket(0, genesisState.getBlock().getHeader().getBaseFee());
84+
FeeMarket.london(0, genesisState.getBlock().getHeader().getBaseFee());
8585

8686
@BeforeEach
8787
public void setUp() {

ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/BlockAdapterBase.java

+1
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ private Optional<CallResult> executeCall(final DataFetchingEnvironment environme
356356
maxFeePerGas,
357357
valueParam,
358358
data,
359+
Optional.empty(),
359360
Optional.empty());
360361

361362
return transactionSimulator.process(

ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractEstimateGas.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ protected CallParameter overrideGasLimit(final CallParameter callParams, final l
147147
callParams.getPayload(),
148148
callParams.getAccessList(),
149149
callParams.getMaxFeePerBlobGas(),
150-
callParams.getBlobVersionedHashes());
150+
callParams.getBlobVersionedHashes(),
151+
callParams.getNonce());
151152
}
152153

153154
/**

0 commit comments

Comments
 (0)