-
Notifications
You must be signed in to change notification settings - Fork 74
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
Rewrite the warp syncing code to use call proofs #2578
Conversation
There was a problem hiding this 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.
The biggest change outside of The only difference is in It makes sense for the syncing state machine to provide both a |
twiggy diff reportDifference in .wasm size before and after this pull request.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix #2080
cc #933 #2529 #2222
The initial intention behind this PR was to make it use call proofs rather than individual storage gets. See #2080.
However, this turned into a bigger refactoring as I've realized that a bigger refactoring is very much needed and would simplify the code a lot.
The warp syncing code now uses an API similar to
all_forks
and tooptimistic
, the two other syncing strategies.The warp syncing code was the first syncing strategy to be written in smoldot, and at that time we didn't have the experience of the caveats of its approaches.
I don't think there's much to comment, given that the API is now extremely close to what already exists.
Apart from using call proofs, I've opted to keep the exact same behavior as today, even though it is a bit questionable. In particular, when we download fragments from a peer, we then always query the same peer for the storage items. If that peer disconnects, we try download fragments again. As mentioned, I've kept this behavior, but the refactoring will make it much easier to improve compared to before this PR.
Can be reviewed commit by commit if desired. I've taken an incremental approach, and everything still works after almost every commit.