remove wrapper

This commit is contained in:
Yong Kang
2025-10-13 09:57:46 +00:00
parent 02dbb22480
commit eff1c3acfa
2 changed files with 5 additions and 24 deletions

View File

@@ -62,7 +62,7 @@ use tokio::runtime::Handle;
use tracing::trace;
#[cfg(feature = "metrics")]
use crate::proof_task_metrics::ProofTaskMetrics;
use crate::proof_task_metrics::ProofTaskTrieMetrics;
type StorageProofResult = Result<DecodedStorageMultiProof, ParallelStateRootError>;
type TrieNodeProviderResult = Result<Option<RevealedNode>, SparseTrieError>;
@@ -117,7 +117,7 @@ fn storage_worker_loop<Tx>(
proof_tx: ProofTaskTx<Tx>,
work_rx: CrossbeamReceiver<StorageWorkerJob>,
worker_id: usize,
#[cfg(feature = "metrics")] metrics: ProofTaskMetrics,
#[cfg(feature = "metrics")] metrics: ProofTaskTrieMetrics,
) where
Tx: DbTx,
{
@@ -264,7 +264,7 @@ fn account_worker_loop<Tx>(
work_rx: CrossbeamReceiver<AccountWorkerJob>,
storage_work_tx: CrossbeamSender<StorageWorkerJob>,
worker_id: usize,
#[cfg(feature = "metrics")] metrics: ProofTaskMetrics,
#[cfg(feature = "metrics")] metrics: ProofTaskTrieMetrics,
) where
Tx: DbTx,
{
@@ -890,7 +890,7 @@ impl ProofTaskManagerHandle {
executor.spawn_blocking(move || {
#[cfg(feature = "metrics")]
let metrics = ProofTaskMetrics::default();
let metrics = ProofTaskTrieMetrics::default();
storage_worker_loop(
proof_task_tx,
@@ -918,7 +918,7 @@ impl ProofTaskManagerHandle {
executor.spawn_blocking(move || {
#[cfg(feature = "metrics")]
let metrics = ProofTaskMetrics::default();
let metrics = ProofTaskTrieMetrics::default();
account_worker_loop(
proof_task_tx,

View File

@@ -1,24 +1,5 @@
use reth_metrics::{metrics::Histogram, Metrics};
/// Metrics for blinded node fetching by proof workers.
#[derive(Clone, Debug, Default)]
pub struct ProofTaskMetrics {
/// The actual metrics for blinded nodes.
pub task_metrics: ProofTaskTrieMetrics,
}
impl ProofTaskMetrics {
/// Record the blinded account node count into the histogram.
pub fn record_account_nodes(&self, count: usize) {
self.task_metrics.record_account_nodes(count);
}
/// Record the blinded storage node count into the histogram.
pub fn record_storage_nodes(&self, count: usize) {
self.task_metrics.record_storage_nodes(count);
}
}
/// Metrics for the proof task.
#[derive(Clone, Metrics)]
#[metrics(scope = "trie.proof_task")]