diff --git a/api/src/health_check.rs b/api/src/health_check.rs index d7aad38139bc1..093db25c493c7 100644 --- a/api/src/health_check.rs +++ b/api/src/health_check.rs @@ -23,11 +23,11 @@ struct HealthCheckParams { struct HealthCheckError; impl reject::Reject for HealthCheckError {} -pub fn health_check_route(health_diem_db: Arc) -> BoxedFilter<(impl Reply,)> { +pub fn health_check_route(health_aptos_db: Arc) -> BoxedFilter<(impl Reply,)> { warp::path!("-" / "healthy") .and(warp::path::end()) .and(warp::query().map(move |params: HealthCheckParams| params)) - .and(warp::any().map(move || health_diem_db.clone())) + .and(warp::any().map(move || health_aptos_db.clone())) .and(warp::any().map(SystemTime::now)) .and_then(health_check) .boxed() diff --git a/aptos-node/src/lib.rs b/aptos-node/src/lib.rs index 1e9757b7b2632..cade8b586d8de 100644 --- a/aptos-node/src/lib.rs +++ b/aptos-node/src/lib.rs @@ -4,7 +4,7 @@ use aptos_api::runtime::bootstrap as bootstrap_api; use aptos_config::{ config::{ - DataStreamingServiceConfig, DiemDataClientConfig, NetworkConfig, NodeConfig, + AptosDataClientConfig, DataStreamingServiceConfig, NetworkConfig, NodeConfig, PersistableConfig, StorageServiceConfig, }, network_id::NetworkId, @@ -95,7 +95,7 @@ pub fn start(config: &NodeConfig, log_file: Option) { let logger = Some(logger.build()); // Let's now log some important information, since the logger is set up - info!(config = config, "Loaded DiemNode config"); + info!(config = config, "Loaded AptosNode config"); if fail::has_failpoints() { warn!("Failpoints is enabled"); @@ -327,7 +327,7 @@ fn setup_data_streaming_service( fn setup_aptos_data_client( storage_service_config: StorageServiceConfig, - aptos_data_client_config: DiemDataClientConfig, + aptos_data_client_config: AptosDataClientConfig, network_handles: HashMap, peer_metadata_storage: Arc, ) -> (AptosNetDataClient, Runtime) { @@ -440,7 +440,7 @@ pub fn setup_environment(node_config: &NodeConfig, logger: Option>) }); let mut instant = Instant::now(); - let (diem_db, db_rw) = DbReaderWriter::wrap( + let (aptos_db, db_rw) = DbReaderWriter::wrap( AptosDB::open( &node_config.storage.dir(), false, /* readonly */ @@ -450,10 +450,10 @@ pub fn setup_environment(node_config: &NodeConfig, logger: Option>) ) .expect("DB should open."), ); - let _simple_storage_service = start_storage_service_with_db(node_config, Arc::clone(&diem_db)); + let _simple_storage_service = start_storage_service_with_db(node_config, Arc::clone(&aptos_db)); let backup_service = start_backup_service( node_config.storage.backup_service_address, - Arc::clone(&diem_db), + Arc::clone(&aptos_db), ); let genesis_waypoint = node_config.base.waypoint.genesis_waypoint(); @@ -615,7 +615,7 @@ pub fn setup_environment(node_config: &NodeConfig, logger: Option>) let (mp_client_sender, mp_client_events) = channel(AC_SMP_CHANNEL_BUFFER_SIZE); - let api_runtime = bootstrap_api(node_config, chain_id, diem_db, mp_client_sender).unwrap(); + let api_runtime = bootstrap_api(node_config, chain_id, aptos_db, mp_client_sender).unwrap(); let mut consensus_runtime = None; let (consensus_to_mempool_sender, consensus_requests) = channel(INTRA_NODE_CHANNEL_BUFFER_SIZE); diff --git a/config/src/config/state_sync_config.rs b/config/src/config/state_sync_config.rs index 6aee5211b1e47..2e87c68b14a83 100644 --- a/config/src/config/state_sync_config.rs +++ b/config/src/config/state_sync_config.rs @@ -30,7 +30,7 @@ pub struct StateSyncConfig { // Everything above belongs to state sync v1 and will be removed in the future. pub data_streaming_service: DataStreamingServiceConfig, - pub aptos_data_client: DiemDataClientConfig, + pub aptos_data_client: AptosDataClientConfig, pub state_sync_driver: StateSyncDriverConfig, pub storage_service: StorageServiceConfig, } @@ -48,7 +48,7 @@ impl Default for StateSyncConfig { sync_request_timeout_ms: 60_000, tick_interval_ms: 100, data_streaming_service: DataStreamingServiceConfig::default(), - aptos_data_client: DiemDataClientConfig::default(), + aptos_data_client: AptosDataClientConfig::default(), state_sync_driver: StateSyncDriverConfig::default(), storage_service: StorageServiceConfig::default(), } @@ -158,12 +158,12 @@ impl Default for DataStreamingServiceConfig { #[derive(Copy, Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(default)] -pub struct DiemDataClientConfig { +pub struct AptosDataClientConfig { pub response_timeout_ms: u64, // Timeout (in milliseconds) when waiting for a response pub summary_poll_interval_ms: u64, // Interval (in milliseconds) between data summary polls } -impl Default for DiemDataClientConfig { +impl Default for AptosDataClientConfig { fn default() -> Self { Self { response_timeout_ms: 3_000, diff --git a/consensus/src/consensus_provider.rs b/consensus/src/consensus_provider.rs index 1892435fa5c22..361ff0ce49b5f 100644 --- a/consensus/src/consensus_provider.rs +++ b/consensus/src/consensus_provider.rs @@ -30,7 +30,7 @@ pub fn start_consensus( network_events: ConsensusNetworkEvents, state_sync_notifier: Arc, consensus_to_mempool_sender: mpsc::Sender, - diem_db: DbReaderWriter, + aptos_db: DbReaderWriter, reconfig_events: ReconfigNotificationListener, peer_metadata_storage: Arc, ) -> Runtime { @@ -39,14 +39,14 @@ pub fn start_consensus( .enable_all() .build() .expect("Failed to create Tokio runtime!"); - let storage = Arc::new(StorageWriteProxy::new(node_config, diem_db.reader.clone())); + let storage = Arc::new(StorageWriteProxy::new(node_config, aptos_db.reader.clone())); let txn_manager = Arc::new(MempoolProxy::new( consensus_to_mempool_sender, node_config.consensus.mempool_poll_count, node_config.consensus.mempool_txn_pull_timeout_ms, node_config.consensus.mempool_executed_txn_timeout_ms, )); - let execution_correctness_manager = ExecutionCorrectnessManager::new(node_config, diem_db); + let execution_correctness_manager = ExecutionCorrectnessManager::new(node_config, aptos_db); let state_computer = Arc::new(ExecutionProxy::new( execution_correctness_manager.client(), diff --git a/consensus/src/counters.rs b/consensus/src/counters.rs index 5f3a6489c72b4..00c5a7b80c04f 100644 --- a/consensus/src/counters.rs +++ b/consensus/src/counters.rs @@ -18,7 +18,7 @@ pub static OP_COUNTERS: Lazy = pub static ERROR_COUNT: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_error_count", + "aptos_consensus_error_count", "Total number of errors in main loop" ) .unwrap() @@ -27,7 +27,7 @@ pub static ERROR_COUNT: Lazy = Lazy::new(|| { /// This counter is set to the round of the highest committed block. pub static LAST_COMMITTED_ROUND: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_last_committed_round", + "aptos_consensus_last_committed_round", "This counter is set to the round of the highest committed block." ) .unwrap() @@ -36,7 +36,7 @@ pub static LAST_COMMITTED_ROUND: Lazy = Lazy::new(|| { /// The counter corresponds to the version of the last committed ledger info. pub static LAST_COMMITTED_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_last_committed_version", + "aptos_consensus_last_committed_version", "The counter corresponds to the version of the last committed ledger info." ) .unwrap() @@ -45,7 +45,7 @@ pub static LAST_COMMITTED_VERSION: Lazy = Lazy::new(|| { /// Count of the committed blocks since last restart. pub static COMMITTED_BLOCKS_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_consensus_committed_blocks_count", + "aptos_consensus_committed_blocks_count", "Count of the committed blocks since last restart." ) .unwrap() @@ -54,7 +54,7 @@ pub static COMMITTED_BLOCKS_COUNT: Lazy = Lazy::new(|| { /// Count of the committed transactions since last restart. pub static COMMITTED_TXNS_COUNT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_consensus_committed_txns_count", + "aptos_consensus_committed_txns_count", "Count of the transactions since last restart. state is success or failed", &["state"] ) @@ -68,13 +68,13 @@ pub static COMMITTED_TXNS_COUNT: Lazy = Lazy::new(|| { /// Count of the block proposals sent by this validator since last restart /// (both primary and secondary) pub static PROPOSALS_COUNT: Lazy = Lazy::new(|| { - register_int_counter!("diem_consensus_proposals_count", "Count of the block proposals sent by this validator since last restart (both primary and secondary)").unwrap() + register_int_counter!("aptos_consensus_proposals_count", "Count of the block proposals sent by this validator since last restart (both primary and secondary)").unwrap() }); /// Count the number of times a validator voted for a nil block since last restart. pub static VOTE_NIL_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_consensus_vote_nil_count", + "aptos_consensus_vote_nil_count", "Count the number of times a validator voted for a nil block since last restart." ) .unwrap() @@ -104,7 +104,7 @@ pub static COMMITTED_VOTES_IN_WINDOW: Lazy = Lazy::new(|| { /// This counter is set to the last round reported by the local round_state. pub static CURRENT_ROUND: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_current_round", + "aptos_consensus_current_round", "This counter is set to the last round reported by the local round_state." ) .unwrap() @@ -113,7 +113,7 @@ pub static CURRENT_ROUND: Lazy = Lazy::new(|| { /// Count of the rounds that gathered QC since last restart. pub static QC_ROUNDS_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_consensus_qc_rounds_count", + "aptos_consensus_qc_rounds_count", "Count of the rounds that gathered QC since last restart." ) .unwrap() @@ -122,7 +122,7 @@ pub static QC_ROUNDS_COUNT: Lazy = Lazy::new(|| { /// Count of the timeout rounds since last restart (close to 0 in happy path). pub static TIMEOUT_ROUNDS_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_consensus_timeout_rounds_count", + "aptos_consensus_timeout_rounds_count", "Count of the timeout rounds since last restart (close to 0 in happy path)." ) .unwrap() @@ -133,13 +133,13 @@ pub static TIMEOUT_ROUNDS_COUNT: Lazy = Lazy::new(|| { /// a timeout there is an ultimate decision to move to the next round (it might take multiple /// timeouts to get the timeout certificate). pub static TIMEOUT_COUNT: Lazy = Lazy::new(|| { - register_int_counter!("diem_consensus_timeout_count", "Count the number of timeouts a node experienced since last restart (close to 0 in happy path).").unwrap() + register_int_counter!("aptos_consensus_timeout_count", "Count the number of timeouts a node experienced since last restart (close to 0 in happy path).").unwrap() }); /// The timeout of the current round. pub static ROUND_TIMEOUT_MS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_round_timeout_s", + "aptos_consensus_round_timeout_s", "The timeout of the current round." ) .unwrap() @@ -151,7 +151,7 @@ pub static ROUND_TIMEOUT_MS: Lazy = Lazy::new(|| { /// Counts the number of times the sync info message has been set since last restart. pub static SYNC_INFO_MSGS_SENT_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_consensus_sync_info_msg_sent_count", + "aptos_consensus_sync_info_msg_sent_count", "Counts the number of times the sync info message has been set since last restart." ) .unwrap() @@ -162,12 +162,12 @@ pub static SYNC_INFO_MSGS_SENT_COUNT: Lazy = Lazy::new(|| { ////////////////////// /// Current epoch num pub static EPOCH: Lazy = - Lazy::new(|| register_int_gauge!("diem_consensus_epoch", "Current epoch num").unwrap()); + Lazy::new(|| register_int_gauge!("aptos_consensus_epoch", "Current epoch num").unwrap()); /// The number of validators in the current epoch pub static CURRENT_EPOCH_VALIDATORS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_current_epoch_validators", + "aptos_consensus_current_epoch_validators", "The number of validators in the current epoch" ) .unwrap() @@ -180,7 +180,7 @@ pub static CURRENT_EPOCH_VALIDATORS: Lazy = Lazy::new(|| { /// In a "happy path" with no collisions and timeouts, should be equal to 3 or 4. pub static NUM_BLOCKS_IN_TREE: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_num_blocks_in_tree", + "aptos_consensus_num_blocks_in_tree", "Counter for the number of blocks in the block tree (including the root)." ) .unwrap() @@ -192,7 +192,7 @@ pub static NUM_BLOCKS_IN_TREE: Lazy = Lazy::new(|| { // TODO Consider reintroducing this counter // pub static UNWRAPPED_PROPOSAL_SIZE_BYTES: Lazy = Lazy::new(|| { // register_histogram!( -// "diem_consensus_unwrapped_proposal_size_bytes", +// "aptos_consensus_unwrapped_proposal_size_bytes", // "Histogram of proposal size after BCS but before wrapping with GRPC and diem net." // ) // .unwrap() @@ -201,7 +201,7 @@ pub static NUM_BLOCKS_IN_TREE: Lazy = Lazy::new(|| { /// Histogram for the number of txns per (committed) blocks. pub static NUM_TXNS_PER_BLOCK: Lazy = Lazy::new(|| { register_histogram!( - "diem_consensus_num_txns_per_block", + "aptos_consensus_num_txns_per_block", "Histogram for the number of txns per (committed) blocks." ) .unwrap() @@ -209,7 +209,7 @@ pub static NUM_TXNS_PER_BLOCK: Lazy = Lazy::new(|| { pub static BLOCK_TRACING: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_consensus_block_tracing", + "aptos_consensus_block_tracing", "Histogram for different stages of a block", &["stage"] ) @@ -219,7 +219,7 @@ pub static BLOCK_TRACING: Lazy = Lazy::new(|| { /// Histogram of the time it requires to wait before inserting blocks into block store. /// Measured as the block's timestamp minus local timestamp. pub static WAIT_DURATION_S: Lazy = Lazy::new(|| { - DurationHistogram::new(register_histogram!("diem_consensus_wait_duration_s", "Histogram of the time it requires to wait before inserting blocks into block store. Measured as the block's timestamp minus the local timestamp.").unwrap()) + DurationHistogram::new(register_histogram!("aptos_consensus_wait_duration_s", "Histogram of the time it requires to wait before inserting blocks into block store. Measured as the block's timestamp minus the local timestamp.").unwrap()) }); /////////////////// @@ -228,7 +228,7 @@ pub static WAIT_DURATION_S: Lazy = Lazy::new(|| { /// Count of the pending messages sent to itself in the channel pub static PENDING_SELF_MESSAGES: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_pending_self_messages", + "aptos_consensus_pending_self_messages", "Count of the pending messages sent to itself in the channel" ) .unwrap() @@ -237,7 +237,7 @@ pub static PENDING_SELF_MESSAGES: Lazy = Lazy::new(|| { /// Count of the pending outbound round timeouts pub static PENDING_ROUND_TIMEOUTS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_pending_round_timeouts", + "aptos_consensus_pending_round_timeouts", "Count of the pending outbound round timeouts" ) .unwrap() @@ -246,7 +246,7 @@ pub static PENDING_ROUND_TIMEOUTS: Lazy = Lazy::new(|| { /// Counter of pending network events to Consensus pub static PENDING_CONSENSUS_NETWORK_EVENTS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_consensus_pending_network_events", + "aptos_consensus_pending_network_events", "Counters(queued,dequeued,dropped) related to pending network notifications to Consensus", &["state"] ) @@ -256,7 +256,7 @@ pub static PENDING_CONSENSUS_NETWORK_EVENTS: Lazy = Lazy::new(|| /// Count of the pending state sync notification. pub static PENDING_STATE_SYNC_NOTIFICATION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_consensus_pending_state_sync_notification", + "aptos_consensus_pending_state_sync_notification", "Count of the pending state sync notification" ) .unwrap() @@ -264,7 +264,7 @@ pub static PENDING_STATE_SYNC_NOTIFICATION: Lazy = Lazy::new(|| { pub static BUFFER_MANAGER_MSGS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_consensus_buffer_manager_msgs_count", + "aptos_consensus_buffer_manager_msgs_count", "Counters(queued,dequeued,dropped) related to pending commit votes", &["state"] ) @@ -274,7 +274,7 @@ pub static BUFFER_MANAGER_MSGS: Lazy = Lazy::new(|| { /// Counters(queued,dequeued,dropped) related to consensus channel pub static CONSENSUS_CHANNEL_MSGS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_consensus_channel_msgs_count", + "aptos_consensus_channel_msgs_count", "Counters(queued,dequeued,dropped) related to consensus channel", &["state"] ) @@ -284,7 +284,7 @@ pub static CONSENSUS_CHANNEL_MSGS: Lazy = Lazy::new(|| { /// Counters(queued,dequeued,dropped) related to consensus channel pub static ROUND_MANAGER_CHANNEL_MSGS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_consensus_round_manager_msgs_count", + "aptos_consensus_round_manager_msgs_count", "Counters(queued,dequeued,dropped) related to consensus channel", &["state"] ) @@ -294,7 +294,7 @@ pub static ROUND_MANAGER_CHANNEL_MSGS: Lazy = Lazy::new(|| { /// Counters(queued,dequeued,dropped) related to block retrieval channel pub static BLOCK_RETRIEVAL_CHANNEL_MSGS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_consensus_block_retrieval_channel_msgs_count", + "aptos_consensus_block_retrieval_channel_msgs_count", "Counters(queued,dequeued,dropped) related to block retrieval channel", &["state"] ) diff --git a/consensus/src/epoch_manager.rs b/consensus/src/epoch_manager.rs index 4c8ca7cc2d820..cc1195c13c2ae 100644 --- a/consensus/src/epoch_manager.rs +++ b/consensus/src/epoch_manager.rs @@ -184,8 +184,10 @@ impl EpochManager { )) } ConsensusProposerType::LeaderReputation(heuristic_config) => { - let backend = - Box::new(AptosDBBackend::new(proposers.len(), self.storage.diem_db())); + let backend = Box::new(AptosDBBackend::new( + proposers.len(), + self.storage.aptos_db(), + )); let heuristic = Box::new(ActiveInactiveHeuristic::new( self.author, heuristic_config.active_weights, @@ -222,7 +224,7 @@ impl EpochManager { ); let proof = self .storage - .diem_db() + .aptos_db() .get_epoch_ending_ledger_infos(request.start_epoch, request.end_epoch) .map_err(DbError::from) .context("[EpochManager] Failed to get epoch proof")?; diff --git a/consensus/src/liveness/leader_reputation.rs b/consensus/src/liveness/leader_reputation.rs index 029994b22275d..9a9e3c982e375 100644 --- a/consensus/src/liveness/leader_reputation.rs +++ b/consensus/src/liveness/leader_reputation.rs @@ -29,15 +29,15 @@ pub trait MetadataBackend: Send + Sync { pub struct AptosDBBackend { window_size: usize, - diem_db: Arc, + aptos_db: Arc, window: Mutex>, } impl AptosDBBackend { - pub fn new(window_size: usize, diem_db: Arc) -> Self { + pub fn new(window_size: usize, aptos_db: Arc) -> Self { Self { window_size, - diem_db, + aptos_db, window: Mutex::new(vec![]), } } @@ -45,7 +45,7 @@ impl AptosDBBackend { fn refresh_window(&self, target_round: Round) -> anyhow::Result<()> { // assumes target round is not too far from latest commit let buffer = 10; - let events = self.diem_db.get_events( + let events = self.aptos_db.get_events( &new_block_event_key(), u64::max_value(), Order::Descending, @@ -73,7 +73,7 @@ impl MetadataBackend for AptosDBBackend { .map(|(v, e)| (*v, e.round())) .unwrap_or((0, 0)); if !(known_round == target_round - || known_version == self.diem_db.get_latest_version().unwrap_or(0)) + || known_version == self.aptos_db.get_latest_version().unwrap_or(0)) { if let Err(e) = self.refresh_window(target_round) { error!( diff --git a/consensus/src/persistent_liveness_storage.rs b/consensus/src/persistent_liveness_storage.rs index b1196e4a5cfc5..a598046254c33 100644 --- a/consensus/src/persistent_liveness_storage.rs +++ b/consensus/src/persistent_liveness_storage.rs @@ -58,7 +58,7 @@ pub trait PersistentLivenessStorage: Send + Sync { fn retrieve_epoch_change_proof(&self, version: u64) -> Result; /// Returns a handle of the aptosdb. - fn diem_db(&self) -> Arc; + fn aptos_db(&self) -> Arc; } #[derive(Clone)] @@ -307,13 +307,13 @@ impl RecoveryData { /// The proxy we use to persist data in diem db storage service via grpc. pub struct StorageWriteProxy { db: Arc, - diem_db: Arc, + aptos_db: Arc, } impl StorageWriteProxy { - pub fn new(config: &NodeConfig, diem_db: Arc) -> Self { + pub fn new(config: &NodeConfig, aptos_db: Arc) -> Self { let db = Arc::new(ConsensusDB::new(config.storage.dir())); - StorageWriteProxy { db, diem_db } + StorageWriteProxy { db, aptos_db } } } @@ -338,7 +338,7 @@ impl PersistentLivenessStorage for StorageWriteProxy { fn recover_from_ledger(&self) -> LedgerRecoveryData { let startup_info = self - .diem_db + .aptos_db .get_startup_info() .expect("unable to read ledger info from storage") .expect("startup info is None"); @@ -407,7 +407,7 @@ impl PersistentLivenessStorage for StorageWriteProxy { // find the block corresponding to storage latest ledger info let startup_info = self - .diem_db + .aptos_db .get_startup_info() .expect("unable to read ledger info from storage") .expect("startup info is None"); @@ -418,7 +418,7 @@ impl PersistentLivenessStorage for StorageWriteProxy { .clone(); let root_executed_trees = startup_info .committed_tree_state - .into_ledger_view(&self.diem_db) + .into_ledger_view(&self.aptos_db) .expect("Failed to construct committed ledger view."); match RecoveryData::new( last_vote, @@ -484,14 +484,14 @@ impl PersistentLivenessStorage for StorageWriteProxy { fn retrieve_epoch_change_proof(&self, version: u64) -> Result { let (_, proofs, _) = self - .diem_db + .aptos_db .get_state_proof(version) .map_err(DbError::from)? .into_inner(); Ok(proofs) } - fn diem_db(&self) -> Arc { - self.diem_db.clone() + fn aptos_db(&self) -> Arc { + self.aptos_db.clone() } } diff --git a/consensus/src/test_utils/mock_storage.rs b/consensus/src/test_utils/mock_storage.rs index b46c457825046..7d309775a2276 100644 --- a/consensus/src/test_utils/mock_storage.rs +++ b/consensus/src/test_utils/mock_storage.rs @@ -244,7 +244,7 @@ impl PersistentLivenessStorage for MockStorage { Ok(EpochChangeProof::new(vec![lis], false)) } - fn diem_db(&self) -> Arc { + fn aptos_db(&self) -> Arc { unimplemented!() } } @@ -316,7 +316,7 @@ impl PersistentLivenessStorage for EmptyStorage { Ok(EpochChangeProof::new(vec![], false)) } - fn diem_db(&self) -> Arc { + fn aptos_db(&self) -> Arc { unimplemented!() } } diff --git a/crates/aptos-crypto/benches/ed25519.rs b/crates/aptos-crypto/benches/ed25519.rs index 6789ce00bd4fc..b9010b5f1b9e3 100644 --- a/crates/aptos-crypto/benches/ed25519.rs +++ b/crates/aptos-crypto/benches/ed25519.rs @@ -11,7 +11,7 @@ use rand::{prelude::ThreadRng, thread_rng}; use serde::{Deserialize, Serialize}; #[derive(Debug, CryptoHasher, BCSCryptoHash, Serialize, Deserialize)] -pub struct TestDiemCrypto(pub String); +pub struct TestAptosCrypto(pub String); use aptos_crypto::{ ed25519::{Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature}, @@ -22,7 +22,7 @@ fn verify(c: &mut Criterion) { let mut csprng: ThreadRng = thread_rng(); let priv_key = Ed25519PrivateKey::generate(&mut csprng); let pub_key: Ed25519PublicKey = (&priv_key).into(); - let msg = TestDiemCrypto("".to_string()); + let msg = TestAptosCrypto("".to_string()); let sig: Ed25519Signature = priv_key.sign(&msg); c.bench_function("Ed25519 signature verification", move |b| { diff --git a/crates/aptos-crypto/src/test_utils.rs b/crates/aptos-crypto/src/test_utils.rs index f03f9052af9cd..acb7540faf020 100644 --- a/crates/aptos-crypto/src/test_utils.rs +++ b/crates/aptos-crypto/src/test_utils.rs @@ -126,20 +126,20 @@ where /// BCS serialization and domain separation #[cfg(any(test, feature = "fuzzing"))] #[derive(Debug, Serialize, Deserialize)] -pub struct TestDiemCrypto(pub String); +pub struct TestAptosCrypto(pub String); // the following block is macro expanded from derive(CryptoHasher, BCSCryptoHash) /// Cryptographic hasher for an BCS-serializable #item #[cfg(any(test, feature = "fuzzing"))] -pub struct TestDiemCryptoHasher(crate::hash::DefaultHasher); +pub struct TestAptosCryptoHasher(crate::hash::DefaultHasher); #[cfg(any(test, feature = "fuzzing"))] -impl ::core::clone::Clone for TestDiemCryptoHasher { +impl ::core::clone::Clone for TestAptosCryptoHasher { #[inline] - fn clone(&self) -> TestDiemCryptoHasher { + fn clone(&self) -> TestAptosCryptoHasher { match *self { - TestDiemCryptoHasher(ref __self_0_0) => { - TestDiemCryptoHasher(::core::clone::Clone::clone(&(*__self_0_0))) + TestAptosCryptoHasher(ref __self_0_0) => { + TestAptosCryptoHasher(::core::clone::Clone::clone(&(*__self_0_0))) } } } @@ -148,27 +148,27 @@ impl ::core::clone::Clone for TestDiemCryptoHasher { static TEST_DIEM_CRYPTO_SEED: crate::_once_cell::sync::OnceCell<[u8; 32]> = crate::_once_cell::sync::OnceCell::new(); #[cfg(any(test, feature = "fuzzing"))] -impl TestDiemCryptoHasher { +impl TestAptosCryptoHasher { fn new() -> Self { - let name = crate::_serde_name::trace_name::() + let name = crate::_serde_name::trace_name::() .expect("The `CryptoHasher` macro only applies to structs and enums"); - TestDiemCryptoHasher(crate::hash::DefaultHasher::new(name.as_bytes())) + TestAptosCryptoHasher(crate::hash::DefaultHasher::new(name.as_bytes())) } } #[cfg(any(test, feature = "fuzzing"))] -static TEST_DIEM_CRYPTO_HASHER: crate::_once_cell::sync::Lazy = - crate::_once_cell::sync::Lazy::new(TestDiemCryptoHasher::new); +static TEST_DIEM_CRYPTO_HASHER: crate::_once_cell::sync::Lazy = + crate::_once_cell::sync::Lazy::new(TestAptosCryptoHasher::new); #[cfg(any(test, feature = "fuzzing"))] -impl std::default::Default for TestDiemCryptoHasher { +impl std::default::Default for TestAptosCryptoHasher { fn default() -> Self { TEST_DIEM_CRYPTO_HASHER.clone() } } #[cfg(any(test, feature = "fuzzing"))] -impl crate::hash::CryptoHasher for TestDiemCryptoHasher { +impl crate::hash::CryptoHasher for TestAptosCryptoHasher { fn seed() -> &'static [u8; 32] { TEST_DIEM_CRYPTO_SEED.get_or_init(|| { - let name = crate::_serde_name::trace_name::() + let name = crate::_serde_name::trace_name::() .expect("The `CryptoHasher` macro only applies to structs and enums.") .as_bytes(); crate::hash::DefaultHasher::prefixed_hash(name) @@ -182,7 +182,7 @@ impl crate::hash::CryptoHasher for TestDiemCryptoHasher { } } #[cfg(any(test, feature = "fuzzing"))] -impl std::io::Write for TestDiemCryptoHasher { +impl std::io::Write for TestAptosCryptoHasher { fn write(&mut self, bytes: &[u8]) -> std::io::Result { self.0.update(bytes); Ok(bytes.len()) @@ -192,19 +192,19 @@ impl std::io::Write for TestDiemCryptoHasher { } } #[cfg(any(test, feature = "fuzzing"))] -impl crate::hash::CryptoHash for TestDiemCrypto { - type Hasher = TestDiemCryptoHasher; +impl crate::hash::CryptoHash for TestAptosCrypto { + type Hasher = TestAptosCryptoHasher; fn hash(&self) -> crate::hash::HashValue { use crate::hash::CryptoHasher; let mut state = Self::Hasher::default(); bcs::serialize_into(&mut state, &self) - .expect("BCS serialization of TestDiemCrypto should not fail"); + .expect("BCS serialization of TestAptosCrypto should not fail"); state.finish() } } -/// Produces a random TestDiemCrypto signable / verifiable struct. +/// Produces a random TestAptosCrypto signable / verifiable struct. #[cfg(any(test, feature = "fuzzing"))] -pub fn random_serializable_struct() -> impl Strategy { - (String::arbitrary()).prop_map(TestDiemCrypto).no_shrink() +pub fn random_serializable_struct() -> impl Strategy { + (String::arbitrary()).prop_map(TestAptosCrypto).no_shrink() } diff --git a/crates/aptos-crypto/src/unit_tests/bcs_test.rs b/crates/aptos-crypto/src/unit_tests/bcs_test.rs index 2d22c38c8bcf2..16e69d4357f03 100644 --- a/crates/aptos-crypto/src/unit_tests/bcs_test.rs +++ b/crates/aptos-crypto/src/unit_tests/bcs_test.rs @@ -10,7 +10,7 @@ use crate::{ ED25519_PUBLIC_KEY_LENGTH, ED25519_SIGNATURE_LENGTH, }, multi_ed25519::{MultiEd25519PrivateKey, MultiEd25519PublicKey, MultiEd25519Signature}, - test_utils::{TestDiemCrypto, TEST_SEED}, + test_utils::{TestAptosCrypto, TEST_SEED}, Signature, SigningKey, Uniform, }; @@ -31,7 +31,7 @@ fn ed25519_bcs_material() { bcs::from_bytes(&serialized_public_key).unwrap(); assert_eq!(deserialized_public_key, public_key); - let message = TestDiemCrypto("Hello, World".to_string()); + let message = TestAptosCrypto("Hello, World".to_string()); let signature: Ed25519Signature = private_key.sign(&message); let serialized_signature = bcs::to_bytes(&Cow::Borrowed(&signature)).unwrap(); @@ -81,7 +81,7 @@ fn multi_ed25519_bcs_material() { bcs::from_bytes(&serialized_multi_public_key).unwrap(); assert_eq!(deserialized_multi_public_key, multi_public_key_7of10); - let message = TestDiemCrypto("Hello, World".to_string()); + let message = TestAptosCrypto("Hello, World".to_string()); // Verifying a 7-of-10 signature against a public key with the same threshold should pass. let multi_signature_7of10: MultiEd25519Signature = multi_private_key_7of10.sign(&message); diff --git a/crates/aptos-crypto/src/unit_tests/multi_ed25519_test.rs b/crates/aptos-crypto/src/unit_tests/multi_ed25519_test.rs index dbe174fd8e958..84a4512f0ca78 100644 --- a/crates/aptos-crypto/src/unit_tests/multi_ed25519_test.rs +++ b/crates/aptos-crypto/src/unit_tests/multi_ed25519_test.rs @@ -4,7 +4,7 @@ use crate::{ ed25519::{Ed25519PrivateKey, Ed25519PublicKey, ED25519_PUBLIC_KEY_LENGTH}, multi_ed25519::{MultiEd25519PrivateKey, MultiEd25519PublicKey}, - test_utils::{TestDiemCrypto, TEST_SEED}, + test_utils::{TestAptosCrypto, TEST_SEED}, traits::*, CryptoMaterialError::{ValidationError, WrongLengthError}, }; @@ -14,8 +14,8 @@ use core::convert::TryFrom; use once_cell::sync::Lazy; use rand::{rngs::StdRng, SeedableRng}; -static MESSAGE: Lazy = Lazy::new(|| TestDiemCrypto("Test Message".to_string())); -fn message() -> &'static TestDiemCrypto { +static MESSAGE: Lazy = Lazy::new(|| TestAptosCrypto("Test Message".to_string())); +fn message() -> &'static TestAptosCrypto { &MESSAGE } diff --git a/crates/aptos-infallible/src/rwlock.rs b/crates/aptos-infallible/src/rwlock.rs index b68e5a8bb3b98..11bc2c3cb7be4 100644 --- a/crates/aptos-infallible/src/rwlock.rs +++ b/crates/aptos-infallible/src/rwlock.rs @@ -45,7 +45,7 @@ mod tests { use std::{sync::Arc, thread}; #[test] - fn test_diem_rwlock() { + fn test_aptos_rwlock() { let a = 7u8; let rwlock = Arc::new(RwLock::new(a)); let rwlock2 = rwlock.clone(); diff --git a/crates/aptos-logger/src/counters.rs b/crates/aptos-logger/src/counters.rs index d9026f5e25429..1a60445c0b222 100644 --- a/crates/aptos-logger/src/counters.rs +++ b/crates/aptos-logger/src/counters.rs @@ -7,13 +7,13 @@ use prometheus::{register_int_counter, IntCounter}; /// Count of the struct logs submitted by macro pub static STRUCT_LOG_COUNT: Lazy = Lazy::new(|| { - register_int_counter!("diem_struct_log_count", "Count of the struct logs.").unwrap() + register_int_counter!("aptos_struct_log_count", "Count of the struct logs.").unwrap() }); /// Count of struct logs processed, but not necessarily sent pub static PROCESSED_STRUCT_LOG_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_struct_log_processed_count", + "aptos_struct_log_processed_count", "Count of the struct logs received by the sender." ) .unwrap() @@ -22,7 +22,7 @@ pub static PROCESSED_STRUCT_LOG_COUNT: Lazy = Lazy::new(|| { /// Count of struct logs submitted through TCP pub static SENT_STRUCT_LOG_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_struct_log_tcp_submit_count", + "aptos_struct_log_tcp_submit_count", "Count of the struct logs submitted by TCP." ) .unwrap() @@ -31,7 +31,7 @@ pub static SENT_STRUCT_LOG_COUNT: Lazy = Lazy::new(|| { /// Number of bytes of struct logs submitted through TCP pub static SENT_STRUCT_LOG_BYTES: Lazy = Lazy::new(|| { register_int_counter!( - "diem_struct_log_tcp_submit_bytes", + "aptos_struct_log_tcp_submit_bytes", "Number of bytes of the struct logs submitted by TCP." ) .unwrap() @@ -40,7 +40,7 @@ pub static SENT_STRUCT_LOG_BYTES: Lazy = Lazy::new(|| { /// Metric for when we connect the outbound TCP pub static STRUCT_LOG_TCP_CONNECT_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_struct_log_tcp_connect_count", + "aptos_struct_log_tcp_connect_count", "Count of the tcp connections made for struct logs." ) .unwrap() @@ -49,7 +49,7 @@ pub static STRUCT_LOG_TCP_CONNECT_COUNT: Lazy = Lazy::new(|| { /// Metric for when we fail to log during sending to the queue pub static STRUCT_LOG_QUEUE_ERROR_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_struct_log_queue_error_count", + "aptos_struct_log_queue_error_count", "Count of all errors during queuing struct logs." ) .unwrap() @@ -58,7 +58,7 @@ pub static STRUCT_LOG_QUEUE_ERROR_COUNT: Lazy = Lazy::new(|| { /// Metric for when we fail to log during sending pub static STRUCT_LOG_SEND_ERROR_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_struct_log_send_error_count", + "aptos_struct_log_send_error_count", "Count of all errors during sending struct logs." ) .unwrap() @@ -66,7 +66,7 @@ pub static STRUCT_LOG_SEND_ERROR_COUNT: Lazy = Lazy::new(|| { pub static STRUCT_LOG_CONNECT_ERROR_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_struct_log_connect_error_count", + "aptos_struct_log_connect_error_count", "Count of all errors during connecting for struct logs." ) .unwrap() @@ -74,7 +74,7 @@ pub static STRUCT_LOG_CONNECT_ERROR_COUNT: Lazy = Lazy::new(|| { pub static STRUCT_LOG_PARSE_ERROR_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_struct_log_parse_error_count", + "aptos_struct_log_parse_error_count", "Count of all parse errors during struct logs." ) .unwrap() diff --git a/crates/aptos-wallet/src/error.rs b/crates/aptos-wallet/src/error.rs index d51192e25c26f..db8d2d8977701 100644 --- a/crates/aptos-wallet/src/error.rs +++ b/crates/aptos-wallet/src/error.rs @@ -4,11 +4,11 @@ use thiserror::Error; /// Diem Wallet Error is a convenience enum for generating arbitrary WalletErrors. Currently, only -/// the DiemWalletGeneric error is being used, but there are plans to add more specific errors as +/// the AptosWalletGeneric error is being used, but there are plans to add more specific errors as /// the Diem Wallet matures #[derive(Debug, Error)] pub enum WalletError { /// generic error message #[error("{0}")] - DiemWalletGeneric(String), + AptosWalletGeneric(String), } diff --git a/crates/aptos-wallet/src/key_factory.rs b/crates/aptos-wallet/src/key_factory.rs index 499e9dcb47ea6..dd45e1de0d8d9 100644 --- a/crates/aptos-wallet/src/key_factory.rs +++ b/crates/aptos-wallet/src/key_factory.rs @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 //! The following is a minimalist version of a hierarchical key derivation library for the -//! DiemWallet. +//! AptosWallet. //! //! Note that the Diem Blockchain makes use of ed25519 Edwards Digital Signature Algorithm //! (EdDSA) and therefore, BIP32 Public Key derivation is not available without falling back to -//! a non-deterministic Schnorr signature scheme. As DiemWallet is meant to be a minimalist +//! a non-deterministic Schnorr signature scheme. As AptosWallet is meant to be a minimalist //! reference implementation of a simple wallet, the following does not deviate from the //! ed25519 spec. In a future iteration of this wallet, we will also provide an implementation //! of a Schnorr variant over curve25519 and demonstrate our proposal for BIP32-like public key @@ -85,7 +85,7 @@ pub struct ExtendedPrivKey { impl ExtendedPrivKey { /// Constructor for creating an ExtendedPrivKey from a ed25519 PrivateKey. Note that the - /// ChildNumber are not used in this iteration of DiemWallet, but in order to + /// ChildNumber are not used in this iteration of AptosWallet, but in order to /// enable more general Hierarchical KeyDerivation schemes, we include it for completeness. pub fn new(_child_number: ChildNumber, private_key: Ed25519PrivateKey) -> Self { Self { diff --git a/crates/aptos-wallet/src/mnemonic.rs b/crates/aptos-wallet/src/mnemonic.rs index 436e8e7e9189e..a029ea0f46098 100644 --- a/crates/aptos-wallet/src/mnemonic.rs +++ b/crates/aptos-wallet/src/mnemonic.rs @@ -53,7 +53,7 @@ impl Mnemonic { let words: Vec<_> = s.split(' ').collect(); let len = words.len(); if !(12..=24).contains(&len) || len % 3 != 0 { - return Err(WalletError::DiemWalletGeneric( + return Err(WalletError::AptosWalletGeneric( "Mnemonic must have a word count of the following lengths: 24, 21, 18, 15, 12" .to_string(), ) @@ -67,7 +67,7 @@ impl Mnemonic { mnemonic.push(WORDS[idx]); bit_writer.write_u11(idx as u16); } else { - return Err(WalletError::DiemWalletGeneric( + return Err(WalletError::AptosWalletGeneric( "Mnemonic contains an unknown word".to_string(), ) .into()); @@ -85,7 +85,7 @@ impl Mnemonic { // Checksum validation. if *checksum != computed_checksum { return Err( - WalletError::DiemWalletGeneric("Mnemonic checksum failed".to_string()).into(), + WalletError::AptosWalletGeneric("Mnemonic checksum failed".to_string()).into(), ); } Ok(Mnemonic(mnemonic)) @@ -95,7 +95,7 @@ impl Mnemonic { pub fn mnemonic(entropy: &[u8]) -> Result { let len = entropy.len(); if !(16..=32).contains(&len) || len % 4 != 0 { - return Err(WalletError::DiemWalletGeneric( + return Err(WalletError::AptosWalletGeneric( "Entropy data for mnemonic must have one of the following byte lengths: \ 32, 28, 24, 20, 16" .to_string(), @@ -123,7 +123,7 @@ impl Mnemonic { /// Write mnemonic to output_file_path. pub fn write(&self, output_file_path: &Path) -> Result<()> { if output_file_path.exists() && !output_file_path.is_file() { - return Err(WalletError::DiemWalletGeneric(format!( + return Err(WalletError::AptosWalletGeneric(format!( "Output file {:?} for mnemonic backup is reserved", output_file_path.to_str(), )) @@ -140,7 +140,7 @@ impl Mnemonic { let mnemonic_string: String = fs::read_to_string(input_file_path)?; return Self::from(&mnemonic_string[..]); } - Err(WalletError::DiemWalletGeneric( + Err(WalletError::AptosWalletGeneric( "Input file for mnemonic backup does not exist".to_string(), ) .into()) diff --git a/crates/aptos-wallet/src/wallet_library.rs b/crates/aptos-wallet/src/wallet_library.rs index 0fb3289a296ed..6fbab5452ebb9 100644 --- a/crates/aptos-wallet/src/wallet_library.rs +++ b/crates/aptos-wallet/src/wallet_library.rs @@ -4,7 +4,7 @@ //! The following document is a minimalist version of Diem Wallet. Note that this Wallet does //! not promote security as the mnemonic is stored in unencrypted form. In future iterations, //! we will be releasing more robust Wallet implementations. It is our intention to present a -//! foundation that is simple to understand and incrementally improve the DiemWallet +//! foundation that is simple to understand and incrementally improve the AptosWallet //! implementation and it's security guarantees throughout testnet. For a more robust wallet //! reference, the authors suggest to audit the file of the same name in the rust-wallet crate. //! That file can be found here: @@ -87,7 +87,7 @@ impl WalletLibrary { pub fn generate_addresses(&mut self, depth: u64) -> Result<()> { let current = self.key_leaf.0; if current > depth { - return Err(WalletError::DiemWalletGeneric( + return Err(WalletError::AptosWalletGeneric( "Addresses already generated up to the supplied depth".to_string(), ) .into()); @@ -121,7 +121,7 @@ impl WalletLibrary { { Ok((authentication_key, old_key_leaf)) } else { - Err(WalletError::DiemWalletGeneric( + Err(WalletError::AptosWalletGeneric( "This address is already in your wallet".to_string(), ) .into()) @@ -143,7 +143,7 @@ impl WalletLibrary { ret.push(*account_address); } None => { - return Err(WalletError::DiemWalletGeneric(format!( + return Err(WalletError::AptosWalletGeneric(format!( "Child num {} not exist while depth is {}", i, self.addr_map.len() @@ -168,7 +168,7 @@ impl WalletLibrary { signature, )) } else { - Err(WalletError::DiemWalletGeneric( + Err(WalletError::AptosWalletGeneric( "Well, that address is nowhere to be found... This is awkward".to_string(), ) .into()) @@ -180,7 +180,7 @@ impl WalletLibrary { if let Some(child) = self.addr_map.get(address) { Ok(self.key_factory.private_child(*child)?.get_private_key()) } else { - Err(WalletError::DiemWalletGeneric("missing address".to_string()).into()) + Err(WalletError::AptosWalletGeneric("missing address".to_string()).into()) } } @@ -192,7 +192,7 @@ impl WalletLibrary { .private_child(*child)? .get_authentication_key()) } else { - Err(WalletError::DiemWalletGeneric("missing address".to_string()).into()) + Err(WalletError::AptosWalletGeneric("missing address".to_string()).into()) } } } diff --git a/execution/executor-benchmark/src/db_generator.rs b/execution/executor-benchmark/src/db_generator.rs index 1236947aeac39..9b57ef3380fd5 100644 --- a/execution/executor-benchmark/src/db_generator.rs +++ b/execution/executor-benchmark/src/db_generator.rs @@ -114,11 +114,11 @@ pub fn run( let db_size = DIEM_STORAGE_ROCKSDB_PROPERTIES .with_label_values(&[ JELLYFISH_MERKLE_NODE_CF_NAME, - "diem_rocksdb_live_sst_files_size_bytes", + "aptos_rocksdb_live_sst_files_size_bytes", ]) .get(); let data_size = DIEM_STORAGE_ROCKSDB_PROPERTIES - .with_label_values(&[JELLYFISH_MERKLE_NODE_CF_NAME, "diem_rocksdb_cf_size_bytes"]) + .with_label_values(&[JELLYFISH_MERKLE_NODE_CF_NAME, "aptos_rocksdb_cf_size_bytes"]) .get(); let reads = DIEM_JELLYFISH_STORAGE_READS.get(); let leaf_bytes = DIEM_JELLYFISH_LEAF_ENCODED_BYTES.get(); diff --git a/execution/executor-test-helpers/src/integration_test_impl.rs b/execution/executor-test-helpers/src/integration_test_impl.rs index 844b2416e3d3f..63d0bb1382252 100644 --- a/execution/executor-test-helpers/src/integration_test_impl.rs +++ b/execution/executor-test-helpers/src/integration_test_impl.rs @@ -39,7 +39,7 @@ pub fn test_execution_with_storage_impl() -> Arc { let path = aptos_temppath::TempPath::new(); path.create_as_dir().unwrap(); - let (diem_db, db, executor, waypoint) = create_db_and_executor(path.path(), &genesis_txn); + let (aptos_db, db, executor, waypoint) = create_db_and_executor(path.path(), &genesis_txn); let parent_block_id = executor.committed_block_id(); let signer = aptos_types::validator_signer::ValidatorSigner::new( @@ -506,7 +506,7 @@ pub fn test_execution_with_storage_impl() -> Arc { assert_eq!(account3_received_events_batch2.len(), 7); assert_eq!(account3_received_events_batch2[0].1.sequence_number(), 6); - diem_db + aptos_db } pub fn create_db_and_executor>( diff --git a/execution/executor/src/metrics.rs b/execution/executor/src/metrics.rs index 3c6fd5f84701b..566befe9b6759 100644 --- a/execution/executor/src/metrics.rs +++ b/execution/executor/src/metrics.rs @@ -7,7 +7,7 @@ use once_cell::sync::Lazy; pub static DIEM_EXECUTOR_EXECUTE_CHUNK_SECONDS: Lazy = Lazy::new(|| { register_histogram!( // metric name - "diem_executor_execute_chunk_seconds", + "aptos_executor_execute_chunk_seconds", // metric description "The time spent in seconds of chunk execution in Diem executor" ) @@ -17,7 +17,7 @@ pub static DIEM_EXECUTOR_EXECUTE_CHUNK_SECONDS: Lazy = Lazy::new(|| { pub static DIEM_EXECUTOR_APPLY_CHUNK_SECONDS: Lazy = Lazy::new(|| { register_histogram!( // metric name - "diem_executor_apply_chunk_seconds", + "aptos_executor_apply_chunk_seconds", // metric description "The time spent in seconds of applying txn output chunk in Diem executor" ) @@ -27,7 +27,7 @@ pub static DIEM_EXECUTOR_APPLY_CHUNK_SECONDS: Lazy = Lazy::new(|| { pub static DIEM_EXECUTOR_COMMIT_CHUNK_SECONDS: Lazy = Lazy::new(|| { register_histogram!( // metric name - "diem_executor_commit_chunk_seconds", + "aptos_executor_commit_chunk_seconds", // metric description "The time spent in seconds of committing chunk in Diem executor" ) @@ -37,7 +37,7 @@ pub static DIEM_EXECUTOR_COMMIT_CHUNK_SECONDS: Lazy = Lazy::new(|| { pub static DIEM_EXECUTOR_VM_EXECUTE_BLOCK_SECONDS: Lazy = Lazy::new(|| { register_histogram!( // metric name - "diem_executor_vm_execute_block_seconds", + "aptos_executor_vm_execute_block_seconds", // metric description "The time spent in seconds of vm block execution in Diem executor" ) @@ -45,13 +45,13 @@ pub static DIEM_EXECUTOR_VM_EXECUTE_BLOCK_SECONDS: Lazy = Lazy::new(| }); pub static DIEM_EXECUTOR_ERRORS: Lazy = Lazy::new(|| { - register_int_counter!("diem_executor_error_total", "Cumulative number of errors").unwrap() + register_int_counter!("aptos_executor_error_total", "Cumulative number of errors").unwrap() }); pub static DIEM_EXECUTOR_EXECUTE_BLOCK_SECONDS: Lazy = Lazy::new(|| { register_histogram!( // metric name - "diem_executor_execute_block_seconds", + "aptos_executor_execute_block_seconds", // metric description "The total time spent in seconds of block execution in the block executor." ) @@ -61,7 +61,7 @@ pub static DIEM_EXECUTOR_EXECUTE_BLOCK_SECONDS: Lazy = Lazy::new(|| { pub static DIEM_EXECUTOR_VM_EXECUTE_CHUNK_SECONDS: Lazy = Lazy::new(|| { register_histogram!( // metric name - "diem_executor_vm_execute_chunk_seconds", + "aptos_executor_vm_execute_chunk_seconds", // metric description "The total time spent in seconds of chunk execution in the chunk executor." ) @@ -71,7 +71,7 @@ pub static DIEM_EXECUTOR_VM_EXECUTE_CHUNK_SECONDS: Lazy = Lazy::new(| pub static DIEM_EXECUTOR_COMMIT_BLOCKS_SECONDS: Lazy = Lazy::new(|| { register_histogram!( // metric name - "diem_executor_commit_blocks_seconds", + "aptos_executor_commit_blocks_seconds", // metric description "The total time spent in seconds of commiting blocks in Diem executor " ) @@ -81,7 +81,7 @@ pub static DIEM_EXECUTOR_COMMIT_BLOCKS_SECONDS: Lazy = Lazy::new(|| { pub static DIEM_EXECUTOR_SAVE_TRANSACTIONS_SECONDS: Lazy = Lazy::new(|| { register_histogram!( // metric name - "diem_executor_save_transactions_seconds", + "aptos_executor_save_transactions_seconds", // metric description "The time spent in seconds of calling save_transactions to storage in Diem executor" ) @@ -91,7 +91,7 @@ pub static DIEM_EXECUTOR_SAVE_TRANSACTIONS_SECONDS: Lazy = Lazy::new( pub static DIEM_EXECUTOR_TRANSACTIONS_SAVED: Lazy = Lazy::new(|| { register_histogram!( // metric name - "diem_executor_transactions_saved", + "aptos_executor_transactions_saved", // metric description "The number of transactions saved to storage in Diem executor" ) diff --git a/mempool/src/counters.rs b/mempool/src/counters.rs index 27b3d4f1b597d..91dbf9af5640c 100644 --- a/mempool/src/counters.rs +++ b/mempool/src/counters.rs @@ -79,7 +79,7 @@ pub const UNKNOWN_PEER: &str = "unknown_peer"; /// Counter tracking size of various indices in core mempool static CORE_MEMPOOL_INDEX_SIZE: Lazy = Lazy::new(|| { register_int_gauge_vec!( - "diem_core_mempool_index_size", + "aptos_core_mempool_index_size", "Size of a core mempool index", &["index"] ) @@ -95,7 +95,7 @@ pub fn core_mempool_index_size(label: &'static str, size: usize) { /// Counter tracking number of txns removed from core mempool pub static CORE_MEMPOOL_REMOVED_TXNS: Lazy = Lazy::new(|| { register_int_counter!( - "diem_core_mempool_removed_txns_count", + "aptos_core_mempool_removed_txns_count", "Number of txns removed from core mempool" ) .unwrap() @@ -105,7 +105,7 @@ pub static CORE_MEMPOOL_REMOVED_TXNS: Lazy = Lazy::new(|| { /// (e.g. time from txn entering core mempool to being pulled in consensus block) pub static CORE_MEMPOOL_TXN_COMMIT_LATENCY: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_core_mempool_txn_commit_latency", + "aptos_core_mempool_txn_commit_latency", "Latency of txn reaching various stages in core mempool after insertion", &["stage"] ) @@ -116,7 +116,7 @@ pub static CORE_MEMPOOL_TXN_COMMIT_LATENCY: Lazy = Lazy::new(|| { /// how many txns were actually cleaned up in this GC event pub static CORE_MEMPOOL_GC_EVENT_COUNT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_core_mempool_gc_event_count", + "aptos_core_mempool_gc_event_count", "Number of times the periodic garbage-collection event occurs, regardless of how many txns were actually removed", &["type"]) .unwrap() @@ -125,7 +125,7 @@ pub static CORE_MEMPOOL_GC_EVENT_COUNT: Lazy = Lazy::new(|| { /// Counter tracking time for how long a transaction stayed in core-mempool before being garbage-collected pub static CORE_MEMPOOL_GC_LATENCY: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_core_mempool_gc_latency", + "aptos_core_mempool_gc_latency", "How long a transaction stayed in core mempool before garbage-collected", &["type", "status"] ) diff --git a/network/README.md b/network/README.md index f5ad371d0d454..8387fc2ae7dd7 100644 --- a/network/README.md +++ b/network/README.md @@ -61,7 +61,7 @@ partial membership views, sophisticated failure detectors, or network overlays. +----------------------+--------------------+ +---------------------+ | Peer(s) | | +----------------------+ | - | DiemTransport | + | AptosTransport | +-------------------------------------------+ ``` @@ -84,7 +84,7 @@ components of new or closed connections. Optionally can be connected to writes [`NetworkMessage`]es from/to the wire. Currently, it implements the two protocols: DirectSend and Rpc. -+ [`DiemTransport`] — A secure, reliable transport. It uses [NoiseIK] over ++ [`AptosTransport`] — A secure, reliable transport. It uses [NoiseIK] over TCP to negotiate an encrypted and authenticated connection between peers. The AptosNet version and any Diem-specific application protocols are negotiated afterward using the [AptosNet Handshake Protocol]. @@ -132,7 +132,7 @@ configurable static timeout. [`ConnectivityManager`]: ./src/connectivity_manager/mod.rs [AptosNet Handshake Protocol]: ../specifications/network/handshake-v1.md [`DiemSystem::validators`]: ../aptos-move/diem-framework/core/doc/DiemSystem.md#struct-diemsystem -[`DiemTransport`]: ./src/transport/mod.rs +[`AptosTransport`]: ./src/transport/mod.rs [`HealthChecker`]: ./src/protocols/health_checker/mod.rs [`Network Interface`]: ./src/protocols/network/mod.rs [`NetworkMessage`]: ./src/protocols/wire/messaging/v1/mod.rs diff --git a/network/discovery/src/counters.rs b/network/discovery/src/counters.rs index b51a62618db58..fa593fd5b6824 100644 --- a/network/discovery/src/counters.rs +++ b/network/discovery/src/counters.rs @@ -29,7 +29,7 @@ pub static DISCOVERY_COUNTS: Lazy = Lazy::new(|| { pub static NETWORK_KEY_MISMATCH: Lazy = Lazy::new(|| { register_int_gauge_vec!( - "diem_network_key_mismatch", + "aptos_network_key_mismatch", "Gauge of whether the network key mismatches onchain state", &["role_type", "network_id", "peer_id"] ) diff --git a/network/src/counters.rs b/network/src/counters.rs index 5f9c9014a8899..fe9d24a8b5857 100644 --- a/network/src/counters.rs +++ b/network/src/counters.rs @@ -65,7 +65,7 @@ pub fn connections_rejected( pub static DIEM_NETWORK_PEER_CONNECTED: Lazy = Lazy::new(|| { register_int_gauge_vec!( - "diem_network_peer_connected", + "aptos_network_peer_connected", "Indicates if we are connected to a particular peer", &["role_type", "network_id", "peer_id", "remote_peer_id"] ) @@ -104,7 +104,7 @@ pub fn inc_by_with_context( pub static DIEM_NETWORK_PENDING_CONNECTION_UPGRADES: Lazy = Lazy::new(|| { register_int_gauge_vec!( - "diem_network_pending_connection_upgrades", + "aptos_network_pending_connection_upgrades", "Number of concurrent inbound or outbound connections we're currently negotiating", &["role_type", "network_id", "peer_id", "direction"] ) @@ -125,7 +125,7 @@ pub fn pending_connection_upgrades( pub static DIEM_NETWORK_CONNECTION_UPGRADE_TIME: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_network_connection_upgrade_time_seconds", + "aptos_network_connection_upgrade_time_seconds", "Time to complete a new inbound or outbound connection upgrade", &["role_type", "network_id", "peer_id", "direction", "state"] ) @@ -148,7 +148,7 @@ pub fn connection_upgrade_time( pub static DIEM_NETWORK_DISCOVERY_NOTES: Lazy = Lazy::new(|| { register_int_gauge_vec!( - "diem_network_discovery_notes", + "aptos_network_discovery_notes", "Diem network discovery notes", &["role_type"] ) @@ -157,7 +157,7 @@ pub static DIEM_NETWORK_DISCOVERY_NOTES: Lazy = Lazy::new(|| { pub static DIEM_NETWORK_RPC_MESSAGES: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_rpc_messages", + "aptos_network_rpc_messages", "Number of RPC messages", &["role_type", "network_id", "peer_id", "type", "state"] ) @@ -180,7 +180,7 @@ pub fn rpc_messages( pub static DIEM_NETWORK_RPC_BYTES: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_rpc_bytes", + "aptos_network_rpc_bytes", "Number of RPC bytes transferred", &["role_type", "network_id", "peer_id", "type", "state"] ) @@ -203,7 +203,7 @@ pub fn rpc_bytes( pub static INVALID_NETWORK_MESSAGES: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_invalid_messages", + "aptos_network_invalid_messages", "Number of invalid messages (RPC/direct_send)", &["role_type", "network_id", "peer_id", "type"] ) @@ -212,7 +212,7 @@ pub static INVALID_NETWORK_MESSAGES: Lazy = Lazy::new(|| { pub static PEER_SEND_FAILURES: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_peer_send_failures", + "aptos_network_peer_send_failures", "Number of messages failed to send to peer", &["role_type", "network_id", "peer_id", "protocol_id"] ) @@ -221,7 +221,7 @@ pub static PEER_SEND_FAILURES: Lazy = Lazy::new(|| { pub static DIEM_NETWORK_OUTBOUND_RPC_REQUEST_LATENCY: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_network_outbound_rpc_request_latency_seconds", + "aptos_network_outbound_rpc_request_latency_seconds", "Outbound RPC request latency in seconds", &["role_type", "network_id", "peer_id", "protocol_id"] ) @@ -242,7 +242,7 @@ pub fn outbound_rpc_request_latency( pub static DIEM_NETWORK_INBOUND_RPC_HANDLER_LATENCY: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_network_inbound_rpc_handler_latency_seconds", + "aptos_network_inbound_rpc_handler_latency_seconds", "Inbound RPC request application handler latency in seconds", &["role_type", "network_id", "peer_id", "protocol_id"] ) @@ -263,7 +263,7 @@ pub fn inbound_rpc_handler_latency( pub static DIEM_NETWORK_DIRECT_SEND_MESSAGES: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_direct_send_messages", + "aptos_network_direct_send_messages", "Number of direct send messages", &["role_type", "network_id", "peer_id", "state"] ) @@ -284,7 +284,7 @@ pub fn direct_send_messages( pub static DIEM_NETWORK_DIRECT_SEND_BYTES: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_direct_send_bytes", + "aptos_network_direct_send_bytes", "Number of direct send bytes transferred", &["role_type", "network_id", "peer_id", "state"] ) @@ -307,7 +307,7 @@ pub fn direct_send_bytes( /// DirectSends. pub static PENDING_NETWORK_NOTIFICATIONS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_pending_network_notifications", + "aptos_network_pending_network_notifications", "Number of pending inbound network notifications by state", &["state"] ) @@ -317,7 +317,7 @@ pub static PENDING_NETWORK_NOTIFICATIONS: Lazy = Lazy::new(|| { /// Counter of pending requests in Network Provider pub static PENDING_NETWORK_REQUESTS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_pending_requests", + "aptos_network_pending_requests", "Number of pending outbound network requests by state", &["state"] ) @@ -327,7 +327,7 @@ pub static PENDING_NETWORK_REQUESTS: Lazy = Lazy::new(|| { /// Counter of pending network events to Health Checker. pub static PENDING_HEALTH_CHECKER_NETWORK_EVENTS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_pending_health_check_events", + "aptos_network_pending_health_check_events", "Number of pending health check events by state", &["state"] ) @@ -337,7 +337,7 @@ pub static PENDING_HEALTH_CHECKER_NETWORK_EVENTS: Lazy = Lazy::ne /// Counter of pending network events to Discovery. pub static PENDING_DISCOVERY_NETWORK_EVENTS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_pending_discovery_events", + "aptos_network_pending_discovery_events", "Number of pending discovery events by state", &["state"] ) @@ -347,7 +347,7 @@ pub static PENDING_DISCOVERY_NETWORK_EVENTS: Lazy = Lazy::new(|| /// Counter of pending requests in Peer Manager pub static PENDING_PEER_MANAGER_REQUESTS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_network_pending_peer_manager_requests", + "aptos_network_pending_peer_manager_requests", "Number of pending peer manager requests by state", &["state"] ) @@ -361,7 +361,7 @@ pub static PENDING_PEER_MANAGER_REQUESTS: Lazy = Lazy::new(|| { /// Counter of pending requests in Connectivity Manager pub static PENDING_CONNECTIVITY_MANAGER_REQUESTS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_connectivity_manager_requests", + "aptos_network_pending_connectivity_manager_requests", "Number of pending connectivity manager requests" ) .unwrap() @@ -370,7 +370,7 @@ pub static PENDING_CONNECTIVITY_MANAGER_REQUESTS: Lazy = Lazy::new(|| /// Counter of pending Connection Handler notifications to PeerManager. pub static PENDING_CONNECTION_HANDLER_NOTIFICATIONS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_connection_handler_notifications", + "aptos_network_pending_connection_handler_notifications", "Number of pending connection handler notifications" ) .unwrap() @@ -379,7 +379,7 @@ pub static PENDING_CONNECTION_HANDLER_NOTIFICATIONS: Lazy = Lazy::new( /// Counter of pending dial requests in Peer Manager pub static PENDING_PEER_MANAGER_DIAL_REQUESTS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_peer_manager_dial_requests", + "aptos_network_pending_peer_manager_dial_requests", "Number of pending peer manager dial requests" ) .unwrap() @@ -388,7 +388,7 @@ pub static PENDING_PEER_MANAGER_DIAL_REQUESTS: Lazy = Lazy::new(|| { /// Counter of messages pending in queue to be sent out on the wire. pub static PENDING_WIRE_MESSAGES: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_wire_messages", + "aptos_network_pending_wire_messages", "Number of pending wire messages" ) .unwrap() @@ -397,7 +397,7 @@ pub static PENDING_WIRE_MESSAGES: Lazy = Lazy::new(|| { /// Counter of pending requests in Direct Send pub static PENDING_DIRECT_SEND_REQUESTS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_direct_send_requests", + "aptos_network_pending_direct_send_requests", "Number of pending direct send requests" ) .unwrap() @@ -406,7 +406,7 @@ pub static PENDING_DIRECT_SEND_REQUESTS: Lazy = Lazy::new(|| { /// Counter of pending Direct Send notifications to Network Provider pub static PENDING_DIRECT_SEND_NOTIFICATIONS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_direct_send_notifications", + "aptos_network_pending_direct_send_notifications", "Number of pending direct send notifications" ) .unwrap() @@ -415,7 +415,7 @@ pub static PENDING_DIRECT_SEND_NOTIFICATIONS: Lazy = Lazy::new(|| { /// Counter of pending requests in RPC pub static PENDING_RPC_REQUESTS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_rpc_requests", + "aptos_network_pending_rpc_requests", "Number of pending rpc requests" ) .unwrap() @@ -424,7 +424,7 @@ pub static PENDING_RPC_REQUESTS: Lazy = Lazy::new(|| { /// Counter of pending RPC notifications to Network Provider pub static PENDING_RPC_NOTIFICATIONS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_rpc_notifications", + "aptos_network_pending_rpc_notifications", "Number of pending rpc notifications" ) .unwrap() @@ -433,7 +433,7 @@ pub static PENDING_RPC_NOTIFICATIONS: Lazy = Lazy::new(|| { /// Counter of pending requests for each remote peer pub static PENDING_PEER_REQUESTS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_peer_requests", + "aptos_network_pending_peer_requests", "Number of pending peer requests" ) .unwrap() @@ -442,7 +442,7 @@ pub static PENDING_PEER_REQUESTS: Lazy = Lazy::new(|| { /// Counter of pending RPC events from Peer to Rpc actor. pub static PENDING_PEER_RPC_NOTIFICATIONS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_peer_rpc_notifications", + "aptos_network_pending_peer_rpc_notifications", "Number of pending peer rpc notifications" ) .unwrap() @@ -451,7 +451,7 @@ pub static PENDING_PEER_RPC_NOTIFICATIONS: Lazy = Lazy::new(|| { /// Counter of pending DirectSend events from Peer to DirectSend actor.. pub static PENDING_PEER_DIRECT_SEND_NOTIFICATIONS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_peer_direct_send_notifications", + "aptos_network_pending_peer_direct_send_notifications", "Number of pending peer direct send notifications" ) .unwrap() @@ -460,7 +460,7 @@ pub static PENDING_PEER_DIRECT_SEND_NOTIFICATIONS: Lazy = Lazy::new(|| /// Counter of pending connection notifications from Peer to NetworkProvider. pub static PENDING_PEER_NETWORK_NOTIFICATIONS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_network_pending_peer_network_notifications", + "aptos_network_pending_peer_network_notifications", "Number of pending peer network notifications" ) .unwrap() @@ -468,7 +468,7 @@ pub static PENDING_PEER_NETWORK_NOTIFICATIONS: Lazy = Lazy::new(|| { pub static NETWORK_RATE_LIMIT_METRICS: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_network_rate_limit", + "aptos_network_rate_limit", "Network Rate Limiting Metrics", &["direction", "metric"] ) diff --git a/network/src/peer_manager/builder.rs b/network/src/peer_manager/builder.rs index 0732e1c5b1107..52e17e9e53fd9 100644 --- a/network/src/peer_manager/builder.rs +++ b/network/src/peer_manager/builder.rs @@ -11,7 +11,7 @@ use crate::{ PeerManagerNotification, PeerManagerRequest, PeerManagerRequestSender, }, protocols::{network::AppConfig, wire::handshake::v1::ProtocolIdSet}, - transport::{self, Connection, AptosNetTransport, DIEM_TCP_TRANSPORT}, + transport::{self, AptosNetTransport, Connection, DIEM_TCP_TRANSPORT}, ProtocolId, }; use aptos_config::{ diff --git a/sdk/src/transaction_builder.rs b/sdk/src/transaction_builder.rs index 013285d91aa93..8f6d7bbf213a1 100644 --- a/sdk/src/transaction_builder.rs +++ b/sdk/src/transaction_builder.rs @@ -465,10 +465,9 @@ impl TransactionFactory { sliding_nonce: u64, config: Vec, ) -> TransactionBuilder { - self.payload(stdlib::encode_update_diem_consensus_config_script_function( - sliding_nonce, - config, - )) + self.payload( + stdlib::encode_update_diem_consensus_config_script_function(sliding_nonce, config), + ) } pub fn update_diem_version(&self, sliding_nonce: u64, major: u64) -> TransactionBuilder { diff --git a/secure/storage/src/tests/suite.rs b/secure/storage/src/tests/suite.rs index 4c56bc6c357f0..ea74419fda86d 100644 --- a/secure/storage/src/tests/suite.rs +++ b/secure/storage/src/tests/suite.rs @@ -4,7 +4,7 @@ use crate::{CryptoStorage, Error, KVStorage, Storage}; use aptos_crypto::{ - ed25519::Ed25519PrivateKey, test_utils::TestDiemCrypto, HashValue, PrivateKey, Signature, + ed25519::Ed25519PrivateKey, test_utils::TestAptosCrypto, HashValue, PrivateKey, Signature, Uniform, }; @@ -164,7 +164,7 @@ fn test_import_key(storage: &mut Storage) { // Verify valid keys - let message = TestDiemCrypto("Hello, World".to_string()); + let message = TestAptosCrypto("Hello, World".to_string()); let message_signature = storage.sign(imported_key_name, &message).unwrap(); message_signature .verify(&message, &imported_public_key) @@ -280,7 +280,7 @@ fn test_create_sign_rotate_sign(storage: &mut Storage) { let public_key = storage.create_key(CRYPTO_NAME).unwrap(); // Create then sign message and verify correct signature - let message = TestDiemCrypto("Hello, World".to_string()); + let message = TestAptosCrypto("Hello, World".to_string()); let message_signature = storage.sign(CRYPTO_NAME, &message).unwrap(); assert!(message_signature.verify(&message, &public_key).is_ok()); diff --git a/secure/storage/src/tests/vault.rs b/secure/storage/src/tests/vault.rs index 442d13519826a..17edd9ee4fedd 100644 --- a/secure/storage/src/tests/vault.rs +++ b/secure/storage/src/tests/vault.rs @@ -9,7 +9,7 @@ use crate::{ }, Capability, CryptoStorage, Error, Identity, KVStorage, Namespaced, Permission, Policy, Storage, }; -use aptos_crypto::{test_utils::TestDiemCrypto, Signature}; +use aptos_crypto::{test_utils::TestAptosCrypto, Signature}; use aptos_vault_client::dev::{self, ROOT_TOKEN}; /// VaultStorage namespace constants @@ -251,7 +251,7 @@ fn test_vault_crypto_policies() { pubkey ); - let message = TestDiemCrypto("Hello, World".to_string()); + let message = TestAptosCrypto("Hello, World".to_string()); // Verify exporter policy let exporter_token = storage.create_token(vec![EXPORTER]).unwrap(); diff --git a/specifications/README.md b/specifications/README.md index e51ae8d13b23e..10f1fac7f6675 100644 --- a/specifications/README.md +++ b/specifications/README.md @@ -36,7 +36,7 @@ Below is a recapixusating diagram of the Diem network. The arrow tail signifies ## The Diem network -![Diem network](images/diem_network.png) +![Diem network](images/aptos_network.png) While a validator has a public endpoint and a validator endpoint, in order to support additional features and properties, such as the principle of least privilege, key rotation, monitoring, DoS protection, scalability, etc., it can be composed of a number of internal components. Below is an example validator architecture that addresses many of these aspects. diff --git a/state-sync/aptos-data-client/src/aptosnet/mod.rs b/state-sync/aptos-data-client/src/aptosnet/mod.rs index 7d06ade148472..59dc812f05bf7 100644 --- a/state-sync/aptos-data-client/src/aptosnet/mod.rs +++ b/state-sync/aptos-data-client/src/aptosnet/mod.rs @@ -7,11 +7,11 @@ use crate::{ metrics::{increment_counter, start_timer}, state::{ErrorType, PeerStates}, }, - DiemDataClient, Error, GlobalDataSummary, Response, ResponseCallback, ResponseContext, + AptosDataClient, Error, GlobalDataSummary, Response, ResponseCallback, ResponseContext, ResponseError, ResponseId, Result, }; use aptos_config::{ - config::{DiemDataClientConfig, StorageServiceConfig}, + config::{AptosDataClientConfig, StorageServiceConfig}, network_id::PeerNetworkId, }; use aptos_id_generator::{IdGenerator, U64IdGenerator}; @@ -49,7 +49,7 @@ mod tests; const GLOBAL_DATA_LOG_FREQ_SECS: u64 = 5; const POLLER_ERROR_LOG_FREQ_SECS: u64 = 1; -/// A [`DiemDataClient`] that fulfills requests from remote peers' Storage Service +/// A [`AptosDataClient`] that fulfills requests from remote peers' Storage Service /// over AptosNet. /// /// The `AptosNetDataClient`: @@ -70,7 +70,7 @@ const POLLER_ERROR_LOG_FREQ_SECS: u64 = 1; #[derive(Clone, Debug)] pub struct AptosNetDataClient { /// Config for AptosNet data client. - data_client_config: DiemDataClientConfig, + data_client_config: AptosDataClientConfig, /// The underlying AptosNet storage service client. network_client: StorageServiceClient, /// All of the data-client specific data we have on each network peer. @@ -83,7 +83,7 @@ pub struct AptosNetDataClient { impl AptosNetDataClient { pub fn new( - data_client_config: DiemDataClientConfig, + data_client_config: AptosDataClientConfig, storage_service_config: StorageServiceConfig, time_service: TimeService, network_client: StorageServiceClient, @@ -313,7 +313,7 @@ impl AptosNetDataClient { } #[async_trait] -impl DiemDataClient for AptosNetDataClient { +impl AptosDataClient for AptosNetDataClient { fn get_global_data_summary(&self) -> GlobalDataSummary { self.global_summary_cache.read().clone() } diff --git a/state-sync/aptos-data-client/src/aptosnet/tests.rs b/state-sync/aptos-data-client/src/aptosnet/tests.rs index b00d8604cd53f..7610fcf2eabab 100644 --- a/state-sync/aptos-data-client/src/aptosnet/tests.rs +++ b/state-sync/aptos-data-client/src/aptosnet/tests.rs @@ -1,9 +1,9 @@ // Copyright (c) The Aptos Foundation // SPDX-License-Identifier: Apache-2.0 -use super::{DataSummaryPoller, DiemDataClient, AptosNetDataClient, Error}; +use super::{AptosDataClient, AptosNetDataClient, DataSummaryPoller, Error}; use aptos_config::{ - config::{DiemDataClientConfig, StorageServiceConfig}, + config::{AptosDataClientConfig, StorageServiceConfig}, network_id::{NetworkId, PeerNetworkId}, }; use aptos_crypto::HashValue; @@ -84,7 +84,7 @@ impl MockNetwork { let mock_time = TimeService::mock(); let (client, poller) = AptosNetDataClient::new( - DiemDataClientConfig::default(), + AptosDataClientConfig::default(), StorageServiceConfig::default(), mock_time.clone(), network_client, diff --git a/state-sync/aptos-data-client/src/lib.rs b/state-sync/aptos-data-client/src/lib.rs index dfe09213746d6..92e13f67bc7c8 100644 --- a/state-sync/aptos-data-client/src/lib.rs +++ b/state-sync/aptos-data-client/src/lib.rs @@ -63,7 +63,7 @@ impl From for Error { /// The API offered by the Diem Data Client. #[async_trait] -pub trait DiemDataClient { +pub trait AptosDataClient { /// Returns a global summary of the data currently available in the network. /// /// This API is intended to be relatively cheap to call, usually returning a diff --git a/state-sync/state-sync-v1/src/counters.rs b/state-sync/state-sync-v1/src/counters.rs index b77d3e16a4689..aa83f51ded209 100644 --- a/state-sync/state-sync-v1/src/counters.rs +++ b/state-sync/state-sync-v1/src/counters.rs @@ -94,7 +94,7 @@ pub const TIMEOUT_LABEL: &str = "timeout"; /// Counter of pending network events to State Sync pub static PENDING_STATE_SYNC_NETWORK_EVENTS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_pending_network_events", + "aptos_state_sync_pending_network_events", "Counters(queued,dequeued,dropped) related to pending network notifications for State Sync", &["state"] ) @@ -105,7 +105,7 @@ pub static PENDING_STATE_SYNC_NETWORK_EVENTS: Lazy = Lazy::new(|| pub static REQUESTS_SENT: Lazy = Lazy::new(|| { register_int_counter_vec!( // metric name - "diem_state_sync_requests_sent_total", + "aptos_state_sync_requests_sent_total", // metric description "Number of chunk requests sent", // metric labels @@ -117,7 +117,7 @@ pub static REQUESTS_SENT: Lazy = Lazy::new(|| { /// Number of chunk responses sent from a node (including FN subscriptions) pub static RESPONSES_SENT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_responses_sent_total", + "aptos_state_sync_responses_sent_total", "Number of chunk responses sent (including FN subscriptions)", &["network", "peer", "result"] ) @@ -126,7 +126,7 @@ pub static RESPONSES_SENT: Lazy = Lazy::new(|| { pub static RESPONSE_FROM_DOWNSTREAM_COUNT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_responses_from_downstream_total", + "aptos_state_sync_responses_from_downstream_total", "Number of chunk responses received from a downstream peer", &["network", "peer"] ) @@ -136,7 +136,7 @@ pub static RESPONSE_FROM_DOWNSTREAM_COUNT: Lazy = Lazy::new(|| { /// Number of attempts to apply a chunk pub static APPLY_CHUNK_COUNT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_apply_chunk_total", + "aptos_state_sync_apply_chunk_total", "Number of Success results of applying a chunk", &["network", "sender", "result"] ) @@ -145,7 +145,7 @@ pub static APPLY_CHUNK_COUNT: Lazy = Lazy::new(|| { pub static PROCESS_CHUNK_REQUEST_COUNT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_process_chunk_request_total", + "aptos_state_sync_process_chunk_request_total", "Number of times chunk request was processed", &["network", "sender", "result"] ) @@ -155,7 +155,7 @@ pub static PROCESS_CHUNK_REQUEST_COUNT: Lazy = Lazy::new(|| { /// Number of transactions in a received chunk response pub static STATE_SYNC_CHUNK_SIZE: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_state_sync_chunk_size", + "aptos_state_sync_chunk_size", "Number of transactions in a state sync chunk response", &["network", "sender"] ) @@ -166,7 +166,7 @@ pub static STATE_SYNC_CHUNK_SIZE: Lazy = Lazy::new(|| { /// They are the set of nodes a node can make sync requests to pub static ACTIVE_UPSTREAM_PEERS: Lazy = Lazy::new(|| { register_int_gauge_vec!( - "diem_state_sync_active_upstream_peers", + "aptos_state_sync_active_upstream_peers", "Number of upstream peers that are currently active", &["network"] ) @@ -179,7 +179,7 @@ pub static ACTIVE_UPSTREAM_PEERS: Lazy = Lazy::new(|| { /// and the node fails over to other networks pub static MULTICAST_LEVEL: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_state_sync_multicast_level", + "aptos_state_sync_multicast_level", "Max network preference of the networks state sync is sending chunk requests to" ) .unwrap() @@ -187,7 +187,7 @@ pub static MULTICAST_LEVEL: Lazy = Lazy::new(|| { pub static TIMESTAMP: Lazy = Lazy::new(|| { register_int_gauge_vec!( - "diem_state_sync_timestamp", + "aptos_state_sync_timestamp", "Timestamp involved in state sync progress", &["type"] // see TimestampType above ) @@ -196,7 +196,7 @@ pub static TIMESTAMP: Lazy = Lazy::new(|| { pub static VERSION: Lazy = Lazy::new(|| { register_int_gauge_vec!( - "diem_state_sync_version", + "aptos_state_sync_version", "Version involved in state sync progress", &["type"] // see version type labels above ) @@ -204,7 +204,7 @@ pub static VERSION: Lazy = Lazy::new(|| { }); pub static EPOCH: Lazy = Lazy::new(|| { - register_int_gauge!("diem_state_sync_epoch", "Current epoch in local state").unwrap() + register_int_gauge!("aptos_state_sync_epoch", "Current epoch in local state").unwrap() }); /// How long it takes to make progress, from requesting a chunk to processing the response and @@ -212,7 +212,7 @@ pub static EPOCH: Lazy = Lazy::new(|| { pub static SYNC_PROGRESS_DURATION: Lazy = Lazy::new(|| { DurationHistogram::new( register_histogram!( - "diem_state_sync_sync_progress_duration_s", + "aptos_state_sync_sync_progress_duration_s", "Histogram of time it takes to sync a chunk, from requesting a chunk to processing the response and committing the chunk" ) .unwrap() @@ -222,7 +222,7 @@ pub static SYNC_PROGRESS_DURATION: Lazy = Lazy::new(|| { /// Number of timeouts that occur during sync pub static TIMEOUT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_state_sync_timeout_total", + "aptos_state_sync_timeout_total", "Number of timeouts that occur during sync" ) .unwrap() @@ -231,7 +231,7 @@ pub static TIMEOUT: Lazy = Lazy::new(|| { /// Number of times sync request (from consensus) processed pub static SYNC_REQUEST_RESULT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_sync_request_total", + "aptos_state_sync_sync_request_total", "Number of sync requests (from consensus) processed", &["result"] ) @@ -241,7 +241,7 @@ pub static SYNC_REQUEST_RESULT: Lazy = Lazy::new(|| { /// Number of failures that occur during the commit flow across consensus, state sync, and mempool pub static COMMIT_FLOW_FAIL: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_commit_flow_fail_total", + "aptos_state_sync_commit_flow_fail_total", "Number of timeouts that occur during the commit flow across consensus, state sync, and mempool", &["component"] // component with which state sync timed out with: consensus, to_mempool, from_mempool ) @@ -250,7 +250,7 @@ pub static COMMIT_FLOW_FAIL: Lazy = Lazy::new(|| { pub static FAILED_CHANNEL_SEND: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_failed_channel_sends_total", + "aptos_state_sync_failed_channel_sends_total", "Number of times a channel send failed in state sync", &["type"] ) @@ -260,7 +260,7 @@ pub static FAILED_CHANNEL_SEND: Lazy = Lazy::new(|| { /// Time it takes for state sync to fully execute a chunk (via executor proxy) pub static EXECUTE_CHUNK_DURATION: Lazy = Lazy::new(|| { register_histogram!( - "diem_state_sync_execute_chunk_duration_s", + "aptos_state_sync_execute_chunk_duration_s", "Histogram of time it takes for state sync's executor proxy to fully execute a chunk" ) .unwrap() @@ -269,7 +269,7 @@ pub static EXECUTE_CHUNK_DURATION: Lazy = Lazy::new(|| { /// Number of times a long-poll subscription is successfully delivered pub static SUBSCRIPTION_DELIVERY_COUNT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_subscription_delivery_count", + "aptos_state_sync_subscription_delivery_count", "Number of times a node delivers a subscription for FN long-poll", &["network", "recipient", "result"] ) @@ -279,7 +279,7 @@ pub static SUBSCRIPTION_DELIVERY_COUNT: Lazy = Lazy::new(|| { /// Time it takes to process a coordinator msg from consensus pub static PROCESS_COORDINATOR_MSG_LATENCY: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_state_sync_coordinator_msg_latency", + "aptos_state_sync_coordinator_msg_latency", "Time it takes to process a message from consensus", &["type"] ) @@ -289,7 +289,7 @@ pub static PROCESS_COORDINATOR_MSG_LATENCY: Lazy = Lazy::new(|| { /// Time it takes to process a state sync message from AptosNet pub static PROCESS_MSG_LATENCY: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_state_sync_process_msg_latency", + "aptos_state_sync_process_msg_latency", "Time it takes to process a message in state sync", &["network", "sender", "type"] ) @@ -298,7 +298,7 @@ pub static PROCESS_MSG_LATENCY: Lazy = Lazy::new(|| { pub static CONSENSUS_COMMIT_FAIL_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_state_sync_consensus_commit_fail", + "aptos_state_sync_consensus_commit_fail", "Number of times a commit msg from consensus failed to be processed" ) .unwrap() @@ -306,7 +306,7 @@ pub static CONSENSUS_COMMIT_FAIL_COUNT: Lazy = Lazy::new(|| { pub static RECONFIG_PUBLISH_COUNT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_state_sync_reconfig_count", + "aptos_state_sync_reconfig_count", "Number of times on-chain reconfig notification is published in state sync", &["result"] ) @@ -315,7 +315,7 @@ pub static RECONFIG_PUBLISH_COUNT: Lazy = Lazy::new(|| { pub static STORAGE_READ_FAIL_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_state_sync_storage_read_fail_count", + "aptos_state_sync_storage_read_fail_count", "Number of times storage read failed in state sync" ) .unwrap() @@ -323,7 +323,7 @@ pub static STORAGE_READ_FAIL_COUNT: Lazy = Lazy::new(|| { pub static NETWORK_ERROR_COUNT: Lazy = Lazy::new(|| { register_int_counter!( - "diem_state_sync_network_error_count", + "aptos_state_sync_network_error_count", "Number of network errors encountered in state sync" ) .unwrap() @@ -333,7 +333,7 @@ pub static NETWORK_ERROR_COUNT: Lazy = Lazy::new(|| { pub static MAIN_LOOP: Lazy = Lazy::new(|| { DurationHistogram::new( register_histogram!( - "diem_state_sync_main_loop", + "aptos_state_sync_main_loop", "Duration of the each run of the event loop" ) .unwrap(), diff --git a/state-sync/state-sync-v2/data-streaming-service/src/data_stream.rs b/state-sync/state-sync-v2/data-streaming-service/src/data_stream.rs index 7cc55f51942ba..123911e23a8b6 100644 --- a/state-sync/state-sync-v2/data-streaming-service/src/data_stream.rs +++ b/state-sync/state-sync-v2/data-streaming-service/src/data_stream.rs @@ -17,7 +17,7 @@ use crate::{ }; use aptos_config::config::DataStreamingServiceConfig; use aptos_data_client::{ - AdvertisedData, DiemDataClient, GlobalDataSummary, Response, ResponseContext, ResponseError, + AdvertisedData, AptosDataClient, GlobalDataSummary, Response, ResponseContext, ResponseError, ResponsePayload, }; use aptos_id_generator::{IdGenerator, U64IdGenerator}; @@ -88,7 +88,7 @@ pub struct DataStream { request_failure_count: u64, } -impl DataStream { +impl DataStream { pub fn new( config: DataStreamingServiceConfig, data_stream_id: DataStreamId, @@ -648,7 +648,7 @@ fn extract_response_error(notification_feedback: &NotificationFeedback) -> Respo } } -fn spawn_request_task( +fn spawn_request_task( data_client_request: DataClientRequest, aptos_data_client: T, pending_response: PendingClientResponse, @@ -704,7 +704,7 @@ fn spawn_request_task( }) } -async fn get_account_states_with_proof( +async fn get_account_states_with_proof( aptos_data_client: T, request: AccountsWithProofRequest, ) -> Result, aptos_data_client::Error> { @@ -718,7 +718,7 @@ async fn get_account_states_with_proof( +async fn get_epoch_ending_ledger_infos( aptos_data_client: T, request: EpochEndingLedgerInfosRequest, ) -> Result, aptos_data_client::Error> { @@ -729,7 +729,7 @@ async fn get_epoch_ending_ledger_infos( +async fn get_number_of_account_states( aptos_data_client: T, request: NumberOfAccountsRequest, ) -> Result, aptos_data_client::Error> { @@ -739,7 +739,7 @@ async fn get_number_of_account_states( +async fn get_transaction_outputs_with_proof( aptos_data_client: T, request: TransactionOutputsWithProofRequest, ) -> Result, aptos_data_client::Error> { @@ -753,7 +753,7 @@ async fn get_transaction_outputs_with_proof( +async fn get_transactions_with_proof( aptos_data_client: T, request: TransactionsWithProofRequest, ) -> Result, aptos_data_client::Error> { diff --git a/state-sync/state-sync-v2/data-streaming-service/src/error.rs b/state-sync/state-sync-v2/data-streaming-service/src/error.rs index 4ae0edbcb5add..dd697810a6348 100644 --- a/state-sync/state-sync-v2/data-streaming-service/src/error.rs +++ b/state-sync/state-sync-v2/data-streaming-service/src/error.rs @@ -10,9 +10,9 @@ pub enum Error { #[error("The requested data is unavailable and cannot be found in the network! Error: {0}")] DataIsUnavailable(String), #[error("Error returned by the diem data client: {0}")] - DiemDataClientError(String), + AptosDataClientError(String), #[error("The response from the diem data client is invalid! Error: {0}")] - DiemDataClientResponseIsInvalid(String), + AptosDataClientResponseIsInvalid(String), #[error("An integer overflow has occurred: {0}")] IntegerOverflow(String), #[error("No data to fetch: {0}")] @@ -28,8 +28,8 @@ impl Error { pub fn get_label(&self) -> &'static str { match self { Self::DataIsUnavailable(_) => "data_is_unavailable", - Self::DiemDataClientError(_) => "aptos_data_client_error", - Self::DiemDataClientResponseIsInvalid(_) => "aptos_data_client_response_is_invalid", + Self::AptosDataClientError(_) => "aptos_data_client_error", + Self::AptosDataClientResponseIsInvalid(_) => "aptos_data_client_response_is_invalid", Self::IntegerOverflow(_) => "integer_overflow", Self::NoDataToFetch(_) => "no_data_to_fetch", Self::UnexpectedErrorEncountered(_) => "unexpected_error_encountered", @@ -40,7 +40,7 @@ impl Error { impl From for Error { fn from(error: aptos_data_client::Error) -> Self { - Error::DiemDataClientError(error.to_string()) + Error::AptosDataClientError(error.to_string()) } } diff --git a/state-sync/state-sync-v2/data-streaming-service/src/logging.rs b/state-sync/state-sync-v2/data-streaming-service/src/logging.rs index fe6b5ac721a59..e52ee78568257 100644 --- a/state-sync/state-sync-v2/data-streaming-service/src/logging.rs +++ b/state-sync/state-sync-v2/data-streaming-service/src/logging.rs @@ -30,7 +30,7 @@ impl<'a> LogSchema<'a> { #[serde(rename_all = "snake_case")] pub enum LogEntry { CheckStreamProgress, - DiemDataClient, + AptosDataClient, EndOfStreamNotification, HandleTerminateRequest, HandleStreamRequest, diff --git a/state-sync/state-sync-v2/data-streaming-service/src/stream_engine.rs b/state-sync/state-sync-v2/data-streaming-service/src/stream_engine.rs index d5755685c4bc6..fd9cc7dd5837b 100644 --- a/state-sync/state-sync-v2/data-streaming-service/src/stream_engine.rs +++ b/state-sync/state-sync-v2/data-streaming-service/src/stream_engine.rs @@ -214,7 +214,7 @@ impl DataStreamEngine for AccountsStreamEngine { Ok(client_requests) } else { info!( - (LogSchema::new(LogEntry::DiemDataClient) + (LogSchema::new(LogEntry::AptosDataClient) .event(LogEvent::Pending) .message(&format!( "Requested the number of accounts at version: {:?}", @@ -545,7 +545,7 @@ impl DataStreamEngine for ContinuousTransactionStreamEngine { if target_ledger_info.ledger_info().epoch() > next_request_epoch { // There was an epoch change. Request an epoch ending ledger info. info!( - (LogSchema::new(LogEntry::DiemDataClient) + (LogSchema::new(LogEntry::AptosDataClient) .event(LogEvent::Pending) .message(&format!( "Requested an epoch ending ledger info for epoch: {:?}", diff --git a/state-sync/state-sync-v2/data-streaming-service/src/streaming_service.rs b/state-sync/state-sync-v2/data-streaming-service/src/streaming_service.rs index fb8db6a351f27..f0bd7561b3666 100644 --- a/state-sync/state-sync-v2/data-streaming-service/src/streaming_service.rs +++ b/state-sync/state-sync-v2/data-streaming-service/src/streaming_service.rs @@ -12,7 +12,7 @@ use crate::{ }, }; use aptos_config::config::DataStreamingServiceConfig; -use aptos_data_client::{DiemDataClient, GlobalDataSummary, OptimalChunkSizes}; +use aptos_data_client::{AptosDataClient, GlobalDataSummary, OptimalChunkSizes}; use aptos_id_generator::{IdGenerator, U64IdGenerator}; use aptos_logger::prelude::*; use futures::StreamExt; @@ -45,7 +45,7 @@ pub struct DataStreamingService { notification_id_generator: Arc, } -impl DataStreamingService { +impl DataStreamingService { pub fn new( config: DataStreamingServiceConfig, aptos_data_client: T, @@ -310,7 +310,7 @@ fn verify_optimal_chunk_sizes(optimal_chunk_sizes: &OptimalChunkSizes) -> Result || optimal_chunk_sizes.transaction_chunk_size == 0 || optimal_chunk_sizes.transaction_output_chunk_size == 0 { - Err(Error::DiemDataClientResponseIsInvalid(format!( + Err(Error::AptosDataClientResponseIsInvalid(format!( "Found at least one optimal chunk size of zero: {:?}", optimal_chunk_sizes ))) diff --git a/state-sync/state-sync-v2/data-streaming-service/src/tests/data_stream.rs b/state-sync/state-sync-v2/data-streaming-service/src/tests/data_stream.rs index 9414adb26c9fa..7fa2e05dd61af 100644 --- a/state-sync/state-sync-v2/data-streaming-service/src/tests/data_stream.rs +++ b/state-sync/state-sync-v2/data-streaming-service/src/tests/data_stream.rs @@ -13,7 +13,7 @@ use crate::{ tests::utils::{ create_data_client_response, create_ledger_info, create_random_u64, create_transaction_list_with_proof, get_data_notification, initialize_logger, - MockDiemDataClient, NoopResponseCallback, MAX_ADVERTISED_ACCOUNTS, + MockAptosDataClient, NoopResponseCallback, MAX_ADVERTISED_ACCOUNTS, MAX_ADVERTISED_EPOCH_END, MAX_ADVERTISED_TRANSACTION_OUTPUT, MAX_NOTIFICATION_TIMEOUT_SECS, MIN_ADVERTISED_ACCOUNTS, MIN_ADVERTISED_EPOCH_END, MIN_ADVERTISED_TRANSACTION_OUTPUT, }, @@ -310,7 +310,7 @@ async fn test_stream_out_of_order_responses() { fn create_account_stream( streaming_service_config: DataStreamingServiceConfig, version: Version, -) -> (DataStream, DataStreamListener) { +) -> (DataStream, DataStreamListener) { // Create an account stream request let stream_request = StreamRequest::GetAllAccounts(GetAllAccountsRequest { version, @@ -323,7 +323,7 @@ fn create_account_stream( fn create_epoch_ending_stream( streaming_service_config: DataStreamingServiceConfig, start_epoch: u64, -) -> (DataStream, DataStreamListener) { +) -> (DataStream, DataStreamListener) { // Create an epoch ending stream request let stream_request = StreamRequest::GetAllEpochEndingLedgerInfos(GetAllEpochEndingLedgerInfosRequest { @@ -337,7 +337,7 @@ fn create_transaction_stream( streaming_service_config: DataStreamingServiceConfig, start_version: Version, end_version: Version, -) -> (DataStream, DataStreamListener) { +) -> (DataStream, DataStreamListener) { // Create a transaction output stream let stream_request = StreamRequest::GetAllTransactions(GetAllTransactionsRequest { start_version, @@ -351,7 +351,7 @@ fn create_transaction_stream( fn create_data_stream( streaming_service_config: DataStreamingServiceConfig, stream_request: StreamRequest, -) -> (DataStream, DataStreamListener) { +) -> (DataStream, DataStreamListener) { initialize_logger(); // Create an advertised data @@ -376,7 +376,7 @@ fn create_data_stream( }; // Create a diem data client mock and notification generator - let aptos_data_client = MockDiemDataClient::new(); + let aptos_data_client = MockAptosDataClient::new(); let notification_generator = Arc::new(U64IdGenerator::new()); // Return the data stream and listener pair @@ -409,7 +409,7 @@ fn create_optimal_chunk_sizes(chunk_sizes: u64) -> OptimalChunkSizes { /// Sets the client response at the index in the pending queue to contain an /// epoch ending data response. fn set_epoch_ending_response_in_queue( - data_stream: &mut DataStream, + data_stream: &mut DataStream, index: usize, ) { // Set the response at the specified index @@ -427,7 +427,7 @@ fn set_epoch_ending_response_in_queue( /// Sets the client response at the head of the pending queue to contain an /// transaction response. -fn set_transaction_response_at_queue_head(data_stream: &mut DataStream) { +fn set_transaction_response_at_queue_head(data_stream: &mut DataStream) { // Set the response at the specified index let (sent_requests, _) = data_stream.get_sent_requests_and_notifications(); if !sent_requests.as_mut().unwrap().is_empty() { @@ -442,7 +442,7 @@ fn set_transaction_response_at_queue_head(data_stream: &mut DataStream, + data_stream: &mut DataStream, pending_response: PendingClientResponse, ) { // Clear the queue @@ -457,7 +457,7 @@ fn insert_response_into_pending_queue( /// Verifies that a client request was resubmitted (i.e., pushed to the head of the /// sent request queue) fn verify_client_request_resubmitted( - data_stream: &mut DataStream, + data_stream: &mut DataStream, client_request: DataClientRequest, ) { let (sent_requests, _) = data_stream.get_sent_requests_and_notifications(); diff --git a/state-sync/state-sync-v2/data-streaming-service/src/tests/streaming_service.rs b/state-sync/state-sync-v2/data-streaming-service/src/tests/streaming_service.rs index 948ed1728be81..1f3708dd77a86 100644 --- a/state-sync/state-sync-v2/data-streaming-service/src/tests/streaming_service.rs +++ b/state-sync/state-sync-v2/data-streaming-service/src/tests/streaming_service.rs @@ -10,7 +10,7 @@ use crate::{ }, streaming_service::DataStreamingService, tests::utils::{ - create_ledger_info, get_data_notification, initialize_logger, MockDiemDataClient, + create_ledger_info, get_data_notification, initialize_logger, MockAptosDataClient, MAX_ADVERTISED_ACCOUNTS, MAX_ADVERTISED_EPOCH_END, MAX_ADVERTISED_TRANSACTION, MAX_ADVERTISED_TRANSACTION_OUTPUT, MIN_ADVERTISED_ACCOUNTS, MIN_ADVERTISED_EPOCH_END, MIN_ADVERTISED_TRANSACTION, MIN_ADVERTISED_TRANSACTION_OUTPUT, TOTAL_NUM_ACCOUNTS, @@ -949,7 +949,7 @@ fn create_new_streaming_client_and_service() -> StreamingServiceClient { new_streaming_service_client_listener_pair(); // Create the streaming service and connect it to the listener - let aptos_data_client = MockDiemDataClient::new(); + let aptos_data_client = MockAptosDataClient::new(); let streaming_service = DataStreamingService::new( DataStreamingServiceConfig::default(), aptos_data_client, diff --git a/state-sync/state-sync-v2/data-streaming-service/src/tests/utils.rs b/state-sync/state-sync-v2/data-streaming-service/src/tests/utils.rs index efe071c699259..ef5c1d10455fd 100644 --- a/state-sync/state-sync-v2/data-streaming-service/src/tests/utils.rs +++ b/state-sync/state-sync-v2/data-streaming-service/src/tests/utils.rs @@ -4,7 +4,7 @@ use crate::{data_notification::DataNotification, data_stream::DataStreamListener, error::Error}; use aptos_crypto::{ed25519::Ed25519PrivateKey, HashValue, PrivateKey, SigningKey, Uniform}; use aptos_data_client::{ - AdvertisedData, DiemDataClient, GlobalDataSummary, OptimalChunkSizes, Response, + AdvertisedData, AptosDataClient, GlobalDataSummary, OptimalChunkSizes, Response, ResponseCallback, ResponseContext, ResponseError, }; use aptos_logger::Level; @@ -53,12 +53,12 @@ pub const MAX_NOTIFICATION_TIMEOUT_SECS: u64 = 10; /// A simple mock of the Diem Data Client #[derive(Clone, Debug)] -pub struct MockDiemDataClient { +pub struct MockAptosDataClient { pub epoch_ending_ledger_infos: HashMap, pub synced_ledger_infos: Vec, } -impl MockDiemDataClient { +impl MockAptosDataClient { pub fn new() -> Self { let epoch_ending_ledger_infos = create_epoch_ending_ledger_infos(); let synced_ledger_infos = create_synced_ledger_infos(&epoch_ending_ledger_infos); @@ -76,7 +76,7 @@ impl MockDiemDataClient { } #[async_trait] -impl DiemDataClient for MockDiemDataClient { +impl AptosDataClient for MockAptosDataClient { fn get_global_data_summary(&self) -> GlobalDataSummary { // Create a random set of optimal chunk sizes to emulate changing environments let optimal_chunk_sizes = OptimalChunkSizes { diff --git a/state-sync/state-sync-v2/state-sync-driver/src/driver.rs b/state-sync/state-sync-v2/state-sync-driver/src/driver.rs index d8510f3d4188d..2633641d82653 100644 --- a/state-sync/state-sync-v2/state-sync-driver/src/driver.rs +++ b/state-sync/state-sync-v2/state-sync-driver/src/driver.rs @@ -14,7 +14,7 @@ use crate::{ utils, }; use aptos_config::config::{RoleType, StateSyncDriverConfig}; -use aptos_data_client::DiemDataClient; +use aptos_data_client::AptosDataClient; use aptos_infallible::Mutex; use aptos_logger::*; use aptos_types::waypoint::Waypoint; @@ -97,7 +97,7 @@ pub struct StateSyncDriver { } impl< - DataClient: DiemDataClient + Send + Clone + 'static, + DataClient: AptosDataClient + Send + Clone + 'static, MempoolNotifier: MempoolNotificationSender, StorageSyncer: StorageSynchronizerInterface + Clone, > StateSyncDriver diff --git a/state-sync/storage-service/server/src/metrics.rs b/state-sync/storage-service/server/src/metrics.rs index aac71da9a3998..5fa572ff8189b 100644 --- a/state-sync/storage-service/server/src/metrics.rs +++ b/state-sync/storage-service/server/src/metrics.rs @@ -10,7 +10,7 @@ use once_cell::sync::Lazy; /// Counter for pending network events to the storage service (server-side) pub static PENDING_STORAGE_SERVER_NETWORK_EVENTS: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_storage_service_server_pending_network_events", + "aptos_storage_service_server_pending_network_events", "Counters for pending network events for the storage server", &["state"] ) @@ -20,7 +20,7 @@ pub static PENDING_STORAGE_SERVER_NETWORK_EVENTS: Lazy = Lazy::ne /// Counter for storage service errors encountered pub static STORAGE_ERRORS_ENCOUNTERED: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_storage_service_server_errors", + "aptos_storage_service_server_errors", "Counters related to the storage server errors encountered", &["protocol", "error_type"] ) @@ -30,7 +30,7 @@ pub static STORAGE_ERRORS_ENCOUNTERED: Lazy = Lazy::new(|| { /// Counter for received storage service requests pub static STORAGE_REQUESTS_RECEIVED: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_storage_service_server_requests_received", + "aptos_storage_service_server_requests_received", "Counters related to the storage server requests received", &["protocol", "request_type"] ) @@ -40,7 +40,7 @@ pub static STORAGE_REQUESTS_RECEIVED: Lazy = Lazy::new(|| { /// Counter for storage service responses sent pub static STORAGE_RESPONSES_SENT: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_storage_service_server_responses_sent", + "aptos_storage_service_server_responses_sent", "Counters related to the storage server responses sent", &["protocol", "response_type"] ) @@ -50,7 +50,7 @@ pub static STORAGE_RESPONSES_SENT: Lazy = Lazy::new(|| { /// Time it takes to process a storage request pub static STORAGE_REQUEST_PROCESSING_LATENCY: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_storage_service_server_request_latency", + "aptos_storage_service_server_request_latency", "Time it takes to process a storage service request", &["protocol", "request_type"] ) diff --git a/storage/aptosdb/src/lib.rs b/storage/aptosdb/src/lib.rs index 27a62b591db17..e54f4e0e653f3 100644 --- a/storage/aptosdb/src/lib.rs +++ b/storage/aptosdb/src/lib.rs @@ -107,27 +107,27 @@ const MAX_NUM_EPOCH_ENDING_LEDGER_INFO: usize = 100; static ROCKSDB_PROPERTY_MAP: Lazy> = Lazy::new(|| { [ ( - "diem_rocksdb_live_sst_files_size_bytes", + "aptos_rocksdb_live_sst_files_size_bytes", "rocksdb.live-sst-files-size", ), ( - "diem_rocksdb_all_memtables_size_bytes", + "aptos_rocksdb_all_memtables_size_bytes", "rocksdb.size-all-mem-tables", ), ( - "diem_rocksdb_num_running_compactions", + "aptos_rocksdb_num_running_compactions", "rocksdb.num-running-compactions", ), ( - "diem_rocksdb_num_running_flushes", + "aptos_rocksdb_num_running_flushes", "rocksdb.num-running-flushes", ), ( - "diem_rocksdb_block_cache_usage_bytes", + "aptos_rocksdb_block_cache_usage_bytes", "rocksdb.block-cache-usage", ), ( - "diem_rocksdb_cf_size_bytes", + "aptos_rocksdb_cf_size_bytes", "rocksdb.estimate-live-data-size", ), ] diff --git a/storage/aptosdb/src/metrics.rs b/storage/aptosdb/src/metrics.rs index b48b96990b21e..38ebba9dcb3f7 100644 --- a/storage/aptosdb/src/metrics.rs +++ b/storage/aptosdb/src/metrics.rs @@ -10,7 +10,7 @@ use once_cell::sync::Lazy; pub static DIEM_STORAGE_LEDGER: Lazy = Lazy::new(|| { register_int_gauge_vec!( // metric name - "diem_storage_ledger", + "aptos_storage_ledger", // metric description "Diem storage ledger counters", // metric labels (dimensions) @@ -21,7 +21,7 @@ pub static DIEM_STORAGE_LEDGER: Lazy = Lazy::new(|| { pub static DIEM_STORAGE_COMMITTED_TXNS: Lazy = Lazy::new(|| { register_int_counter!( - "diem_storage_committed_txns", + "aptos_storage_committed_txns", "Diem storage committed transactions" ) .unwrap() @@ -29,7 +29,7 @@ pub static DIEM_STORAGE_COMMITTED_TXNS: Lazy = Lazy::new(|| { pub static DIEM_STORAGE_LATEST_TXN_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_storage_latest_transaction_version", + "aptos_storage_latest_transaction_version", "Diem storage latest transaction version" ) .unwrap() @@ -37,7 +37,7 @@ pub static DIEM_STORAGE_LATEST_TXN_VERSION: Lazy = Lazy::new(|| { pub static DIEM_STORAGE_LEDGER_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_storage_ledger_version", + "aptos_storage_ledger_version", "Version in the latest saved ledger info." ) .unwrap() @@ -45,7 +45,7 @@ pub static DIEM_STORAGE_LEDGER_VERSION: Lazy = Lazy::new(|| { pub static DIEM_STORAGE_NEXT_BLOCK_EPOCH: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_storage_next_block_epoch", + "aptos_storage_next_block_epoch", "ledger_info.next_block_epoch() for the latest saved ledger info." ) .unwrap() @@ -53,19 +53,19 @@ pub static DIEM_STORAGE_NEXT_BLOCK_EPOCH: Lazy = Lazy::new(|| { pub static DIEM_STORAGE_LATEST_ACCOUNT_COUNT: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_storage_latest_account_count", + "aptos_storage_latest_account_count", "Total number of account in the StateDB at the latest version." ) .unwrap() }); pub static DIEM_STORAGE_PRUNE_WINDOW: Lazy = Lazy::new(|| { - register_int_gauge!("diem_storage_prune_window", "Diem storage prune window").unwrap() + register_int_gauge!("aptos_storage_prune_window", "Diem storage prune window").unwrap() }); pub static DIEM_STORAGE_PRUNER_LEAST_READABLE_STATE_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_storage_pruner_least_readable_state_version", + "aptos_storage_pruner_least_readable_state_version", "Diem storage pruner least readable state version" ) .unwrap() @@ -74,7 +74,7 @@ pub static DIEM_STORAGE_PRUNER_LEAST_READABLE_STATE_VERSION: Lazy = La pub static DIEM_STORAGE_API_LATENCY_SECONDS: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_storage_api_latency_seconds", + "aptos_storage_api_latency_seconds", // metric description "Diem storage api latency in seconds", // metric labels (dimensions) @@ -86,7 +86,7 @@ pub static DIEM_STORAGE_API_LATENCY_SECONDS: Lazy = Lazy::new(|| { pub static DIEM_STORAGE_OTHER_TIMERS_SECONDS: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_storage_other_timers_seconds", + "aptos_storage_other_timers_seconds", // metric description "Various timers below public API level.", // metric labels (dimensions) @@ -99,7 +99,7 @@ pub static DIEM_STORAGE_OTHER_TIMERS_SECONDS: Lazy = Lazy::new(|| pub static DIEM_STORAGE_ROCKSDB_PROPERTIES: Lazy = Lazy::new(|| { register_int_gauge_vec!( // metric name - "diem_rocksdb_properties", + "aptos_rocksdb_properties", // metric description "rocksdb integer properties", // metric labels (dimensions) diff --git a/storage/backup/backup-cli/src/metrics/backup.rs b/storage/backup/backup-cli/src/metrics/backup.rs index 5a9a03c3515b1..850bc71cbb92f 100644 --- a/storage/backup/backup-cli/src/metrics/backup.rs +++ b/storage/backup/backup-cli/src/metrics/backup.rs @@ -6,7 +6,7 @@ use once_cell::sync::Lazy; pub static HEARTBEAT_TS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_coordinator_heartbeat_timestamp_s", + "aptos_db_backup_coordinator_heartbeat_timestamp_s", "Timestamp when the backup coordinator successfully updates state from the backup service." ) .unwrap() @@ -14,7 +14,7 @@ pub static HEARTBEAT_TS: Lazy = Lazy::new(|| { pub static EPOCH_ENDING_EPOCH: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_coordinator_epoch_ending_epoch", + "aptos_db_backup_coordinator_epoch_ending_epoch", "Epoch of the latest epoch ending backed up." ) .unwrap() @@ -22,7 +22,7 @@ pub static EPOCH_ENDING_EPOCH: Lazy = Lazy::new(|| { pub static STATE_SNAPSHOT_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_coordinator_state_snapshot_version", + "aptos_db_backup_coordinator_state_snapshot_version", "The version of the latest state snapshot taken." ) .unwrap() @@ -30,7 +30,7 @@ pub static STATE_SNAPSHOT_VERSION: Lazy = Lazy::new(|| { pub static TRANSACTION_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_coordinator_transaction_version", + "aptos_db_backup_coordinator_transaction_version", "Version of the latest transaction backed up." ) .unwrap() diff --git a/storage/backup/backup-cli/src/metrics/restore.rs b/storage/backup/backup-cli/src/metrics/restore.rs index 070c42ffe3ee1..3aca02c29436c 100644 --- a/storage/backup/backup-cli/src/metrics/restore.rs +++ b/storage/backup/backup-cli/src/metrics/restore.rs @@ -6,7 +6,7 @@ use once_cell::sync::Lazy; pub static COORDINATOR_TARGET_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_coordinator_target_version", + "aptos_db_restore_coordinator_target_version", "The target version to restore to by the restore coordinator." ) .unwrap() @@ -14,7 +14,7 @@ pub static COORDINATOR_TARGET_VERSION: Lazy = Lazy::new(|| { pub static EPOCH_ENDING_EPOCH: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_epoch_ending_epoch", + "aptos_db_restore_epoch_ending_epoch", "Current epoch ending epoch being restored." ) .unwrap() @@ -22,7 +22,7 @@ pub static EPOCH_ENDING_EPOCH: Lazy = Lazy::new(|| { pub static EPOCH_ENDING_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_epoch_ending_version", + "aptos_db_restore_epoch_ending_version", "Last version of the current epoch ending being restored." ) .unwrap() @@ -30,7 +30,7 @@ pub static EPOCH_ENDING_VERSION: Lazy = Lazy::new(|| { pub static STATE_SNAPSHOT_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_state_snapshot_version", + "aptos_db_restore_state_snapshot_version", "The version that a state snapshot restores to." ) .unwrap() @@ -38,7 +38,7 @@ pub static STATE_SNAPSHOT_VERSION: Lazy = Lazy::new(|| { pub static STATE_SNAPSHOT_TARGET_LEAF_INDEX: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_state_snapshot_target_leaf_index", + "aptos_db_restore_state_snapshot_target_leaf_index", "The biggest leaf index in state snapshot being restored (# of accounts - 1)." ) .unwrap() @@ -46,7 +46,7 @@ pub static STATE_SNAPSHOT_TARGET_LEAF_INDEX: Lazy = Lazy::new(|| { pub static STATE_SNAPSHOT_LEAF_INDEX: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_state_snapshot_leaf_index", + "aptos_db_restore_state_snapshot_leaf_index", "Current leaf index being restored." ) .unwrap() @@ -54,7 +54,7 @@ pub static STATE_SNAPSHOT_LEAF_INDEX: Lazy = Lazy::new(|| { pub static TRANSACTION_SAVE_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_transaction_save_version", + "aptos_db_restore_transaction_save_version", "Version of the transaction being restored without replaying." ) .unwrap() @@ -62,7 +62,7 @@ pub static TRANSACTION_SAVE_VERSION: Lazy = Lazy::new(|| { pub static TRANSACTION_REPLAY_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_transaction_replay_version", + "aptos_db_restore_transaction_replay_version", "Version of the transaction being replayed" ) .unwrap() @@ -70,7 +70,7 @@ pub static TRANSACTION_REPLAY_VERSION: Lazy = Lazy::new(|| { pub static COORDINATOR_START_TS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_coordinator_start_timestamp_s", + "aptos_db_restore_coordinator_start_timestamp_s", "Timestamp when the verify coordinator starts." ) .unwrap() @@ -78,7 +78,7 @@ pub static COORDINATOR_START_TS: Lazy = Lazy::new(|| { pub static COORDINATOR_SUCC_TS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_coordinator_succeed_timestamp_s", + "aptos_db_restore_coordinator_succeed_timestamp_s", "Timestamp when the verify coordinator fails." ) .unwrap() @@ -86,7 +86,7 @@ pub static COORDINATOR_SUCC_TS: Lazy = Lazy::new(|| { pub static COORDINATOR_FAIL_TS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_restore_coordinator_fail_timestamp_s", + "aptos_db_restore_coordinator_fail_timestamp_s", "Timestamp when the verify coordinator fails." ) .unwrap() diff --git a/storage/backup/backup-cli/src/metrics/verify.rs b/storage/backup/backup-cli/src/metrics/verify.rs index 43573259c087c..c7d9e2dea7bb4 100644 --- a/storage/backup/backup-cli/src/metrics/verify.rs +++ b/storage/backup/backup-cli/src/metrics/verify.rs @@ -6,7 +6,7 @@ use once_cell::sync::Lazy; pub static VERIFY_EPOCH_ENDING_EPOCH: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_verify_epoch_ending_epoch", + "aptos_db_backup_verify_epoch_ending_epoch", "Current epoch ending epoch being verified." ) .unwrap() @@ -14,7 +14,7 @@ pub static VERIFY_EPOCH_ENDING_EPOCH: Lazy = Lazy::new(|| { pub static VERIFY_EPOCH_ENDING_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_verify_epoch_ending_version", + "aptos_db_backup_verify_epoch_ending_version", "Last version of the current epoch ending being verified." ) .unwrap() @@ -22,7 +22,7 @@ pub static VERIFY_EPOCH_ENDING_VERSION: Lazy = Lazy::new(|| { pub static VERIFY_STATE_SNAPSHOT_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_verify_state_snapshot_version", + "aptos_db_backup_verify_state_snapshot_version", "The version of the verified state snapshot." ) .unwrap() @@ -30,7 +30,7 @@ pub static VERIFY_STATE_SNAPSHOT_VERSION: Lazy = Lazy::new(|| { pub static VERIFY_STATE_SNAPSHOT_TARGET_LEAF_INDEX: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_verify_state_snapshot_target_leaf_index", + "aptos_db_backup_verify_state_snapshot_target_leaf_index", "The biggest leaf index in state snapshot being verified (# of accounts - 1)." ) .unwrap() @@ -38,7 +38,7 @@ pub static VERIFY_STATE_SNAPSHOT_TARGET_LEAF_INDEX: Lazy = Lazy::new(| pub static VERIFY_STATE_SNAPSHOT_LEAF_INDEX: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_verify_state_snapshot_leaf_index", + "aptos_db_backup_verify_state_snapshot_leaf_index", "Current leaf index being verified." ) .unwrap() @@ -46,7 +46,7 @@ pub static VERIFY_STATE_SNAPSHOT_LEAF_INDEX: Lazy = Lazy::new(|| { pub static VERIFY_TRANSACTION_VERSION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_verify_transaction_version", + "aptos_db_backup_verify_transaction_version", "Version of the transaction being verified." ) .unwrap() @@ -54,7 +54,7 @@ pub static VERIFY_TRANSACTION_VERSION: Lazy = Lazy::new(|| { pub static VERIFY_COORDINATOR_START_TS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_verify_coordinator_start_timestamp_s", + "aptos_db_backup_verify_coordinator_start_timestamp_s", "Timestamp when the verify coordinator starts." ) .unwrap() @@ -62,7 +62,7 @@ pub static VERIFY_COORDINATOR_START_TS: Lazy = Lazy::new(|| { pub static VERIFY_COORDINATOR_SUCC_TS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_verify_coordinator_succeed_timestamp_s", + "aptos_db_backup_verify_coordinator_succeed_timestamp_s", "Timestamp when the verify coordinator fails." ) .unwrap() @@ -70,7 +70,7 @@ pub static VERIFY_COORDINATOR_SUCC_TS: Lazy = Lazy::new(|| { pub static VERIFY_COORDINATOR_FAIL_TS: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_db_backup_verify_coordinator_fail_timestamp_s", + "aptos_db_backup_verify_coordinator_fail_timestamp_s", "Timestamp when the verify coordinator fails." ) .unwrap() diff --git a/storage/jellyfish-merkle/src/metrics.rs b/storage/jellyfish-merkle/src/metrics.rs index 41ebf3ff8f7de..b3479558f94ce 100644 --- a/storage/jellyfish-merkle/src/metrics.rs +++ b/storage/jellyfish-merkle/src/metrics.rs @@ -6,7 +6,7 @@ use once_cell::sync::Lazy; pub static DIEM_JELLYFISH_LEAF_ENCODED_BYTES: Lazy = Lazy::new(|| { register_int_counter!( - "diem_jellyfish_leaf_encoded_bytes", + "aptos_jellyfish_leaf_encoded_bytes", "Diem jellyfish leaf encoded bytes in total" ) .unwrap() @@ -14,7 +14,7 @@ pub static DIEM_JELLYFISH_LEAF_ENCODED_BYTES: Lazy = Lazy::new(|| { pub static DIEM_JELLYFISH_INTERNAL_ENCODED_BYTES: Lazy = Lazy::new(|| { register_int_counter!( - "diem_jellyfish_internal_encoded_bytes", + "aptos_jellyfish_internal_encoded_bytes", "Diem jellyfish total internal nodes encoded in bytes" ) .unwrap() @@ -22,7 +22,7 @@ pub static DIEM_JELLYFISH_INTERNAL_ENCODED_BYTES: Lazy = Lazy::new(| pub static DIEM_JELLYFISH_STORAGE_READS: Lazy = Lazy::new(|| { register_int_counter!( - "diem_jellyfish_storage_reads", + "aptos_jellyfish_storage_reads", "Diem jellyfish reads from storage" ) .unwrap() diff --git a/storage/schemadb/src/metrics.rs b/storage/schemadb/src/metrics.rs index ecdad70dca1c0..1b9a438955b8a 100644 --- a/storage/schemadb/src/metrics.rs +++ b/storage/schemadb/src/metrics.rs @@ -9,7 +9,7 @@ use once_cell::sync::Lazy; pub static DIEM_SCHEMADB_ITER_LATENCY_SECONDS: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_schemadb_iter_latency_seconds", + "aptos_schemadb_iter_latency_seconds", // metric description "Diem schemadb iter latency in seconds", // metric labels (dimensions) @@ -21,7 +21,7 @@ pub static DIEM_SCHEMADB_ITER_LATENCY_SECONDS: Lazy = Lazy::new(|| pub static DIEM_SCHEMADB_ITER_BYTES: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_schemadb_iter_bytes", + "aptos_schemadb_iter_bytes", // metric description "Diem schemadb iter size in bytess", // metric labels (dimensions) @@ -33,7 +33,7 @@ pub static DIEM_SCHEMADB_ITER_BYTES: Lazy = Lazy::new(|| { pub static DIEM_SCHEMADB_GET_LATENCY_SECONDS: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_schemadb_get_latency_seconds", + "aptos_schemadb_get_latency_seconds", // metric description "Diem schemadb get latency in seconds", // metric labels (dimensions) @@ -45,7 +45,7 @@ pub static DIEM_SCHEMADB_GET_LATENCY_SECONDS: Lazy = Lazy::new(|| pub static DIEM_SCHEMADB_GET_BYTES: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_schemadb_get_bytes", + "aptos_schemadb_get_bytes", // metric description "Diem schemadb get call returned data size in bytes", // metric labels (dimensions) @@ -57,7 +57,7 @@ pub static DIEM_SCHEMADB_GET_BYTES: Lazy = Lazy::new(|| { pub static DIEM_SCHEMADB_BATCH_COMMIT_LATENCY_SECONDS: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_schemadb_batch_commit_latency_seconds", + "aptos_schemadb_batch_commit_latency_seconds", // metric description "Diem schemadb schema batch commit latency in seconds", // metric labels (dimensions) @@ -69,7 +69,7 @@ pub static DIEM_SCHEMADB_BATCH_COMMIT_LATENCY_SECONDS: Lazy = Lazy pub static DIEM_SCHEMADB_BATCH_COMMIT_BYTES: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_schemadb_batch_commit_bytes", + "aptos_schemadb_batch_commit_bytes", // metric description "Diem schemadb schema batch commit size in bytes", // metric labels (dimensions) @@ -81,7 +81,7 @@ pub static DIEM_SCHEMADB_BATCH_COMMIT_BYTES: Lazy = Lazy::new(|| { pub static DIEM_SCHEMADB_PUT_BYTES: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_schemadb_put_bytes", + "aptos_schemadb_put_bytes", // metric description "Diem schemadb put call puts data size in bytes", // metric labels (dimensions) @@ -92,7 +92,7 @@ pub static DIEM_SCHEMADB_PUT_BYTES: Lazy = Lazy::new(|| { pub static DIEM_SCHEMADB_DELETES: Lazy = Lazy::new(|| { register_int_counter_vec!( - "diem_storage_deletes", + "aptos_storage_deletes", "Diem storage delete calls", &["cf_name"] ) @@ -102,7 +102,7 @@ pub static DIEM_SCHEMADB_DELETES: Lazy = Lazy::new(|| { pub static DIEM_SCHEMADB_BATCH_PUT_LATENCY_SECONDS: Lazy = Lazy::new(|| { register_histogram_vec!( // metric name - "diem_schemadb_batch_put_latency_seconds", + "aptos_schemadb_batch_put_latency_seconds", // metric description "Diem schemadb schema batch put latency in seconds", // metric labels (dimensions) diff --git a/storage/scratchpad/src/sparse_merkle/metrics.rs b/storage/scratchpad/src/sparse_merkle/metrics.rs index c77d358c17e3e..cd52fa7286aff 100644 --- a/storage/scratchpad/src/sparse_merkle/metrics.rs +++ b/storage/scratchpad/src/sparse_merkle/metrics.rs @@ -8,7 +8,7 @@ use once_cell::sync::Lazy; pub static OLDEST_GENERATION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_scratchpad_smt_oldest_generation", + "aptos_scratchpad_smt_oldest_generation", "Generation value on the oldest ancestor, after fetched." ) .unwrap() @@ -16,7 +16,7 @@ pub static OLDEST_GENERATION: Lazy = Lazy::new(|| { pub static LATEST_GENERATION: Lazy = Lazy::new(|| { register_int_gauge!( - "diem_scratchpad_smt_latest_generation", + "aptos_scratchpad_smt_latest_generation", "Generation value on newly spawned SMT." ) .unwrap() @@ -24,7 +24,7 @@ pub static LATEST_GENERATION: Lazy = Lazy::new(|| { pub static TIMER: Lazy = Lazy::new(|| { register_histogram_vec!( - "diem_scratchpad_smt_timer_seconds", + "aptos_scratchpad_smt_timer_seconds", "Various timers for performance analysis.", &["name"] ) diff --git a/storage/storage-service/src/lib.rs b/storage/storage-service/src/lib.rs index e5c556296767b..c1ad0264b69b0 100644 --- a/storage/storage-service/src/lib.rs +++ b/storage/storage-service/src/lib.rs @@ -21,8 +21,11 @@ use std::{ use storage_interface::{DbReader, DbWriter, Error, StartupInfo}; /// Starts storage service with a given AptosDB -pub fn start_storage_service_with_db(config: &NodeConfig, diem_db: Arc) -> JoinHandle<()> { - let storage_service = StorageService { db: diem_db }; +pub fn start_storage_service_with_db( + config: &NodeConfig, + aptos_db: Arc, +) -> JoinHandle<()> { + let storage_service = StorageService { db: aptos_db }; storage_service.run(config) } diff --git a/testsuite/generate-format/src/consensus.rs b/testsuite/generate-format/src/consensus.rs index f47eeb5f057a9..b0d88d12b9c0c 100644 --- a/testsuite/generate-format/src/consensus.rs +++ b/testsuite/generate-format/src/consensus.rs @@ -20,11 +20,11 @@ pub fn output_file() -> Option<&'static str> { /// This aims at signing canonically serializable BCS data #[derive(CryptoHasher, BCSCryptoHash, Serialize, Deserialize)] -struct TestDiemCrypto(String); +struct TestAptosCrypto(String); /// Record sample values for crypto types used by consensus. fn trace_crypto_values(tracer: &mut Tracer, samples: &mut Samples) -> Result<()> { - let message = TestDiemCrypto("Hello, World".to_string()); + let message = TestAptosCrypto("Hello, World".to_string()); let mut rng: StdRng = SeedableRng::from_seed([0; 32]); let private_key = Ed25519PrivateKey::generate(&mut rng); diff --git a/testsuite/smoke-test/src/consensus.rs b/testsuite/smoke-test/src/consensus.rs index fed98fdaf7c03..39bd74f990da5 100644 --- a/testsuite/smoke-test/src/consensus.rs +++ b/testsuite/smoke-test/src/consensus.rs @@ -77,7 +77,8 @@ async fn test_onchain_upgrade(new_onfig: OnChainConsensusConfig) { .chain_info() .root_account .sign_with_transaction_builder( - transaction_factory.update_diem_consensus_config(0, bcs::to_bytes(&new_onfig).unwrap()), + transaction_factory + .update_diem_consensus_config(0, bcs::to_bytes(&new_onfig).unwrap()), ); let client = swarm.validators().next().unwrap().rest_client(); diff --git a/testsuite/smoke-test/src/genesis.rs b/testsuite/smoke-test/src/genesis.rs index 11a334f44abef..19a5da4072283 100644 --- a/testsuite/smoke-test/src/genesis.rs +++ b/testsuite/smoke-test/src/genesis.rs @@ -112,7 +112,7 @@ async fn test_genesis_transaction_flow() { for i in 0..5 { for validator in swarm.validators() { let round = validator - .get_metric("diem_consensus_current_round{}") + .get_metric("aptos_consensus_current_round{}") .await .unwrap() .unwrap(); diff --git a/testsuite/smoke-test/src/test_utils.rs b/testsuite/smoke-test/src/test_utils.rs index 85ef0121b7406..a34f46a4afeec 100644 --- a/testsuite/smoke-test/src/test_utils.rs +++ b/testsuite/smoke-test/src/test_utils.rs @@ -99,9 +99,9 @@ pub async fn assert_balance(client: &RestClient, account: &LocalAccount, balance } /// This module provides useful functions for operating, handling and managing -/// DiemSwarm instances. It is particularly useful for working with tests that +/// AptosSwarm instances. It is particularly useful for working with tests that /// require a SmokeTestEnvironment, as it provides a generic interface across -/// DiemSwarms, regardless of if the swarm is a validator swarm, validator full +/// AptosSwarms, regardless of if the swarm is a validator swarm, validator full /// node swarm, or a public full node swarm. pub mod diem_swarm_utils { use crate::test_utils::fetch_backend_storage; diff --git a/testsuite/testcases/src/state_sync_performance.rs b/testsuite/testcases/src/state_sync_performance.rs index ea503369c97e9..b8c2271882c8d 100644 --- a/testsuite/testcases/src/state_sync_performance.rs +++ b/testsuite/testcases/src/state_sync_performance.rs @@ -11,7 +11,7 @@ use rand::{ use std::{thread, time::Instant}; use tokio::{runtime::Runtime, time::Duration}; -const STATE_SYNC_COMMITTED_COUNTER_NAME: &str = "diem_state_sync_version.synced"; +const STATE_SYNC_COMMITTED_COUNTER_NAME: &str = "aptos_state_sync_version.synced"; pub struct StateSyncPerformance; diff --git a/types/src/validator_verifier.rs b/types/src/validator_verifier.rs index 04c3ff04b4991..ea73a17be45bf 100644 --- a/types/src/validator_verifier.rs +++ b/types/src/validator_verifier.rs @@ -379,7 +379,7 @@ pub fn random_validator_verifier( mod tests { use super::*; use crate::validator_signer::ValidatorSigner; - use aptos_crypto::test_utils::{TestDiemCrypto, TEST_SEED}; + use aptos_crypto::test_utils::{TestAptosCrypto, TEST_SEED}; use std::collections::BTreeMap; #[test] @@ -397,7 +397,7 @@ mod tests { } ); - let dummy_struct = TestDiemCrypto("Hello, World".to_string()); + let dummy_struct = TestAptosCrypto("Hello, World".to_string()); for validator in validator_signers.iter() { author_to_signature_map.insert(validator.author(), validator.sign(&dummy_struct)); } @@ -411,7 +411,7 @@ mod tests { #[test] fn test_validator() { let validator_signer = ValidatorSigner::random(TEST_SEED); - let dummy_struct = TestDiemCrypto("Hello, World".to_string()); + let dummy_struct = TestAptosCrypto("Hello, World".to_string()); let signature = validator_signer.sign(&dummy_struct); let validator = ValidatorVerifier::new_single(validator_signer.author(), validator_signer.public_key()); @@ -442,7 +442,7 @@ mod tests { let validator_signers: Vec = (0..NUM_SIGNERS) .map(|i| ValidatorSigner::random([i; 32])) .collect(); - let dummy_struct = TestDiemCrypto("Hello, World".to_string()); + let dummy_struct = TestAptosCrypto("Hello, World".to_string()); // Create a map from authors to public keys with equal voting power. let mut author_to_public_key_map = BTreeMap::new(); @@ -538,7 +538,7 @@ mod tests { let validator_signers: Vec = (0..NUM_SIGNERS) .map(|i| ValidatorSigner::random([i; 32])) .collect(); - let dummy_struct = TestDiemCrypto("Hello, World".to_string()); + let dummy_struct = TestAptosCrypto("Hello, World".to_string()); // Create a map from authors to public keys with increasing weights (0, 1, 2, 3) and // a map of author to signature. @@ -570,7 +570,7 @@ mod tests { let validator_signers: Vec = (0..NUM_SIGNERS) .map(|i| ValidatorSigner::random([i; 32])) .collect(); - let dummy_struct = TestDiemCrypto("Hello, World".to_string()); + let dummy_struct = TestAptosCrypto("Hello, World".to_string()); // Create a map from authors to public keys with increasing weights (0, 1, 2, 3) and // a map of author to signature.