From 1c4785bed47715275725eb2192b1df3f8df964ac Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Thu, 30 May 2024 14:04:12 +0700 Subject: [PATCH] Update fast-sync after latest polkadot-sdk --- crates/subspace-service/src/lib.rs | 11 +---------- .../subspace-service/src/sync_from_dsn/fast_sync.rs | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/subspace-service/src/lib.rs b/crates/subspace-service/src/lib.rs index 3fef29cac49..dd9b66fc3e8 100644 --- a/crates/subspace-service/src/lib.rs +++ b/crates/subspace-service/src/lib.rs @@ -75,7 +75,7 @@ use sc_proof_of_time::source::gossip::pot_gossip_peers_set_config; use sc_proof_of_time::source::{PotSlotInfo, PotSourceWorker}; use sc_proof_of_time::verifier::PotVerifier; use sc_service::error::Error as ServiceError; -use sc_service::{ClientExt, Configuration, NetworkStarter, SpawnTasksParams, TaskManager}; +use sc_service::{Configuration, NetworkStarter, SpawnTasksParams, TaskManager}; use sc_subspace_block_relay::{ build_consensus_relay, BlockRelayConfigurationError, NetworkWrapper, }; @@ -722,15 +722,6 @@ where mut telemetry, } = other; - // TODO: This will not be needed once we clear block gap correctly after sync is done - if config.sync == ChainSyncMode::Snap { - let info = client.info(); - if info.best_hash != info.genesis_hash { - debug!(?info, "Clear block gap after fast-sync"); - client.clear_block_gap(); - } - } - let offchain_indexing_enabled = config.offchain_worker.indexing_enabled; let (node, bootstrap_nodes) = match config.subspace_networking { SubspaceNetworking::Reuse { diff --git a/crates/subspace-service/src/sync_from_dsn/fast_sync.rs b/crates/subspace-service/src/sync_from_dsn/fast_sync.rs index 1d0611c697c..f8d68ee34f5 100644 --- a/crates/subspace-service/src/sync_from_dsn/fast_sync.rs +++ b/crates/subspace-service/src/sync_from_dsn/fast_sync.rs @@ -304,7 +304,7 @@ where // Clear the block gap that arises from first block import with a much higher number than // previously (resulting in a gap) // TODO: This is a hack and better solution is needed: https://github.com/paritytech/polkadot-sdk/issues/4407 - client.clear_block_gap(); + client.clear_block_gap()?; debug!(info = ?client.info(), "Fast sync finished successfully");