From 6b86c60d2968550e82db285eccd7045e87691543 Mon Sep 17 00:00:00 2001 From: William Smith Date: Thu, 27 Jun 2024 12:05:11 -0700 Subject: [PATCH] [StateAccumulatorV2] Re-enable on testnet as per epoch component (#18444) ## Description As in title ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: --- .../src/authority/epoch_start_configuration.rs | 2 +- crates/sui-core/src/state_accumulator.rs | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/crates/sui-core/src/authority/epoch_start_configuration.rs b/crates/sui-core/src/authority/epoch_start_configuration.rs index 8c4947c350446..71b9906c61343 100644 --- a/crates/sui-core/src/authority/epoch_start_configuration.rs +++ b/crates/sui-core/src/authority/epoch_start_configuration.rs @@ -62,7 +62,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(), false) + Self::default_flags_impl(&Default::default(), true) } fn default_flags_impl( diff --git a/crates/sui-core/src/state_accumulator.rs b/crates/sui-core/src/state_accumulator.rs index f67f150839721..8ec3b5f184b6d 100644 --- a/crates/sui-core/src/state_accumulator.rs +++ b/crates/sui-core/src/state_accumulator.rs @@ -5,7 +5,7 @@ use itertools::Itertools; use mysten_metrics::monitored_scope; use prometheus::{register_int_gauge_with_registry, IntGauge, Registry}; use serde::Serialize; -use sui_protocol_config::ProtocolConfig; +use sui_protocol_config::{Chain, ProtocolConfig}; use sui_types::base_types::{ObjectID, ObjectRef, SequenceNumber, VersionNumber}; use sui_types::committee::EpochId; use sui_types::digests::{ObjectDigest, TransactionDigest}; @@ -389,15 +389,13 @@ impl StateAccumulator { epoch_store: &Arc, metrics: Arc, ) -> Self { - if cfg!(msim) { - if epoch_store.state_accumulator_v2_enabled() { - return StateAccumulator::V2(StateAccumulatorV2::new(store, metrics)); - } else { - return StateAccumulator::V1(StateAccumulatorV1::new(store, metrics)); - } + if epoch_store.state_accumulator_v2_enabled() + && epoch_store.get_chain_identifier().chain() != Chain::Mainnet + { + StateAccumulator::V2(StateAccumulatorV2::new(store, metrics)) + } else { + StateAccumulator::V1(StateAccumulatorV1::new(store, metrics)) } - - StateAccumulator::V1(StateAccumulatorV1::new(store, metrics)) } pub fn new_for_tests(