Skip to content

Commit

Permalink
Removed logging/probes.
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-zil committed Oct 4, 2024
1 parent 75536de commit 7dfcd13
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions zilliqa/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2617,8 +2617,6 @@ impl Consensus {
transactions: Vec<SignedTransaction>,
committee: &[NodePublicKeyRaw],
) -> Result<()> {
let len = transactions.len();
let start = std::time::Instant::now();
debug!("Executing block: {:?}", block.header.hash);

let parent = self
Expand All @@ -2634,7 +2632,6 @@ impl Consensus {
// We re-inject any missing Intershard transactions (or really, any missing
// transactions) from our mempool. If any txs are unavailable in both the
// message or locally, the proposal cannot be applied
let now = std::time::Instant::now();
for (idx, tx_hash) in block.transactions.iter().enumerate() {
// Prefer to insert verified txn from pool. This is faster.
let txn = match self.transaction_pool.pop_transaction(*tx_hash) {
Expand All @@ -2654,8 +2651,6 @@ impl Consensus {
verified_txns.insert(idx, txn);
}

info!("{} ELAPSED_INS {:?}", len, now.elapsed());

let transaction_hashes = verified_txns
.iter()
.map(|tx| format!("{:?}", tx.hash))
Expand All @@ -2677,7 +2672,6 @@ impl Consensus {
let mut receipts_trie = eth_trie::EthTrie::new(Arc::new(MemoryDB::new(true)));
let mut transactions_trie = eth_trie::EthTrie::new(Arc::new(MemoryDB::new(true)));

let now = std::time::Instant::now();
for (tx_index, txn) in verified_txns.into_iter().enumerate() {
self.new_transaction(txn.clone())?;
let tx_hash = txn.hash;
Expand Down Expand Up @@ -2714,7 +2708,6 @@ impl Consensus {
info!(?receipt, "applied transaction {:?}", receipt);
block_receipts.push((receipt, tx_index));
}
info!("{} ELAPSED_APP {:?}", len, now.elapsed());

if cumulative_gas_used != block.gas_used() {
warn!("Cumulative gas used by executing all transactions: {cumulative_gas_used} is different that the one provided in the block: {}", block.gas_used());
Expand Down Expand Up @@ -2754,15 +2747,13 @@ impl Consensus {
));
}

let now = std::time::Instant::now();
for (receipt, tx_index) in &mut block_receipts {
receipt.block_hash = block.hash();
// Avoid cloning the receipt if there are no subscriptions to send it to.
if self.receipts.receiver_count() != 0 {
let _ = self.receipts.send((receipt.clone(), *tx_index));
}
}
info!("{} ELAPSED_RCT {:?}", len, now.elapsed());

// Important - only add blocks we are going to execute because they can potentially
// overwrite the mapping of block height to block, which there should only be one of.
Expand All @@ -2776,18 +2767,15 @@ impl Consensus {
// closure has to be move to take ownership of block_receipts
let db = &self.db;
self.db.with_sqlite_tx(move |sqlite_tx| {
let now = std::time::Instant::now();
for (receipt, _) in block_receipts {
db.insert_transaction_receipt_with_db_tx(sqlite_tx, receipt)?;
}
info!("{} ELAPSED_SQL {:?}", len, now.elapsed());
Ok(())
})?;
}

// Tell the block store to request more blocks if it can.
self.block_store.request_missing_blocks()?;
info!("{} ELAPSED_EXE {:?}", len, start.elapsed());
Ok(())
}

Expand Down

0 comments on commit 7dfcd13

Please sign in to comment.