Skip to content

Commit

Permalink
[core] Force enable state accumulator v2
Browse files Browse the repository at this point in the history
  • Loading branch information
williampsmith committed Sep 6, 2024
1 parent 2d7a7aa commit ab86d2d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions crates/sui-core/src/authority/epoch_start_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,20 @@ pub enum EpochFlag {

impl EpochFlag {
pub fn default_flags_for_new_epoch(config: &NodeConfig) -> Vec<Self> {
Self::default_flags_impl(&config.execution_cache, config.state_accumulator_v2)
Self::default_flags_impl(&config.execution_cache)
}

/// For situations in which there is no config available (e.g. setting up a downloaded snapshot).
pub fn default_for_no_config() -> Vec<Self> {
Self::default_flags_impl(&Default::default(), true)
Self::default_flags_impl(&Default::default())
}

fn default_flags_impl(
cache_config: &ExecutionCacheConfig,
enable_state_accumulator_v2: bool,
) -> Vec<Self> {
let mut new_flags = vec![EpochFlag::ExecutedInEpochTable];
fn default_flags_impl(cache_config: &ExecutionCacheConfig) -> Vec<Self> {
let mut new_flags = vec![
EpochFlag::ExecutedInEpochTable,
EpochFlag::StateAccumulatorV2EnabledTestnet,
EpochFlag::StateAccumulatorV2EnabledMainnet,
];

if matches!(
choose_execution_cache(cache_config),
Expand All @@ -92,11 +93,6 @@ impl EpochFlag {
new_flags.push(EpochFlag::WritebackCacheEnabled);
}

if enable_state_accumulator_v2 {
new_flags.push(EpochFlag::StateAccumulatorV2EnabledTestnet);
new_flags.push(EpochFlag::StateAccumulatorV2EnabledMainnet);
}

new_flags
}
}
Expand Down

0 comments on commit ab86d2d

Please sign in to comment.