mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(revm): rm no longer used BlockExecutorStats (#9830)
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -8218,7 +8218,6 @@ dependencies = [
|
|||||||
"reth-storage-errors",
|
"reth-storage-errors",
|
||||||
"reth-trie",
|
"reth-trie",
|
||||||
"revm",
|
"revm",
|
||||||
"tracing",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@ -24,7 +24,7 @@ use reth_primitives::{
|
|||||||
};
|
};
|
||||||
use reth_prune_types::PruneModes;
|
use reth_prune_types::PruneModes;
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
batch::{BlockBatchRecord, BlockExecutorStats},
|
batch::BlockBatchRecord,
|
||||||
db::states::bundle_state::BundleRetention,
|
db::states::bundle_state::BundleRetention,
|
||||||
state_change::{apply_blockhashes_update, post_block_balance_increments},
|
state_change::{apply_blockhashes_update, post_block_balance_increments},
|
||||||
Evm, State,
|
Evm, State,
|
||||||
@ -103,11 +103,7 @@ where
|
|||||||
DB: Database<Error: Into<ProviderError> + Display>,
|
DB: Database<Error: Into<ProviderError> + Display>,
|
||||||
{
|
{
|
||||||
let executor = self.eth_executor(db);
|
let executor = self.eth_executor(db);
|
||||||
EthBatchExecutor {
|
EthBatchExecutor { executor, batch_record: BlockBatchRecord::default() }
|
||||||
executor,
|
|
||||||
batch_record: BlockBatchRecord::default(),
|
|
||||||
stats: BlockExecutorStats::default(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,7 +397,6 @@ pub struct EthBatchExecutor<EvmConfig, DB> {
|
|||||||
executor: EthBlockExecutor<EvmConfig, DB>,
|
executor: EthBlockExecutor<EvmConfig, DB>,
|
||||||
/// Keeps track of the batch and records receipts based on the configured prune mode
|
/// Keeps track of the batch and records receipts based on the configured prune mode
|
||||||
batch_record: BlockBatchRecord,
|
batch_record: BlockBatchRecord,
|
||||||
stats: BlockExecutorStats,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<EvmConfig, DB> EthBatchExecutor<EvmConfig, DB> {
|
impl<EvmConfig, DB> EthBatchExecutor<EvmConfig, DB> {
|
||||||
@ -446,8 +441,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn finalize(mut self) -> Self::Output {
|
fn finalize(mut self) -> Self::Output {
|
||||||
self.stats.log_debug();
|
|
||||||
|
|
||||||
ExecutionOutcome::new(
|
ExecutionOutcome::new(
|
||||||
self.executor.state.take_bundle(),
|
self.executor.state.take_bundle(),
|
||||||
self.batch_record.take_receipts(),
|
self.batch_record.take_receipts(),
|
||||||
|
|||||||
@ -15,10 +15,8 @@ use reth_optimism_consensus::validate_block_post_execution;
|
|||||||
use reth_primitives::{BlockNumber, BlockWithSenders, Header, Receipt, Receipts, TxType, U256};
|
use reth_primitives::{BlockNumber, BlockWithSenders, Header, Receipt, Receipts, TxType, U256};
|
||||||
use reth_prune_types::PruneModes;
|
use reth_prune_types::PruneModes;
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
batch::{BlockBatchRecord, BlockExecutorStats},
|
batch::BlockBatchRecord, db::states::bundle_state::BundleRetention,
|
||||||
db::states::bundle_state::BundleRetention,
|
state_change::post_block_balance_increments, Evm, State,
|
||||||
state_change::post_block_balance_increments,
|
|
||||||
Evm, State,
|
|
||||||
};
|
};
|
||||||
use revm_primitives::{
|
use revm_primitives::{
|
||||||
db::{Database, DatabaseCommit},
|
db::{Database, DatabaseCommit},
|
||||||
@ -85,11 +83,7 @@ where
|
|||||||
DB: Database<Error: Into<ProviderError> + std::fmt::Display>,
|
DB: Database<Error: Into<ProviderError> + std::fmt::Display>,
|
||||||
{
|
{
|
||||||
let executor = self.op_executor(db);
|
let executor = self.op_executor(db);
|
||||||
OpBatchExecutor {
|
OpBatchExecutor { executor, batch_record: BlockBatchRecord::default() }
|
||||||
executor,
|
|
||||||
batch_record: BlockBatchRecord::default(),
|
|
||||||
stats: BlockExecutorStats::default(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,7 +370,6 @@ pub struct OpBatchExecutor<EvmConfig, DB> {
|
|||||||
executor: OpBlockExecutor<EvmConfig, DB>,
|
executor: OpBlockExecutor<EvmConfig, DB>,
|
||||||
/// Keeps track of the batch and record receipts based on the configured prune mode
|
/// Keeps track of the batch and record receipts based on the configured prune mode
|
||||||
batch_record: BlockBatchRecord,
|
batch_record: BlockBatchRecord,
|
||||||
stats: BlockExecutorStats,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<EvmConfig, DB> OpBatchExecutor<EvmConfig, DB> {
|
impl<EvmConfig, DB> OpBatchExecutor<EvmConfig, DB> {
|
||||||
@ -423,8 +416,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn finalize(mut self) -> Self::Output {
|
fn finalize(mut self) -> Self::Output {
|
||||||
self.stats.log_debug();
|
|
||||||
|
|
||||||
ExecutionOutcome::new(
|
ExecutionOutcome::new(
|
||||||
self.executor.state.take_bundle(),
|
self.executor.state.take_bundle(),
|
||||||
self.batch_record.take_receipts(),
|
self.batch_record.take_receipts(),
|
||||||
|
|||||||
@ -28,9 +28,6 @@ revm.workspace = true
|
|||||||
# alloy
|
# alloy
|
||||||
alloy-eips.workspace = true
|
alloy-eips.workspace = true
|
||||||
|
|
||||||
# common
|
|
||||||
tracing.workspace = true
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
reth-trie.workspace = true
|
reth-trie.workspace = true
|
||||||
reth-ethereum-forks.workspace = true
|
reth-ethereum-forks.workspace = true
|
||||||
|
|||||||
@ -4,12 +4,10 @@ use crate::{
|
|||||||
precompile::{Address, HashSet},
|
precompile::{Address, HashSet},
|
||||||
primitives::alloy_primitives::BlockNumber,
|
primitives::alloy_primitives::BlockNumber,
|
||||||
};
|
};
|
||||||
use core::time::Duration;
|
|
||||||
use reth_execution_errors::BlockExecutionError;
|
use reth_execution_errors::BlockExecutionError;
|
||||||
use reth_primitives::{Receipt, Receipts, Request, Requests};
|
use reth_primitives::{Receipt, Receipts, Request, Requests};
|
||||||
use reth_prune_types::{PruneMode, PruneModes, PruneSegmentError, MINIMUM_PRUNING_DISTANCE};
|
use reth_prune_types::{PruneMode, PruneModes, PruneSegmentError, MINIMUM_PRUNING_DISTANCE};
|
||||||
use revm::db::states::bundle_state::BundleRetention;
|
use revm::db::states::bundle_state::BundleRetention;
|
||||||
use tracing::debug;
|
|
||||||
|
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(feature = "std"))]
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
@ -182,37 +180,6 @@ impl BlockBatchRecord {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Block execution statistics. Contains duration of each step of block execution.
|
|
||||||
#[derive(Clone, Debug, Default)]
|
|
||||||
pub struct BlockExecutorStats {
|
|
||||||
/// Execution duration.
|
|
||||||
pub execution_duration: Duration,
|
|
||||||
/// Time needed to apply output of revm execution to revm cached state.
|
|
||||||
pub apply_state_duration: Duration,
|
|
||||||
/// Time needed to apply post execution state changes.
|
|
||||||
pub apply_post_execution_state_changes_duration: Duration,
|
|
||||||
/// Time needed to merge transitions and create reverts.
|
|
||||||
/// It this time transitions are applies to revm bundle state.
|
|
||||||
pub merge_transitions_duration: Duration,
|
|
||||||
/// Time needed to calculate receipt roots.
|
|
||||||
pub receipt_root_duration: Duration,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl BlockExecutorStats {
|
|
||||||
/// Log duration to debug level log.
|
|
||||||
pub fn log_debug(&self) {
|
|
||||||
debug!(
|
|
||||||
target: "evm",
|
|
||||||
evm_transact = ?self.execution_duration,
|
|
||||||
apply_state = ?self.apply_state_duration,
|
|
||||||
apply_post_state = ?self.apply_post_execution_state_changes_duration,
|
|
||||||
merge_transitions = ?self.merge_transitions_duration,
|
|
||||||
receipt_root = ?self.receipt_root_duration,
|
|
||||||
"Execution time"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
Reference in New Issue
Block a user