Fast/warp sync fixes (#10562)

* Fast sync fixes

* Fix gap blocks validation

* Updated test

* Formatting

* Networking test
This commit is contained in:
Arkadiy Paronyan authored and GitHub committed 2022-01-13 15:26:06 +00:00
1 parent 3a88215fca
commit 4d477ea9b4
7 files changed
+126 -32

No files matched your search

+5 -1
View File
@@ -347,7 +347,11 @@ impl Config {
{
trace!(target: "babe", "Getting slot duration");
let best_block_id = BlockId::Hash(client.usage_info().chain.best_hash);
let mut best_block_id = BlockId::Hash(client.usage_info().chain.best_hash);
if client.usage_info().chain.finalized_state.is_none() {
debug!(target: "babe", "No finalized state is available. Reading config from genesis");
best_block_id = BlockId::Hash(client.usage_info().chain.genesis_hash);
}
let runtime_api = client.runtime_api();
let version = runtime_api.api_version::<dyn BabeApi<B>>(&best_block_id)?;