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

[ETCM-716] Readd block headers to work queue in case of errors #943

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

1015bit
Copy link
Contributor

@1015bit 1015bit commented Mar 19, 2021

Description

  • fixes a bug where block headers weren't readded to the work queue in case of errors
  • also moves the block headers work queue to syncState to keep it together with the work queues for bodies and receipts

Proposed Solution

If requests time out or the peer disconnects we need to readd the requested block headers to the work queue so they will be requested from another peer.

Testing

Full sync on sagano testnet and successful syncing on mainnet for some time.

@@ -677,17 +680,16 @@ class FastSync(
private def handleRequestFailure(peer: Peer, handler: ActorRef, reason: BlacklistReason): Unit = {
removeRequestHandler(handler)

requestedHeaders.get(peer).foreach(requested => syncState = syncState.enqueueHeaderRange(requested))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the relevant line for fixing the bug.

@1015bit 1015bit marked this pull request as ready for review March 19, 2021 09:57
@1015bit 1015bit merged commit 404ba7b into develop Mar 19, 2021
@1015bit 1015bit deleted the fix/etcm-716 branch March 19, 2021 10:57
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