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

Unverified blocks cap not working properly #2793

Open
tomaka opened this issue Sep 28, 2022 · 1 comment
Open

Unverified blocks cap not working properly #2793

tomaka opened this issue Sep 28, 2022 · 1 comment

Comments

@tomaka
Copy link
Contributor

tomaka commented Sep 28, 2022

There exists a cap to the number of unverified blocks:

while self.inner.inner.inner.blocks.num_unverified_blocks() >= 100 {

Once this cap is reached, the syncing stalls. It shouldn't.

I believe that the issue is that unverified blocks removes too much information, and the state machine isn't capable of downloading back the next block.

When I commented out this block of code, the syncing didn't stall:

smoldot/src/sync/all_forks.rs

Lines 1405 to 1409 in 62ff6b7

self.inner
.inner
.inner
.blocks
.remove_sources_known_block(height, &hash);

@tomaka
Copy link
Contributor Author

tomaka commented Sep 29, 2022

After #2801, we should write a test to make sure it's fixed/working.

mergify bot added a commit that referenced this issue Oct 4, 2022
cc #2793

After trying to analyze the problem, I've decided to leave it to
future-me.
It is very complicated to determine which entries in the list of "blocks
known by a source" should be kept and which can be thrown away. There
are several other TODOs related to that in the code.

For now, this PR fixes the sync stalling.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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

1 participant