Skip to content

Commit

Permalink
Merge pull request #2490 from subspace/fix-domain-block-log
Browse files Browse the repository at this point in the history
Skip domain block imported log during major sync
  • Loading branch information
NingLin-P authored Feb 1, 2024
2 parents 5fe09ce + e052269 commit 0d97b2c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion domains/client/domain-operator/src/bundle_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,19 @@ where
let header = self.client.header(domain_tip)?.ok_or_else(|| {
sp_blockchain::Error::Backend(format!("Header for #{:?} not found", domain_tip))
})?;
let block_origin = if self
.domain_block_processor
.consensus_network_sync_oracle
.is_major_syncing()
{
// The domain block is derived from the consensus block, if the consensus chain is
// in major sync then we should also consider the domain block is `NetworkInitialSync`
BlockOrigin::NetworkInitialSync
} else {
BlockOrigin::Own
};
let block_import_params = {
let mut import_block = BlockImportParams::new(BlockOrigin::Own, header);
let mut import_block = BlockImportParams::new(block_origin, header);
import_block.import_existing = true;
import_block.fork_choice = Some(ForkChoiceStrategy::Custom(true));
import_block.state_action = StateAction::Skip;
Expand Down

0 comments on commit 0d97b2c

Please sign in to comment.