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

Syncing chain drops blocks when rolling over to new chain #6100

Open
dapplion opened this issue Jul 15, 2024 · 0 comments
Open

Syncing chain drops blocks when rolling over to new chain #6100

dapplion opened this issue Jul 15, 2024 · 0 comments
Assignees

Comments

@dapplion
Copy link
Collaborator

Description

Range sync groups peers by status message. When peers are re-status'd a new group is created and peers roll over to the new chain. This group is called a syncing chain and comprises many block batches. Block batches are downloaded in advance and buffered in-memory.

When syncing chains roll over to the new group of peer the buffered batches are dropped and wasted. This PR will give us visibility on the issue

But there are some solutions we could do to mitigate it.

Potential solution

When we want to switch chains into the next one we can switch the current chain into Stopping state. In that state it will not attempt to download new batches, but it will attempt to process existing batches. Once it can not make any more progress (either complete all of them, or some failure) the chain can transition to Stopped and be dropped without wasting blocks.

Note that this strategy allows to not lose progress but it can slow down sync during the roll over and no more batches are getting buffered.

@ackintosh ackintosh self-assigned this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants