Skip to content

Commit 3bcb8d3

Browse files
committed
integrate scroll reth upstream changes and foundry fork
1 parent bc3d500 commit 3bcb8d3

16 files changed

Lines changed: 3204 additions & 2988 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 104 additions & 77 deletions
Large diffs are not rendered by default.

crates/chain-orchestrator/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ test-utils = [
9999
"scroll-db/test-utils",
100100
"scroll-engine/test-utils",
101101
"scroll-network/test-utils",
102+
"reth-tasks/test-utils",
102103
]
103104
serde = [
104105
"dep:serde",

crates/node/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ aws-config = "1.8.0"
8080
aws-sdk-kms = "1.76.0"
8181

8282
# test-utils
83-
anvil = { git = "https://github.com/foundry-rs/foundry.git", rev = "2c84e1c970d11ef5023a77d8002a1cb70b143888", default-features = false, optional = true }
83+
anvil = { git = "https://github.com/scroll-tech/foundry.git", branch = "feat/bump-dependencies", default-features = false, optional = true }
8484
alloy-rpc-types-eth = { workspace = true, optional = true }
8585
alloy-rpc-types-anvil = { workspace = true, optional = true }
8686
reth-db = { workspace = true, optional = true, features = ["test-utils"] }
@@ -175,4 +175,5 @@ test-utils = [
175175
"alloy-provider/anvil-api",
176176
"alloy-provider/anvil-node",
177177
"reth-db?/test-utils",
178+
"reth-tasks/test-utils",
178179
]

crates/node/src/add_ons/handle.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ impl<
2525
fn rpc_handle(&self) -> &RpcHandle<Node, EthApi> {
2626
&self.rpc_handle
2727
}
28+
29+
fn rpc_handle_mut(&mut self) -> &mut RpcHandle<Node, EthApi> {
30+
&mut self.rpc_handle
31+
}
2832
}

crates/node/src/args.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl ScrollRollupNodeConfig {
217217
Ok(handle) => {
218218
tracing::info!(target: "rollup_node::pprof", "pprof server started successfully");
219219
// Spawn the pprof server task
220-
ctx.task_executor.spawn_critical("pprof_server", async move {
220+
ctx.task_executor.spawn_critical_task("pprof_server", async move {
221221
if let Err(e) = handle.await {
222222
tracing::error!(target: "rollup_node::pprof", "pprof server error: {:?}", e);
223223
}
@@ -281,7 +281,7 @@ impl ScrollRollupNodeConfig {
281281
// Fetch the database from the hydrated config.
282282
let db = self.database.clone().expect("should hydrate config before build");
283283
let db_maintenance = DatabaseMaintenance::new(db.clone());
284-
ctx.task_executor.spawn(db_maintenance.run());
284+
ctx.task_executor.spawn_critical_task("db_maintenance", db_maintenance.run());
285285

286286
// Run the database migrations
287287
if let Some(named) = chain_spec.chain().named() {
@@ -383,7 +383,8 @@ impl ScrollRollupNodeConfig {
383383
td_constant(chain_spec.chain().named()),
384384
authorized_signer,
385385
);
386-
ctx.task_executor.spawn(scroll_network_manager.run());
386+
ctx.task_executor
387+
.spawn_critical_task("scroll_network_manager", scroll_network_manager.run());
387388

388389
tracing::info!(target: "scroll::node::args", fcs = ?fcs, payload_building_duration = ?self.sequencer_args.payload_building_duration, "Starting engine driver");
389390
let engine = Engine::new(Arc::new(engine_api), fcs);

crates/node/src/test_utils/fixture.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use reth_node_types::NodeTypesWithDBAdapter;
2828
use reth_provider::providers::BlockchainProvider;
2929
use reth_scroll_chainspec::SCROLL_DEV;
3030
use reth_scroll_primitives::ScrollPrimitives;
31-
use reth_tasks::TaskManager;
31+
use reth_tasks::TaskExecutor;
3232
use reth_tokio_util::EventStream;
3333
use rollup_node_chain_orchestrator::{ChainOrchestratorEvent, ChainOrchestratorHandle};
3434
use rollup_node_primitives::BlockInfo;
@@ -119,8 +119,8 @@ pub enum NodeType {
119119
pub struct ScrollNodeTestComponents {
120120
/// The node helper type for the test node.
121121
pub node: ScrollTestNode,
122-
/// The task manager for the test node.
123-
pub task_manager: TaskManager,
122+
/// The task executor for the test node.
123+
pub task_executor: TaskExecutor,
124124
/// The exit future for the test node.
125125
pub exit_future: NodeExitFuture,
126126
}
@@ -129,10 +129,10 @@ impl ScrollNodeTestComponents {
129129
/// Create new test node components.
130130
pub async fn new(
131131
node: ScrollTestNode,
132-
task_manager: TaskManager,
132+
task_executor: TaskExecutor,
133133
exit_future: NodeExitFuture,
134134
) -> Self {
135-
Self { node, task_manager, exit_future }
135+
Self { node, task_executor, exit_future }
136136
}
137137
}
138138

crates/node/src/test_utils/mod.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ use reth_node_builder::{
9999
use reth_node_core::args::{DiscoveryArgs, NetworkArgs, RpcServerArgs, TxPoolArgs};
100100
use reth_provider::providers::BlockchainProvider;
101101
use reth_rpc_server_types::RpcModuleSelection;
102-
use reth_tasks::TaskManager;
102+
use reth_tasks::TaskExecutor;
103103
use rollup_node_sequencer::L1MessageInclusionMode;
104104
use std::{path::PathBuf, sync::Arc};
105105
use tokio::sync::Mutex;
@@ -155,7 +155,11 @@ where
155155
.with_rpc(RpcServerArgs::default().with_http().with_http_api(RpcModuleSelection::All))
156156
.with_unused_ports()
157157
.set_dev(is_dev)
158-
.with_txpool(TxPoolArgs { no_local_transactions_propagation, ..Default::default() });
158+
.with_txpool(TxPoolArgs {
159+
no_local_transactions_propagation,
160+
max_account_slots: 16_384,
161+
..Default::default()
162+
});
159163

160164
// Check if we already have provided a database for a node (reboot scenario)
161165
let db = if let Some((_, provided_db)) = &reboot_info {
@@ -201,10 +205,10 @@ where
201205

202206
let span = span!(Level::INFO, "node", node_index);
203207
let _enter = span.enter();
204-
let task_manager = TaskManager::current();
208+
let task_executor = TaskExecutor::default();
205209
let testing_node = NodeBuilder::new(node_config.clone())
206210
.with_database(db.clone())
207-
.with_launch_context(task_manager.executor());
211+
.with_launch_context(task_executor.clone());
208212
let testing_config = testing_node.config().clone();
209213
let node = ScrollRollupNode::new(scroll_node_config.clone(), testing_config).await;
210214
let RethNodeHandle { node, node_exit_future } = testing_node
@@ -241,7 +245,7 @@ where
241245
}
242246
}
243247

244-
let node = ScrollNodeTestComponents::new(node, task_manager, node_exit_future).await;
248+
let node = ScrollNodeTestComponents::new(node, task_executor, node_exit_future).await;
245249

246250
nodes.push(node);
247251
}
@@ -252,7 +256,7 @@ where
252256
/// Generate a transfer transaction with the given wallet.
253257
pub async fn generate_tx(wallet: Arc<Mutex<Wallet>>) -> Bytes {
254258
let mut wallet = wallet.lock().await;
255-
let tx_fut = TransactionTestContext::transfer_tx_nonce_bytes(
259+
let tx_fut = TransactionTestContext::transfer_tx_bytes_with_nonce(
256260
wallet.chain_id,
257261
wallet.inner.clone(),
258262
wallet.inner_nonce,

crates/node/src/test_utils/reboot.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ impl TestFixture {
4141
.get_mut(node_index)
4242
.and_then(|opt| opt.take())
4343
.expect("Node existence checked above");
44-
let ScrollNodeTestComponents { node, task_manager, exit_future } = node;
44+
let ScrollNodeTestComponents { node, task_executor, exit_future } = node;
4545

46-
tokio::task::spawn_blocking(|| {
47-
if !task_manager.graceful_shutdown_with_timeout(Duration::from_secs(10)) {
46+
tokio::task::spawn_blocking(move || {
47+
if !task_executor.graceful_shutdown_with_timeout(Duration::from_secs(10)) {
4848
return Err(eyre::eyre!("Failed to shutdown tasks within timeout"));
4949
}
5050
eyre::Ok(())

crates/node/src/test_utils/tx_helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'a> TransferTxBuilder<'a> {
6060
let mut wallet = self.tx_helper.fixture.wallet.lock().await;
6161

6262
// Generate the transaction
63-
let raw_tx = TransactionTestContext::transfer_tx_nonce_bytes(
63+
let raw_tx = TransactionTestContext::transfer_tx_bytes_with_nonce(
6464
wallet.chain_id,
6565
wallet.inner.clone(),
6666
wallet.inner_nonce,
@@ -85,7 +85,7 @@ impl<'a> TransferTxBuilder<'a> {
8585
pub async fn build(self) -> eyre::Result<Bytes> {
8686
let mut wallet = self.tx_helper.fixture.wallet.lock().await;
8787

88-
let raw_tx = TransactionTestContext::transfer_tx_nonce_bytes(
88+
let raw_tx = TransactionTestContext::transfer_tx_bytes_with_nonce(
8989
wallet.chain_id,
9090
wallet.inner.clone(),
9191
wallet.inner_nonce,

0 commit comments

Comments
 (0)