-
Notifications
You must be signed in to change notification settings - Fork 75
Fast sync download fix on restart #175
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
Conversation
requestedMptNodes = requestedMptNodes - ref | ||
requestedNonMptNodes = requestedNonMptNodes - ref | ||
requestedBlockBodies = requestedBlockBodies - ref | ||
requestedReceipts = requestedReceipts - ref |
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.
I'm wondering, should we add any request being handled by the terminated handler to our queues of pending requests? For example if a FastSyncNodesRequestHandler
terminated we may have to add the nodes it was in charge of to mptNodesQueue
and nonMptNodesQueue
lists
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's done in the FastSyncNodesRequestHandler
itself:
override def handleTerminated(): Unit = {
syncController ! FastSync.EnqueueNodes(requestedHashes)
cleanupAndStop()
}
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.
hmm actually that's what happens when underlying peer
actor is terminated, not the handler
requestedMptNodes = requestedMptNodes - ref | ||
requestedNonMptNodes = requestedNonMptNodes - ref | ||
requestedBlockBodies = requestedBlockBodies - ref | ||
requestedReceipts = requestedReceipts - ref |
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.
Terminated message will happen after requested entities will be added back to queue?
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.
let me double check
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.
seems you're right @adamsmo we should enqueue these items here
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
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!
This fixes the issue when, after restarting during fast sync, some mpt nodes were "lost". Solution: we need to also save requested items in sync state (the ones that are not yet in db, but not in queues anymore).