chore(supervisor/storage): log improvements#2525
Conversation
There was a problem hiding this comment.
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
ChainIdfield to all storage provider structs and updates their constructors - Replaces manual constructor implementations with
derive_more::Constructorderive 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 ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Will we be doing the same for other modules in separate PR? |
Yep, I am working on it. |
Addresses #2337