Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

feat: block processing metrics#2296

Merged
dhyaniarun1993 merged 6 commits intomainfrom
feat/chain-metrics
Jun 26, 2025
Merged

feat: block processing metrics#2296
dhyaniarun1993 merged 6 commits intomainfrom
feat/chain-metrics

Conversation

@dhyaniarun1993
Copy link
Collaborator

Closes #2090

@dhyaniarun1993 dhyaniarun1993 self-assigned this Jun 26, 2025
@dhyaniarun1993 dhyaniarun1993 added M-metrics Meta: metric related W-supervisor Workstream: supervisor labels Jun 26, 2025
@codecov
Copy link

codecov bot commented Jun 26, 2025

Codecov Report

Attention: Patch coverage is 38.28571% with 108 lines in your changes missing coverage. Please review.

Project coverage is 81.0%. Comparing base (2a957ae) to head (685006c).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/supervisor/core/src/chain_processor/task.rs 54.7% 52 Missing ⚠️
...tes/supervisor/core/src/chain_processor/metrics.rs 0.0% 47 Missing ⚠️
...rates/supervisor/core/src/chain_processor/chain.rs 40.0% 6 Missing ⚠️
crates/supervisor/core/src/supervisor.rs 0.0% 3 Missing ⚠️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dhyaniarun1993 dhyaniarun1993 marked this pull request as ready for review June 26, 2025 06:18
Copilot AI review requested due to automatic review settings June 26, 2025 06:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds metrics tracking to the block processing pipeline in the supervisor core. It introduces helper functions and fields for enabling metrics, updates error variants to cover new failure cases, and integrates metrics initialization into both the chain processor tasks and the higher-level chain processor.

  • Added unconditionally applied metrics on chain processors (with a todo for making it configurable).
  • Updated error types in the LogIndexer and ChainProcessor error modules.
  • Integrated a new Metrics module with constants and initialization.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/supervisor/core/src/supervisor.rs Adds a call to with_metrics() with a todo note for conditional configuration.
crates/supervisor/core/src/logindexer/indexer.rs Updates LogIndexerError to derive PartialEq and Eq.
crates/supervisor/core/src/chain_processor/task.rs Introduces metrics_enabled flag, observe_block_processing helper, and updates event handling to record metrics.
crates/supervisor/core/src/chain_processor/mod.rs Adds and re-exports the new Metrics module.
crates/supervisor/core/src/chain_processor/metrics.rs New module defining metric names, descriptions, and initialization logic.
crates/supervisor/core/src/chain_processor/error.rs Updates the ChainProcessorError enum with new error variants.
crates/supervisor/core/src/chain_processor/chain.rs Propagates metrics configuration to tasks and initializes metrics when enabled.
Comments suppressed due to low confidence (1)

crates/supervisor/core/src/chain_processor/task.rs:274

  • The signature of handle_unsafe_event has been changed to return a Result. Verify that all its call sites are updated to handle the returned error properly.
    ) -> Result<BlockInfo, ChainProcessorError> {

@dhyaniarun1993 dhyaniarun1993 merged commit 215b37a into main Jun 26, 2025
21 of 28 checks passed
@dhyaniarun1993 dhyaniarun1993 deleted the feat/chain-metrics branch June 26, 2025 11:05
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Dec 10, 2025
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

M-metrics Meta: metric related W-supervisor Workstream: supervisor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore[supervisor/core]: Expose block processing metrics

4 participants