Skip to content

Commit 0d97b2c

Browse files
authored
Merge pull request #2490 from subspace/fix-domain-block-log
Skip domain block imported log during major sync
2 parents 5fe09ce + e052269 commit 0d97b2c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

domains/client/domain-operator/src/bundle_processor.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,19 @@ where
231231
let header = self.client.header(domain_tip)?.ok_or_else(|| {
232232
sp_blockchain::Error::Backend(format!("Header for #{:?} not found", domain_tip))
233233
})?;
234+
let block_origin = if self
235+
.domain_block_processor
236+
.consensus_network_sync_oracle
237+
.is_major_syncing()
238+
{
239+
// The domain block is derived from the consensus block, if the consensus chain is
240+
// in major sync then we should also consider the domain block is `NetworkInitialSync`
241+
BlockOrigin::NetworkInitialSync
242+
} else {
243+
BlockOrigin::Own
244+
};
234245
let block_import_params = {
235-
let mut import_block = BlockImportParams::new(BlockOrigin::Own, header);
246+
let mut import_block = BlockImportParams::new(block_origin, header);
236247
import_block.import_existing = true;
237248
import_block.fork_choice = Some(ForkChoiceStrategy::Custom(true));
238249
import_block.state_action = StateAction::Skip;

0 commit comments

Comments
 (0)