Fast sync child trie support. (#9239)

* state machine proofs.

* initial implementation

* Remove todo.

* Extend test and fix import.

* fix no proof, with proof ko.

* fix start at logic.

* Restore response size.

* Rework comments.

* Add explicit ref

* Use compact proof.

* ref change

* elaborato on empty change set condition.

* KeyValueState renaming.

* Do not add two time child trie with same root to sync reply.

* rust format

* Fix merge.

* fix warnings and fmt

* fmt

* update protocol id to V2
This commit is contained in:
cheme
2021-11-07 14:13:02 +01:00
committed by GitHub
parent 7827dbb73c
commit ca5b07243f
13 changed files with 855 additions and 140 deletions
+7
View File
@@ -697,6 +697,8 @@ pub struct FullPeerConfig {
pub is_authority: bool,
/// Syncing mode
pub sync_mode: SyncMode,
/// Extra genesis storage.
pub extra_storage: Option<sp_core::storage::Storage>,
/// Enable transaction indexing.
pub storage_chain: bool,
}
@@ -765,6 +767,11 @@ where
(Some(keep_blocks), false) => TestClientBuilder::with_pruning_window(keep_blocks),
(None, false) => TestClientBuilder::with_default_backend(),
};
if let Some(storage) = config.extra_storage {
let genesis_extra_storage = test_client_builder.genesis_init_mut().extra_storage();
*genesis_extra_storage = storage;
}
if matches!(config.sync_mode, SyncMode::Fast { .. } | SyncMode::Warp) {
test_client_builder = test_client_builder.set_no_genesis();
}