Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
with:
cache-on-failure: true
- name: Run doc
run: cargo docs --document-private-items
run: cargo docs --document-private-items --exclude rollup-node-chain-orchestrator
env:
RUSTDOCFLAGS: --cfg docsrs --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options -D warnings

Expand Down
61 changes: 17 additions & 44 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ members = [
"crates/engine",
"crates/chain-orchestrator",
"crates/l1",
"crates/manager",
"crates/network",
"crates/node",
"crates/primitives",
Expand Down Expand Up @@ -179,6 +178,7 @@ reth-cli-util = { git = "https://github.com/scroll-tech/reth.git", default-featu

# reth-scroll
reth-scroll-chainspec = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
reth-scroll-consensus = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
reth-scroll-cli = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
reth-scroll-evm = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
reth-scroll-rpc = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
Expand All @@ -190,7 +190,6 @@ reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth.git", defa
# rollup node
rollup-node = { path = "crates/node" }
rollup-node-chain-orchestrator = { path = "crates/chain-orchestrator" }
rollup-node-manager = { path = "crates/manager" }
rollup-node-primitives = { path = "crates/primitives" }
rollup-node-providers = { path = "crates/providers" }
rollup-node-sequencer = { path = "crates/sequencer" }
Expand Down
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ test:
--no-fail-fast \
-E 'not test(docker)'

.PHONY: test-docker
test-docker:
cargo nextest run \
--workspace \
--locked \
--all-features \
--no-fail-fast \
--no-tests=pass \
-E 'test(docker)' \
--test-threads=1 \
--failure-output immediate \
--success-output never \
--verbose

# Used to update the mainnet-sample.sql data. Provide the path to the sqlite database that should be read from
# using `DB_PATH`.
.PHONY: test-data
Expand All @@ -83,7 +97,7 @@ export-sample-test-data:

.PHONY: docs
docs:
cargo docs --document-private-items
cargo docs --document-private-items --exclude rollup-node-chain-orchestrator

.PHONY: pr
pr: lint test docs
Expand Down
45 changes: 45 additions & 0 deletions crates/chain-orchestrator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,44 @@ alloy-eips = { workspace = true }
alloy-json-rpc.workspace = true
alloy-primitives.workspace = true
alloy-provider.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-transport.workspace = true

# rollup-node
scroll-alloy-provider.workspace = true
scroll-db.workspace = true
scroll-engine.workspace = true
rollup-node-providers.workspace = true
rollup-node-primitives.workspace = true
rollup-node-sequencer.workspace = true
rollup-node-signer.workspace = true
rollup-node-watcher.workspace = true

# scroll
reth-scroll-engine-primitives.workspace = true
reth-scroll-consensus.workspace = true
reth-scroll-node.workspace = true
reth-scroll-primitives.workspace = true
scroll-alloy-consensus.workspace = true
scroll-alloy-hardforks.workspace = true
scroll-alloy-network.workspace = true
scroll-derivation-pipeline.workspace = true
scroll-network.workspace = true

# reth
reth-chainspec.workspace = true
reth-network-api.workspace = true
reth-network-p2p.workspace = true
reth-network-peers.workspace = true
reth-primitives-traits.workspace = true
reth-tasks.workspace = true
reth-tokio-util.workspace = true

# misc
futures.workspace = true
metrics.workspace = true
metrics-derive.workspace = true
serde = { workspace = true, optional = true, features = ["derive"] }
strum = "0.27.1"
thiserror.workspace = true
tokio = { workspace = true, features = ["full"] }
Expand Down Expand Up @@ -73,3 +87,34 @@ rand.workspace = true
reqwest.workspace = true
serde_json.workspace = true
tokio.workspace = true

[features]
test-utils = [
"reth-chainspec/test-utils",
"reth-network-p2p/test-utils",
"reth-primitives-traits/test-utils",
"reth-scroll-node/test-utils",
"rollup-node-providers/test-utils",
"rollup-node-watcher/test-utils",
"scroll-db/test-utils",
"scroll-engine/test-utils",
"scroll-network/test-utils",
]
serde = [
"dep:serde",
"alloy-consensus/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"alloy-rpc-types-engine/serde",
"parking_lot/serde",
"rand/serde",
"reth-eth-wire-types/serde",
"reth-network-api/serde",
"reth-primitives-traits/serde",
"reth-scroll-forks/serde",
"reth-scroll-primitives/serde",
"scroll-alloy-consensus/serde",
"scroll-alloy-hardforks/serde",
"scroll-engine/serde",
"scroll-network/serde",
]
57 changes: 0 additions & 57 deletions crates/chain-orchestrator/src/action.rs

This file was deleted.

39 changes: 39 additions & 0 deletions crates/chain-orchestrator/src/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
use std::sync::Arc;

/// Configuration for the chain orchestrator.
#[derive(Debug)]
pub struct ChainOrchestratorConfig<ChainSpec> {
/// The chain specification.
chain_spec: Arc<ChainSpec>,
/// The threshold for optimistic sync. If the received block is more than this many blocks
/// ahead of the current chain, we optimistically sync the chain.
optimistic_sync_threshold: u64,
/// The L1 message queue index at which the V2 L1 message queue was enabled.
l1_v2_message_queue_start_index: u64,
}

impl<ChainSpec> ChainOrchestratorConfig<ChainSpec> {
/// Creates a new chain configuration.
pub const fn new(
chain_spec: Arc<ChainSpec>,
optimistic_sync_threshold: u64,
l1_v2_message_queue_start_index: u64,
) -> Self {
Self { chain_spec, optimistic_sync_threshold, l1_v2_message_queue_start_index }
}

/// Returns a reference to the chain specification.
pub const fn chain_spec(&self) -> &Arc<ChainSpec> {
&self.chain_spec
}

/// Returns the optimistic sync threshold.
pub const fn optimistic_sync_threshold(&self) -> u64 {
self.optimistic_sync_threshold
}

/// Returns the L1 message queue index at which the V2 L1 message queue was enabled.
pub const fn l1_v2_message_queue_start_index(&self) -> u64 {
self.l1_v2_message_queue_start_index
}
}
Loading
Loading