diff --git a/core/consensus/Cargo.toml b/core/consensus/Cargo.toml index db6836459..85e4355be 100644 --- a/core/consensus/Cargo.toml +++ b/core/consensus/Cargo.toml @@ -19,6 +19,7 @@ parking_lot = "0.9" rlp = "0.4" serde = {version = "1.0", features = ["derive"]} +common-logger = { path = "../../common/logger"} common-crypto = { path = "../../common/crypto"} common-merkle = { path = "../../common/merkle"} core-mempool = { path = "../../core/mempool"} diff --git a/core/consensus/src/engine.rs b/core/consensus/src/engine.rs index bb045c42e..28cfdfd01 100644 --- a/core/consensus/src/engine.rs +++ b/core/consensus/src/engine.rs @@ -363,6 +363,12 @@ impl ConsensusEngine { .save_epoch(Context::new(), epoch.clone()) .await?; + common_logger::metrics(common_logger::json!({ + "name": "save_epoch", + "epoch_id": epoch_id, + "ordered_tx_num": epoch.ordered_tx_hashes.len() + })); + let prev_hash = Hash::digest(epoch.encode_fixed()?); { let mut current_consensus_status = self.current_consensus_status.write();