-
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
fix: update peers ENRs in peer store in case they are updated #2818
Conversation
You can find the image built from this PR at
Built from 3623419 |
You can find the image built from this PR at
Built from 3623419 |
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.
PR looks good to me, but I wonder if it could be the case that when discovering you receive the same peer but with older information. Since we are not looking at the sequence number of the enr, we might end up overriding the peer information with outdated info
Ah do note that this is a scenario that i have seen in go-waku. I do not know if such thing can happen in the nim implementation |
Oh great catch! So basically before updating the ENR, we have to also check for the If that makes sense, will implement that fix too :) |
Yes, that's what we do in go-waku! we check if the sequence number is greater to update the peer info! |
Done! Updated the PR, lmk in case there's something wrong with the fix. Thanks so much! |
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! Thanks! 💯
Description
Checking if the ENR of an incoming peer is the same as the one we have saved and if not, update it in the peer store.
Changes
Issue
closes #2817