Skip to content

feat: chain orchestrator #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

feat: chain orchestrator #185

wants to merge 16 commits into from

Conversation

frisitano
Copy link
Collaborator

No description provided.

@frisitano frisitano marked this pull request as ready for review July 16, 2025 14:10
@frisitano frisitano requested a review from Copilot July 16, 2025 14:13
Copy link

@Copilot 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 a new ChainOrchestrator to replace the previous indexer, integrates it throughout the node, watcher, network, and engine, and updates tests and database migrations accordingly.

  • Introduces ChainOrchestrator in place of Indexer, refactors RollupNodeManager to consume orchestrator events instead of indexer events.
  • Adds Synced notifications to L1Watcher and updates engine driver to handle optimistic sync via ChainOrchestrator.
  • Refactors configuration (ScrollRollupNodeConfig), network manager, and database migrations; adjusts tests to cover the new orchestrator flows.

Reviewed Changes

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

Show a summary per file
File Description
crates/indexer/src/lib.rs Rename Indexer to ChainOrchestrator and overhaul API flows
crates/manager/src/manager/mod.rs Replace indexer usage with ChainOrchestrator in node manager
crates/node/src/args.rs Instantiate ChainOrchestrator in ScrollRollupNodeConfig
crates/watcher/src/lib.rs Add Synced variant and is_synced flag to L1Watcher
crates/scroll-wire/src/protocol/proto.rs Adjust doc comment for NewBlock::new
crates/node/tests/e2e.rs Add/revise reorg and sync end-to-end tests
crates/watcher/tests/reorg.rs Update tests to skip Synced notifications
crates/database/db/src/operations.rs Extend DB ops with L1MessageStart and block-and-batch queries
crates/database/migration/src/migration_info.rs Add genesis_hash() to migrations and insert genesis blocks
crates/network/src/manager.rs Wire up eth-wire listener and dispatch chain-orchestrator events
crates/engine/src/driver.rs Support ChainImport and OptimisticSync futures in engine driver
Comments suppressed due to low confidence (2)

crates/scroll-wire/src/protocol/proto.rs:33

  • The doc comment uses "blocks" (plural) but the constructor takes a single block; change to "block" for accuracy.
    /// Returns a [`NewBlock`] instance with the provided signature and blocks.

crates/node/tests/e2e.rs:95

  • The follower_can_reorg test has no assertions; either add meaningful checks or remove the empty test to maintain coverage.
async fn follower_can_reorg() -> eyre::Result<()> {

@@ -91,15 +91,19 @@ async fn test_should_detect_reorg() -> eyre::Result<()> {
continue
}

// skip the `L1Notification::Synced` notifications
let mut notification = l1_watcher.recv().await.unwrap();
if matches!(notification.as_ref(), L1Notification::Synced) {
Copy link
Preview

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

This only skips one Synced notification; consider looping (e.g. while matches!(...) { ... }) to skip all consecutive Synced messages.

Suggested change
if matches!(notification.as_ref(), L1Notification::Synced) {
while matches!(notification.as_ref(), L1Notification::Synced) {

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant