From 107636af4490d5a2ca7bd4881b451bba00cb7e10 Mon Sep 17 00:00:00 2001 From: William Smith Date: Sat, 15 Jun 2024 22:10:21 -0700 Subject: [PATCH] [StateAccumulatorV2] Ignore epoch flag CP --- .../src/authority/epoch_start_configuration.rs | 2 +- crates/sui-core/src/state_accumulator.rs | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/sui-core/src/authority/epoch_start_configuration.rs b/crates/sui-core/src/authority/epoch_start_configuration.rs index e8ff1deef8b38..3dc99e962902f 100644 --- a/crates/sui-core/src/authority/epoch_start_configuration.rs +++ b/crates/sui-core/src/authority/epoch_start_configuration.rs @@ -57,7 +57,7 @@ impl EpochFlag { /// For situations in which there is no config available (e.g. setting up a downloaded snapshot). pub fn default_for_no_config() -> Vec { - Self::default_flags_impl(&Default::default(), true) + Self::default_flags_impl(&Default::default(), false) } fn default_flags_impl( diff --git a/crates/sui-core/src/state_accumulator.rs b/crates/sui-core/src/state_accumulator.rs index 8c14925e16527..502c93597f265 100644 --- a/crates/sui-core/src/state_accumulator.rs +++ b/crates/sui-core/src/state_accumulator.rs @@ -4,7 +4,7 @@ use itertools::Itertools; use mysten_metrics::monitored_scope; use serde::Serialize; -use sui_protocol_config::{Chain, ProtocolConfig}; +use sui_protocol_config::ProtocolConfig; use sui_types::base_types::{ObjectID, ObjectRef, SequenceNumber, VersionNumber}; use sui_types::committee::EpochId; use sui_types::digests::{ObjectDigest, TransactionDigest}; @@ -367,12 +367,15 @@ impl StateAccumulator { store: Arc, epoch_store: &Arc, ) -> Self { - let chain = epoch_store.get_chain_identifier().chain(); - if epoch_store.state_accumulator_v2_enabled() && chain != Chain::Mainnet { - StateAccumulator::V2(StateAccumulatorV2::new(store)) - } else { - StateAccumulator::V1(StateAccumulatorV1::new(store)) + if cfg!(msim) { + if epoch_store.state_accumulator_v2_enabled() { + return StateAccumulator::V2(StateAccumulatorV2::new(store)); + } else { + return StateAccumulator::V1(StateAccumulatorV1::new(store)); + } } + + StateAccumulator::V1(StateAccumulatorV1::new(store)) } /// Accumulates the effects of a single checkpoint and persists the accumulator.