Skip to content

Commit cbe6306

Browse files
authored
Add Mainnet to merged networks (#4463)
* Add Mainnet to the merged networks, to force fast-sync-min-peers to 1 Signed-off-by: Fabio Di Fabio <[email protected]>
1 parent 10e72bb commit cbe6306

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Additions and Improvements
66
- Avoid sending added block events to transaction pool, and processing incoming transactions during initial sync [#4457](https://github.com/hyperledger/besu/pull/4457)
77
- When building a new proposal, keep the best block built until now instead of the last one [#4455](https://github.com/hyperledger/besu/pull/4455)
8+
- Add Mainnet to merged networks [#4463](https://github.com/hyperledger/besu/pull/4463)
89

910
### Bug Fixes
1011
### Download Links

besu/src/main/java/org/hyperledger/besu/cli/config/NetworkName.java

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public Optional<String> getDeprecationDate() {
8989

9090
public static boolean isMergedNetwork(final NetworkName networkName) {
9191
switch (networkName) {
92+
case MAINNET:
9293
case GOERLI:
9394
case ROPSTEN:
9495
case SEPOLIA:

besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java

+5-17
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ public void noOverrideDefaultValuesIfKeyIsNotPresentInConfigFile() throws IOExce
882882

883883
final SynchronizerConfiguration syncConfig = syncConfigurationCaptor.getValue();
884884
assertThat(syncConfig.getSyncMode()).isEqualTo(SyncMode.FAST);
885-
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(5);
885+
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(1);
886886

887887
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
888888

@@ -1709,19 +1709,19 @@ public void helpShouldDisplayFastSyncOptions() {
17091709
}
17101710

17111711
@Test
1712-
public void checkValidDefaultFastSyncMinPeersOption() {
1713-
parseCommand("--sync-mode", "FAST");
1712+
public void checkValidDefaultFastSyncMinPeersPoS() {
1713+
parseCommand("--sync-mode", "FAST", "--network", "MAINNET");
17141714
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture());
17151715

17161716
final SynchronizerConfiguration syncConfig = syncConfigurationCaptor.getValue();
17171717
assertThat(syncConfig.getSyncMode()).isEqualTo(SyncMode.FAST);
1718-
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(5);
1718+
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(1);
17191719
assertThat(commandOutput.toString(UTF_8)).isEmpty();
17201720
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
17211721
}
17221722

17231723
@Test
1724-
public void checkValidDefaultFastSyncMinPeersPreMergeOption() {
1724+
public void checkValidDefaultFastSyncMinPeersPoW() {
17251725
parseCommand("--sync-mode", "FAST", "--network", "CLASSIC");
17261726
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture());
17271727

@@ -1732,18 +1732,6 @@ public void checkValidDefaultFastSyncMinPeersPreMergeOption() {
17321732
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
17331733
}
17341734

1735-
@Test
1736-
public void checkValidDefaultFastSyncMinPeersPostMergeOption() {
1737-
parseCommand("--sync-mode", "FAST", "--network", "GOERLI");
1738-
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture());
1739-
1740-
final SynchronizerConfiguration syncConfig = syncConfigurationCaptor.getValue();
1741-
assertThat(syncConfig.getSyncMode()).isEqualTo(SyncMode.FAST);
1742-
assertThat(syncConfig.getFastSyncMinimumPeerCount()).isEqualTo(1);
1743-
assertThat(commandOutput.toString(UTF_8)).isEmpty();
1744-
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
1745-
}
1746-
17471735
@Test
17481736
public void parsesValidFastSyncMinPeersOption() {
17491737
parseCommand("--sync-mode", "FAST", "--fast-sync-min-peers", "11");

0 commit comments

Comments
 (0)