Skip to content
Unverified Commit 1f1f20a8 authored by Nazar Mokrynskyi's avatar Nazar Mokrynskyi Committed by GitHub
Browse files

Syncing strategy refactoring (#5469)

This is a step towards
https://github.com/paritytech/polkadot-sdk/issues/5333

The commits with code moving (but no other changes) and actual changes
are separated for easier review.

Essentially this results in `SyncingStrategy` trait replacing struct
(which is renamed to `PolkadotSyncingStrategy`, open for better name
suggestions). Technically it is already possible to replace
`PolkadotSyncingStrategy<B, Client>` with `Box<dyn SyncingStrategy<B>`
in syncing engine, but I decided to postpone such change until we
actually have an ability to customize it. It should also be possible to
swap `PolkadotSyncingStrategy` with just `ChainSync` that only supports
regular full sync from genesis (it also implements `SyncingStrategy`
trait).

While extracted trait still has a lot of non-generic stuff in it like
exposed knowledge of warp sync and `StrategyKey` with hardcoded set of
options, I believe this is a step in the right direction and will
address those in upcoming PRs.

With https://github.com/paritytech/polkadot-sdk/pull/5431 that landed
earlier warp sync configuration is more straightforward, but there are
still numerous things interleaved that will take some time to abstract
away nicely and expose in network config for developers. For now this is
an internal change even though data structures are technically public
and require major version bump.
parent d887804b
Pipeline #496445 waiting for manual action with stages
in 37 minutes and 26 seconds