Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hyperledger/besu into pipeline-debu…
Browse files Browse the repository at this point in the history
…g-rpc
  • Loading branch information
macfarla committed Nov 3, 2023
2 parents 7bf78e3 + 6a2d41f commit b6db17d
Show file tree
Hide file tree
Showing 126 changed files with 3,600 additions and 978 deletions.
43 changes: 27 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# Changelog

### Breaking Changes

### Deprecations

### Additions and Improvements

### Bug Fixes

### Download Links

## 23.10.2

### Breaking Changes
Expand All @@ -19,26 +9,47 @@
### Additions and Improvements
- Ethereum Classic Spiral network upgrade [#6078](https://github.com/hyperledger/besu/pull/6078)
- Add a method to read from a `Memory` instance without altering its inner state [#6073](https://github.com/hyperledger/besu/pull/6073)
- Accept `input` and `data` field for the payload of transaction-related RPC methods [#6094](https://github.com/hyperledger/besu/pull/6094)
- Add APIs to set and get the min gas price a transaction must pay for being selected during block creation [#6097](https://github.com/hyperledger/besu/pull/6097)
- TraceService: return results for transactions in block [#6086](https://github.com/hyperledger/besu/pull/6086)
- New option `--min-priority-fee` that sets the minimum priority fee a transaction must meet to be selected for a block. [#6080](https://github.com/hyperledger/besu/pull/6080) [#6083](https://github.com/hyperledger/besu/pull/6083)
- Implement new `miner_setMinPriorityFee` and `miner_getMinPriorityFee` RPC methods [#6080](https://github.com/hyperledger/besu/pull/6080)
- Clique config option `createemptyblocks` to not create empty blocks [#6082](https://github.com/hyperledger/besu/pull/6082)

### Bug fixes

- Upgrade netty to address CVE-2023-44487, CVE-2023-34462 [#6100](https://github.com/hyperledger/besu/pull/6100)
- Upgrade grpc to address CVE-2023-32731, CVE-2023-33953, CVE-2023-44487, CVE-2023-4785 [#6100](https://github.com/hyperledger/besu/pull/6100)
- Fix blob gas calculation in reference tests [#6107](https://github.com/hyperledger/besu/pull/6107)

---

### Download Links

## 23.10.1
- Cache last n blocks by using a new Besu flag --cache-last-blocks=n [#6009](https://github.com/hyperledger/besu/pull/6009)
- Optimize performances of RPC method Eth_feeHistory [#6011](https://github.com/hyperledger/besu/pull/6011)

### Breaking Changes
### Additions and Improvements
- New option `--tx-pool-priority-senders` to specify a list of senders, that has the effect to prioritize any transactions sent by these senders from any source [#5959](https://github.com/hyperledger/besu/pull/5959)
- Cache last n blocks by using a new Besu flag `--cache-last-blocks=n` [#6009](https://github.com/hyperledger/besu/pull/6009)
- Optimize performances of RPC method `eth_feeHistory` [#6011](https://github.com/hyperledger/besu/pull/6011) [#6035](https://github.com/hyperledger/besu/pull/6035)
- Logging summary of plugins at Info as part of the config overview [#5964](https://github.com/hyperledger/besu/pull/5964) [#6049](https://github.com/hyperledger/besu/pull/6049)
- Layered tx pool memory improvements [#5985](https://github.com/hyperledger/besu/pull/5985) [#5974](https://github.com/hyperledger/besu/pull/5974)
- Update Bouncy Castle to 1.76, and force the use of the `jdk18on` variant [#5748](https://github.com/hyperledger/besu/pull/5748)
- Add GraphQL support for new fields in Cancun [#5923](https://github.com/hyperledger/besu/pull/5923) [#5975](https://github.com/hyperledger/besu/pull/5975)
- Add new configuration options to the EVM Fluent APIs [#5930](https://github.com/hyperledger/besu/pull/5930)


### Deprecations
- `--tx-pool-disable-locals` has been deprecated for removal in favor of `--tx-pool-no-local-priority`, no semantic change, only a renaming [#5959](https://github.com/hyperledger/besu/pull/5959)

### Additions and Improvements
- New option `--tx-pool-priority-senders` to specify a list of senders, that has the effect to prioritize any transactions sent by these senders from any source [#5959](https://github.com/hyperledger/besu/pull/5959)

### Bug Fixes
- Fix regression with t8n tool filling [#5979](https://github.com/hyperledger/besu/pull/5979)
- Fix EOF and EIP-4788 regressions in reference tests [#6060](https://github.com/hyperledger/besu/pull/6060)

### Download Links
https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/23.10.1/besu-23.10.1.tar.gz / sha256: e27645f345583f3ee447e5418302382c6f8335d2da8707bdd20033aabd86ce4c

https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/23.10.1/besu-23.10.1.zip / sha256: fb173acb93c72fbb74a6542051691ca2d3d5f54ea2f51026467a512f3a22106b

## 23.10.0
### Layered Transaction Pool: the new default transaction pool implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3433,6 +3433,7 @@ private String generateConfigurationOverview() {
}

builder.setTxPoolImplementation(buildTransactionPoolConfiguration().getTxPoolImplementation());
builder.setWorldStateUpdateMode(unstableEvmOptions.toDomainObject().worldUpdaterMode());

builder.setPluginContext(besuComponent.getBesuPluginContext());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.hyperledger.besu.BesuInfo;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
import org.hyperledger.besu.evm.internal.EvmConfiguration;
import org.hyperledger.besu.services.BesuPluginContextImpl;
import org.hyperledger.besu.util.log.FramedLogMessage;
import org.hyperledger.besu.util.platform.PlatformDetector;
Expand Down Expand Up @@ -50,6 +51,7 @@ public class ConfigurationOverviewBuilder {
private String engineJwtFilePath;
private boolean isHighSpec = false;
private TransactionPoolConfiguration.Implementation txPoolImplementation;
private EvmConfiguration.WorldUpdaterMode worldStateUpdateMode;
private Map<String, String> environment;
private BesuPluginContextImpl besuPluginContext;

Expand Down Expand Up @@ -181,6 +183,18 @@ public ConfigurationOverviewBuilder setTxPoolImplementation(
return this;
}

/**
* Sets the world state updater mode
*
* @param worldStateUpdateMode the world state updater mode
* @return the builder
*/
public ConfigurationOverviewBuilder setWorldStateUpdateMode(
final EvmConfiguration.WorldUpdaterMode worldStateUpdateMode) {
this.worldStateUpdateMode = worldStateUpdateMode;
return this;
}

/**
* Sets the engine jwt file path.
*
Expand Down Expand Up @@ -257,6 +271,7 @@ public String build() {
}

lines.add("Using " + txPoolImplementation + " transaction pool implementation");
lines.add("Using " + worldStateUpdateMode + " worldstate update mode");

lines.add("");
lines.add("Host:");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.hyperledger.besu.cli.options.CLIOptions;
import org.hyperledger.besu.evm.internal.EvmConfiguration;

import java.util.Arrays;
import java.util.List;

import picocli.CommandLine;
Expand All @@ -29,6 +28,9 @@ public class EvmOptions implements CLIOptions<EvmConfiguration> {
/** The constant JUMPDEST_CACHE_WEIGHT. */
public static final String JUMPDEST_CACHE_WEIGHT = "--Xevm-jumpdest-cache-weight-kb";

/** The constant WORLDSTATE_UPDATE_MODE. */
public static final String WORLDSTATE_UPDATE_MODE = "--Xevm-worldstate-update-mode";

/**
* Create evm options.
*
Expand All @@ -51,13 +53,24 @@ public static EvmOptions create() {
private Long jumpDestCacheWeightKilobytes =
32_000L; // 10k contracts, (25k max contract size / 8 bit) + 32byte hash

@CommandLine.Option(
names = {WORLDSTATE_UPDATE_MODE},
description = "How to handle worldstate updates within a transaction",
fallbackValue = "STACKED",
defaultValue = "STACKED",
hidden = true,
arity = "1")
private EvmConfiguration.WorldUpdaterMode worldstateUpdateMode =
EvmConfiguration.WorldUpdaterMode
.STACKED; // Stacked Updater. Years of battle tested correctness.

@Override
public EvmConfiguration toDomainObject() {
return new EvmConfiguration(jumpDestCacheWeightKilobytes);
return new EvmConfiguration(jumpDestCacheWeightKilobytes, worldstateUpdateMode);
}

@Override
public List<String> getCLIOptions() {
return Arrays.asList(JUMPDEST_CACHE_WEIGHT);
return List.of(JUMPDEST_CACHE_WEIGHT, WORLDSTATE_UPDATE_MODE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,7 @@ public BesuController build() {
if (chainPrunerConfiguration.getChainPruningEnabled()) {
protocolContext
.safeConsensusContext(MergeContext.class)
.ifPresent(
mergeContext -> {
mergeContext.setIsChainPruningEnabled(true);
});
.ifPresent(mergeContext -> mergeContext.setIsChainPruningEnabled(true));
final ChainDataPruner chainDataPruner = createChainPruner(blockchainStorage);
blockchain.observeBlockAdded(chainDataPruner);
LOG.info(
Expand Down Expand Up @@ -776,7 +773,6 @@ public BesuController build() {

final SubProtocolConfiguration subProtocolConfiguration =
createSubProtocolConfiguration(ethProtocolManager, maybeSnapProtocolManager);
;

final JsonRpcMethods additionalJsonRpcMethodFactory =
createAdditionalJsonRpcMethodFactory(protocolContext);
Expand Down Expand Up @@ -831,24 +827,21 @@ protected Synchronizer createSynchronizer(
final EthProtocolManager ethProtocolManager,
final PivotBlockSelector pivotBlockSelector) {

final DefaultSynchronizer toUse =
new DefaultSynchronizer(
syncConfig,
protocolSchedule,
protocolContext,
worldStateStorage,
ethProtocolManager.getBlockBroadcaster(),
maybePruner,
ethContext,
syncState,
dataDirectory,
storageProvider,
clock,
metricsSystem,
getFullSyncTerminationCondition(protocolContext.getBlockchain()),
pivotBlockSelector);

return toUse;
return new DefaultSynchronizer(
syncConfig,
protocolSchedule,
protocolContext,
worldStateStorage,
ethProtocolManager.getBlockBroadcaster(),
maybePruner,
ethContext,
syncState,
dataDirectory,
storageProvider,
clock,
metricsSystem,
getFullSyncTerminationCondition(protocolContext.getBlockchain()),
pivotBlockSelector);
}

private PivotBlockSelector createPivotSelector(
Expand Down Expand Up @@ -930,9 +923,8 @@ protected SubProtocolConfiguration createSubProtocolConfiguration(
final SubProtocolConfiguration subProtocolConfiguration =
new SubProtocolConfiguration().withSubProtocol(EthProtocol.get(), ethProtocolManager);
maybeSnapProtocolManager.ifPresent(
snapProtocolManager -> {
subProtocolConfiguration.withSubProtocol(SnapProtocol.get(), snapProtocolManager);
});
snapProtocolManager ->
subProtocolConfiguration.withSubProtocol(SnapProtocol.get(), snapProtocolManager));
return subProtocolConfiguration;
}

Expand Down Expand Up @@ -1071,22 +1063,21 @@ WorldStateArchive createWorldStateArchive(
final WorldStateStorage worldStateStorage,
final Blockchain blockchain,
final CachedMerkleTrieLoader cachedMerkleTrieLoader) {
switch (dataStorageConfiguration.getDataStorageFormat()) {
case BONSAI:
return new BonsaiWorldStateProvider(
(BonsaiWorldStateKeyValueStorage) worldStateStorage,
blockchain,
Optional.of(dataStorageConfiguration.getBonsaiMaxLayersToLoad()),
cachedMerkleTrieLoader,
metricsSystem,
besuComponent.map(BesuComponent::getBesuPluginContext).orElse(null));

case FOREST:
default:
return switch (dataStorageConfiguration.getDataStorageFormat()) {
case BONSAI -> new BonsaiWorldStateProvider(
(BonsaiWorldStateKeyValueStorage) worldStateStorage,
blockchain,
Optional.of(dataStorageConfiguration.getBonsaiMaxLayersToLoad()),
cachedMerkleTrieLoader,
metricsSystem,
besuComponent.map(BesuComponent::getBesuPluginContext).orElse(null),
evmConfiguration);
case FOREST -> {
final WorldStatePreimageStorage preimageStorage =
storageProvider.createWorldStatePreimageStorage();
return new DefaultWorldStateArchive(worldStateStorage, preimageStorage);
}
yield new DefaultWorldStateArchive(worldStateStorage, preimageStorage, evmConfiguration);
}
};
}

private ChainDataPruner createChainPruner(final BlockchainStorage blockchainStorage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
private Address localAddress;
private EpochManager epochManager;
private long secondsBetweenBlocks;
private boolean createEmptyBlocks = true;
private final BlockInterface blockInterface = new CliqueBlockInterface();

@Override
Expand All @@ -61,6 +62,7 @@ protected void prepForBuild() {
final CliqueConfigOptions cliqueConfig = configOptionsSupplier.get().getCliqueConfigOptions();
final long blocksPerEpoch = cliqueConfig.getEpochLength();
secondsBetweenBlocks = cliqueConfig.getBlockPeriodSeconds();
createEmptyBlocks = cliqueConfig.getCreateEmptyBlocks();

epochManager = new EpochManager(blocksPerEpoch);
}
Expand Down Expand Up @@ -91,7 +93,8 @@ protected MiningCoordinator createMiningCoordinator(
protocolContext.getConsensusContext(CliqueContext.class).getValidatorProvider(),
localAddress,
secondsBetweenBlocks),
epochManager);
epochManager,
createEmptyBlocks);
final CliqueMiningCoordinator miningCoordinator =
new CliqueMiningCoordinator(
protocolContext.getBlockchain(),
Expand Down
Loading

0 comments on commit b6db17d

Please sign in to comment.