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

Move Merkle proof verification to warp syncing module #3054

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Nov 29, 2022

Before this PR, the warp syncing code asks "hey I'd like to know the runtime", and the upper layers download a Merkle proof, verify it, and give the storage values to the warp syncing code.

This PR modifies this. The warp syncing code now asks for a Merkle proof of arbitrary keys, and the upper layers download that proof and give to the warp syncing code. It is the warp syncing code that verifies said proof.

The objective of this PR is simplification of the API surface of the syncing code.
It will also make it easier to implement #1769, as it is now clear who is responsible for first downloading only the hash.

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 Nov 29, 2022

twiggy diff report

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


 Delta Bytes │ Item
─────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       -4198 ┊ <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h84b17a0b74291b01
       +4153 ┊ <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h459c3eb3a13ecc25
       +2796 ┊ smoldot::sync::warp_sync::BuildRuntime<TSrc,TRq>::build::h44660f69e7f431c7
       -2263 ┊ smoldot::sync::warp_sync::BuildChainInformation<TSrc,TRq>::build::h2494a23ac4644114
       +2197 ┊ smoldot::sync::warp_sync::BuildChainInformation<TSrc,TRq>::build::h66726f3436492757
       -1979 ┊ smoldot::sync::warp_sync::BuildRuntime<TSrc,TRq>::build::h138dcbd3297b9e33
       -1099 ┊ smoldot::sync::all::AllSync<TRq,TSrc,TBl>::storage_get_response::hda110036c2b54790
        -964 ┊ core::iter::adapters::map::map_try_fold::{{closure}}::h823d5033903a22dd
        +802 ┊ core::iter::adapters::map::map_try_fold::{{closure}}::h226fbe882304f9c0
        -739 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::try_fold::h1810f93bc8b6e49a
        +739 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::try_fold::hff510a30ca9a423d
        +692 ┊ smoldot::sync::all::AllSync<TRq,TSrc,TBl>::storage_get_response::h4be46d5c931d1b7c
        -642 ┊ smoldot::sync::warp_sync::InProgressWarpSync<TSrc,TRq>::runtime_parameters_get_success::hc474e6f783fb3da2
        -617 ┊ <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h868b4436a7be2a1b
        +598 ┊ <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold::h110e6117b3165d9b
        -598 ┊ <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold::h666a2ee6441a5dd9
        -569 ┊ <futures_util::stream::futures_unordered::FuturesUnordered<Fut> as futures_core::stream::Stream>::poll_next::h3184906f99bd1d4c
        +569 ┊ <futures_util::stream::futures_unordered::FuturesUnordered<Fut> as futures_core::stream::Stream>::poll_next::hcb3d144023fe880d
        -533 ┊ core::iter::adapters::filter::filter_try_fold::{{closure}}::h3fadad45e342985c
        +533 ┊ core::iter::adapters::filter::filter_try_fold::{{closure}}::h83fbe71912e8d83d
        -553 ┊ ... and 249 more.
       -3044 ┊ Σ [269 Total Rows]

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Nov 30, 2022
@mergify mergify bot merged commit 4bf957a into paritytech:main Nov 30, 2022
@tomaka tomaka deleted the warp-sync-proof-verif branch November 30, 2022 10:43
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.

1 participant