From ad86ae6e711eecd8a0499ea4992a9e5a086e3d9c Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 25 Sep 2024 16:23:15 +1000 Subject: [PATCH 1/8] 7311: Rename PeerManager to PeerSelector Signed-off-by: Matilda Clerke --- ...PeerManager.java => DefaultPeerSelector.java} | 6 +++--- .../{PeerManager.java => PeerSelector.java} | 16 ++++++++-------- .../eth/manager/peertask/PeerTaskExecutor.java | 8 ++++---- ...gerTest.java => DefaultPeerSelectorTest.java} | 16 ++++++++-------- .../manager/peertask/PeerTaskExecutorTest.java | 8 ++++---- 5 files changed, 27 insertions(+), 27 deletions(-) rename ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/{DefaultPeerManager.java => DefaultPeerSelector.java} (91%) rename ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/{PeerManager.java => PeerSelector.java} (80%) rename ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/{DefaultPeerManagerTest.java => DefaultPeerSelectorTest.java} (85%) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerManager.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java similarity index 91% rename from ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerManager.java rename to ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java index 9424ee0b48..f399963173 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerManager.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java @@ -28,11 +28,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * This is a simple PeerManager implementation that can be used the default implementation in most + * This is a simple PeerSelector implementation that can be used the default implementation in most * situations */ -public class DefaultPeerManager implements PeerManager { - private static final Logger LOG = LoggerFactory.getLogger(DefaultPeerManager.class); +public class DefaultPeerSelector implements PeerSelector { + private static final Logger LOG = LoggerFactory.getLogger(DefaultPeerSelector.class); // use a synchronized map to ensure the map is never modified by multiple threads at once private final Map ethPeersByPeerId = diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerManager.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java similarity index 80% rename from ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerManager.java rename to ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java index 14323474a1..73af26ec4c 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerManager.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java @@ -20,11 +20,11 @@ import org.hyperledger.besu.ethereum.p2p.peers.PeerId; import java.util.Optional; import java.util.function.Predicate; -/** "Manages" the EthPeers for the PeerTaskExecutor */ -public interface PeerManager { +/** Selects the EthPeers for the PeerTaskExecutor */ +public interface PeerSelector { /** - * Gets the highest reputation peer matching the supplies filter + * Gets the highest reputation peer matching the supplied filter * * @param filter a filter to match prospective peers with * @return the highest reputation peer matching the supplies filter @@ -37,21 +37,21 @@ public interface PeerManager { * * @param peerId the peerId of the desired EthPeer * @return An Optional\ containing the EthPeer identified by peerId if present in the - * PeerManager, or empty otherwise + * PeerSelector, or empty otherwise */ Optional getPeerByPeerId(final PeerId peerId); /** - * Add the supplied EthPeer to the PeerManager + * Add the supplied EthPeer to the PeerSelector * - * @param ethPeer the EthPeer to be added to the PeerManager + * @param ethPeer the EthPeer to be added to the PeerSelector */ void addPeer(final EthPeer ethPeer); /** - * Remove the EthPeer identified by peerId from the PeerManager + * Remove the EthPeer identified by peerId from the PeerSelector * - * @param peerId the PeerId of the EthPeer to be removed from the PeerManager + * @param peerId the PeerId of the EthPeer to be removed from the PeerSelector */ void removePeer(final PeerId peerId); } diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutor.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutor.java index fabf88d05d..ad56987efc 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutor.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutor.java @@ -34,17 +34,17 @@ import java.util.function.Supplier; public class PeerTaskExecutor { private static final long[] WAIT_TIME_BEFORE_RETRY = {0, 20000, 5000}; - private final PeerManager peerManager; + private final PeerSelector peerSelector; private final PeerTaskRequestSender requestSender; private final Supplier protocolSpecSupplier; private final LabelledMetric requestTimer; public PeerTaskExecutor( - final PeerManager peerManager, + final PeerSelector peerSelector, final PeerTaskRequestSender requestSender, final Supplier protocolSpecSupplier, final MetricsSystem metricsSystem) { - this.peerManager = peerManager; + this.peerSelector = peerSelector; this.requestSender = requestSender; this.protocolSpecSupplier = protocolSpecSupplier; requestTimer = @@ -61,7 +61,7 @@ public class PeerTaskExecutor { EthPeer peer; try { peer = - peerManager.getPeer( + peerSelector.getPeer( (candidatePeer) -> isPeerUnused(candidatePeer, usedEthPeers) && (protocolSpecSupplier.get().isPoS() diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerManagerTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java similarity index 85% rename from ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerManagerTest.java rename to ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java index 5aa04f8f9a..f3b0b27033 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerManagerTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java @@ -28,31 +28,31 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -public class DefaultPeerManagerTest { +public class DefaultPeerSelectorTest { - public DefaultPeerManager peerManager; + public DefaultPeerSelector peerSelector; @BeforeEach public void beforeTest() { - peerManager = new DefaultPeerManager(); + peerSelector = new DefaultPeerSelector(); } @Test public void testGetPeer() throws NoAvailablePeerException { EthPeer protocol1With5ReputationPeer = createTestPeer(Set.of(Capability.create("capability1", 1)), "protocol1", 5); - peerManager.addPeer(protocol1With5ReputationPeer); + peerSelector.addPeer(protocol1With5ReputationPeer); EthPeer protocol1With4ReputationPeer = createTestPeer(Set.of(Capability.create("capability1", 1)), "protocol1", 4); - peerManager.addPeer(protocol1With4ReputationPeer); + peerSelector.addPeer(protocol1With4ReputationPeer); EthPeer protocol2With50ReputationPeer = createTestPeer(Set.of(Capability.create("capability1", 1)), "protocol2", 50); - peerManager.addPeer(protocol2With50ReputationPeer); + peerSelector.addPeer(protocol2With50ReputationPeer); EthPeer protocol2With4ReputationPeer = createTestPeer(Set.of(Capability.create("capability1", 1)), "protocol2", 4); - peerManager.addPeer(protocol2With4ReputationPeer); + peerSelector.addPeer(protocol2With4ReputationPeer); - EthPeer result = peerManager.getPeer((p) -> p.getProtocolName().equals("protocol1")); + EthPeer result = peerSelector.getPeer((p) -> p.getProtocolName().equals("protocol1")); Assertions.assertSame(protocol1With5ReputationPeer, result); } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutorTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutorTest.java index 2c015425f1..930f4325b6 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutorTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutorTest.java @@ -35,7 +35,7 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; public class PeerTaskExecutorTest { - private @Mock PeerManager peerManager; + private @Mock PeerSelector peerSelector; private @Mock PeerTaskRequestSender requestSender; private @Mock ProtocolSpec protocolSpec; private @Mock PeerTask peerTask; @@ -51,7 +51,7 @@ public class PeerTaskExecutorTest { mockCloser = MockitoAnnotations.openMocks(this); peerTaskExecutor = new PeerTaskExecutor( - peerManager, requestSender, () -> protocolSpec, new NoOpMetricsSystem()); + peerSelector, requestSender, () -> protocolSpec, new NoOpMetricsSystem()); } @AfterEach @@ -205,7 +205,7 @@ public class PeerTaskExecutorTest { String subprotocol = "subprotocol"; Object responseObject = new Object(); - Mockito.when(peerManager.getPeer(Mockito.any(Predicate.class))).thenReturn(ethPeer); + Mockito.when(peerSelector.getPeer(Mockito.any(Predicate.class))).thenReturn(ethPeer); Mockito.when(peerTask.getRequestMessage()).thenReturn(requestMessageData); Mockito.when(peerTask.getPeerTaskBehaviors()).thenReturn(Collections.emptyList()); @@ -238,7 +238,7 @@ public class PeerTaskExecutorTest { int requestMessageDataCode = 123; EthPeer peer2 = Mockito.mock(EthPeer.class); - Mockito.when(peerManager.getPeer(Mockito.any(Predicate.class))) + Mockito.when(peerSelector.getPeer(Mockito.any(Predicate.class))) .thenReturn(ethPeer) .thenReturn(peer2); From 38f04ab5a1be4d130b3423703cec2779040a36ee Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 25 Sep 2024 16:33:04 +1000 Subject: [PATCH 2/8] 7311: Reword PeerSelector javadoc to avoid implementation details Signed-off-by: Matilda Clerke --- .../ethereum/eth/manager/peertask/DefaultPeerSelector.java | 7 +++++++ .../besu/ethereum/eth/manager/peertask/PeerSelector.java | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java index f399963173..5d32a37bc8 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java @@ -38,6 +38,13 @@ public class DefaultPeerSelector implements PeerSelector { private final Map ethPeersByPeerId = Collections.synchronizedMap(new HashMap<>()); + /** + * Gets the highest reputation peer matching the supplied filter + * + * @param filter a filter to match prospective peers with + * @return the highest reputation peer matching the supplies filter + * @throws NoAvailablePeerException If there are no suitable peers + */ @Override public EthPeer getPeer(final Predicate filter) throws NoAvailablePeerException { LOG.trace("Getting peer from pool of {} peers", ethPeersByPeerId.size()); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java index 73af26ec4c..3f5589f93b 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerSelector.java @@ -24,10 +24,10 @@ import java.util.function.Predicate; public interface PeerSelector { /** - * Gets the highest reputation peer matching the supplied filter + * Gets a peer matching the supplied filter * * @param filter a filter to match prospective peers with - * @return the highest reputation peer matching the supplies filter + * @return a peer matching the supplied filter * @throws NoAvailablePeerException If there are no suitable peers */ EthPeer getPeer(final Predicate filter) throws NoAvailablePeerException; From 6de3fb366a8b920bd1a830b43ff6a6af96e53315 Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 25 Sep 2024 16:36:51 +1000 Subject: [PATCH 3/8] 7311: Use ConcurrentHashMap in DefaultPeerSelector Signed-off-by: Matilda Clerke --- .../ethereum/eth/manager/peertask/DefaultPeerSelector.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java index 5d32a37bc8..37a6fd1895 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java @@ -22,6 +22,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.Map; import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; import java.util.function.Predicate; import org.slf4j.Logger; @@ -34,9 +35,7 @@ import org.slf4j.LoggerFactory; public class DefaultPeerSelector implements PeerSelector { private static final Logger LOG = LoggerFactory.getLogger(DefaultPeerSelector.class); - // use a synchronized map to ensure the map is never modified by multiple threads at once - private final Map ethPeersByPeerId = - Collections.synchronizedMap(new HashMap<>()); + private final Map ethPeersByPeerId = new ConcurrentHashMap<>(); /** * Gets the highest reputation peer matching the supplied filter From da9cd438aed5f84954ebe66c640c7575d8cbc021 Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 25 Sep 2024 16:40:10 +1000 Subject: [PATCH 4/8] 7311: Reword trace log in DefaultPeerSelector Signed-off-by: Matilda Clerke --- .../besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java index 37a6fd1895..be6eed7fee 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java @@ -46,7 +46,7 @@ public class DefaultPeerSelector implements PeerSelector { */ @Override public EthPeer getPeer(final Predicate filter) throws NoAvailablePeerException { - LOG.trace("Getting peer from pool of {} peers", ethPeersByPeerId.size()); + LOG.trace("Finding peer from pool of {} peers", ethPeersByPeerId.size()); return ethPeersByPeerId.values().stream() .filter(filter) .max(Comparator.naturalOrder()) From ce7d24582c1a443050003525abf92c8d80521581 Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 25 Sep 2024 16:40:28 +1000 Subject: [PATCH 5/8] 7311: Remove unused imports Signed-off-by: Matilda Clerke --- .../besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java index be6eed7fee..c334773d16 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelector.java @@ -17,9 +17,7 @@ package org.hyperledger.besu.ethereum.eth.manager.peertask; import org.hyperledger.besu.ethereum.eth.manager.EthPeer; import org.hyperledger.besu.ethereum.p2p.peers.PeerId; -import java.util.Collections; import java.util.Comparator; -import java.util.HashMap; import java.util.Map; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; From c9eb22e614ca5ca2a15d149042a0806b129fedde Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 25 Sep 2024 16:51:37 +1000 Subject: [PATCH 6/8] 7311: Use a 1 second delay between retries in PeerTaskExecutor to match old implementation Signed-off-by: Matilda Clerke --- .../ethereum/eth/manager/peertask/PeerTaskExecutor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutor.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutor.java index ad56987efc..894568b8b7 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutor.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/peertask/PeerTaskExecutor.java @@ -32,7 +32,6 @@ import java.util.function.Supplier; /** Manages the execution of PeerTasks, respecting their PeerTaskBehavior */ public class PeerTaskExecutor { - private static final long[] WAIT_TIME_BEFORE_RETRY = {0, 20000, 5000}; private final PeerSelector peerSelector; private final PeerTaskRequestSender requestSender; @@ -123,7 +122,7 @@ public class PeerTaskExecutor { } while (--triesRemaining > 0 && executorResult.getResponseCode() != PeerTaskExecutorResponseCode.SUCCESS && executorResult.getResponseCode() != PeerTaskExecutorResponseCode.PEER_DISCONNECTED - && sleepBetweenRetries(WAIT_TIME_BEFORE_RETRY[triesRemaining])); + && sleepBetweenRetries()); return executorResult; } @@ -133,9 +132,10 @@ public class PeerTaskExecutor { return CompletableFuture.supplyAsync(() -> executeAgainstPeer(peerTask, peer)); } - private boolean sleepBetweenRetries(final long sleepTime) { + private boolean sleepBetweenRetries() { try { - Thread.sleep(sleepTime); + //sleep for 1 second to match implemented wait between retries in AbstractRetryingPeerTask + Thread.sleep(1000); return true; } catch (InterruptedException e) { return false; From e2fda731928109306b85e0bd7ff5f84672d99e58 Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 25 Sep 2024 16:54:15 +1000 Subject: [PATCH 7/8] 7311: Add testGetPeerButNoPeerMatchesFilter to DefaultPeerSelectorTest Signed-off-by: Matilda Clerke --- .../peertask/DefaultPeerSelectorTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java index f3b0b27033..bc92da6fb0 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java @@ -57,6 +57,24 @@ public class DefaultPeerSelectorTest { Assertions.assertSame(protocol1With5ReputationPeer, result); } + @Test + public void testGetPeerButNoPeerMatchesFilter() throws NoAvailablePeerException { + EthPeer protocol1With5ReputationPeer = + createTestPeer(Set.of(Capability.create("capability1", 1)), "protocol1", 5); + peerSelector.addPeer(protocol1With5ReputationPeer); + EthPeer protocol1With4ReputationPeer = + createTestPeer(Set.of(Capability.create("capability1", 1)), "protocol1", 4); + peerSelector.addPeer(protocol1With4ReputationPeer); + EthPeer protocol2With50ReputationPeer = + createTestPeer(Set.of(Capability.create("capability1", 1)), "protocol2", 50); + peerSelector.addPeer(protocol2With50ReputationPeer); + EthPeer protocol2With4ReputationPeer = + createTestPeer(Set.of(Capability.create("capability1", 1)), "protocol2", 4); + peerSelector.addPeer(protocol2With4ReputationPeer); + + Assertions.assertThrows(NoAvailablePeerException.class, () -> peerSelector.getPeer((p) -> p.getProtocolName().equals("fake protocol"))); + } + private EthPeer createTestPeer( final Set connectionCapabilities, final String protocolName, From 608feceff4c7105209f8003e8e0eeab0d807b2e0 Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 25 Sep 2024 16:54:54 +1000 Subject: [PATCH 8/8] 7311: Add testGetPeerButNoPeerMatchesFilter to DefaultPeerSelectorTest Signed-off-by: Matilda Clerke --- .../ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java index bc92da6fb0..16d53f474b 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/peertask/DefaultPeerSelectorTest.java @@ -58,7 +58,7 @@ public class DefaultPeerSelectorTest { } @Test - public void testGetPeerButNoPeerMatchesFilter() throws NoAvailablePeerException { + public void testGetPeerButNoPeerMatchesFilter() { EthPeer protocol1With5ReputationPeer = createTestPeer(Set.of(Capability.create("capability1", 1)), "protocol1", 5); peerSelector.addPeer(protocol1With5ReputationPeer);