Skip to content

Commit

Permalink
[rename] target loggers and other underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
davidiw committed Mar 7, 2022
1 parent 62459c5 commit cee3bf4
Show file tree
Hide file tree
Showing 60 changed files with 339 additions and 334 deletions.
4 changes: 2 additions & 2 deletions api/src/health_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ struct HealthCheckParams {
struct HealthCheckError;
impl reject::Reject for HealthCheckError {}

pub fn health_check_route(health_diem_db: Arc<dyn MoveDbReader>) -> BoxedFilter<(impl Reply,)> {
pub fn health_check_route(health_aptos_db: Arc<dyn MoveDbReader>) -> 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()
Expand Down
14 changes: 7 additions & 7 deletions aptos-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -95,7 +95,7 @@ pub fn start(config: &NodeConfig, log_file: Option<PathBuf>) {
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");
Expand Down Expand Up @@ -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<NetworkId, storage_service_client::StorageServiceNetworkSender>,
peer_metadata_storage: Arc<PeerMetadataStorage>,
) -> (AptosNetDataClient, Runtime) {
Expand Down Expand Up @@ -440,7 +440,7 @@ pub fn setup_environment(node_config: &NodeConfig, logger: Option<Arc<Logger>>)
});

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 */
Expand All @@ -450,10 +450,10 @@ pub fn setup_environment(node_config: &NodeConfig, logger: Option<Arc<Logger>>)
)
.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();
Expand Down Expand Up @@ -615,7 +615,7 @@ pub fn setup_environment(node_config: &NodeConfig, logger: Option<Arc<Logger>>)

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);
Expand Down
8 changes: 4 additions & 4 deletions config/src/config/state_sync_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -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(),
}
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions consensus/src/consensus_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn start_consensus(
network_events: ConsensusNetworkEvents,
state_sync_notifier: Arc<dyn ConsensusNotificationSender>,
consensus_to_mempool_sender: mpsc::Sender<ConsensusRequest>,
diem_db: DbReaderWriter,
aptos_db: DbReaderWriter,
reconfig_events: ReconfigNotificationListener,
peer_metadata_storage: Arc<PeerMetadataStorage>,
) -> Runtime {
Expand All @@ -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(),
Expand Down
56 changes: 28 additions & 28 deletions consensus/src/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub static OP_COUNTERS: Lazy<aptos_metrics::OpMetrics> =

pub static ERROR_COUNT: Lazy<IntGauge> = Lazy::new(|| {
register_int_gauge!(
"diem_consensus_error_count",
"aptos_consensus_error_count",
"Total number of errors in main loop"
)
.unwrap()
Expand All @@ -27,7 +27,7 @@ pub static ERROR_COUNT: Lazy<IntGauge> = Lazy::new(|| {
/// This counter is set to the round of the highest committed block.
pub static LAST_COMMITTED_ROUND: Lazy<IntGauge> = 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()
Expand All @@ -36,7 +36,7 @@ pub static LAST_COMMITTED_ROUND: Lazy<IntGauge> = Lazy::new(|| {
/// The counter corresponds to the version of the last committed ledger info.
pub static LAST_COMMITTED_VERSION: Lazy<IntGauge> = 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()
Expand All @@ -45,7 +45,7 @@ pub static LAST_COMMITTED_VERSION: Lazy<IntGauge> = Lazy::new(|| {
/// Count of the committed blocks since last restart.
pub static COMMITTED_BLOCKS_COUNT: Lazy<IntCounter> = Lazy::new(|| {
register_int_counter!(
"diem_consensus_committed_blocks_count",
"aptos_consensus_committed_blocks_count",
"Count of the committed blocks since last restart."
)
.unwrap()
Expand All @@ -54,7 +54,7 @@ pub static COMMITTED_BLOCKS_COUNT: Lazy<IntCounter> = Lazy::new(|| {
/// Count of the committed transactions since last restart.
pub static COMMITTED_TXNS_COUNT: Lazy<IntCounterVec> = 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"]
)
Expand All @@ -68,13 +68,13 @@ pub static COMMITTED_TXNS_COUNT: Lazy<IntCounterVec> = Lazy::new(|| {
/// Count of the block proposals sent by this validator since last restart
/// (both primary and secondary)
pub static PROPOSALS_COUNT: Lazy<IntCounter> = 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<IntCounter> = 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()
Expand Down Expand Up @@ -104,7 +104,7 @@ pub static COMMITTED_VOTES_IN_WINDOW: Lazy<IntGauge> = Lazy::new(|| {
/// This counter is set to the last round reported by the local round_state.
pub static CURRENT_ROUND: Lazy<IntGauge> = 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()
Expand All @@ -113,7 +113,7 @@ pub static CURRENT_ROUND: Lazy<IntGauge> = Lazy::new(|| {
/// Count of the rounds that gathered QC since last restart.
pub static QC_ROUNDS_COUNT: Lazy<IntCounter> = 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()
Expand All @@ -122,7 +122,7 @@ pub static QC_ROUNDS_COUNT: Lazy<IntCounter> = Lazy::new(|| {
/// Count of the timeout rounds since last restart (close to 0 in happy path).
pub static TIMEOUT_ROUNDS_COUNT: Lazy<IntCounter> = 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()
Expand All @@ -133,13 +133,13 @@ pub static TIMEOUT_ROUNDS_COUNT: Lazy<IntCounter> = 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<IntCounter> = 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<IntGauge> = Lazy::new(|| {
register_int_gauge!(
"diem_consensus_round_timeout_s",
"aptos_consensus_round_timeout_s",
"The timeout of the current round."
)
.unwrap()
Expand All @@ -151,7 +151,7 @@ pub static ROUND_TIMEOUT_MS: Lazy<IntGauge> = 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<IntCounter> = 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()
Expand All @@ -162,12 +162,12 @@ pub static SYNC_INFO_MSGS_SENT_COUNT: Lazy<IntCounter> = Lazy::new(|| {
//////////////////////
/// Current epoch num
pub static EPOCH: Lazy<IntGauge> =
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<IntGauge> = Lazy::new(|| {
register_int_gauge!(
"diem_consensus_current_epoch_validators",
"aptos_consensus_current_epoch_validators",
"The number of validators in the current epoch"
)
.unwrap()
Expand All @@ -180,7 +180,7 @@ pub static CURRENT_EPOCH_VALIDATORS: Lazy<IntGauge> = 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<IntGauge> = 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()
Expand All @@ -192,7 +192,7 @@ pub static NUM_BLOCKS_IN_TREE: Lazy<IntGauge> = Lazy::new(|| {
// TODO Consider reintroducing this counter
// pub static UNWRAPPED_PROPOSAL_SIZE_BYTES: Lazy<Histogram> = 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()
Expand All @@ -201,15 +201,15 @@ pub static NUM_BLOCKS_IN_TREE: Lazy<IntGauge> = Lazy::new(|| {
/// Histogram for the number of txns per (committed) blocks.
pub static NUM_TXNS_PER_BLOCK: Lazy<Histogram> = 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()
});

pub static BLOCK_TRACING: Lazy<HistogramVec> = Lazy::new(|| {
register_histogram_vec!(
"diem_consensus_block_tracing",
"aptos_consensus_block_tracing",
"Histogram for different stages of a block",
&["stage"]
)
Expand All @@ -219,7 +219,7 @@ pub static BLOCK_TRACING: Lazy<HistogramVec> = 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<DurationHistogram> = 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())
});

///////////////////
Expand All @@ -228,7 +228,7 @@ pub static WAIT_DURATION_S: Lazy<DurationHistogram> = Lazy::new(|| {
/// Count of the pending messages sent to itself in the channel
pub static PENDING_SELF_MESSAGES: Lazy<IntGauge> = 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()
Expand All @@ -237,7 +237,7 @@ pub static PENDING_SELF_MESSAGES: Lazy<IntGauge> = Lazy::new(|| {
/// Count of the pending outbound round timeouts
pub static PENDING_ROUND_TIMEOUTS: Lazy<IntGauge> = Lazy::new(|| {
register_int_gauge!(
"diem_consensus_pending_round_timeouts",
"aptos_consensus_pending_round_timeouts",
"Count of the pending outbound round timeouts"
)
.unwrap()
Expand All @@ -246,7 +246,7 @@ pub static PENDING_ROUND_TIMEOUTS: Lazy<IntGauge> = Lazy::new(|| {
/// Counter of pending network events to Consensus
pub static PENDING_CONSENSUS_NETWORK_EVENTS: Lazy<IntCounterVec> = 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"]
)
Expand All @@ -256,15 +256,15 @@ pub static PENDING_CONSENSUS_NETWORK_EVENTS: Lazy<IntCounterVec> = Lazy::new(||
/// Count of the pending state sync notification.
pub static PENDING_STATE_SYNC_NOTIFICATION: Lazy<IntGauge> = 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()
});

pub static BUFFER_MANAGER_MSGS: Lazy<IntCounterVec> = 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"]
)
Expand All @@ -274,7 +274,7 @@ pub static BUFFER_MANAGER_MSGS: Lazy<IntCounterVec> = Lazy::new(|| {
/// Counters(queued,dequeued,dropped) related to consensus channel
pub static CONSENSUS_CHANNEL_MSGS: Lazy<IntCounterVec> = 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"]
)
Expand All @@ -284,7 +284,7 @@ pub static CONSENSUS_CHANNEL_MSGS: Lazy<IntCounterVec> = Lazy::new(|| {
/// Counters(queued,dequeued,dropped) related to consensus channel
pub static ROUND_MANAGER_CHANNEL_MSGS: Lazy<IntCounterVec> = 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"]
)
Expand All @@ -294,7 +294,7 @@ pub static ROUND_MANAGER_CHANNEL_MSGS: Lazy<IntCounterVec> = Lazy::new(|| {
/// Counters(queued,dequeued,dropped) related to block retrieval channel
pub static BLOCK_RETRIEVAL_CHANNEL_MSGS: Lazy<IntCounterVec> = 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"]
)
Expand Down
8 changes: 5 additions & 3 deletions consensus/src/epoch_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")?;
Expand Down
Loading

0 comments on commit cee3bf4

Please sign in to comment.