-
Notifications
You must be signed in to change notification settings - Fork 1k
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
QSP-45 Add Check for No Connected Peers BestFinalized #6402
Conversation
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.
It would be good to have @farazdagi to also take a look at this, since this is mostly used in initial sync
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.
@nisdas thanks for summoning, I was going to work on the issue myself (I've marked my intent in #6327, Raul probably just didn't see my comment), so gladly adding my thoughts as a review:
I don't think that unless we re-write the method completely, we should do anything but:
- add a comment to
BestFinalized()
, mentioning that client code must check the len(peers) before using extra info - review and make sure that current code does this (I suppose it does)
❗ Btw, have you noticed that we don't actually use the targetRoot anywhere (except tests), what we are using is epoch
and peers
. So, we can throw away the targetRoot
and resolve QSP-45 that way.
3dd7c08
to
ad92b65
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
Part of #6327, we were not handling the case with 0 connected peers in the peer status BestFinalized() method. Instead, we were checking for no connected peers around the method but not in the method itself, which could lead to misuse down the line