diff --git a/crates/sui-config/src/node.rs b/crates/sui-config/src/node.rs index 2959c8684224d..2ff96097f693f 100644 --- a/crates/sui-config/src/node.rs +++ b/crates/sui-config/src/node.rs @@ -564,7 +564,7 @@ impl Default for CheckpointExecutorConfig { } } -#[derive(Debug, Clone, Copy, Deserialize, Serialize)] +#[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "kebab-case")] pub struct AuthorityStorePruningConfig { /// number of the latest epoch dbs to retain diff --git a/crates/sui-core/src/authority.rs b/crates/sui-core/src/authority.rs index 435c78766f8ea..8ff3c85e01958 100644 --- a/crates/sui-core/src/authority.rs +++ b/crates/sui-core/src/authority.rs @@ -2599,7 +2599,7 @@ impl AuthorityState { store.perpetual_tables.clone(), checkpoint_store.clone(), store.objects_lock_table.clone(), - config.authority_store_pruning_config, + config.authority_store_pruning_config.clone(), epoch_store.committee().authority_exists(&name), epoch_store.epoch_start_state().epoch_duration_ms(), prometheus_registry, diff --git a/crates/sui-core/src/authority/authority_store_pruner.rs b/crates/sui-core/src/authority/authority_store_pruner.rs index eb301df701577..6e6ce3f5a5053 100644 --- a/crates/sui-core/src/authority/authority_store_pruner.rs +++ b/crates/sui-core/src/authority/authority_store_pruner.rs @@ -670,12 +670,12 @@ impl AuthorityStorePruner { loop { tokio::select! { _ = objects_prune_interval.tick(), if config.num_epochs_to_retain != u64::MAX => { - if let Err(err) = Self::prune_objects_for_eligible_epochs(&perpetual_db, &checkpoint_store, &objects_lock_table, config, metrics.clone(), indirect_objects_threshold, epoch_duration_ms).await { + if let Err(err) = Self::prune_objects_for_eligible_epochs(&perpetual_db, &checkpoint_store, &objects_lock_table, config.clone(), metrics.clone(), indirect_objects_threshold, epoch_duration_ms).await { error!("Failed to prune objects: {:?}", err); } }, _ = checkpoints_prune_interval.tick(), if !matches!(config.num_epochs_to_retain_for_checkpoints(), None | Some(u64::MAX) | Some(0)) => { - if let Err(err) = Self::prune_checkpoints_for_eligible_epochs(&perpetual_db, &checkpoint_store, &objects_lock_table, config, metrics.clone(), indirect_objects_threshold, archive_readers.clone(), epoch_duration_ms).await { + if let Err(err) = Self::prune_checkpoints_for_eligible_epochs(&perpetual_db, &checkpoint_store, &objects_lock_table, config.clone(), metrics.clone(), indirect_objects_threshold, archive_readers.clone(), epoch_duration_ms).await { error!("Failed to prune checkpoints: {:?}", err); } }, diff --git a/crates/sui-core/src/db_checkpoint_handler.rs b/crates/sui-core/src/db_checkpoint_handler.rs index 455cbaec1e2fc..5323c18c21d28 100644 --- a/crates/sui-core/src/db_checkpoint_handler.rs +++ b/crates/sui-core/src/db_checkpoint_handler.rs @@ -261,7 +261,7 @@ impl DBCheckpointHandler { &perpetual_db, &checkpoint_store, &lock_table, - self.pruning_config, + self.pruning_config.clone(), metrics, self.indirect_objects_threshold, epoch_duration_ms, diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index 6d805aea7511c..070206f181bc1 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -427,7 +427,7 @@ impl SuiNode { DBMetrics::init(&prometheus_registry); mysten_metrics::init_metrics(&prometheus_registry); - let genesis = config.genesis()?; + let genesis = config.genesis()?.clone(); let secret = Arc::pin(config.protocol_key_pair().copy()); let genesis_committee = genesis.committee()?; @@ -447,7 +447,7 @@ impl SuiNode { .expect("Database read should not fail at init."); let store = - AuthorityStore::open(perpetual_tables, genesis, &config, &prometheus_registry).await?; + AuthorityStore::open(perpetual_tables, &genesis, &config, &prometheus_registry).await?; let cur_epoch = store.get_recovery_epoch_at_restart()?; let committee = committee_store @@ -587,13 +587,14 @@ impl SuiNode { state_snapshot_handle.is_some(), )?; - let mut pruning_config = config.authority_store_pruning_config; if !epoch_store .protocol_config() .simplified_unwrap_then_delete() { // We cannot prune tombstones if simplified_unwrap_then_delete is not enabled. - pruning_config.set_killswitch_tombstone_pruning(true); + config + .authority_store_pruning_config + .set_killswitch_tombstone_pruning(true); } let state = AuthorityState::new( @@ -921,7 +922,7 @@ impl SuiNode { .prune_and_compact_before_upload .unwrap_or(true), config.indirect_objects_threshold, - config.authority_store_pruning_config, + config.authority_store_pruning_config.clone(), prometheus_registry, state_snapshot_enabled, )?;