Skip to content

Commit d86a96d

Browse files
committed
Migrate rollup node to DogeOS reth
1 parent c2d445b commit d86a96d

11 files changed

Lines changed: 1626 additions & 3584 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 74 additions & 124 deletions
Large diffs are not rendered by default.

crates/chain-orchestrator/src/consensus.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ mod tests {
150150
excess_blob_gas: None,
151151
parent_beacon_block_root: None,
152152
requests_hash: None,
153+
block_access_list_hash: None,
154+
slot_number: None,
153155
},
154156
body: ScrollBlockBody {
155157
transactions: vec![

crates/derivation-pipeline/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ pub async fn derive<L1P: L1Provider + Sync + Send>(
371371
prev_randao: B256::ZERO,
372372
withdrawals: None,
373373
parent_beacon_block_root: None,
374+
slot_number: None,
375+
target_gas_limit: None,
374376
},
375377
transactions: Some(txs),
376378
no_tx_pool: true,

crates/node/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ alloy-primitives.workspace = true
3232
alloy-provider.workspace = true
3333
alloy-rpc-client.workspace = true
3434
alloy-rpc-types-engine.workspace = true
35+
alloy-node-bindings = { workspace = true, optional = true }
3536
alloy-signer-local.workspace = true
36-
alloy-signer-aws = "1.0.30"
37-
alloy-signer = "1.0.30"
37+
alloy-signer-aws.workspace = true
38+
alloy-signer.workspace = true
3839
alloy-transport.workspace = true
3940

4041
scroll-alloy-consensus.workspace = true
@@ -68,6 +69,7 @@ reth-network-p2p.workspace = true
6869
reth-network-peers.workspace = true
6970
reth-provider.workspace = true
7071
reth-revm.workspace = true
72+
revm.workspace = true
7173
reth-rpc-api.workspace = true
7274
reth-rpc-eth-api.workspace = true
7375
reth-rpc-eth-types.workspace = true
@@ -90,7 +92,6 @@ aws-config = "1.8.0"
9092
aws-sdk-kms = "1.76.0"
9193

9294
# test-utils
93-
anvil = { git = "https://github.com/foundry-rs/foundry.git", rev = "2c84e1c970d11ef5023a77d8002a1cb70b143888", default-features = false, optional = true }
9495
alloy-rpc-types-eth = { workspace = true, optional = true }
9596
alloy-rpc-types-anvil = { workspace = true, optional = true }
9697
reth-db = { workspace = true, optional = true, features = ["test-utils"] }
@@ -198,7 +199,7 @@ test-utils = [
198199
"reth-network-p2p/test-utils",
199200
"rollup-node-chain-orchestrator/test-utils",
200201
"scroll-network/test-utils",
201-
"anvil",
202+
"alloy-node-bindings",
202203
"reth-storage-api",
203204
"alloy-rpc-types-eth",
204205
"alloy-rpc-types-anvil",

crates/node/src/add_ons/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use reth_node_builder::{
1515
FullNodeComponents,
1616
};
1717
use reth_node_types::NodeTypes;
18-
use reth_revm::context::{BlockEnv, TxEnv};
18+
use reth_revm::context::BlockEnv;
1919
use reth_rpc_eth_types::error::FromEvmError;
2020
use reth_scroll_chainspec::ScrollChainSpec;
2121
use reth_scroll_engine_primitives::ScrollEngineTypes;
@@ -25,6 +25,7 @@ use reth_scroll_node::{
2525
};
2626
use reth_scroll_primitives::ScrollPrimitives;
2727
use reth_scroll_rpc::{eth::ScrollEthApiBuilder, ScrollEthApiError};
28+
use revm::context::TxEnv;
2829
use scroll_alloy_evm::ScrollTransactionIntoTxEnv;
2930
use scroll_wire::ScrollWireEvent;
3031
use std::sync::Arc;

crates/node/src/builder/network.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,5 +354,7 @@ fn header_to_alloy<H: BlockHeader>(header: &H) -> Header {
354354
excess_blob_gas: header.excess_blob_gas(),
355355
parent_beacon_block_root: header.parent_beacon_block_root(),
356356
requests_hash: header.requests_hash(),
357+
block_access_list_hash: header.block_access_list_hash(),
358+
slot_number: header.slot_number(),
357359
}
358360
}

crates/node/src/test_utils/fixture.rs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::{
1212

1313
use alloy_eips::BlockNumberOrTag;
1414
use alloy_network::Ethereum;
15+
use alloy_node_bindings::{Anvil, AnvilInstance};
1516
use alloy_primitives::Address;
1617
use alloy_provider::{ext::AnvilApi, layers::CacheLayer, Provider, ProviderBuilder};
1718
use alloy_rpc_client::RpcClient;
@@ -68,7 +69,7 @@ pub struct TestFixture {
6869
/// L1 provider for making L1 RPC calls (if connected to real L1).
6970
pub l1_provider: Option<L1Provider>,
7071
/// Optional Anvil instance for L1 simulation.
71-
pub anvil: Option<anvil::NodeHandle>,
72+
pub anvil: Option<AnvilInstance>,
7273
/// The configuration for the nodes.
7374
pub config: ScrollRollupNodeConfig,
7475
/// Whether this fixture has a remote source node (always the last node).
@@ -354,7 +355,7 @@ impl TestFixture {
354355
);
355356
let client = RpcClient::builder()
356357
.layer(retry_layer)
357-
.http(anvil.http_endpoint().parse().expect("failed to parse anvil http endpoint"));
358+
.http(anvil.endpoint().parse().expect("failed to parse anvil http endpoint"));
358359
let cache_layer = CacheLayer::new(constants::L1_PROVIDER_CACHE_MAX_ITEMS);
359360
ProviderBuilder::new().layer(cache_layer).connect_client(client)
360361
})
@@ -749,7 +750,7 @@ impl TestFixtureBuilder {
749750

750751
// Parse endpoint URL once and reuse
751752
let endpoint_url = handle
752-
.http_endpoint()
753+
.endpoint()
753754
.parse::<reqwest::Url>()
754755
.map_err(|e| eyre::eyre!("Failed to parse Anvil endpoint URL: {}", e))?;
755756

@@ -837,31 +838,27 @@ impl TestFixtureBuilder {
837838
chain_id: Option<u64>,
838839
block_time: Option<u64>,
839840
slots_in_an_epoch: u64,
840-
) -> eyre::Result<anvil::NodeHandle> {
841-
let mut config = anvil::NodeConfig { port: 0, ..Default::default() };
841+
) -> eyre::Result<AnvilInstance> {
842+
let mut anvil = Anvil::new().port(0u16);
842843

843844
if let Some(id) = chain_id {
844-
config.chain_id = Some(id);
845+
anvil = anvil.chain_id(id);
845846
}
846847

847-
// Configure block time
848848
if let Some(time) = block_time {
849-
config.block_time = Some(std::time::Duration::from_secs(time));
849+
anvil = anvil.block_time(time);
850850
}
851851

852-
// Load state from file if provided
853852
if let Some(path) = state_path {
854-
let state = anvil::eth::backend::db::SerializableState::load(path).map_err(|e| {
855-
eyre::eyre!("Failed to load Anvil state from {}: {:?}", path.display(), e)
856-
})?;
857-
tracing::info!("Loaded Anvil state from: {}", path.display());
858-
config.init_state = Some(state);
853+
if !path.exists() {
854+
return Err(eyre::eyre!("Anvil state file does not exist: {}", path.display()));
855+
}
856+
tracing::info!("Loading Anvil state from: {}", path.display());
857+
anvil = anvil.arg("--load-state").arg(path);
859858
}
860859

861-
config.slots_in_an_epoch = slots_in_an_epoch;
860+
anvil = anvil.arg("--slots-in-an-epoch").arg(slots_in_an_epoch.to_string());
862861

863-
// Spawn Anvil and return the NodeHandle
864-
let (_api, handle) = anvil::spawn(config).await;
865-
Ok(handle)
862+
anvil.try_spawn().map_err(|e| eyre::eyre!("Failed to spawn Anvil: {}", e))
866863
}
867864
}

crates/providers/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ alloy-eips = { workspace = true, features = ["kzg"] }
1515
alloy-primitives.workspace = true
1616
alloy-provider.workspace = true
1717
alloy-rpc-client.workspace = true
18-
alloy-rpc-types-beacon = "1.0.37"
19-
alloy-serde = { version = "1.0.37", default-features = false }
18+
alloy-rpc-types-beacon.workspace = true
19+
alloy-serde.workspace = true
2020
alloy-transport.workspace = true
2121

2222
# scroll

crates/sequencer/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ where
113113
parent_beacon_block_root: None,
114114
prev_randao: Default::default(),
115115
withdrawals: None,
116+
slot_number: None,
117+
target_gas_limit: None,
116118
};
117119

118120
let mut l1_messages = vec![];

0 commit comments

Comments
 (0)