ethereum-optimism / ethereum-optimism/optimism
Track SuperAuthority finalized L2 head in metrics
- Dominant language
- Go
- Stars
- 6.5k
- Forks
- 4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 145
Description
## Summary
Add a dedicated metric for the SuperAuthority finalized L2 head/block.
PR #20872 intentionally stops using `EngineController.SetFinalizedHead` when materializing a SuperAuthority finalized ref, because `SetFinalizedHead` mutates `localFinalizedHead` / `deprecatedFinalizedHead`. That mutation is the wrong state model for SuperAuthority finality, but it also means the existing `l2_finalized` ref metric is no longer updated from the SuperAuthority path.
## Context
Review thread: https://github.com/ethereum-optimism/optimism/pull/20872#discussion_r3268284287
Current metrics I found:
- `op-node` records generic `l2_finalized` via `SetFinalizedHead`.
- `op-supervisor` records local/cross safe and unsafe refs, but not finalized refs.
- `op-supernode` records interop verification counters/timestamps, but not the SuperAuthority finalized L2 block/ref itself.
## Proposed direction
Add a dedicated SuperAuthority finality ref metric, for example one of:
- an `op-node` ref metric such as `l2_super_authority_finalized`, recorded when `FinalizedHead()` successfully resolves the SuperAuthority finalized block; or
- a SuperAuthority/supernode-owned metric that records the finalized L2 block/hash/number per chain when the authority computes it.
The important property is that dashboards can track SuperAuthority finality progress without overloading `l2_finalized`, which is tied to local engine/controller finalized state.
## Acceptance criteria
- SuperAuthority finalized L2 progress is exposed as a scraped metric.
- The metric is distinct from local finalized state.
- The metric includes enough information to track finality lag/progress, ideally block number and hash, and chain ID where applicable.
- Tests cover that the metric is updated when SuperAuthority finalized output advances.
Contributor guide
Research direction
Start by tracing op-node's SetFinalizedHead and FinalizedHead paths, then compare the finalized-ref handling in op-supervisor and op-supernode. Decide where the dedicated SuperAuthority metric belongs and inspect the existing ref metrics there. Done means a distinct scraped metric exposes advancing SuperAuthority finality with block details and tests verify its updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100