diff --git a/crates/iota-core/Cargo.toml b/crates/iota-core/Cargo.toml index 650aabf8f4b..8138aea0c46 100644 --- a/crates/iota-core/Cargo.toml +++ b/crates/iota-core/Cargo.toml @@ -104,8 +104,8 @@ num-bigint.workspace = true pretty_assertions.workspace = true rstest.workspace = true serde-reflection.workspace = true -tower.workspace = true serde_yaml.workspace = true +tower.workspace = true # internal dependencies iota-move.workspace = true diff --git a/crates/iota-core/src/authority/authority_per_epoch_store.rs b/crates/iota-core/src/authority/authority_per_epoch_store.rs index ed95b214216..21a928bfb59 100644 --- a/crates/iota-core/src/authority/authority_per_epoch_store.rs +++ b/crates/iota-core/src/authority/authority_per_epoch_store.rs @@ -33,7 +33,7 @@ use iota_types::{ authenticator_state::{ActiveJwk, get_authenticator_state}, base_types::{ AuthorityName, CommitRound, ConciseableName, EpochId, ObjectID, ObjectRef, SequenceNumber, - TimestampMs, TransactionDigest, + TransactionDigest, }, committee::{Committee, CommitteeTrait}, crypto::{AuthoritySignInfo, AuthorityStrongQuorumSignInfo, RandomnessRound}, @@ -103,7 +103,7 @@ use crate::{ epoch::{ epoch_metrics::EpochMetrics, randomness::{ - DkgStatus, RandomnessManager, RandomnessReporter, SINGLETON_KEY, + DkgStatus, RandomnessManager, RandomnessReporter, SINGLETON_KEY, CommitTimestampMs, VersionedProcessedMessage, VersionedUsedProcessedMessages, }, reconfiguration::ReconfigState, @@ -598,7 +598,7 @@ pub struct AuthorityEpochTables { pub(crate) randomness_highest_completed_round: DBMap, /// Holds the timestamp of the most recently generated round of randomness. - pub(crate) randomness_last_round_timestamp: DBMap, + pub(crate) randomness_last_round_timestamp: DBMap, } fn signed_transactions_table_default_config() -> DBOptions { @@ -3839,7 +3839,7 @@ pub(crate) struct ConsensusCommitOutput { pending_checkpoints: Vec, // random beacon state - next_randomness_round: Option<(RandomnessRound, TimestampMs)>, + next_randomness_round: Option<(RandomnessRound, CommitTimestampMs)>, dkg_confirmations: BTreeMap, dkg_processed_messages: BTreeMap, @@ -3917,7 +3917,7 @@ impl ConsensusCommitOutput { pub fn reserve_next_randomness_round( &mut self, next_randomness_round: RandomnessRound, - commit_timestamp: TimestampMs, + commit_timestamp: CommitTimestampMs, ) { assert!(self.next_randomness_round.is_none()); self.next_randomness_round = Some((next_randomness_round, commit_timestamp)); diff --git a/crates/iota-core/src/epoch/randomness.rs b/crates/iota-core/src/epoch/randomness.rs index 71d4e7d04cb..e63f4f2a4e8 100644 --- a/crates/iota-core/src/epoch/randomness.rs +++ b/crates/iota-core/src/epoch/randomness.rs @@ -21,7 +21,7 @@ use futures::{StreamExt, stream::FuturesUnordered}; use iota_macros::fail_point_if; use iota_network::randomness; use iota_types::{ - base_types::{AuthorityName, CommitRound, TimestampMs}, + base_types::{AuthorityName, CommitRound}, committee::{Committee, EpochId, StakeUnit}, crypto::{AuthorityKeyPair, RandomnessRound}, error::{IotaError, IotaResult}, @@ -46,6 +46,9 @@ use crate::{ consensus_adapter::SubmitToConsensus, }; +/// The epoch UNIX timestamp in milliseconds +pub type CommitTimestampMs = u64; + type PkG = bls12381::G2Element; type EncG = bls12381::G2Element; @@ -689,7 +692,7 @@ impl RandomnessManager { /// be resumed. pub(crate) fn reserve_next_randomness( &mut self, - commit_timestamp: TimestampMs, + commit_timestamp: CommitTimestampMs, output: &mut ConsensusCommitOutput, ) -> IotaResult> { let epoch_store = self.epoch_store()?; diff --git a/crates/iota-types/src/base_types.rs b/crates/iota-types/src/base_types.rs index 53dcaf67948..a557ddb80ff 100644 --- a/crates/iota-types/src/base_types.rs +++ b/crates/iota-types/src/base_types.rs @@ -117,9 +117,6 @@ pub type VersionNumber = SequenceNumber; /// The round number. pub type CommitRound = u64; -/// The epoch UNIX timestamp in milliseconds -pub type TimestampMs = u64; - #[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Hash, Default, Debug, Serialize, Deserialize)] pub struct UserData(pub Option<[u8; 32]>);