From fa3245b26b1dc47f2dec4f9ba0e5cbce3bdb9904 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Wed, 31 Jan 2024 13:43:01 +1000 Subject: [PATCH 1/3] deprecate p2p-peer-lower-bound Signed-off-by: Sally MacFarlane --- .../dsl/node/ThreadBesuNodeRunner.java | 1 - .../org/hyperledger/besu/RunnerBuilder.java | 1 - .../org/hyperledger/besu/cli/BesuCommand.java | 16 ++----- .../besu/cli/DefaultCommandValues.java | 2 - .../options/unstable/NetworkingOptions.java | 6 +-- .../controller/BesuControllerBuilder.java | 18 +------- .../java/org/hyperledger/besu/RunnerTest.java | 1 - .../hyperledger/besu/cli/BesuCommandTest.java | 43 +------------------ .../besu/cli/CommandTestAbstract.java | 1 - .../cli/options/NetworkingOptionsTest.java | 1 - .../besu/ethereum/eth/manager/EthPeers.java | 13 +----- .../manager/EthProtocolManagerTestUtil.java | 3 -- .../ethtaskutils/AbstractMessageTaskTest.java | 1 - .../AbstractBlockPropagationManagerTest.java | 2 - .../ethereum/eth/transactions/TestNode.java | 1 - .../TransactionPoolFactoryTest.java | 1 - .../p2p/config/NetworkingConfiguration.java | 11 ----- .../ethereum/retesteth/RetestethContext.java | 1 - 18 files changed, 10 insertions(+), 113 deletions(-) diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java index 429c91d2b99..a29a7b0ee60 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java @@ -211,7 +211,6 @@ public void startNode(final BesuNode node) { .map(pkiConfig -> new PkiBlockCreationConfigurationProvider().load(pkiConfig))) .evmConfiguration(EvmConfiguration.DEFAULT) .maxPeers(maxPeers) - .lowerBoundPeers(maxPeers) .maxRemotelyInitiatedPeers(15) .networkConfiguration(node.getNetworkingConfiguration()) .randomPeerPriority(false) diff --git a/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java b/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java index bb3172b7dee..9dea2f54470 100644 --- a/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java @@ -690,7 +690,6 @@ public Runner build() { .timestampForks(besuController.getGenesisConfigOptions().getForkBlockTimestamps()) .allConnectionsSupplier(ethPeers::getAllConnections) .allActiveConnectionsSupplier(ethPeers::getAllActiveConnections) - .peersLowerBound(ethPeers.getPeerLowerBound()) .build(); }; diff --git a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java index b24a8e1c2a1..bf80be6f081 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java @@ -21,6 +21,7 @@ import static java.util.Collections.singletonList; import static org.hyperledger.besu.cli.DefaultCommandValues.getDefaultBesuDataPath; import static org.hyperledger.besu.cli.config.NetworkName.MAINNET; +import static org.hyperledger.besu.cli.options.unstable.NetworkingOptions.PEER_LOWER_BOUND_FLAG; import static org.hyperledger.besu.cli.util.CommandLineUtils.DEPENDENCY_WARNING_MSG; import static org.hyperledger.besu.cli.util.CommandLineUtils.isOptionSet; import static org.hyperledger.besu.controller.BesuController.DATABASE_PATH; @@ -320,7 +321,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable { private int maxPeers; private int maxRemoteInitiatedPeers; - private int peersLowerBound; // CLI options defined by user at runtime. // Options parsing is done with CLI library Picocli https://picocli.info/ @@ -1581,18 +1581,11 @@ private void checkApiOptionsDependencies() { private void ensureValidPeerBoundParams() { maxPeers = p2PDiscoveryOptionGroup.maxPeers; - peersLowerBound = unstableNetworkingOptions.toDomainObject().getPeerLowerBound(); - if (peersLowerBound > maxPeers) { - logger.warn( - "`--Xp2p-peer-lower-bound` " - + peersLowerBound - + " must not exceed --max-peers " - + maxPeers); - logger.warn("setting --Xp2p-peer-lower-bound=" + maxPeers); - peersLowerBound = maxPeers; - } final Boolean isLimitRemoteWireConnectionsEnabled = p2PDiscoveryOptionGroup.isLimitRemoteWireConnectionsEnabled; + if (isOptionSet(commandLine, PEER_LOWER_BOUND_FLAG)) { + logger.warn(PEER_LOWER_BOUND_FLAG + " is deprecated and will be removed soon."); + } if (isLimitRemoteWireConnectionsEnabled) { final float fraction = Fraction.fromPercentage(p2PDiscoveryOptionGroup.maxRemoteConnectionsPercentage) @@ -1860,7 +1853,6 @@ public BesuControllerBuilder getControllerBuilder() { .evmConfiguration(unstableEvmOptions.toDomainObject()) .dataStorageConfiguration(dataStorageOptions.toDomainObject()) .maxPeers(p2PDiscoveryOptionGroup.maxPeers) - .lowerBoundPeers(peersLowerBound) .maxRemotelyInitiatedPeers(maxRemoteInitiatedPeers) .randomPeerPriority(p2PDiscoveryOptionGroup.randomPeerPriority) .chainPruningConfiguration(unstableChainPruningOptions.toDomainObject()) diff --git a/besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java b/besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java index 3a0db478160..e62d76baf38 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java @@ -74,8 +74,6 @@ public interface DefaultCommandValues { int SYNC_MIN_PEER_COUNT = 5; /** The constant DEFAULT_MAX_PEERS. */ int DEFAULT_MAX_PEERS = 25; - /** The constant DEFAULT_P2P_PEER_LOWER_BOUND. */ - int DEFAULT_P2P_PEER_LOWER_BOUND = 25; /** The constant DEFAULT_HTTP_MAX_CONNECTIONS. */ int DEFAULT_HTTP_MAX_CONNECTIONS = 80; /** The constant DEFAULT_HTTP_MAX_BATCH_SIZE. */ diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/NetworkingOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/NetworkingOptions.java index 82dffbbe136..35e37d06ddc 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/NetworkingOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/unstable/NetworkingOptions.java @@ -80,8 +80,8 @@ public class NetworkingOptions implements CLIOptions { hidden = true, names = PEER_LOWER_BOUND_FLAG, description = - "Lower bound on the target number of P2P connections (default: ${DEFAULT-VALUE})") - private Integer peerLowerBoundConfig = DefaultCommandValues.DEFAULT_P2P_PEER_LOWER_BOUND; + "(Deprecated) Lower bound on the target number of P2P connections (default: ${DEFAULT-VALUE})") + private final Integer peerLowerBoundConfig = DefaultCommandValues.DEFAULT_MAX_PEERS; private NetworkingOptions() {} @@ -107,7 +107,6 @@ public static NetworkingOptions fromConfig(final NetworkingConfiguration network cliOptions.initiateConnectionsFrequencySec = networkingConfig.getInitiateConnectionsFrequencySec(); cliOptions.dnsDiscoveryServerOverride = networkingConfig.getDnsDiscoveryServerOverride(); - cliOptions.peerLowerBoundConfig = networkingConfig.getPeerLowerBound(); return cliOptions; } @@ -120,7 +119,6 @@ public NetworkingConfiguration toDomainObject() { config.setDnsDiscoveryServerOverride(dnsDiscoveryServerOverride); config.getDiscovery().setDiscoveryV5Enabled(isPeerDiscoveryV5Enabled); config.getDiscovery().setFilterOnEnrForkId(filterOnEnrForkId); - config.setPeerLowerBound(peerLowerBoundConfig); return config; } diff --git a/besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java index 8bc9deee8b9..d3e7641aec8 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java @@ -178,7 +178,6 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides /** The Max peers. */ protected int maxPeers; - private int peerLowerBound; private int maxRemotelyInitiatedPeers; /** The Chain pruner configuration. */ protected ChainPrunerConfiguration chainPrunerConfiguration = ChainPrunerConfiguration.DEFAULT; @@ -475,22 +474,10 @@ public BesuControllerBuilder maxPeers(final int maxPeers) { return this; } - /** - * Lower bound of peers where we stop actively trying to initiate new outgoing connections - * - * @param peerLowerBound lower bound of peers where we stop actively trying to initiate new - * outgoing connections - * @return the besu controller builder - */ - public BesuControllerBuilder lowerBoundPeers(final int peerLowerBound) { - this.peerLowerBound = peerLowerBound; - return this; - } - /** * Maximum number of remotely initiated peer connections * - * @param maxRemotelyInitiatedPeers aximum number of remotely initiated peer connections + * @param maxRemotelyInitiatedPeers maximum number of remotely initiated peer connections * @return the besu controller builder */ public BesuControllerBuilder maxRemotelyInitiatedPeers(final int maxRemotelyInitiatedPeers) { @@ -511,7 +498,7 @@ public BesuControllerBuilder chainPruningConfiguration( } /** - * Chain pruning configuration besu controller builder. + * Sets the number of blocks to cache. * * @param numberOfBlocksToCache the number of blocks to cache * @return the besu controller builder @@ -681,7 +668,6 @@ public BesuController build() { maxMessageSize, messagePermissioningProviders, nodeKey.getPublicKey().getEncodedBytes(), - peerLowerBound, maxPeers, maxRemotelyInitiatedPeers, randomPeerPriority); diff --git a/besu/src/test/java/org/hyperledger/besu/RunnerTest.java b/besu/src/test/java/org/hyperledger/besu/RunnerTest.java index f8bdb5cb690..c9e16baeecc 100644 --- a/besu/src/test/java/org/hyperledger/besu/RunnerTest.java +++ b/besu/src/test/java/org/hyperledger/besu/RunnerTest.java @@ -462,7 +462,6 @@ private BesuController getController( .networkConfiguration(NetworkingConfiguration.create()) .randomPeerPriority(Boolean.FALSE) .maxPeers(25) - .lowerBoundPeers(25) .maxRemotelyInitiatedPeers(15) .build(); } diff --git a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java index b51dd5dc778..9bb2f997687 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java @@ -253,7 +253,6 @@ public void callingBesuCommandWithoutOptionsMustSyncWithDefaultValues() { verify(mockControllerBuilder).storageProvider(storageProviderArgumentCaptor.capture()); verify(mockControllerBuilder).gasLimitCalculator(eq(GasLimitCalculator.constant())); verify(mockControllerBuilder).maxPeers(eq(maxPeers)); - verify(mockControllerBuilder).lowerBoundPeers(eq(maxPeers)); verify(mockControllerBuilder).maxRemotelyInitiatedPeers(eq((int) Math.floor(0.6 * maxPeers))); verify(mockControllerBuilder).build(); @@ -1143,7 +1142,7 @@ public void apiPriorityFeeUpperBoundCoefficientsOptionMustBeUsed() { } @Test - public void p2pPeerUpperBound_without_p2pPeerLowerBound_shouldSetLowerBoundEqualToUpperBound() { + public void p2pPeerUpperBound_without_p2pPeerLowerBound_shouldSetMaxPeers() { final int maxPeers = 23; parseCommand("--p2p-peer-upper-bound", String.valueOf(maxPeers)); @@ -1154,35 +1153,9 @@ public void p2pPeerUpperBound_without_p2pPeerLowerBound_shouldSetLowerBoundEqual verify(mockControllerBuilder).maxPeers(intArgumentCaptor.capture()); assertThat(intArgumentCaptor.getValue()).isEqualTo(maxPeers); - verify(mockControllerBuilder).lowerBoundPeers(intArgumentCaptor.capture()); - assertThat(intArgumentCaptor.getValue()).isEqualTo(maxPeers); - verify(mockRunnerBuilder).build(); } - @Test - public void maxpeersSet_p2pPeerLowerBoundSet() { - - final int maxPeers = 123; - final int minPeers = 66; - parseCommand( - "--max-peers", - String.valueOf(maxPeers), - "--Xp2p-peer-lower-bound", - String.valueOf(minPeers)); - - verify(mockControllerBuilder).maxPeers(intArgumentCaptor.capture()); - assertThat(intArgumentCaptor.getValue()).isEqualTo(maxPeers); - - verify(mockControllerBuilder).lowerBoundPeers(intArgumentCaptor.capture()); - assertThat(intArgumentCaptor.getValue()).isEqualTo(minPeers); - - verify(mockRunnerBuilder).build(); - - assertThat(commandOutput.toString(UTF_8)).isEmpty(); - assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); - } - @Test public void remoteConnectionsPercentageOptionMustBeUsed() { @@ -3405,20 +3378,6 @@ public void checkpointMergeAtGenesisWithGenesisBlockDifficultyZeroFails() throws "PoS checkpoint sync can't be used with TTD = 0 and checkpoint totalDifficulty = 0"); } - @Test - public void checkP2pPeerLowerBound_isSet() { - final int lowerBound = 13; - parseCommand("--Xp2p-peer-lower-bound", String.valueOf(lowerBound)); - - verify(mockControllerBuilder).lowerBoundPeers(intArgumentCaptor.capture()); - verify(mockControllerBuilder).build(); - - assertThat(intArgumentCaptor.getValue()).isEqualTo(lowerBound); - - assertThat(commandErrorOutput.toString(UTF_8)).isEmpty(); - assertThat(commandOutput.toString(UTF_8)).isEmpty(); - } - @Test public void kzgTrustedSetupFileRequiresDataBlobEnabledNetwork() throws IOException { final Path genesisFileWithoutBlobs = diff --git a/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java b/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java index 1609758b966..915eefcd249 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java @@ -288,7 +288,6 @@ public void initMocks() throws Exception { when(mockControllerBuilder.maxPeers(anyInt())).thenReturn(mockControllerBuilder); when(mockControllerBuilder.chainPruningConfiguration(any())).thenReturn(mockControllerBuilder); when(mockControllerBuilder.maxPeers(anyInt())).thenReturn(mockControllerBuilder); - when(mockControllerBuilder.lowerBoundPeers(anyInt())).thenReturn(mockControllerBuilder); when(mockControllerBuilder.maxRemotelyInitiatedPeers(anyInt())) .thenReturn(mockControllerBuilder); when(mockControllerBuilder.transactionSelectorFactory(any())).thenReturn(mockControllerBuilder); diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/NetworkingOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/NetworkingOptionsTest.java index c96b9035e3f..a645f28b548 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/NetworkingOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/NetworkingOptionsTest.java @@ -176,7 +176,6 @@ protected NetworkingConfiguration createCustomizedDomainObject() { NetworkingConfiguration.DEFAULT_INITIATE_CONNECTIONS_FREQUENCY_SEC + 10); config.setCheckMaintainedConnectionsFrequency( NetworkingConfiguration.DEFAULT_CHECK_MAINTAINED_CONNECTIONS_FREQUENCY_SEC + 10); - config.setPeerLowerBound(NetworkingConfiguration.DEFAULT_PEER_LOWER_BOUND - 10); return config; } diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java index c27b473d314..7f72743e9cd 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java @@ -83,7 +83,6 @@ public class EthPeers { private final Subscribers connectCallbacks = Subscribers.create(); private final Subscribers disconnectCallbacks = Subscribers.create(); private final Collection pendingRequests = new CopyOnWriteArrayList<>(); - private final int peerLowerBound; private final int peerUpperBound; private final int maxRemotelyInitiatedConnections; private final Boolean randomPeerPriority; @@ -104,7 +103,6 @@ public EthPeers( final int maxMessageSize, final List permissioningProviders, final Bytes localNodeId, - final int peerLowerBound, final int peerUpperBound, final int maxRemotelyInitiatedConnections, final Boolean randomPeerPriority) { @@ -115,15 +113,10 @@ public EthPeers( this.maxMessageSize = maxMessageSize; this.bestPeerComparator = HEAVIEST_CHAIN; this.localNodeId = localNodeId; - this.peerLowerBound = peerLowerBound; this.peerUpperBound = peerUpperBound; this.maxRemotelyInitiatedConnections = maxRemotelyInitiatedConnections; this.randomPeerPriority = randomPeerPriority; - LOG.trace( - "MaxPeers: {}, Lower Bound: {}, Max Remote: {}", - peerUpperBound, - peerLowerBound, - maxRemotelyInitiatedConnections); + LOG.trace("MaxPeers: {}, Max Remote: {}", peerUpperBound, maxRemotelyInitiatedConnections); metricsSystem.createIntegerGauge( BesuMetricCategory.ETHEREUM, "peer_count", @@ -171,10 +164,6 @@ public void registerNewConnection( } } - public int getPeerLowerBound() { - return peerLowerBound; - } - @NotNull private List getIncompleteConnections(final Bytes id) { return incompleteConnections.asMap().keySet().stream() diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTestUtil.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTestUtil.java index 5f970e44dc5..a57a6db455d 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTestUtil.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTestUtil.java @@ -86,7 +86,6 @@ public static EthProtocolManager create( Bytes.random(64), 25, 25, - 25, false); final EthMessages messages = new EthMessages(); final EthScheduler ethScheduler = new DeterministicEthScheduler(TimeoutPolicy.NEVER_TIMEOUT); @@ -206,7 +205,6 @@ public static EthProtocolManager create( Bytes.random(64), 25, 25, - 25, false); final EthMessages messages = new EthMessages(); @@ -272,7 +270,6 @@ public static EthProtocolManager create( Bytes.random(64), 25, 25, - 25, false); final EthMessages messages = new EthMessages(); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/AbstractMessageTaskTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/AbstractMessageTaskTest.java index 1538ecc7278..868030334c8 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/AbstractMessageTaskTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/ethtaskutils/AbstractMessageTaskTest.java @@ -118,7 +118,6 @@ public void setupTest() { Bytes.random(64), MAX_PEERS, MAX_PEERS, - MAX_PEERS, false)); final EthMessages ethMessages = new EthMessages(); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/AbstractBlockPropagationManagerTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/AbstractBlockPropagationManagerTest.java index 25ff8ab4b46..f36958b2fb1 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/AbstractBlockPropagationManagerTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/AbstractBlockPropagationManagerTest.java @@ -630,7 +630,6 @@ public void shouldNotImportBlocksThatAreAlreadyBeingImported() { Bytes.random(64), 25, 25, - 25, false), new EthMessages(), ethScheduler); @@ -769,7 +768,6 @@ public Object answer(final InvocationOnMock invocation) throws Throwable { Bytes.random(64), 25, 25, - 25, false), new EthMessages(), ethScheduler); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java index d593c38b5ea..c02e2d78934 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNode.java @@ -147,7 +147,6 @@ public boolean isMessagePermitted(final EnodeURL destinationEnode, final int cod Bytes.random(64), 25, 25, - 25, false); final EthScheduler scheduler = new EthScheduler(1, 1, 1, metricsSystem); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolFactoryTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolFactoryTest.java index 70d24e8c9e9..79d88a82d21 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolFactoryTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolFactoryTest.java @@ -110,7 +110,6 @@ public void setup() { Bytes.random(64), 25, 25, - 25, false); when(ethContext.getEthMessages()).thenReturn(ethMessages); when(ethContext.getEthPeers()).thenReturn(ethPeers); diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/config/NetworkingConfiguration.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/config/NetworkingConfiguration.java index 478e3617376..8efbcdd35b9 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/config/NetworkingConfiguration.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/config/NetworkingConfiguration.java @@ -30,7 +30,6 @@ public class NetworkingConfiguration { private int initiateConnectionsFrequencySec = DEFAULT_INITIATE_CONNECTIONS_FREQUENCY_SEC; private int checkMaintainedConnectionsFrequencySec = DEFAULT_CHECK_MAINTAINED_CONNECTIONS_FREQUENCY_SEC; - private Integer peerLowerBound = DEFAULT_PEER_LOWER_BOUND; private Optional dnsDiscoveryServerOverride = Optional.empty(); public static NetworkingConfiguration create() { @@ -87,16 +86,6 @@ public NetworkingConfiguration setCheckMaintainedConnectionsFrequency( return this; } - public Integer getPeerLowerBound() { - return peerLowerBound; - } - - public NetworkingConfiguration setPeerLowerBound(final Integer peerLowerBoundConfig) { - checkArgument(peerLowerBoundConfig > 0); - this.peerLowerBound = peerLowerBoundConfig; - return this; - } - @Override public boolean equals(final Object o) { if (o == this) { diff --git a/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/RetestethContext.java b/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/RetestethContext.java index 044f61b3b7d..98054b27dbf 100644 --- a/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/RetestethContext.java +++ b/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/RetestethContext.java @@ -231,7 +231,6 @@ private boolean buildContext( localNodeKey, MAX_PEERS, MAX_PEERS, - MAX_PEERS, false); final SyncState syncState = new SyncState(blockchain, ethPeers); From f3a888cc1a3f927197ec2306cc69b970a1b4a736 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Wed, 31 Jan 2024 13:46:55 +1000 Subject: [PATCH 2/3] changelog Signed-off-by: Sally MacFarlane --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a650aa6d07..76372363c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Deprecations +- `--Xp2p-peer-lower-bound` [#6501](https://github.com/hyperledger/besu/pull/6501) ### Additions and Improvements - Upgrade Prometheus and Opentelemetry dependencies [#6422](https://github.com/hyperledger/besu/pull/6422) From 04623439ceabce03fd954bc44c594fe7b14110d8 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Wed, 31 Jan 2024 13:57:02 +1000 Subject: [PATCH 3/3] fix Signed-off-by: Sally MacFarlane --- .../besu/ethereum/eth/manager/EthProtocolManagerTestUtil.java | 1 - 1 file changed, 1 deletion(-) diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTestUtil.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTestUtil.java index a57a6db455d..8fc4e614c76 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTestUtil.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManagerTestUtil.java @@ -239,7 +239,6 @@ public static EthProtocolManager create( Bytes.random(64), 25, 25, - 25, false); final EthMessages messages = new EthMessages();