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

fix(kademlia): always connect to bootnodes on startup to identify them #4910

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

istae
Copy link
Member

@istae istae commented Nov 21, 2024

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

For fresh nodes, bootnodes are discovered and are excluded from any protocol requests. For older nodes, however, because there are other peers in the addressbook, it may not have to call connectBootNodes to discover peers from the network. The older node may also connect to the bootnode at some point because there will an entry for it in the addressbook without realizing that the peer is in fact a bootnode. As a result, the node may accidently send protocol requests to the bootnode.
As such, it's important that on every start up, the node discovers the bootnodes to exclude the bootnodes from the protocol requests peer list.

We are also persisting which peers are bootnodes so that "always discover" part can be removed in the future.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

@istae istae merged commit 2f2ef4a into master Nov 21, 2024
12 checks passed
@istae istae deleted the discover-bootnodes branch November 21, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants