Merge branch 'main' into 7311-add-peertask-foundation-code

pull/7628/head
Matilda-Clerke 2 months ago committed by GitHub
commit e901fdf25b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 18
      besu/src/main/java/org/hyperledger/besu/cli/options/unstable/SynchronizerOptions.java
  2. 1
      besu/src/test/resources/everything_config.toml
  3. 18
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/SynchronizerConfiguration.java

@ -314,6 +314,13 @@ public class SynchronizerOptions implements CLIOptions<SynchronizerConfiguration
description = "Snap sync enabled for BFT chains (default: ${DEFAULT-VALUE})")
private Boolean snapsyncBftEnabled = SnapSyncConfiguration.DEFAULT_SNAP_SYNC_BFT_ENABLED;
@CommandLine.Option(
names = {"--Xpeertask-system-enabled"},
hidden = true,
description =
"Temporary feature toggle to enable using the new peertask system (default: ${DEFAULT-VALUE})")
private final Boolean isPeerTaskSystemEnabled = false;
private SynchronizerOptions() {}
/**
@ -334,6 +341,15 @@ public class SynchronizerOptions implements CLIOptions<SynchronizerConfiguration
return snapsyncBftEnabled;
}
/**
* Flag to indicate whether the peer task system should be used where available
*
* @return true if the peer task system should be used where available
*/
public boolean isPeerTaskSystemEnabled() {
return isPeerTaskSystemEnabled;
}
/**
* Create synchronizer options.
*
@ -420,7 +436,7 @@ public class SynchronizerOptions implements CLIOptions<SynchronizerConfiguration
.isSnapSyncBftEnabled(snapsyncBftEnabled)
.build());
builder.checkpointPostMergeEnabled(checkpointPostMergeSyncEnabled);
builder.isPeerTaskSystemEnabled(isPeerTaskSystemEnabled);
return builder;
}

@ -226,6 +226,7 @@ Xsecp256k1-native-enabled=false
Xaltbn128-native-enabled=false
Xsnapsync-server-enabled=true
Xbonsai-full-flat-db-enabled=true
Xpeertask-system-enabled=false
# compatibility flags
compatibility-eth64-forkid-enabled=false

@ -85,6 +85,7 @@ public class SynchronizerConfiguration {
private final int maxTrailingPeers;
private final long worldStateMinMillisBeforeStalling;
private final long propagationManagerGetBlockTimeoutMillis;
private final boolean isPeerTaskSystemEnabled;
private SynchronizerConfiguration(
final int syncPivotDistance,
@ -108,7 +109,8 @@ public class SynchronizerConfiguration {
final int computationParallelism,
final int maxTrailingPeers,
final long propagationManagerGetBlockTimeoutMillis,
final boolean checkpointPostMergeEnabled) {
final boolean checkpointPostMergeEnabled,
final boolean isPeerTaskSystemEnabled) {
this.syncPivotDistance = syncPivotDistance;
this.fastSyncFullValidationRate = fastSyncFullValidationRate;
this.syncMinimumPeerCount = syncMinimumPeerCount;
@ -131,6 +133,7 @@ public class SynchronizerConfiguration {
this.maxTrailingPeers = maxTrailingPeers;
this.propagationManagerGetBlockTimeoutMillis = propagationManagerGetBlockTimeoutMillis;
this.checkpointPostMergeEnabled = checkpointPostMergeEnabled;
this.isPeerTaskSystemEnabled = isPeerTaskSystemEnabled;
}
public static Builder builder() {
@ -256,6 +259,10 @@ public class SynchronizerConfiguration {
return propagationManagerGetBlockTimeoutMillis;
}
public boolean isPeerTaskSystemEnabled() {
return isPeerTaskSystemEnabled;
}
public static class Builder {
private SyncMode syncMode = SyncMode.FULL;
private int syncMinimumPeerCount = DEFAULT_SYNC_MINIMUM_PEERS;
@ -280,6 +287,7 @@ public class SynchronizerConfiguration {
DEFAULT_WORLD_STATE_MAX_REQUESTS_WITHOUT_PROGRESS;
private long worldStateMinMillisBeforeStalling = DEFAULT_WORLD_STATE_MIN_MILLIS_BEFORE_STALLING;
private int worldStateTaskCacheSize = DEFAULT_WORLD_STATE_TASK_CACHE_SIZE;
private boolean isPeerTaskSystemEnabled = false;
private long propagationManagerGetBlockTimeoutMillis =
DEFAULT_PROPAGATION_MANAGER_GET_BLOCK_TIMEOUT_MILLIS;
@ -406,6 +414,11 @@ public class SynchronizerConfiguration {
return this;
}
public Builder isPeerTaskSystemEnabled(final boolean isPeerTaskSystemEnabled) {
this.isPeerTaskSystemEnabled = isPeerTaskSystemEnabled;
return this;
}
public SynchronizerConfiguration build() {
return new SynchronizerConfiguration(
syncPivotDistance,
@ -429,7 +442,8 @@ public class SynchronizerConfiguration {
computationParallelism,
maxTrailingPeers,
propagationManagerGetBlockTimeoutMillis,
checkpointPostMergeEnabled);
checkpointPostMergeEnabled,
isPeerTaskSystemEnabled);
}
}
}

Loading…
Cancel
Save