Skip to content

Commit

Permalink
Update object version assignment tables to include object start versi…
Browse files Browse the repository at this point in the history
…on in the key (#20527)
  • Loading branch information
aschran authored Jan 6, 2025
1 parent b14ee43 commit fb49e8c
Show file tree
Hide file tree
Showing 25 changed files with 673 additions and 178 deletions.
3 changes: 2 additions & 1 deletion crates/simulacrum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use sui_swarm_config::network_config_builder::ConfigBuilder;
use sui_types::base_types::{AuthorityName, ObjectID, VersionNumber};
use sui_types::crypto::AuthoritySignature;
use sui_types::digests::ConsensusCommitDigest;
use sui_types::messages_consensus::ConsensusDeterminedVersionAssignments;
use sui_types::object::Object;
use sui_types::storage::{ObjectStore, ReadStore, RpcStateReader};
use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemState;
Expand Down Expand Up @@ -234,7 +235,7 @@ impl<R, S: store::SimulatorStore> Simulacrum<R, S> {
round,
timestamp_ms,
ConsensusCommitDigest::default(),
Vec::new(),
ConsensusDeterminedVersionAssignments::empty_for_testing(),
);

self.execute_transaction(consensus_commit_prologue_transaction.into())
Expand Down
5 changes: 4 additions & 1 deletion crates/sui-benchmark/tests/simtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,10 @@ mod test {
let num_objs = thread_rng().gen_range(1..15);
let mut assigned_object_versions = Vec::new();
for _ in 0..num_objs {
assigned_object_versions.push((ObjectID::random(), SequenceNumber::CONGESTED));
assigned_object_versions.push((
(ObjectID::random(), SequenceNumber::UNKNOWN),
SequenceNumber::CONGESTED,
));
}
additional_cancelled_txns.push((TransactionDigest::random(), assigned_object_versions));
}
Expand Down
233 changes: 180 additions & 53 deletions crates/sui-core/src/authority/authority_per_epoch_store.rs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions crates/sui-core/src/authority/epoch_start_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ pub trait EpochStartConfigTrait {
ExecutionCacheConfigType::PassthroughCache
}
}

fn use_version_assignment_tables_v3(&self) -> bool {
self.flags()
.contains(&EpochFlag::UseVersionAssignmentTablesV3)
}
}

// IMPORTANT: Assign explicit values to each variant to ensure that the values are stable.
Expand Down Expand Up @@ -67,6 +72,8 @@ pub enum EpochFlag {
StateAccumulatorV2EnabledMainnet = 6,

ExecutedInEpochTable = 7,

UseVersionAssignmentTablesV3 = 8,
}

impl EpochFlag {
Expand All @@ -84,6 +91,7 @@ impl EpochFlag {
EpochFlag::ExecutedInEpochTable,
EpochFlag::StateAccumulatorV2EnabledTestnet,
EpochFlag::StateAccumulatorV2EnabledMainnet,
EpochFlag::UseVersionAssignmentTablesV3,
];

if matches!(
Expand Down Expand Up @@ -121,6 +129,9 @@ impl fmt::Display for EpochFlag {
EpochFlag::StateAccumulatorV2EnabledMainnet => {
write!(f, "StateAccumulatorV2EnabledMainnet")
}
EpochFlag::UseVersionAssignmentTablesV3 => {
write!(f, "UseVersionAssignmentTablesV3")
}
}
}
}
Expand Down
Loading

0 comments on commit fb49e8c

Please sign in to comment.