Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ jobs:
include:
- type: wasm
target: wasm32-unknown-unknown
exclude: scroll-engine,scroll-wire,scroll-bridge,scroll-network,rollup-node-manager
exclude: scroll-engine,scroll-wire,scroll-bridge,scroll-network,rollup-node-manager,scroll-indexer,scroll-l1,scroll-pipeline,scroll-primitives,sequencer
- type: riscv
target: riscv32imac-unknown-none-elf
exclude: scroll-engine,scroll-wire,scroll-bridge,scroll-network,rollup-node-manager
exclude: scroll-engine,scroll-wire,scroll-bridge,scroll-network,rollup-node-manager,scroll-indexer,scroll-l1,scroll-pipeline,scroll-primitives,sequencer
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
Expand Down
70 changes: 70 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ members = [
"crates/engine",
"crates/node",
"crates/network",
"crates/scroll-wire"
]
"crates/scroll-wire",
"crates/primitives",
"crates/l1",
"crates/database",
"crates/indexer",
"crates/sequencer",
"crates/pipeline",
"crates/provider",
"crates/codec"]

resolver = "2"

Expand Down Expand Up @@ -111,6 +118,7 @@ alloy-primitives = { version = "0.8.15", default-features = false }
alloy-rpc-types-engine = { version = "0.11.0", default-features = false }

# scroll-alloy
scroll-alloy-rpc-types-engine = { git = "https://github.com/scroll-tech/reth.git", branch = "feat/add-deref-blanket-engine-api" }
scroll-alloy-provider = { git = "https://github.com/scroll-tech/reth.git", branch = "feat/add-deref-blanket-engine-api" }
scroll-alloy-network = { git = "https://github.com/scroll-tech/reth.git", branch = "feat/add-deref-blanket-engine-api" }

Expand All @@ -132,7 +140,11 @@ reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth.git", bran

# rollup node
scroll-engine = { path = "crates/engine" }
scroll-indexer = { path = "crates/indexer" }
scroll-l1 = { path = "crates/l1" }
scroll-network = { path = "crates/network" }
scroll-pipeline = { path = "crates/pipeline"}
scroll-primitives = { path = "crates/primitives" }
scroll-wire = { path = "crates/scroll-wire" }
rollup-node-manager = { path = "crates/node" }

Expand Down
3 changes: 3 additions & 0 deletions bin/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ reth-scroll-primitives = { workspace = true }
scroll-wire.workspace = true
scroll-network.workspace = true
scroll-engine = { workspace = true, features = ["test-utils"] }
scroll-l1.workspace = true
scroll-indexer.workspace = true
scroll-pipeline.workspace = true

# rollup-node
rollup-node-manager.workspace = true
Expand Down
18 changes: 16 additions & 2 deletions bin/bridge/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ use reth_rpc_builder::config::RethRpcServerConfig;
use reth_scroll_chainspec::ScrollChainSpec;
use reth_scroll_primitives::ScrollPrimitives;
use reth_transaction_pool::{PoolTransaction, TransactionPool};
use rollup_node_manager::{PoAConsensus, RollupNodeManager};
use rollup_node_manager::{Config, PoAConsensus, RollupNodeManager};
use scroll_alloy_provider::ScrollAuthEngineApiProvider;
use scroll_engine::{test_utils::NoopExecutionPayloadProvider, EngineDriver, ForkchoiceState};
use scroll_indexer::Indexer;
use scroll_l1::L1Watcher;
use scroll_network::NetworkManager as ScrollNetworkManager;
use scroll_pipeline::Pipeline;
use scroll_wire::{ProtocolHandler, ScrollWireConfig};
use tracing::info;

Expand Down Expand Up @@ -64,6 +67,7 @@ where
let consensus = PoAConsensus::new(vec![]);
let payload_provider = NoopExecutionPayloadProvider;

// Create the engine driver.
let auth_port = ctx.config().rpc.auth_port;
let auth_secret = ctx.config().rpc.auth_jwt_secret(ctx.config().datadir().jwt())?;

Expand All @@ -73,13 +77,23 @@ where
);
let engine = EngineDriver::new(engine_api, payload_provider);

// TODO: Provide this via config file.
// Create the node config.
let is_sequencer = false;
let block_time = 2;
let config = Config::new(is_sequencer, block_time);

let rollup_node_manager = RollupNodeManager::new(
config,
scroll_network_manager,
engine,
consensus,
L1Watcher,
Indexer,
Pipeline,
ForkchoiceState::genesis(
ctx.config().chain.chain.try_into().expect("must be a named chain"),
),
consensus,
new_block_rx,
);

Expand Down
12 changes: 12 additions & 0 deletions crates/codec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "codec"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
exclude.workspace = true

[dependencies]

[lints]
workspace = true
2 changes: 2 additions & 0 deletions crates/codec/src/batch.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[allow(dead_code)]
struct BatchCodec;
2 changes: 2 additions & 0 deletions crates/codec/src/chunk.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[allow(dead_code)]
struct ChunkCodec;
4 changes: 4 additions & 0 deletions crates/codec/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#[allow(dead_code)]
enum CodecError {
Error,
}
6 changes: 6 additions & 0 deletions crates/codec/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//! Codec is a library for encoding and decoding data relevant to settling the Scroll rollup to the
//! L1.

mod batch;
mod chunk;
mod error;
12 changes: 12 additions & 0 deletions crates/database/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "database"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
exclude.workspace = true

[dependencies]

[lints]
workspace = true
5 changes: 5 additions & 0 deletions crates/database/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//! A database implementation for persisting data.

/// A database implementation for persisting data.
#[derive(Debug)]
pub struct Database;
2 changes: 1 addition & 1 deletion crates/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ alloy-rpc-types-engine.workspace = true
# scroll-alloy
scroll-alloy-network.workspace = true
scroll-alloy-provider.workspace = true
scroll-alloy-rpc-types-engine = { git = "https://github.com/scroll-tech/reth.git", branch = "feat/add-deref-blanket-engine-api" }
scroll-alloy-rpc-types-engine.workspace = true

# reth
reth-engine-primitives = { git = "https://github.com/scroll-tech/reth.git", branch = "feat/add-deref-blanket-engine-api", default-features = false, features = ["scroll"] }
Expand Down
15 changes: 15 additions & 0 deletions crates/indexer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "scroll-indexer"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
exclude.workspace = true

[dependencies]
# rollup-node
scroll-l1.workspace = true
scroll-primitives.workspace = true

[lints]
workspace = true
38 changes: 38 additions & 0 deletions crates/indexer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//! A library responsible for indexing data relevant to the L1.

use scroll_l1::L1Event;
use scroll_primitives::{BatchInput, L1Message};
use std::sync::Arc;

/// The indexer is responsible for indexing data relevant to the L1.
#[derive(Debug)]
pub struct Indexer;

impl Indexer {
/// Handles an event from the L1.
pub async fn handle_l1_event(&mut self, event: L1Event) {
match event {
L1Event::CommitBatch(batch_input) => self.handle_batch_input(batch_input).await,
L1Event::Reorg(block_number) => self.handle_reorg(block_number).await,
L1Event::NewBlock(_block_number) => todo!(),
L1Event::Finalized(block_number) => self.handle_finalized(block_number).await,
L1Event::L1Message(l1_message) => self.handle_l1_message(l1_message).await,
}
}

async fn handle_reorg(&self, _block_number: u64) {
todo!()
}

async fn handle_finalized(&self, _block_number: u64) {
todo!()
}

async fn handle_l1_message(&self, _l1_message: Arc<L1Message>) {
todo!()
}

async fn handle_batch_input(&self, _batch_input: Arc<BatchInput>) {
todo!()
}
}
21 changes: 21 additions & 0 deletions crates/l1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "scroll-l1"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
exclude.workspace = true

[dependencies]
# alloy
alloy-sol-types = { version = "0.8.20", features = ["json"] }
alloy-primitives.workspace = true

# rollup-node
scroll-primitives.workspace = true

# misc
futures.workspace = true

[lints]
workspace = true
1 change: 1 addition & 0 deletions crates/l1/abi/L1MessageQueue.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions crates/l1/abi/ScrollChain.json

Large diffs are not rendered by default.

Loading
Loading