Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new PoA network option to use bootnodes during any peer table refresh, not just the first one #7314

Merged
merged 6 commits into from
Jul 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/d…
…iscovery/internal/PeerDiscoveryController.java

Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>
  • Loading branch information
matthew1001 and pinges authored Jul 23, 2024
commit dd2a44bb97ed8b0853b635b49a900d6a4cb944cc
Original file line number Diff line number Diff line change
@@ -487,21 +487,15 @@ RecursivePeerRefreshState getRecursivePeerRefreshState() {
private void refreshTable() {
final Bytes target = Peer.randomId();

final List<DiscoveryPeer> initialPeers;
final List<DiscoveryPeer> initialPeers = peerTable.nearestBondedPeers(Peer.randomId(), 16);
if (includeBootnodesOnPeerRefresh) {
bootstrapNodes.stream()
.filter(p -> p.getStatus() != PeerDiscoveryStatus.BONDED)
.forEach(p -> p.setStatus(PeerDiscoveryStatus.KNOWN));

// If configured to retry bootnodes during peer table refresh, include them
// in the initial peers list.
initialPeers =
Stream.concat(
bootstrapNodes.stream(),
peerTable.nearestBondedPeers(Peer.randomId(), 16).stream())
.collect(Collectors.toList());
} else {
initialPeers = peerTable.nearestBondedPeers(Peer.randomId(), 16);
initialPeers.addAll(bootstrapNodes);
}
recursivePeerRefreshState.start(initialPeers, target);
lastRefreshTime = System.currentTimeMillis();
Loading