Skip to content

Commit f6c062c

Browse files
committed
merge
Signed-off-by: Sally MacFarlane <[email protected]>
2 parents 8104cb6 + 7443cc1 commit f6c062c

File tree

144 files changed

+1353
-2114
lines changed

Some content is hidden

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

144 files changed

+1353
-2114
lines changed

.github/workflows/stale-issues.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
days-before-pr-stale: 30
2222
days-before-pr-close: 14
2323
stale-pr-message: "This pr is stale because it has been open for 30 days with no activity."
24-
close-pr-message: "This PR was closed because it has been inactive for 14 days since being marked as stale."
25-
remove-issue-stale-when-updated: true
26-
remove-pr-stale-when-updated: true
24+
close-pr-message: "This pr was closed because it has been inactive for 14 days since being marked as stale."
25+
operations-per-run: 300
2726
exempt-issue-labels: "icebox"
2827
repo-token: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Remove `--Xsnapsync-server-enabled` deprecated since 25.7.0. Use `--snapsync-server-enabled` instead.
99
- Remove `--Xsnapsync-synchronizer-pre-merge-headers-only-enabled` deprecated since 25.7.0. Use `--snapsync-synchronizer-pre-checkpoint-headers-only-enabled` instead.
1010
- Remove `--Xhistory-expiry-prune` deprecated since 25.7.0. Use `--history-expiry-prune` instead.
11+
- Use error code 3 for execution reverted [#9365](https://github.com/hyperledger/besu/pull/9365)
1112
- eth_createAccessList now returns success result if execution reverted [#9358](https://github.com/hyperledger/besu/pull/9358)
1213
- Return null result if block not found for `debug_accountAt`, `debug_setHead`, `eth_call`, `eth_getBlockReceipts`, `eth_getProof`, `eth_simulateV1`, `eth_getBalance`, `eth_getCode`, `eth_getStorageAt`, `eth_getTransactionCount` [#9303](https://github.com/hyperledger/besu/pull/9303)
1314

@@ -19,8 +20,10 @@
1920
### Additions and Improvements
2021
- Update to vertx 4.5.22 [#9375](https://github.com/hyperledger/besu/pull/9375)
2122
- Add `opcodes` optional parameter to RPC methods: `debug_standardTraceBlockToFile`, `debug_standardTraceBadBlockToFile`, `debug_traceBlockByNumber`, `debug_traceBlockByHash`, `debug_traceTransaction`, `debug_traceBlock`, `debug_traceCall` for tracing specified opcodes [#9335](https://github.com/hyperledger/besu/pull/9335)
23+
- Use error code 3 for execution reverted [#9365](https://github.com/hyperledger/besu/pull/9365)
2224
- eth_createAccessList now returns success result if execution reverted [#9358](https://github.com/hyperledger/besu/pull/9358)
2325
- Return null result if block not found for `debug_accountAt`, `debug_setHead`, `eth_call`, `eth_getBlockReceipts`, `eth_getProof`, `eth_simulateV1`, `eth_getBalance`, `eth_getCode`, `eth_getStorageAt`, `eth_getTransactionCount` [#9303](https://github.com/hyperledger/besu/pull/9303)
26+
- Use Eclipse Temurin OpenJDK JRE in Besu docker image [#9392](https://github.com/hyperledger/besu/pull/9392)
2427

2528
### Bug fixes
2629

app/src/main/java/org/hyperledger/besu/RunnerBuilder.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
7171
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
7272
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
73+
import org.hyperledger.besu.ethereum.mainnet.BalConfiguration;
7374
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
7475
import org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration;
7576
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
@@ -170,6 +171,7 @@ public class RunnerBuilder {
170171
private WebSocketConfiguration webSocketConfiguration;
171172
private InProcessRpcConfiguration inProcessRpcConfiguration;
172173
private ApiConfiguration apiConfiguration;
174+
private BalConfiguration balConfiguration = BalConfiguration.DEFAULT;
173175
private Path dataDir;
174176
private Optional<Path> pidPath = Optional.empty();
175177
private MetricsConfiguration metricsConfiguration;
@@ -393,6 +395,17 @@ public RunnerBuilder apiConfiguration(final ApiConfiguration apiConfiguration) {
393395
return this;
394396
}
395397

398+
/**
399+
* Sets the block access list configuration.
400+
*
401+
* @param balConfiguration the BAL configuration
402+
* @return the runner builder
403+
*/
404+
public RunnerBuilder balConfiguration(final BalConfiguration balConfiguration) {
405+
this.balConfiguration = balConfiguration;
406+
return this;
407+
}
408+
396409
/**
397410
* Add Permissioning configuration.
398411
*
@@ -1260,6 +1273,7 @@ private Map<String, JsonRpcMethod> jsonRpcMethods(
12601273
besuController.getProtocolManager().ethContext().getEthPeers(),
12611274
consensusEngineServer,
12621275
apiConfiguration,
1276+
balConfiguration,
12631277
enodeDnsConfiguration,
12641278
transactionSimulator,
12651279
ethScheduler);

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.hyperledger.besu.cli.error.BesuExecutionExceptionHandler;
4343
import org.hyperledger.besu.cli.error.BesuParameterExceptionHandler;
4444
import org.hyperledger.besu.cli.options.ApiConfigurationOptions;
45+
import org.hyperledger.besu.cli.options.BalConfigurationOptions;
4546
import org.hyperledger.besu.cli.options.ChainPruningOptions;
4647
import org.hyperledger.besu.cli.options.DebugTracerOptions;
4748
import org.hyperledger.besu.cli.options.DnsOptions;
@@ -122,6 +123,7 @@
122123
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
123124
import org.hyperledger.besu.ethereum.eth.transactions.ImmutableTransactionPoolConfiguration;
124125
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
126+
import org.hyperledger.besu.ethereum.mainnet.BalConfiguration;
125127
import org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration;
126128
import org.hyperledger.besu.ethereum.p2p.discovery.P2PDiscoveryConfiguration;
127129
import org.hyperledger.besu.ethereum.p2p.peers.EnodeDnsConfiguration;
@@ -601,6 +603,9 @@ void setUserName(final String userName) {
601603
@CommandLine.ArgGroup(validate = false, heading = "@|bold API Configuration Options|@%n")
602604
ApiConfigurationOptions apiConfigurationOptions = new ApiConfigurationOptions();
603605

606+
@CommandLine.ArgGroup(validate = false, heading = "@|bold Block Access List Options|@%n")
607+
BalConfigurationOptions balConfigurationOptions = new BalConfigurationOptions();
608+
604609
@CommandLine.Option(
605610
names = {"--static-nodes-file"},
606611
paramLabel = MANDATORY_FILE_FORMAT_HELP,
@@ -1241,6 +1246,7 @@ private Runner buildRunner() {
12411246
jsonRpcIpcConfiguration,
12421247
inProcessRpcConfiguration,
12431248
apiConfigurationSupplier.get(),
1249+
balConfigurationOptions.toDomainObject(),
12441250
metricsConfiguration,
12451251
permissioningConfiguration,
12461252
staticNodes,
@@ -1811,6 +1817,9 @@ public BesuControllerBuilder setupControllerBuilder() {
18111817
.withMiningParameters(miningParametersSupplier.get())
18121818
.withJsonRpcHttpOptions(jsonRpcHttpOptions);
18131819
final KeyValueStorageProvider storageProvider = keyValueStorageProvider(keyValueStorageName);
1820+
final ApiConfiguration apiConfiguration = apiConfigurationSupplier.get();
1821+
final BalConfiguration balConfiguration = balConfigurationOptions.toDomainObject();
1822+
18141823
BesuControllerBuilder besuControllerBuilder =
18151824
controllerBuilder
18161825
.fromEthNetworkConfig(updateNetworkConfig(network), getDefaultSyncModeIfNotSet())
@@ -1839,16 +1848,15 @@ public BesuControllerBuilder setupControllerBuilder() {
18391848
.cacheLastBlockHeaders(numberOfBlockHeadersToCache)
18401849
.isCacheLastBlockHeadersPreloadEnabled(isCacheLastBlockHeadersPreloadEnabled)
18411850
.genesisStateHashCacheEnabled(genesisStateHashCacheEnabled)
1842-
.apiConfiguration(apiConfigurationSupplier.get())
1851+
.apiConfiguration(apiConfiguration)
1852+
.balConfiguration(balConfiguration)
18431853
.besuComponent(besuComponent);
18441854
if (DataStorageFormat.BONSAI.equals(getDataStorageConfiguration().getDataStorageFormat())) {
18451855
final PathBasedExtraStorageConfiguration subStorageConfiguration =
18461856
getDataStorageConfiguration().getPathBasedExtraStorageConfiguration();
18471857
besuControllerBuilder.isParallelTxProcessingEnabled(
18481858
subStorageConfiguration.getParallelTxProcessingEnabled());
18491859
}
1850-
besuControllerBuilder.isBlockAccessListEnabled(
1851-
apiConfigurationOptions.apiConfiguration().isBlockAccessListEnabled());
18521860
return besuControllerBuilder;
18531861
}
18541862

@@ -2112,6 +2120,7 @@ private Runner synchronize(
21122120
final JsonRpcIpcConfiguration jsonRpcIpcConfiguration,
21132121
final InProcessRpcConfiguration inProcessRpcConfiguration,
21142122
final ApiConfiguration apiConfiguration,
2123+
final BalConfiguration balConfiguration,
21152124
final MetricsConfiguration metricsConfiguration,
21162125
final Optional<PermissioningConfiguration> permissioningConfiguration,
21172126
final Collection<EnodeURL> staticNodes,
@@ -2140,6 +2149,7 @@ private Runner synchronize(
21402149
.jsonRpcIpcConfiguration(jsonRpcIpcConfiguration)
21412150
.inProcessRpcConfiguration(inProcessRpcConfiguration)
21422151
.apiConfiguration(apiConfiguration)
2152+
.balConfiguration(balConfiguration)
21432153
.pidPath(pidPath)
21442154
.dataDir(dataDir())
21452155
.bannedNodeIds(p2PDiscoveryConfig.bannedNodeIds())
@@ -2587,6 +2597,9 @@ private Boolean getDefaultVersionCompatibilityProtectionIfNotSet() {
25872597
private String generateConfigurationOverview() {
25882598
final ConfigurationOverviewBuilder builder = new ConfigurationOverviewBuilder(logger);
25892599

2600+
final BalConfiguration balConfiguration = balConfigurationOptions.toDomainObject();
2601+
builder.setBalConfiguration(balConfiguration);
2602+
25902603
if (environment != null) {
25912604
builder.setEnvironment(environment);
25922605
}

app/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package org.hyperledger.besu.cli;
1616

1717
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
18+
import org.hyperledger.besu.ethereum.mainnet.BalConfiguration;
1819
import org.hyperledger.besu.evm.internal.EvmConfiguration;
1920
import org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions;
2021
import org.hyperledger.besu.services.BesuPluginContextImpl;
@@ -23,6 +24,7 @@
2324
import org.hyperledger.besu.util.platform.PlatformDetector;
2425

2526
import java.math.BigInteger;
27+
import java.time.Duration;
2628
import java.util.ArrayList;
2729
import java.util.Collection;
2830
import java.util.List;
@@ -69,6 +71,11 @@ public class ConfigurationOverviewBuilder {
6971
private boolean isParallelTxProcessingEnabled = false;
7072
private RocksDBCLIOptions.BlobDBSettings blobDBSettings;
7173
private Long targetGasLimit;
74+
private boolean isBalOptimizationEnabled = true;
75+
private boolean isBalLenientOnStateRootMismatch = false;
76+
private boolean shouldLogBalsOnMismatch = false;
77+
private boolean isBalApiEnabled = false;
78+
private Duration balStateRootTimeout = Duration.ofSeconds(1);
7279

7380
/**
7481
* Create a new ConfigurationOverviewBuilder.
@@ -381,6 +388,21 @@ public ConfigurationOverviewBuilder setTargetGasLimit(final Long targetGasLimit)
381388
return this;
382389
}
383390

391+
/**
392+
* Sets the BAL configuration.
393+
*
394+
* @param balConfiguration the BAL configuration
395+
* @return the builder
396+
*/
397+
public ConfigurationOverviewBuilder setBalConfiguration(final BalConfiguration balConfiguration) {
398+
this.isBalOptimizationEnabled = balConfiguration.isBalOptimisationEnabled();
399+
this.isBalLenientOnStateRootMismatch = balConfiguration.isBalLenientOnStateRootMismatch();
400+
this.shouldLogBalsOnMismatch = balConfiguration.shouldLogBalsOnMismatch();
401+
this.isBalApiEnabled = balConfiguration.isBalApiEnabled();
402+
this.balStateRootTimeout = balConfiguration.getBalStateRootTimeout();
403+
return this;
404+
}
405+
384406
/**
385407
* Build configuration overview.
386408
*
@@ -453,6 +475,14 @@ public String build() {
453475
lines.add("Parallel transaction processing disabled");
454476
}
455477

478+
lines.add("BAL optimizations " + (isBalOptimizationEnabled ? "enabled" : "disabled"));
479+
lines.add(
480+
"BAL state root mismatch leniency "
481+
+ (isBalLenientOnStateRootMismatch ? "enabled" : "disabled"));
482+
lines.add("BAL logging on BAL mismatch " + (shouldLogBalsOnMismatch ? "enabled" : "disabled"));
483+
lines.add("BAL API " + (isBalApiEnabled ? "enabled" : "disabled"));
484+
lines.add("BAL state root timeout: " + balStateRootTimeout.toMillis() + " ms");
485+
456486
if (isLimitTrieLogsEnabled) {
457487
final StringBuilder trieLogPruningString = new StringBuilder();
458488
trieLogPruningString

app/src/main/java/org/hyperledger/besu/cli/options/ApiConfigurationOptions.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@ public ApiConfigurationOptions() {}
6060
"Set to enable gas price and minimum priority fee limit in eth_getGasPrice and eth_feeHistory (default: ${DEFAULT-VALUE})")
6161
private final Boolean apiGasAndPriorityFeeLimitingEnabled = false;
6262

63-
@CommandLine.Option(
64-
names = {"--Xapi-block-access-list-enabled"},
65-
hidden = true,
66-
description =
67-
"Set to enable eth_getBlockAccessListByNumber method and Block Access Lists in simulation results")
68-
private final Boolean apiBlockAccessListEnabled = false;
69-
7063
@CommandLine.Option(
7164
names = {"--api-gas-and-priority-fee-lower-bound-coefficient"},
7265
hidden = true,
@@ -144,8 +137,7 @@ public ApiConfiguration apiConfiguration() {
144137
.maxLogsRange(rpcMaxLogsRange)
145138
.gasCap(rpcGasCap)
146139
.isGasAndPriorityFeeLimitingEnabled(apiGasAndPriorityFeeLimitingEnabled)
147-
.maxTraceFilterRange(maxTraceFilterRange)
148-
.isBlockAccessListEnabled(apiBlockAccessListEnabled);
140+
.maxTraceFilterRange(maxTraceFilterRange);
149141
if (apiGasAndPriorityFeeLimitingEnabled) {
150142
builder
151143
.lowerBoundGasAndPriorityFeeCoefficient(apiGasAndPriorityFeeLowerBoundCoefficient)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright contributors to Hyperledger Besu.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*
13+
* SPDX-License-Identifier: Apache-2.0
14+
*/
15+
package org.hyperledger.besu.cli.options;
16+
17+
import org.hyperledger.besu.ethereum.mainnet.BalConfiguration;
18+
import org.hyperledger.besu.ethereum.mainnet.ImmutableBalConfiguration;
19+
20+
import java.time.Duration;
21+
22+
import picocli.CommandLine;
23+
24+
/** Command-line options for configuring Block Access List behaviour. */
25+
public class BalConfigurationOptions {
26+
/** Default constructor. */
27+
public BalConfigurationOptions() {}
28+
29+
@CommandLine.Option(
30+
names = {"--Xbal-optimization-enabled"},
31+
hidden = true,
32+
description = "Allows disabling BAL-based optimizations.")
33+
boolean balOptimizationEnabled = true;
34+
35+
@CommandLine.Option(
36+
names = {"--Xbal-lenient-on-state-root-mismatch"},
37+
hidden = true,
38+
description =
39+
"Log an error instead of throwing when the BAL-computed state root does not match the synchronously computed root.")
40+
boolean balLenientOnStateRootMismatch = true;
41+
42+
@CommandLine.Option(
43+
names = {"--Xbal-log-bals-on-mismatch"},
44+
hidden = true,
45+
description = "Log the constructed and block's BAL when they differ.")
46+
boolean balLogBalsOnMismatch = false;
47+
48+
@CommandLine.Option(
49+
names = {"--Xbal-api-enabled"},
50+
hidden = true,
51+
description =
52+
"Set to enable eth_getBlockAccessListByNumber method and Block Access Lists in simulation results")
53+
private final Boolean balApiEnabled = false;
54+
55+
@CommandLine.Option(
56+
names = {"--Xbal-state-root-timeout"},
57+
hidden = true,
58+
paramLabel = "<INTEGER>",
59+
description = "Timeout in milliseconds when waiting for the BAL-computed state root.")
60+
private long balStateRootTimeoutMs = Duration.ofSeconds(1).toMillis();
61+
62+
/**
63+
* Builds the immutable {@link BalConfiguration} corresponding to the parsed CLI options.
64+
*
65+
* @return an immutable BAL configuration reflecting the current option values
66+
*/
67+
public BalConfiguration toDomainObject() {
68+
return ImmutableBalConfiguration.builder()
69+
.isBalApiEnabled(balApiEnabled)
70+
.isBalOptimisationEnabled(balOptimizationEnabled)
71+
.shouldLogBalsOnMismatch(balLogBalsOnMismatch)
72+
.isBalLenientOnStateRootMismatch(balLenientOnStateRootMismatch)
73+
.balStateRootTimeout(Duration.ofMillis(balStateRootTimeoutMs))
74+
.build();
75+
}
76+
}

app/src/main/java/org/hyperledger/besu/cli/options/MetricsOptions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import picocli.CommandLine;
3737

3838
/** Command line options for configuring metrics. */
39-
// TODO: implement CLIOption<MetricsConfiguration>
4039
public class MetricsOptions implements CLIOptions<MetricsConfiguration.Builder> {
4140
private MetricCategoryRegistryImpl metricCategoryRegistry;
4241

app/src/main/java/org/hyperledger/besu/cli/options/SynchronizerOptions.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,6 @@ public void parseBlockPropagationRange(final String arg) {
302302
private int snapsyncFlatStorageHealedCountPerRequest =
303303
SnapSyncConfiguration.DEFAULT_LOCAL_FLAT_STORAGE_COUNT_TO_HEAL_PER_REQUEST;
304304

305-
// TODO --Xsnapsync-server-enabled is deprecated, remove in a future release
306-
@SuppressWarnings("ExperimentalCliOptionMustBeCorrectlyDisplayed")
307305
@CommandLine.Option(
308306
names = {SNAP_SERVER_ENABLED_FLAG},
309307
paramLabel = "<Boolean>",

0 commit comments

Comments
 (0)