Skip to content

Commit

Permalink
Remove unnecessary deps (#20773)
Browse files Browse the repository at this point in the history
  • Loading branch information
mystenmark authored Jan 3, 2025
1 parent fa3ecc3 commit e33b7c2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 33 deletions.
17 changes: 0 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions crates/sui-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ async-trait.workspace = true
axum.workspace = true
bcs.workspace = true
bytes.workspace = true
chrono.workspace = true
consensus-core.workspace = true
consensus-config.workspace = true
count-min-sketch.workspace = true
Expand All @@ -27,9 +26,7 @@ enum_dispatch.workspace = true
eyre.workspace = true
futures.workspace = true
im.workspace = true
indexmap.workspace = true
itertools.workspace = true
jsonrpsee.workspace = true
lru.workspace = true
mockall.workspace = true
num_cpus.workspace = true
Expand All @@ -45,13 +42,11 @@ scopeguard.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_with.workspace = true
signature.workspace = true
static_assertions.workspace = true
tap.workspace = true
tempfile.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["full", "tracing", "test-util"] }
tokio-retry.workspace = true
tokio-stream.workspace = true
tracing.workspace = true
twox-hash.workspace = true
Expand Down Expand Up @@ -89,7 +84,6 @@ sui-simulator.workspace = true
sui-storage.workspace = true
sui-tls.workspace = true
sui-types.workspace = true
zeroize.workspace = true
nonempty.workspace = true

[dev-dependencies]
Expand All @@ -113,9 +107,6 @@ sui-move.workspace = true
pprof.workspace = true
test-fuzz.workspace = true

sui-macros.workspace = true
sui-protocol-config.workspace = true

# moka uses `quanta` by default for timing, which is not compatible with the simulator
[target.'cfg(msim)'.dependencies]
moka = { workspace = true, default-features = false, features = [
Expand Down
10 changes: 7 additions & 3 deletions crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use anyhow::anyhow;
use arc_swap::{ArcSwap, Guard};
use async_trait::async_trait;
use authority_per_epoch_store::CertLockGuard;
use chrono::prelude::*;
use fastcrypto::encoding::Base58;
use fastcrypto::encoding::Encoding;
use fastcrypto::hash::MultisetHash;
Expand All @@ -38,6 +37,8 @@ use std::io::Write;
use std::path::{Path, PathBuf};
use std::sync::atomic::Ordering;
use std::time::Duration;
use std::time::SystemTime;
use std::time::UNIX_EPOCH;
use std::{
collections::{HashMap, HashSet},
fs,
Expand Down Expand Up @@ -2667,8 +2668,11 @@ impl AuthorityState {
}

pub fn unixtime_now_ms() -> u64 {
let ts_ms = Utc::now().timestamp_millis();
u64::try_from(ts_ms).expect("Travelling in time machine")
let now = SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("Time went backwards")
.as_millis();
u64::try_from(now).expect("Travelling in time machine")
}

// TODO(fastpath): update this handler for Mysticeti fastpath.
Expand Down
8 changes: 4 additions & 4 deletions crates/sui-core/src/checkpoints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use sui_types::sui_system_state::epoch_start_sui_system_state::EpochStartSystemS

use crate::authority::authority_per_epoch_store::AuthorityPerEpochStore;
use crate::consensus_handler::SequencedConsensusTransactionKey;
use chrono::Utc;
use rand::rngs::OsRng;
use rand::seq::SliceRandom;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
Expand All @@ -40,7 +39,7 @@ use std::io::Write;
use std::path::Path;
use std::sync::Arc;
use std::sync::Weak;
use std::time::Duration;
use std::time::{Duration, SystemTime};
use sui_protocol_config::ProtocolVersion;
use sui_types::base_types::{AuthorityName, EpochId, TransactionDigest};
use sui_types::committee::StakeUnit;
Expand Down Expand Up @@ -2011,7 +2010,7 @@ async fn diagnose_split_brain(
checkpoint_seq = local_summary.sequence_number,
"Running split brain diagnostics..."
);
let time = Utc::now();
let time = SystemTime::now();
// collect one random disagreeing validator per differing digest
let digest_to_validator = all_unique_values
.iter()
Expand Down Expand Up @@ -2163,7 +2162,8 @@ async fn diagnose_split_brain(

let header = format!(
"Checkpoint Fork Dump - Authority {local_validator:?}: \n\
Datetime: {time}",
Datetime: {:?}",
time
);
let fork_logs_text = format!("{header}\n\n{diff_patches}\n\n");
let path = tempfile::tempdir()
Expand Down

0 comments on commit e33b7c2

Please sign in to comment.