Skip to content

Commit

Permalink
[StateAccumulator] Do not set epoch flag by default (#18278)
Browse files Browse the repository at this point in the history
## Description 

Describe the changes or additions included in this PR.

## 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:
  • Loading branch information
williampsmith authored Jun 16, 2024
1 parent 06c32a8 commit 15c74eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/sui-core/src/authority/epoch_start_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Self::default_flags_impl(&Default::default(), true)
Self::default_flags_impl(&Default::default(), false)
}

fn default_flags_impl(
Expand Down
15 changes: 9 additions & 6 deletions crates/sui-core/src/state_accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -367,12 +367,15 @@ impl StateAccumulator {
store: Arc<dyn AccumulatorStore>,
epoch_store: &Arc<AuthorityPerEpochStore>,
) -> 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.
Expand Down

0 comments on commit 15c74eb

Please sign in to comment.