Skip to content

Commit

Permalink
Implement Aura+Grandpa warp syncing (#2581)
Browse files Browse the repository at this point in the history
* Detect consensus at warp sync initialization

* Only query Babe things if chain is using Babe

* Start Aura calls if chain is using Aura

* Implement Aura in process_one

* Implement Aura in BuildChainInformation::build

* Enable Aura

* CHANGELOG

* PR number

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
tomaka and mergify[bot] authored Aug 5, 2022
1 parent 2b03619 commit a51c999
Show file tree
Hide file tree
Showing 3 changed files with 766 additions and 220 deletions.
1 change: 1 addition & 0 deletions bin/wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Changed

- The GRANDPA warp sync algorithm now downloads Merkle proofs of all the necessary storage items at once, rather than one by one sequentially. This removes approximately 11 networking round-trips and thus significantly reduces the time the warp syncing takes. ([#2578](https://github.com/paritytech/smoldot/pull/2578))
- The GRANDPA warp sync algorithm now works on AURA-based chains. It previously only worked for chains that are using BABE. Note that GRANDPA warp sync is irrelevant for parachains. ([#2581](https://github.com/paritytech/smoldot/pull/2581))
- The GRANDPA warp sync implementation has been considerably refactored. It is possible that unintended changes in behaviour have accidentally been introduced. ([#2578](https://github.com/paritytech/smoldot/pull/2578))

## 0.6.27 - 2022-07-29
Expand Down
6 changes: 5 additions & 1 deletion src/sync/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ impl<TRq, TSrc, TBl> AllSync<TRq, TSrc, TBl> {
requests_capacity: config.sources_capacity, // TODO: ?! add as config?
}) {
Ok(inner) => AllSyncInner::GrandpaWarpSync { inner },
Err((chain_information, warp_sync::WarpSyncInitError::NotGrandpa)) => {
Err((
chain_information,
warp_sync::WarpSyncInitError::NotGrandpa
| warp_sync::WarpSyncInitError::UnknownConsensus,
)) => {
// On error, `warp_sync` returns back the chain information that was
// provided in its configuration.
AllSyncInner::Optimistic {
Expand Down
Loading

0 comments on commit a51c999

Please sign in to comment.