Skip to content

Commit

Permalink
[core] Cleanup StateAccumulatorV1
Browse files Browse the repository at this point in the history
  • Loading branch information
williampsmith committed Jul 22, 2024
1 parent 5e3f38c commit c64bdf9
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 306 deletions.
17 changes: 6 additions & 11 deletions crates/sui-core/src/authority/epoch_start_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ pub enum EpochFlag {
// This flag was "burned" because it was deployed with a broken version of the code. The
// new flags below are required to enable state accumulator v2
_StateAccumulatorV2EnabledDeprecated = 4,
StateAccumulatorV2EnabledTestnet = 5,
StateAccumulatorV2EnabledMainnet = 6,
_StateAccumulatorV2EnabledTestnetDeprecated = 5,
_StateAccumulatorV2EnabledMainnetDeprecated = 6,

ExecutedInEpochTable = 7,
}
Expand Down Expand Up @@ -92,11 +92,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 All @@ -119,11 +114,11 @@ impl fmt::Display for EpochFlag {
write!(f, "StateAccumulatorV2EnabledDeprecated (DEPRECATED)")
}
EpochFlag::ExecutedInEpochTable => write!(f, "ExecutedInEpochTable"),
EpochFlag::StateAccumulatorV2EnabledTestnet => {
write!(f, "StateAccumulatorV2EnabledTestnet")
EpochFlag::_StateAccumulatorV2EnabledTestnetDeprecated => {
write!(f, "StateAccumulatorV2EnabledTestnet (DEPRECATED)")
}
EpochFlag::StateAccumulatorV2EnabledMainnet => {
write!(f, "StateAccumulatorV2EnabledMainnet")
EpochFlag::_StateAccumulatorV2EnabledMainnetDeprecated => {
write!(f, "StateAccumulatorV2EnabledMainnet (DEPRECATED)")
}
}
}
Expand Down
1 change: 0 additions & 1 deletion crates/sui-core/src/checkpoints/checkpoint_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ impl CheckpointExecutor {
.expect("Failed to accumulate running root");
self.accumulator
.accumulate_epoch(epoch_store.clone(), *checkpoint.sequence_number())
.await
.expect("Accumulating epoch cannot fail");

self.bump_highest_executed_checkpoint(checkpoint);
Expand Down
5 changes: 1 addition & 4 deletions crates/sui-core/src/checkpoints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1452,9 +1452,7 @@ impl CheckpointBuilder {
state_acc
.accumulate_running_root(&self.epoch_store, sequence_number, Some(acc))
.await?;
state_acc
.digest_epoch(self.epoch_store.clone(), sequence_number)
.await?
state_acc.digest_epoch(self.epoch_store.clone(), sequence_number)?
};
self.metrics.highest_accumulated_epoch.set(epoch as i64);
info!("Epoch {epoch} root state hash digest: {root_state_digest:?}");
Expand Down Expand Up @@ -2516,7 +2514,6 @@ mod tests {

let accumulator = Arc::new(StateAccumulator::new_for_tests(
state.get_accumulator_store().clone(),
&epoch_store,
));

let (checkpoint_service, _exit) = CheckpointService::spawn(
Expand Down
Loading

0 comments on commit c64bdf9

Please sign in to comment.