Skip to content

Commit f3c7acb

Browse files
authored
Merge branch 'main' into docs/docker-operations
2 parents f47465b + a0643df commit f3c7acb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2307
-1063
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -124,74 +124,74 @@ strip = "none"
124124

125125
[workspace.dependencies]
126126
# alloy
127-
alloy-chains = { version = "0.2.9", default-features = false }
127+
alloy-chains = { version = "0.2.5", default-features = false }
128128
alloy-consensus = { version = "1.0.37", default-features = false }
129129
alloy-eips = { version = "1.0.37", default-features = false }
130130
alloy-json-rpc = { version = "1.0.37", default-features = false }
131131
alloy-network = { version = "1.0.37", default-features = false }
132-
alloy-primitives = { version = "1.3.1", default-features = false }
132+
alloy-primitives = { version = "1.4.1", default-features = false }
133133
alloy-provider = { version = "1.0.37", default-features = false }
134134
alloy-rpc-client = { version = "1.0.37", default-features = false }
135135
alloy-rpc-types-engine = { version = "1.0.37", default-features = false }
136136
alloy-rpc-types-eth = { version = "1.0.37", default-features = false }
137-
alloy-sol-types = { version = "1.3.1", default-features = false }
137+
alloy-sol-types = { version = "1.4.1", default-features = false }
138138
alloy-signer = { version = "1.0.37", default-features = false }
139139
alloy-signer-local = { version = "1.0.37", default-features = false }
140140
alloy-transport = { version = "1.0.37", default-features = false }
141141

142142
# scroll-alloy
143-
scroll-alloy-consensus = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
144-
scroll-alloy-hardforks = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
145-
scroll-alloy-network = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
146-
scroll-alloy-provider = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
147-
scroll-alloy-evm = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
148-
scroll-alloy-rpc-types = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
149-
scroll-alloy-rpc-types-engine = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
143+
scroll-alloy-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
144+
scroll-alloy-hardforks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
145+
scroll-alloy-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
146+
scroll-alloy-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
147+
scroll-alloy-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
148+
scroll-alloy-rpc-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
149+
scroll-alloy-rpc-types-engine = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
150150

151151
# reth
152-
reth-chainspec = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
153-
reth-e2e-test-utils = { git = "https://github.com/scroll-tech/reth.git" }
154-
reth-eth-wire = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
155-
reth-eth-wire-types = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
156-
reth-network = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
157-
reth-network-api = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
158-
reth-network-p2p = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
159-
reth-network-peers = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
160-
reth-network-types = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
161-
reth-node-builder = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
162-
reth-node-core = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
163-
reth-node-api = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
164-
reth-node-types = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
165-
reth-payload-primitives = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
166-
reth-primitives = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
167-
reth-primitives-traits = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
168-
reth-provider = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
169-
reth-rpc-api = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
170-
reth-rpc-eth-api = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
171-
reth-rpc-eth-types = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
172-
reth-rpc-server-types = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
173-
reth-storage-api = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
174-
reth-tasks = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
175-
reth-tokio-util = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
176-
reth-tracing = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
177-
reth-transaction-pool = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
178-
reth-trie-db = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
179-
reth-testing-utils = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
180-
reth-revm = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
181-
reth-evm = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
182-
reth-engine-local = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
183-
reth-cli-util = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
152+
reth-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
153+
reth-e2e-test-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91" }
154+
reth-eth-wire = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
155+
reth-eth-wire-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
156+
reth-network = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
157+
reth-network-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
158+
reth-network-p2p = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
159+
reth-network-peers = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
160+
reth-network-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
161+
reth-node-builder = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
162+
reth-node-core = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
163+
reth-node-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
164+
reth-node-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
165+
reth-payload-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
166+
reth-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
167+
reth-primitives-traits = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
168+
reth-provider = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
169+
reth-rpc-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
170+
reth-rpc-eth-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
171+
reth-rpc-eth-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
172+
reth-rpc-server-types = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
173+
reth-storage-api = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
174+
reth-tasks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
175+
reth-tokio-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
176+
reth-tracing = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
177+
reth-transaction-pool = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
178+
reth-trie-db = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
179+
reth-testing-utils = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
180+
reth-revm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
181+
reth-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
182+
reth-engine-local = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
183+
reth-cli-util = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
184184

185185
# reth-scroll
186-
reth-scroll-chainspec = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
187-
reth-scroll-consensus = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
188-
reth-scroll-cli = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
189-
reth-scroll-evm = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
190-
reth-scroll-rpc = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
191-
reth-scroll-engine-primitives = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
192-
reth-scroll-forks = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
193-
reth-scroll-node = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
194-
reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth.git", default-features = false }
186+
reth-scroll-chainspec = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
187+
reth-scroll-consensus = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
188+
reth-scroll-cli = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
189+
reth-scroll-evm = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
190+
reth-scroll-rpc = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
191+
reth-scroll-engine-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
192+
reth-scroll-forks = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
193+
reth-scroll-node = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
194+
reth-scroll-primitives = { git = "https://github.com/scroll-tech/reth.git", tag = "scroll-v91", default-features = false }
195195

196196
# rollup node
197197
rollup-node = { path = "crates/node" }
@@ -235,8 +235,8 @@ tracing = "0.1.0"
235235
getrandom = { version = "0.2", features = ["js"] }
236236

237237
[patch.crates-io]
238-
revm = { git = "https://github.com/scroll-tech/revm" }
239-
op-revm = { git = "https://github.com/scroll-tech/revm" }
238+
revm = { git = "https://github.com/scroll-tech/revm", tag = "scroll-v91" }
239+
op-revm = { git = "https://github.com/scroll-tech/revm", tag = "scroll-v91" }
240240

241241
# [patch."https://github.com/scroll-tech/reth.git"]
242242
# reth-chainspec = { path = "../reth/crates/chainspec" }

crates/chain-orchestrator/src/consolidation.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use super::ChainOrchestratorError;
22
use alloy_provider::Provider;
33
use futures::{stream::FuturesOrdered, TryStreamExt};
4-
use rollup_node_primitives::{BatchConsolidationOutcome, BatchInfo, L2BlockInfoWithL1Messages};
4+
use rollup_node_primitives::{
5+
BatchConsolidationOutcome, BatchInfo, BatchStatus, L2BlockInfoWithL1Messages,
6+
};
57
use scroll_alloy_network::Scroll;
68
use scroll_derivation_pipeline::{BatchDerivationResult, DerivedAttributes};
79
use scroll_engine::{block_matches_attributes, ForkchoiceState};
@@ -53,7 +55,11 @@ pub(crate) async fn reconcile_batch<L2P: Provider<Scroll>>(
5355
}
5456

5557
let actions: Vec<BlockConsolidationAction> = futures.try_collect().await?;
56-
Ok(BatchReconciliationResult { batch_info: batch.batch_info, actions })
58+
Ok(BatchReconciliationResult {
59+
batch_info: batch.batch_info,
60+
actions,
61+
target_status: batch.target_status,
62+
})
5763
}
5864

5965
/// The result of reconciling a batch with the L2 chain.
@@ -63,6 +69,8 @@ pub(crate) struct BatchReconciliationResult {
6369
pub batch_info: BatchInfo,
6470
/// The actions that must be performed on the L2 chain to consolidate the batch.
6571
pub actions: Vec<BlockConsolidationAction>,
72+
/// The target status of the batch after consolidation.
73+
pub target_status: BatchStatus,
6674
}
6775

6876
impl BatchReconciliationResult {
@@ -93,7 +101,8 @@ impl BatchReconciliationResult {
93101
self,
94102
reorg_results: Vec<L2BlockInfoWithL1Messages>,
95103
) -> Result<BatchConsolidationOutcome, ChainOrchestratorError> {
96-
let mut consolidate_chain = BatchConsolidationOutcome::new(self.batch_info);
104+
let mut consolidate_chain =
105+
BatchConsolidationOutcome::new(self.batch_info, self.target_status);
97106

98107
// First append all non-reorg results to the consolidated chain.
99108
self.actions.into_iter().filter(|action| !action.is_reorg()).for_each(|action| {

crates/chain-orchestrator/src/event.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,21 @@ pub enum ChainOrchestratorEvent {
4242
batch_info: BatchInfo,
4343
/// The L1 block number in which the batch was committed.
4444
l1_block_number: u64,
45-
/// The safe L2 block info.
46-
safe_head: Option<BlockInfo>,
4745
},
4846
/// A batch has been finalized returning a list of finalized batches.
49-
BatchFinalized(u64, Vec<BatchInfo>),
47+
BatchFinalized {
48+
/// The L1 block info at which the batch finalization event was received.
49+
l1_block_info: BlockInfo,
50+
/// The list of batches that have been triggered for the derivation pipeline.
51+
triggered_batches: Vec<BatchInfo>,
52+
},
53+
/// A batch has been reverted returning the batch info and the new safe head.
54+
BatchReverted {
55+
/// The latest batch info after the revert.
56+
batch_info: BatchInfo,
57+
/// The new safe head after the revert.
58+
safe_head: BlockInfo,
59+
},
5060
/// A new L1 block has been received returning the L1 block number.
5161
NewL1Block(u64),
5262
/// An L1 block has been finalized returning the L1 block number and the list of finalized

crates/chain-orchestrator/src/handle/command.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ pub enum ChainOrchestratorCommand<N: FullNetwork<Primitives = ScrollNetworkPrimi
3030
/// Enable gossiping of blocks to peers.
3131
#[cfg(feature = "test-utils")]
3232
SetGossip((bool, oneshot::Sender<()>)),
33+
/// Returns a database handle for direct database access.
34+
#[cfg(feature = "test-utils")]
35+
DatabaseHandle(oneshot::Sender<std::sync::Arc<scroll_db::Database>>),
3336
}
3437

3538
/// The database queries that can be sent to the rollup manager.

crates/chain-orchestrator/src/handle/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,14 @@ impl<N: FullNetwork<Primitives = ScrollNetworkPrimitives>> ChainOrchestratorHand
110110
self.send_command(ChainOrchestratorCommand::SetGossip((enabled, tx)));
111111
rx.await
112112
}
113+
114+
/// Sends a command to the rollup manager to get a database handle for direct database access.
115+
#[cfg(feature = "test-utils")]
116+
pub async fn get_database_handle(
117+
&self,
118+
) -> Result<std::sync::Arc<scroll_db::Database>, oneshot::error::RecvError> {
119+
let (tx, rx) = oneshot::channel();
120+
self.send_command(ChainOrchestratorCommand::DatabaseHandle(tx));
121+
rx.await
122+
}
113123
}

0 commit comments

Comments
 (0)