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

feat(supervisor/core): handle invalidate blocks#2564

Merged
dhyaniarun1993 merged 17 commits intomainfrom
feat/handle-invalidate-blocks
Jul 29, 2025
Merged

feat(supervisor/core): handle invalidate blocks#2564
dhyaniarun1993 merged 17 commits intomainfrom
feat/handle-invalidate-blocks

Conversation

@dhyaniarun1993
Copy link
Collaborator

Closes #2435
Close #2436

@dhyaniarun1993 dhyaniarun1993 self-assigned this Jul 28, 2025
@dhyaniarun1993 dhyaniarun1993 added the W-supervisor Workstream: supervisor label Jul 28, 2025
@codecov
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 94.18605% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.5%. Comparing base (b3833f9) to head (c1dc1a9).
⚠️ Report is 7 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 94.0% 20 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.

Base automatically changed from sa/feat/integrate-l2-reorg to main July 28, 2025 10:58
@dhyaniarun1993 dhyaniarun1993 marked this pull request as ready for review July 28, 2025 12:12
Copilot AI review requested due to automatic review settings July 28, 2025 12:12
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 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 InvalidateBlock event type to the chain event system
  • Implemented invalidate block and block replacement handling logic with state management
  • Changed primitive types from U64 to u64 for 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)

@dhyaniarun1993 dhyaniarun1993 changed the title [WIP] feat(supervisor/core): handle invalidate blocks feat(supervisor/core): handle invalidate blocks Jul 28, 2025
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.

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.

@dhyaniarun1993 dhyaniarun1993 requested a review from sadiq1971 July 29, 2025 03:00
@dhyaniarun1993 dhyaniarun1993 added this pull request to the merge queue Jul 29, 2025
Merged via the queue into main with commit 2fb3845 Jul 29, 2025
30 checks passed
@dhyaniarun1993 dhyaniarun1993 deleted the feat/handle-invalidate-blocks branch July 29, 2025 09:58
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Dec 10, 2025
Closes op-rs/kona#2435 
Close op-rs/kona#2436

---------

Co-authored-by: sadiq1971 <sadiqurr8@gmail.com>
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 14, 2026
Closes #2435 
Close #2436

---------

Co-authored-by: sadiq1971 <sadiqurr8@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

W-supervisor Workstream: supervisor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat (supervisor/core): [Safety Checker] handle block replacement feat (supervisor/core): [Safety Checker] block invalidation

4 participants