Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split the get_revm_metric_record function into two #1

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/revm/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,14 @@ where

/// Handle revm metric records.
#[cfg(feature = "open_revm_metrics_record")]
fn get_revm_metric_record(&self) -> (RevmMetricRecord, usize) {
(self.revm_metric_record.clone(), self.evm.db.as_ref().expect("db is empty").size())
fn get_revm_metric_record(&self) -> RevmMetricRecord {
self.revm_metric_record.clone()
}

/// Handle revm metric records.
#[cfg(feature = "open_revm_metrics_record")]
fn get_revm_metric_cachedb_size(&self) -> usize {
self.evm.db.as_ref().expect("db is empty").size()
}
}

Expand Down
5 changes: 3 additions & 2 deletions crates/stages/src/stages/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ impl<EF: ExecutorFactory> ExecutionStage<EF> {
let record = executor.get_revm_metric_record();
println!("");
println!("block_number = {:?}", block_number);
println!("revm_record = {:?}", record.0);
println!("cachedb_size = {:?}", record.1);
println!("revm_record = {:?}", record);
let cachedb_size = executor.get_revm_metric_cachedb_size();
println!("cachedb_size = {:?}", cachedb_size);
println!("");
}
cnt1 += 1;
Expand Down
10 changes: 8 additions & 2 deletions crates/storage/provider/src/traits/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ pub trait BlockExecutor<SP: StateProvider> {

/// Handle revm metric records.
#[cfg(feature = "open_revm_metrics_record")]
fn get_revm_metric_record(&self) -> (RevmMetricRecord, usize) {
(RevmMetricRecord::default(), 0)
fn get_revm_metric_record(&self) -> RevmMetricRecord {
RevmMetricRecord::default()
}

/// Handle revm metric records.
#[cfg(feature = "open_revm_metrics_record")]
fn get_revm_metric_cachedb_size(&self) -> usize {
0
}
}
Loading