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
Implement Grandpa warp syncing #270
Comments
cc #294 |
After paritytech/substrate#7789 and paritytech/substrate#7829, which, assuming doesn't take ages to get merged, should be available in Polkadot 0.7.28, maybe at the same time as the GrandPa warp sync server side. It should then be possible to grab the Babe epoch information from the single latest finalized block, without having to go through extra block requests to walk up the chain. |
Will indeed be the case. |
Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.9.0 to 0.10.0. - [Release notes](https://github.com/jeromefroe/lru-rs/releases) - [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md) - [Commits](jeromefroe/lru-rs@0.9.0...0.10.0) --- updated-dependencies: - dependency-name: lru dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The sending side of Grandpa warp sync is paritytech/substrate#1208
This issue consists in implementing the "receiving" side, in other words sending a request, downloading the data, and syncing the chain.
There are two things to do:
Advancing the chain
The finalized state of the chain is represented in the code by a
chain::chain_information::ChainInformation
.As a high level overview, advancing the chain would consist in updating this
ChainInformation
. In other words, some system that takes as input aChainInformation
and a warp sync payload, and outputs a newChainInformation
.For logging purposes, it is important that we don't verify the entire warp sync payload at once, but step by step (one header and justification at a time).
As such, the API should look like:
This can be put in a new module
chain::warp_sync
.As for the implementation, it could use the
NonFinalizedTree
type found inblocks_tree.rs
.Unfortunately, the
NonFinalizedTree
requires you to pass all headers, and doesn't support skipping headers yet. It's unclear to me how to implement this, because one of the important step when advancing the finalized block is scanning all the headers in between the previous and new finalized blocks in order to find the new values to put in the updatedChainInformation
.It is unclear how to implement .
Adding the networking code
The code that decodes the payload should be put in
protocol.rs
. Similar existing code can already be found there for block requests and storage proof requests.In the same vain, a function to send out a warp sync request should be added to
src/network/service.rs
andfull_node/src/network_service.rs
, similar to the existingblocks_request
andstorage_proof_request
.The text was updated successfully, but these errors were encountered: