Skip to content

Commit

Permalink
Merge with main
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Whitehead <[email protected]>
  • Loading branch information
matthew1001 committed Jun 10, 2024
1 parent b988e61 commit 8cfe615
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Promote experimental --Xbonsai-trie-logs-pruning-window-size to production-ready, --bonsai-trie-logs-pruning-window-size [#7192](https://github.com/hyperledger/besu/pull/7192)
- `admin_nodeInfo` JSON/RPC call returns the currently active EVM version [#7127](https://github.com/hyperledger/besu/pull/7127)
- Improve the selection of the most profitable built block [#7174](https://github.com/hyperledger/besu/pull/7174)
- `--Xsnapsync-bft-enabled` option enables experimental support for snap sync with IBFT/QBFT permissioned chains [#7140](https://github.com/hyperledger/besu/pull/7140)

### Bug fixes
- Make `eth_gasPrice` aware of the base fee market [#7102](https://github.com/hyperledger/besu/pull/7102)
Expand Down
4 changes: 2 additions & 2 deletions besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -1540,11 +1540,11 @@ private void validateOptions() {
}

private void validateConsensusSyncCompatibilityOptions() {
// snap and checkpoint can't be used with BFT but can for clique
// snap and checkpoint are experimental for BFT
if ((genesisConfigOptionsSupplier.get().isIbftLegacy()
|| genesisConfigOptionsSupplier.get().isIbft2()
|| genesisConfigOptionsSupplier.get().isQbft())
&& genesisConfigOptionsSupplier.get().isEthHash()) {
&& !unstableSynchronizerOptions.isSnapSyncBftEnabled()) {
final String errorSuffix = "can't be used with BFT networks";
if (SyncMode.CHECKPOINT.equals(syncMode) || SyncMode.X_CHECKPOINT.equals(syncMode)) {
throw new ParameterException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,9 @@ private PivotBlockSelector createPivotSelector(
final MetricsSystem metricsSystem) {

if (genesisConfigOptions.isQbft() || genesisConfigOptions.isIbft2()) {
LOG.info("QBFT is configured, creating initial sync for BFT");
LOG.info(
"{} is configured, creating initial sync for BFT",
genesisConfigOptions.getConsensusEngine().toUpperCase());
return new BFTPivotSelectorFromPeers(
ethContext, syncConfig, syncState, metricsSystem, protocolContext, nodeKey);
} else if (genesisConfigOptions.getTerminalTotalDifficulty().isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public Optional<FastSyncState> selectNewPivotBlock() {
// pivot distance
if (bestPeer.get().chainState().getEstimatedHeight()
<= syncConfig.getFastSyncPivotDistance()) {
LOG.info(
"Best peer for sync found but chain height hasn't reached minimum sync pivot distance {}, exiting sync process",
syncConfig.getFastSyncPivotDistance());
throw new NoSyncRequiredException();
}

Expand All @@ -78,6 +81,7 @@ public Optional<FastSyncState> selectNewPivotBlock() {
&& validatorProvider
.getValidatorsAtHead()
.contains(Util.publicKeyToAddress(nodeKey.getPublicKey()))) {
LOG.info("This node is the only BFT validator, exiting sync process");
throw new NoSyncRequiredException();
}

Expand Down Expand Up @@ -105,6 +109,9 @@ public Optional<FastSyncState> selectNewPivotBlock() {
// assume this is a new chain
// and skip waiting for any more peers to sync with. The worst case is this puts us into
// full sync mode.
LOG.info(
"Peered with {} validators but no best peer found to sync from. Assuming new BFT chain, exiting sync process",
peerValidatorCount.get());
throw new NoSyncRequiredException();
}
}
Expand Down

0 comments on commit 8cfe615

Please sign in to comment.