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

Fix state_getKeys and state_getKeysPaged almost always erroneously returning an empty result #2491

Merged
merged 3 commits into from
Jul 11, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Jul 11, 2022

The next variable, which contains the list of queries to perform at the next iteration, can be empty either because we're done or because no progress could be made.
Since we iterate forever until progress can be made, there's always a point where no progress can be made anymore.

Unfortunately, we were checking next.is_empty() too early and assuming that it means that we're done.

This PR fixes the logic to check if any progress has been made before assuming success.

Copy link
Contributor

@mergify mergify bot left a comment

Choose a reason for hiding this comment

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

Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2022

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼───────────────────────────────────────────────────────────────────
         +17 ┊ smoldot::trie::prefix_proof::PrefixScan::resume::h25e7ea839cb36c50
         +17 ┊ Σ [1 Total Rows]

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge pull request as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants