Skip to content
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

StateDownloader should retry immediately after receiving empty reply from peer #1077

Closed
gsalgado opened this issue Jul 24, 2018 · 1 comment
Assignees

Comments

@gsalgado
Copy link
Contributor

What is wrong?

During a state sync, sometimes a peer won't have the trie nodes we requested, and so will send us an empty NodeData msg. When that happens we just move on and those nodes are re-requested only after the timeout (20s) has passed.

How can it be fixed

Whenever we get an empty NodeData from a peer, we should look up the nodes that were originally requested to that peer and re-request them to a different peer.

@pipermerriam
Copy link
Member

Seems like we need to keep some sort of tracking around which peers do not have certain trie nodes so that we can get to a point where we know "no peers have this trie node". I believe this is needed for us to get out of a stalled state sync as noted in #1073

@gsalgado gsalgado self-assigned this Jul 25, 2018
gsalgado added a commit to gsalgado/py-evm that referenced this issue Jul 26, 2018
Keep track of which nodes we requested to every peer so that we know
which ones they're missing when they reply with just a subset of what
was requested. That way we can avoid re-requesting those missing nodes
to peers that don't have them. #1073

Also, when a reply from a peer contains only a subset of what was
requested, we immediately re-request the missing ones. Closes: ethereum#1077
gsalgado added a commit to gsalgado/py-evm that referenced this issue Jul 26, 2018
Keep track of which nodes we requested to every peer so that we know
which ones they're missing when they reply with just a subset of what
was requested. That way we can avoid re-requesting those missing nodes
to peers that don't have them. #1073

Also, when a reply from a peer contains only a subset of what was
requested, we immediately re-request the missing ones. Closes: ethereum#1077
gsalgado added a commit to gsalgado/py-evm that referenced this issue Jul 30, 2018
Keep track of which nodes we requested to every peer so that we know
which ones they're missing when they reply with just a subset of what
was requested. That way we can avoid re-requesting those missing nodes
to peers that don't have them. #1073

Also, when a reply from a peer contains only a subset of what was
requested, we immediately re-request the missing ones. Closes: ethereum#1077
gsalgado added a commit to gsalgado/py-evm that referenced this issue Jul 30, 2018
Keep track of which nodes we requested to every peer so that we know
which ones they're missing when they reply with just a subset of what
was requested. That way we can avoid re-requesting those missing nodes
to peers that don't have them. #1073

Also, when a reply from a peer contains only a subset of what was
requested, we immediately re-request the missing ones. Closes: ethereum#1077
gsalgado added a commit that referenced this issue Jul 30, 2018
Keep track of which nodes we requested to every peer so that we know
which ones they're missing when they reply with just a subset of what
was requested. That way we can avoid re-requesting those missing nodes
to peers that don't have them. #1073

Also, when a reply from a peer contains only a subset of what was
requested, we immediately re-request the missing ones. Closes: #1077
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

No branches or pull requests

2 participants