Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymousGiga committed Dec 1, 2023
1 parent 613457b commit 357ac79
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ revm-utils = { workspace = true, optional = true }
# common
tracing.workspace = true

ctor = "0.2.5"
ctor = {version = "0.2.5", optional = true }

[dev-dependencies]
reth-rlp.workspace = true
Expand All @@ -43,4 +43,4 @@ enable_cache_record = [
"reth-provider/enable_cache_record",
"revm-utils",
]
enable_execute_measure = ["revm-utils"]
enable_execute_measure = ["revm-utils", "ctor"]
15 changes: 14 additions & 1 deletion crates/revm/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use revm_utils::time_utils::instant::Instant;
use revm_utils::time_utils::{convert_cycles_to_ns_f64, instant::Instant};

/// ExecuteTxsRecord
#[derive(Debug, Clone, Copy, Default)]
Expand Down Expand Up @@ -96,6 +96,19 @@ impl ExecuteTxsRecord {
pub fn verify_receipt(&self) -> u64 {
self.verify_receipt
}
/// TODO: This function needs to be deleted later on.
pub fn print(&self) {
self.printline("total", self.total);
self.printline("transact", self.transact);
self.printline("commit_changes", self.commit_changes);
self.printline("add receipt", self.add_receipt);
self.printline("apply_post_block_changes", self.apply_post_block_changes);
self.printline("verify_receipt", self.verify_receipt);
}

fn printline(&self, cat: &'static str, cycles: u64) {
println!("{:?}: {:?} ns", cat, convert_cycles_to_ns_f64(cycles));
}
}

// TODO: This variable needs to be merged into a large structural variable later.
Expand Down
1 change: 1 addition & 0 deletions crates/stages/src/stages/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ impl<EF: ExecutorFactory> ExecutionStage<EF> {
if let Some(metrics_tx) = &mut self.metrics_tx {
let _ = metrics_tx.send(MetricEvent::ExecuteTxsInfo { execute_txs_record: record });
}
record.print();
}

// Write remaining changes
Expand Down

0 comments on commit 357ac79

Please sign in to comment.