Skip to content

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

Merged
merged 3 commits into from
May 4, 2017

Conversation

LukasGasior1
Copy link
Contributor

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).

requestedMptNodes = requestedMptNodes - ref
requestedNonMptNodes = requestedNonMptNodes - ref
requestedBlockBodies = requestedBlockBodies - ref
requestedReceipts = requestedReceipts - ref
Copy link

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

Copy link
Contributor Author

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()
  }

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me double check

Copy link
Contributor Author

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

Copy link
Contributor

@adamsmo adamsmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@ntallar ntallar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@LukasGasior1 LukasGasior1 merged commit e1cf171 into phase/3/txExecution May 4, 2017
@LukasGasior1 LukasGasior1 deleted the feature/fast-sync-bugfix branch May 4, 2017 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants