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

Implement warp sync proof request #3183

Open
EclesioMeloJunior opened this issue Mar 29, 2023 · 0 comments
Open

Implement warp sync proof request #3183

EclesioMeloJunior opened this issue Mar 29, 2023 · 0 comments
Assignees
Labels
C-complex Complex changes across multiple modules. Possibly will require additional research. P-low this is mostly nice to have. S-network issues related to the dot/network package. T-feat this issue/pr is a new feature or functionality.

Comments

@EclesioMeloJunior
Copy link
Member

EclesioMeloJunior commented Mar 29, 2023

Description

  • Implement the warp sync proof request
  • The mechanism should be a strategy under the sync package, it must implement the Strategy interface
type Strategy interface {
	OnBlockAnnounce(from peer.ID, msg *network.BlockAnnounceMessage) (repChange *Change, err error)
	OnBlockAnnounceHandshake(from peer.ID, msg *network.BlockAnnounceHandshake) error
	NextActions() ([]*syncTask, error)
	IsFinished(results []*syncTaskResult) (done bool, repChanges []Change, blocks []peer.ID, err error)
	ShowMetrics()
}

The Warp Proof Request is issued to a valid peer and the message format is just the hash of the block, since we don't have it documented in the spec, an example can be found here: https://github.com/paritytech/polkadot-sdk/blob/eb0a9e593fb6a0f2bbfdb75602a51f4923995529/substrate/client/network/sync/src/strategy/warp.rs#L516

The Warp Sync Strategy should issue the warp sync proof request until it receives the done flag from the peer indicating that the warp sync is completed then it should issue a state request to bring the most up to data state and import it.

Each warp sync proof contains a set of warp fragments, each fragment contains a block that a authority set happened and the justification proving the finality of the block, these blocks should be validated and imported in the state, the response format is defined in the link in additional informations

The Warp Sync process is full done once the most up to date state is requested and imported, once finished the sync service should change from warp sync to full sync method and keeping syncing!

Additional informations

https://spec.polkadot.network/#sect-sync-warp
WARP Sync slides (2).pdf

@EclesioMeloJunior EclesioMeloJunior self-assigned this Mar 29, 2023
@EclesioMeloJunior EclesioMeloJunior added S-network issues related to the dot/network package. P-low this is mostly nice to have. C-complex Complex changes across multiple modules. Possibly will require additional research. T-feat this issue/pr is a new feature or functionality. labels Aug 8, 2024
@dimartiro dimartiro self-assigned this Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-complex Complex changes across multiple modules. Possibly will require additional research. P-low this is mostly nice to have. S-network issues related to the dot/network package. T-feat this issue/pr is a new feature or functionality.
Projects
None yet
Development

No branches or pull requests

4 participants