feat(supervisor/core): handle invalidate blocks#2564
Conversation
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR implements invalidate block handling functionality in the supervisor core component. The primary purpose is to add support for handling block invalidation events and subsequent block replacement operations in the chain processor.
Key Changes:
- Added
InvalidateBlockevent type to the chain event system - Implemented invalidate block and block replacement handling logic with state management
- Changed primitive types from
U64tou64for block numbers and timestamps
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
crates/supervisor/types/src/types.rs |
Changed BlockSeal fields from U64 to native u64 type |
crates/supervisor/core/src/event/chain.rs |
Added new InvalidateBlock variant to ChainEvent enum |
crates/supervisor/core/src/chain_processor/task.rs |
Implemented core invalidate block handling logic and block replacement processing |
crates/supervisor/core/src/chain_processor/chain.rs |
Updated trait bounds to use consolidated storage traits |
Comments suppressed due to low confidence (1)
There was a problem hiding this comment.
smol comments on log level, asides that lgtm
we want log levels to be used like this:
INFO Handling reorg for chain sequence start_block=X ...
DEBUG Replacing blocks old=X new=Y ...
TRACE Entering a specific method args=X, e.g. handle_invalidate_block ...
INFO Reorg successful new_head_hash=X.
does that make sense?
recap on how to think about log levels:
we want to use log filters by target in the most helpful way, e.g. we are isolating a bug in target chain_processor which is triggered in the interaction with target supervisor_service, then we use the log filter RUST_LOG=supervisor_service=debug,chain_processor=trace in order to observe chain processor with more granularity and supervisor with less granularity at the same time. that's why it's important that debug log levels (and info log levels) aren't too verbose, and that we make use of trace log level for that, because we have to take into account observing several components at the same time with different granularity.
Closes op-rs/kona#2435 Close op-rs/kona#2436 --------- Co-authored-by: sadiq1971 <sadiqurr8@gmail.com>
Closes #2435
Close #2436