|
15 | 15 | package org.hyperledger.besu.cli; |
16 | 16 |
|
17 | 17 | import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration; |
| 18 | +import org.hyperledger.besu.ethereum.mainnet.BalConfiguration; |
18 | 19 | import org.hyperledger.besu.evm.internal.EvmConfiguration; |
19 | 20 | import org.hyperledger.besu.plugin.services.storage.rocksdb.configuration.RocksDBCLIOptions; |
20 | 21 | import org.hyperledger.besu.services.BesuPluginContextImpl; |
|
23 | 24 | import org.hyperledger.besu.util.platform.PlatformDetector; |
24 | 25 |
|
25 | 26 | import java.math.BigInteger; |
| 27 | +import java.time.Duration; |
26 | 28 | import java.util.ArrayList; |
27 | 29 | import java.util.Collection; |
28 | 30 | import java.util.List; |
@@ -69,6 +71,11 @@ public class ConfigurationOverviewBuilder { |
69 | 71 | private boolean isParallelTxProcessingEnabled = false; |
70 | 72 | private RocksDBCLIOptions.BlobDBSettings blobDBSettings; |
71 | 73 | private Long targetGasLimit; |
| 74 | + private boolean isBalOptimizationEnabled = true; |
| 75 | + private boolean isBalStateRootTrusted = false; |
| 76 | + private boolean isBalLenientOnMismatch = false; |
| 77 | + private boolean isBalApiEnabled = false; |
| 78 | + private Duration balStateRootTimeout = Duration.ofSeconds(1); |
72 | 79 |
|
73 | 80 | /** |
74 | 81 | * Create a new ConfigurationOverviewBuilder. |
@@ -381,6 +388,21 @@ public ConfigurationOverviewBuilder setTargetGasLimit(final Long targetGasLimit) |
381 | 388 | return this; |
382 | 389 | } |
383 | 390 |
|
| 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.isBalStateRootTrusted = balConfiguration.isBalStateRootTrusted(); |
| 400 | + this.isBalLenientOnMismatch = balConfiguration.isBalLenientOnMismatch(); |
| 401 | + this.isBalApiEnabled = balConfiguration.isBalApiEnabled(); |
| 402 | + this.balStateRootTimeout = balConfiguration.getBalStateRootTimeout(); |
| 403 | + return this; |
| 404 | + } |
| 405 | + |
384 | 406 | /** |
385 | 407 | * Build configuration overview. |
386 | 408 | * |
@@ -453,6 +475,12 @@ public String build() { |
453 | 475 | lines.add("Parallel transaction processing disabled"); |
454 | 476 | } |
455 | 477 |
|
| 478 | + lines.add("BAL optimizations " + (isBalOptimizationEnabled ? "enabled" : "disabled")); |
| 479 | + lines.add("BAL state root trust " + (isBalStateRootTrusted ? "enabled" : "disabled")); |
| 480 | + lines.add("BAL mismatch leniency " + (isBalLenientOnMismatch ? "enabled" : "disabled")); |
| 481 | + lines.add("BAL API " + (isBalApiEnabled ? "enabled" : "disabled")); |
| 482 | + lines.add("BAL state root timeout: " + balStateRootTimeout.toMillis() + " ms"); |
| 483 | + |
456 | 484 | if (isLimitTrieLogsEnabled) { |
457 | 485 | final StringBuilder trieLogPruningString = new StringBuilder(); |
458 | 486 | trieLogPruningString |
|
0 commit comments