diff --git a/crates/sc-consensus-subspace/src/archiver.rs b/crates/sc-consensus-subspace/src/archiver.rs index 6f2f9f1701..e72efeea55 100644 --- a/crates/sc-consensus-subspace/src/archiver.rs +++ b/crates/sc-consensus-subspace/src/archiver.rs @@ -433,6 +433,11 @@ impl CreateObjectMappings { segment_index >= target_index } + + /// Returns true if object mappings will be created from a past or future segment index. + pub fn is_enabled(&self) -> bool { + matches!(self, CreateObjectMappings::Segment(_)) + } } #[derive(Clone, Debug, Eq, PartialEq)] @@ -959,6 +964,13 @@ where AS: AuxStore + Send + Sync + 'static, SO: SyncOracle + Send + Sync + 'static, { + if !create_object_mappings.is_enabled() { + info!( + ?create_object_mappings, + "Creating object mappings from the configured segment onwards" + ); + } + let maybe_archiver = if segment_headers_store.max_segment_index().is_none() { Some(initialize_archiver( &segment_headers_store,