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

chore(supervisor/storage): log improvements#2525

Merged
dhyaniarun1993 merged 1 commit intomainfrom
chore/log-improvements
Jul 23, 2025
Merged

chore(supervisor/storage): log improvements#2525
dhyaniarun1993 merged 1 commit intomainfrom
chore/log-improvements

Conversation

@dhyaniarun1993
Copy link
Collaborator

Addresses #2337

@dhyaniarun1993 dhyaniarun1993 self-assigned this Jul 23, 2025
Copilot AI review requested due to automatic review settings July 23, 2025 07:06
@dhyaniarun1993 dhyaniarun1993 added K-chore Kind: chore W-supervisor Workstream: supervisor A-db Area: database labels Jul 23, 2025
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 PR enhances logging in the supervisor storage module by adding chain ID context to all log messages across the storage providers. The main purpose is to improve debugging and monitoring capabilities in multi-chain environments where distinguishing between different chains is crucial.

  • Adds ChainId field to all storage provider structs and updates their constructors
  • Replaces manual constructor implementations with derive_more::Constructor derive macro
  • Enhances all log statements to include chain ID information for better traceability

Reviewed Changes

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

File Description
log_provider.rs Adds chain_id field to LogProvider, updates constructor with derive macro, and adds chain_id to all logging statements
head_ref_provider.rs Adds chain_id field to SafetyHeadRefProvider, updates constructor with derive macro, and includes chain_id in log messages
derivation_provider.rs Adds chain_id field to DerivationProvider, updates constructor with derive macro, and enhances logging with chain_id context
chaindb.rs Updates all provider instantiations to pass chain_id parameter and adds chain_id to some error log messages
Comments suppressed due to low confidence (3)

crates/supervisor/storage/src/providers/log_provider.rs:334

  • [nitpick] The constant name 'CHAIN_ID' is too generic for a test context. Consider renaming to 'TEST_CHAIN_ID' to better indicate this is test-specific data.
    static CHAIN_ID: ChainId = 1;

crates/supervisor/storage/src/providers/head_ref_provider.rs:134

  • [nitpick] The constant name 'CHAIN_ID' is too generic for a test context. Consider renaming to 'TEST_CHAIN_ID' to better indicate this is test-specific data.
    static CHAIN_ID: ChainId = 1;

crates/supervisor/storage/src/providers/derivation_provider.rs:538

  • [nitpick] The constant name 'CHAIN_ID' is too generic for a test context. Consider renaming to 'TEST_CHAIN_ID' to better indicate this is test-specific data.
    static CHAIN_ID: ChainId = 1;

@codecov
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

Attention: Patch coverage is 77.88462% with 23 lines in your changes missing coverage. Please review.

Project coverage is 82.4%. Comparing base (572de05) to head (4baa0db).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...s/supervisor/storage/src/providers/log_provider.rs 50.0% 16 Missing ⚠️
crates/supervisor/storage/src/chaindb.rs 89.7% 5 Missing ⚠️
...visor/storage/src/providers/derivation_provider.rs 88.2% 2 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.

Copy link
Contributor

@emhane emhane left a comment

Choose a reason for hiding this comment

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

lgtm

@itschaindev
Copy link
Collaborator

Will we be doing the same for other modules in separate PR?

@dhyaniarun1993
Copy link
Collaborator Author

Will we be doing the same for other modules in separate PR?

Yep, I am working on it.

@dhyaniarun1993 dhyaniarun1993 added this pull request to the merge queue Jul 23, 2025
Merged via the queue into main with commit c508d91 Jul 23, 2025
32 of 34 checks passed
@dhyaniarun1993 dhyaniarun1993 deleted the chore/log-improvements branch July 23, 2025 09:10
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

A-db Area: database K-chore Kind: chore W-supervisor Workstream: supervisor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants