Skip to content

Commit 2795c09

Browse files
committed
update codec and interfaces
1 parent fb58c5e commit 2795c09

File tree

16 files changed

+82
-19
lines changed

16 files changed

+82
-19
lines changed

Cargo.lock

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ members = [
1212
"crates/node",
1313
"crates/network",
1414
"crates/scroll-wire",
15-
"crates/primitives", "crates/l1", "crates/database", "crates/indexer", "crates/sequencer", "crates/pipeline", "crates/provider"]
15+
"crates/primitives",
16+
"crates/l1",
17+
"crates/database",
18+
"crates/indexer",
19+
"crates/sequencer",
20+
"crates/pipeline",
21+
"crates/provider",
22+
"crates/codec"]
1623

1724
resolver = "2"
1825

@@ -136,6 +143,7 @@ scroll-engine = { path = "crates/engine" }
136143
scroll-indexer = { path = "crates/indexer" }
137144
scroll-l1 = { path = "crates/l1" }
138145
scroll-network = { path = "crates/network" }
146+
scroll-pipeline = { path = "crates/pipeline"}
139147
scroll-primitives = { path = "crates/primitives" }
140148
scroll-wire = { path = "crates/scroll-wire" }
141149
rollup-node-manager = { path = "crates/node" }

crates/codec/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "codec"
3+
version.workspace = true
4+
edition.workspace = true
5+
rust-version.workspace = true
6+
license.workspace = true
7+
exclude.workspace = true
8+
9+
[dependencies]
10+
11+
[lints]
12+
workspace = true

crates/codec/src/batch.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub struct BatchCodec;

crates/codec/src/chunk.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub struct ChunkCodec;

crates/codec/src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub enum CodecError {
2+
Error,
3+
}

crates/codec/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mod batch;
2+
mod chunk;
3+
mod error;

crates/node/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ scroll-engine.workspace = true
3131
scroll-indexer.workspace = true
3232
scroll-l1.workspace = true
3333
scroll-network.workspace = true
34+
scroll-pipeline.workspace = true
3435
scroll-wire.workspace = true
3536

3637
# misc

crates/node/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/// The configuration of the rollup node.
22
#[derive(Debug)]
33
pub struct Config {
4+
/// If it is a sequencer node.
45
is_sequencer: bool,
6+
/// The block time in milliseconds.
57
block_time: u64,
68
}

crates/node/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use scroll_network::{
1717
BlockImportError, BlockImportOutcome, BlockValidation, BlockValidationError, NetworkManager,
1818
NetworkManagerEvent, NewBlockWithPeer,
1919
};
20+
use scroll_pipeline::Pipeline;
2021
use scroll_wire::NewBlock;
2122
use std::{
2223
future::Future,
@@ -38,6 +39,9 @@ pub use consensus::PoAConsensus;
3839
mod config;
3940
pub use config::Config;
4041

42+
mod state;
43+
pub use state::State;
44+
4145
/// The size of the event channel.
4246
const EVENT_CHANNEL_SIZE: usize = 100;
4347

@@ -72,6 +76,8 @@ pub struct RollupNodeManager<C, EC, P> {
7276
l1_watcher: L1Watcher,
7377
/// The indexer for indexing rollup node data.
7478
indexer: Indexer,
79+
/// The pipeline that derives the scroll chain from L1 events.
80+
pipeline: Pipeline,
7581
/// The receiver for new blocks received from the network (used to bridge from eth-wire).
7682
new_block_rx: UnboundedReceiverStream<NewBlockWithPeer>,
7783
/// The forkchoice state of the rollup node.
@@ -96,6 +102,7 @@ where
96102
consensus: C,
97103
l1_watcher: L1Watcher,
98104
indexer: Indexer,
105+
pipeline: Pipeline,
99106
forkchoice_state: ForkchoiceState,
100107
new_block_rx: UnboundedReceiver<NewBlockWithPeer>,
101108
) -> Self {
@@ -106,6 +113,7 @@ where
106113
consensus,
107114
l1_watcher,
108115
indexer,
116+
pipeline,
109117
new_block_rx: new_block_rx.into(),
110118
forkchoice_state,
111119
pending_block_imports: FuturesOrdered::new(),
@@ -213,7 +221,7 @@ where
213221

214222
/// Handles an L1 event from the L1 watcher.
215223
fn handle_l1_event(&mut self, _event: L1Event) {
216-
todo!();
224+
todo!()
217225
}
218226

219227
/// Handles a block import outcome.

0 commit comments

Comments
 (0)