-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite the warp syncing code to use call proofs (#2578)
* VirtualMachineParamsGet -> ChainInfoQuery * Add call proofs requests to AllSync * Start adding a requests system to warp_sync.rs * warp_sync_source no longer public * Start adding call proof requests * Provide block_hash in warp_sync::RequestDetail * Fix implementation in sync_service * Send the call proofs * Store the call proof responses * Use the call proofs * Remove StorageGet and NextKey variants from warp_sync * Add RequestDetail::WarpSyncRequest * Inline PostVerificationState * Add a Phase enum to ChainInfoQuery * Do the warp sync as part of ChainInfoQuery * Remove GrandpaWarpSync and Verifier variants * Remove ChainInfoQuery::current_source * Remove source_id field, instead get source on the fly * Remove WaitingForSources struct * Merge InProgressWarpSync and ChainInfoQuery into one * Remove warp_sync_header() * Have a run() function that drives the CPU process * Properly transition requests * Update inject_error function * as_chain_information is in fact correct * Add warp_sync::Config::requests_capacity * Update remove_source * Store the raw downloaded runtime code and compile later * Store the downloaded fragments and verify them in run() * Small tweak to run() * handle_response_ok no longer takes ownership * Tweaks to downloaded_proof * Tweak desired_requests so that rustfmt is happy * Small tweaks to desired_requests * Add a TRq user data for requests * Remove functions a bit * Split RequestDetail from DesiredRequest, to remove state_trie_root field * Use Cow for the function name and parameters * Split PreVerification phase in two * Immediately create a Verifier after download * Extract body of run() to different sub-structs * run() -> process_one() and tweaks * BuildChainInformation::verify() -> build() * Fix one todo in VerifyWarpSyncFragment::verify * Restore verifying fragments one by one * Only verify one fragment at a time in warp_sync * CHANGELOG * Remove all remaining todo!()s from warp_sync.rs * Fix most warnings * Properly check block hash on warp sync request success * Try again sources if all sources banned * Tweak usage * Properly remove obsolete requests when removing source * Improve docs somewhat * Move process_one to the bottom * PR number * Rustfmt * Fix doclink * Fix spellcheck * Properly change phase if multiple sets of fragments to download * No longer ignore responses from banned sources, to prevent infinite loop Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0c76256
commit 6b26ed6
Showing
5 changed files
with
1,600 additions
and
1,198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.