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
253 changes: 127 additions & 126 deletions Cargo.lock

Large diffs are not rendered by default.

98 changes: 49 additions & 49 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,59 +140,59 @@ alloy-signer-local = { version = "1.0.37", default-features = false }
alloy-transport = { version = "1.0.37", default-features = false }

# scroll-alloy
scroll-alloy-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
scroll-alloy-hardforks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
scroll-alloy-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
scroll-alloy-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
scroll-alloy-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
scroll-alloy-rpc-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
scroll-alloy-rpc-types-engine = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
scroll-alloy-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
scroll-alloy-hardforks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
scroll-alloy-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
scroll-alloy-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
scroll-alloy-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
scroll-alloy-rpc-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
scroll-alloy-rpc-types-engine = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }

# reth
reth-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-e2e-test-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4" }
reth-eth-wire = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-eth-wire-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-network-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-network-p2p = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-network-peers = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-network-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-node-builder = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-node-core = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-node-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-node-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-payload-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-primitives-traits = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-rpc-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-rpc-eth-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-rpc-eth-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-rpc-layer = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-rpc-server-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-storage-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-tasks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-tokio-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-tracing = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-transaction-pool = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-trie-db = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-testing-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-revm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-engine-local = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-cli-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-e2e-test-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5" }
reth-eth-wire = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-eth-wire-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-network-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-network-p2p = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-network-peers = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-network-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-node-builder = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-node-core = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-node-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-node-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-payload-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-primitives-traits = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-rpc-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-rpc-eth-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-rpc-eth-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-rpc-layer = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-rpc-server-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-storage-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-tasks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-tokio-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-tracing = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-transaction-pool = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-trie-db = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-testing-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-revm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-engine-local = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-cli-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }

# reth-scroll
reth-scroll-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-scroll-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-scroll-cli = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-scroll-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-scroll-rpc = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-scroll-engine-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-scroll-forks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-scroll-node = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.4", default-features = false }
reth-scroll-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-scroll-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-scroll-cli = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-scroll-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-scroll-rpc = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-scroll-engine-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-scroll-forks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-scroll-node = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }
reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91.5", default-features = false }

# rollup node
rollup-node = { path = "crates/node" }
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export-sample-test-data:

.PHONY: docs
docs:
cargo docs --document-private-items --exclude rollup-node-chain-orchestrator
cargo +$(NIGHTLY_TOOLCHAIN) docs --document-private-items --exclude rollup-node-chain-orchestrator

.PHONY: pr
pr: lint test docs
Expand Down
2 changes: 2 additions & 0 deletions crates/chain-orchestrator/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use scroll_network::NewBlockWithPeer;
pub enum ChainOrchestratorEvent {
/// A received block failed the consensus checks.
BlockFailedConsensusChecks(B256, PeerId),
/// A finalized block was received from a peer.
L2FinalizedBlockReceived(B256, PeerId),
/// A new block has been received from the network but we have insufficient data to process it
/// due to being in optimistic mode.
InsufficientDataForReceivedBlock(B256),
Expand Down
11 changes: 11 additions & 0 deletions crates/chain-orchestrator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,17 @@ impl<
) -> Result<Option<ChainOrchestratorEvent>, ChainOrchestratorError> {
tracing::debug!(target: "scroll::chain_orchestrator", block_hash = ?block_with_peer.block.header.hash_slow(), block_number = ?block_with_peer.block.number, peer_id = ?block_with_peer.peer_id, "Received new block from peer");

// Check we are not handling a finalized block.
if block_with_peer.block.header.number <= self.engine.fcs().finalized_block_info().number {
self.network
.handle()
.block_import_outcome(BlockImportOutcome::finalized_block(block_with_peer.peer_id));
return Ok(Some(ChainOrchestratorEvent::L2FinalizedBlockReceived(
block_with_peer.block.header.hash_slow(),
block_with_peer.peer_id,
)));
}

if let Err(err) =
self.consensus.validate_new_block(&block_with_peer.block, &block_with_peer.signature)
{
Expand Down
7 changes: 7 additions & 0 deletions crates/network/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ pub struct BlockImportOutcome {
}

impl BlockImportOutcome {
/// Creates a new `BlockImportOutcome` instance for a finalized block with the given peer ID.
pub fn finalized_block(peer: PeerId) -> Self {
Self { peer, result: Err(BlockImportError::L2FinalizedBlockReceived(peer)) }
}

/// Creates a new `BlockImportOutcome` instance for an invalid block with the given peer ID.
pub fn invalid_block(peer: PeerId) -> Self {
Self { peer, result: Err(BlockImportError::Validation(BlockValidationError::InvalidBlock)) }
Expand Down Expand Up @@ -56,6 +61,8 @@ pub enum BlockImportError {
Consensus(ConsensusError),
/// An error occurred during block validation.
Validation(BlockValidationError),
/// A finalized block was received from a peer.
L2FinalizedBlockReceived(PeerId),
}

/// A consensus related error that can occur during block import.
Expand Down
Loading
Loading