From 0ddaf1b26c1ec5344afc03a233357d6e089a347d Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 23 Jan 2026 16:17:33 +0100 Subject: [PATCH] feat(engine): add BAL metrics type for EIP-7928 (#21356) --- crates/engine/tree/src/tree/metrics.rs | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/crates/engine/tree/src/tree/metrics.rs b/crates/engine/tree/src/tree/metrics.rs index ea17ff2314..fb6508d99b 100644 --- a/crates/engine/tree/src/tree/metrics.rs +++ b/crates/engine/tree/src/tree/metrics.rs @@ -22,6 +22,9 @@ pub(crate) struct EngineApiMetrics { pub(crate) block_validation: BlockValidationMetrics, /// Canonical chain and reorg related metrics pub tree: TreeMetrics, + /// Metrics for EIP-7928 Block-Level Access Lists (BAL). + #[allow(dead_code)] + pub(crate) bal: BalMetrics, } impl EngineApiMetrics { @@ -293,6 +296,33 @@ impl NewPayloadStatusMetrics { } } +/// Metrics for EIP-7928 Block-Level Access Lists (BAL). +/// +/// See also +#[allow(dead_code)] +#[derive(Metrics, Clone)] +#[metrics(scope = "execution.block_access_list")] +pub(crate) struct BalMetrics { + /// Size of the BAL in bytes for the current block. + pub(crate) size_bytes: Gauge, + /// Total number of blocks with valid BALs. + pub(crate) valid_total: Counter, + /// Total number of blocks with invalid BALs. + pub(crate) invalid_total: Counter, + /// Time taken to validate the BAL against actual execution. + pub(crate) validation_time_seconds: Histogram, + /// Number of account changes in the BAL. + pub(crate) account_changes: Gauge, + /// Number of storage changes in the BAL. + pub(crate) storage_changes: Gauge, + /// Number of balance changes in the BAL. + pub(crate) balance_changes: Gauge, + /// Number of nonce changes in the BAL. + pub(crate) nonce_changes: Gauge, + /// Number of code changes in the BAL. + pub(crate) code_changes: Gauge, +} + /// Metrics for non-execution related block validation. #[derive(Metrics, Clone)] #[metrics(scope = "sync.block_validation")]