-
Notifications
You must be signed in to change notification settings - Fork 60
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
node: Improve OutOfSync code #2519
base: master
Are you sure you want to change the base?
Conversation
459291e
to
9936174
Compare
9936174
to
25b81d4
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 (just a very little nit that can be ignored)
@@ -461,8 +467,9 @@ impl<DB: database::DB, VM: vm::VMExecution, N: Network> | |||
|
|||
if !inv.inv_list.is_empty() { |
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.
nit: since we are at it, can we simply return early if inv.inv_list.is_empty()
rather than nesting logic in the opposite case?
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.
Totally in favor!
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.
RFT (Request for test)
// Transit back to InSync mode | ||
// We check the timeout here to prevent the peer from keeping us in | ||
// outofsync by flooding our node with blocks | ||
if self.on_sync_timeout().await { |
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.
On_sync_timeout try to acquire a write lock from the acceptor (but you already acquired it, so probably it get stuck)
Try this before merge
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.
Will do!
Addresses unresolved comments in #2484
last_request
inrequest_pool_missing_blocks