From 08a83f52b85943f48cf3e82dffae8829ebe6184b Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 30 Oct 2024 17:15:46 +1000 Subject: [PATCH] Log the start segment for object mappings --- crates/sc-consensus-subspace/src/archiver.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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,