-
Notifications
You must be signed in to change notification settings - Fork 57
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
chore: saving peers enr capabilities #3127
Conversation
You can find the image built from this PR at
Built from a8eb49e |
f642319
to
8b4f6f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to move some variables around as many were unnecessary in a global scope and gave issues related to GC safety.
Also, changed the validEnr
value because apparently that ENR was missing fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outstanding one! Thanks :) !
eb1fa68
to
cf24b36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Awesome, thank you.
Description
When adding peers, we used to ignore the protocols advertised in the ENR and would fill the protocols in the Peer Store only after performing Identify.
We're now initializing the protocols with the advertised capabilities and will get updated once Identify is performed.
When mapping the ENR's capabilities to the supported protocols, we assume that the peers use the same version of the protocol as ours. If that's not the case, we'll find out during Identify, update the information and act accordingly.
In addition to that, started adding the Discv5 bootstrap nodes to the Peer Store.
I moved all the Waku protocols codec definitions to a separate file, as in the current state we had to import most of a protocol even if we only needed a codec, which caused circular dependency issues. Protocol codecs are public information, so it makes sense to be able to access them without having to import an entire protocol :)
Changes
RemotePeerInfo