Skip to content
Closed
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
4,954 changes: 1,519 additions & 3,435 deletions Cargo.lock

Large diffs are not rendered by default.

198 changes: 74 additions & 124 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions crates/chain-orchestrator/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ mod tests {
excess_blob_gas: None,
parent_beacon_block_root: None,
requests_hash: None,
block_access_list_hash: None,
slot_number: None,
},
body: ScrollBlockBody {
transactions: vec![
Expand Down
2 changes: 2 additions & 0 deletions crates/derivation-pipeline/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ pub async fn derive<L1P: L1Provider + Sync + Send>(
prev_randao: B256::ZERO,
withdrawals: None,
parent_beacon_block_root: None,
slot_number: None,
target_gas_limit: None,
},
transactions: Some(txs),
no_tx_pool: true,
Expand Down
9 changes: 5 additions & 4 deletions crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ alloy-primitives.workspace = true
alloy-provider.workspace = true
alloy-rpc-client.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-node-bindings = { workspace = true, optional = true }
alloy-signer-local.workspace = true
alloy-signer-aws = "1.0.30"
alloy-signer = "1.0.30"
alloy-signer-aws.workspace = true
alloy-signer.workspace = true
alloy-transport.workspace = true

scroll-alloy-consensus.workspace = true
Expand Down Expand Up @@ -68,6 +69,7 @@ reth-network-p2p.workspace = true
reth-network-peers.workspace = true
reth-provider.workspace = true
reth-revm.workspace = true
revm.workspace = true
reth-rpc-api.workspace = true
reth-rpc-eth-api.workspace = true
reth-rpc-eth-types.workspace = true
Expand All @@ -90,7 +92,6 @@ aws-config = "1.8.0"
aws-sdk-kms = "1.76.0"

# test-utils
anvil = { git = "https://github.com/foundry-rs/foundry.git", rev = "2c84e1c970d11ef5023a77d8002a1cb70b143888", default-features = false, optional = true }
alloy-rpc-types-eth = { workspace = true, optional = true }
alloy-rpc-types-anvil = { workspace = true, optional = true }
reth-db = { workspace = true, optional = true, features = ["test-utils"] }
Expand Down Expand Up @@ -198,7 +199,7 @@ test-utils = [
"reth-network-p2p/test-utils",
"rollup-node-chain-orchestrator/test-utils",
"scroll-network/test-utils",
"anvil",
"alloy-node-bindings",
"reth-storage-api",
"alloy-rpc-types-eth",
"alloy-rpc-types-anvil",
Expand Down
3 changes: 2 additions & 1 deletion crates/node/src/add_ons/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use reth_node_builder::{
FullNodeComponents,
};
use reth_node_types::NodeTypes;
use reth_revm::context::{BlockEnv, TxEnv};
use reth_revm::context::BlockEnv;
use reth_rpc_eth_types::error::FromEvmError;
use reth_scroll_chainspec::ScrollChainSpec;
use reth_scroll_engine_primitives::ScrollEngineTypes;
Expand All @@ -25,6 +25,7 @@ use reth_scroll_node::{
};
use reth_scroll_primitives::ScrollPrimitives;
use reth_scroll_rpc::{eth::ScrollEthApiBuilder, ScrollEthApiError};
use revm::context::TxEnv;
use scroll_alloy_evm::ScrollTransactionIntoTxEnv;
use scroll_wire::ScrollWireEvent;
use std::sync::Arc;
Expand Down
2 changes: 2 additions & 0 deletions crates/node/src/builder/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,7 @@ fn header_to_alloy<H: BlockHeader>(header: &H) -> Header {
excess_blob_gas: header.excess_blob_gas(),
parent_beacon_block_root: header.parent_beacon_block_root(),
requests_hash: header.requests_hash(),
block_access_list_hash: header.block_access_list_hash(),
slot_number: header.slot_number(),
}
}
33 changes: 15 additions & 18 deletions crates/node/src/test_utils/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::{

use alloy_eips::BlockNumberOrTag;
use alloy_network::Ethereum;
use alloy_node_bindings::{Anvil, AnvilInstance};
use alloy_primitives::Address;
use alloy_provider::{ext::AnvilApi, layers::CacheLayer, Provider, ProviderBuilder};
use alloy_rpc_client::RpcClient;
Expand Down Expand Up @@ -68,7 +69,7 @@ pub struct TestFixture {
/// L1 provider for making L1 RPC calls (if connected to real L1).
pub l1_provider: Option<L1Provider>,
/// Optional Anvil instance for L1 simulation.
pub anvil: Option<anvil::NodeHandle>,
pub anvil: Option<AnvilInstance>,
/// The configuration for the nodes.
pub config: ScrollRollupNodeConfig,
/// Whether this fixture has a remote source node (always the last node).
Expand Down Expand Up @@ -354,7 +355,7 @@ impl TestFixture {
);
let client = RpcClient::builder()
.layer(retry_layer)
.http(anvil.http_endpoint().parse().expect("failed to parse anvil http endpoint"));
.http(anvil.endpoint().parse().expect("failed to parse anvil http endpoint"));
let cache_layer = CacheLayer::new(constants::L1_PROVIDER_CACHE_MAX_ITEMS);
ProviderBuilder::new().layer(cache_layer).connect_client(client)
})
Expand Down Expand Up @@ -749,7 +750,7 @@ impl TestFixtureBuilder {

// Parse endpoint URL once and reuse
let endpoint_url = handle
.http_endpoint()
.endpoint()
.parse::<reqwest::Url>()
.map_err(|e| eyre::eyre!("Failed to parse Anvil endpoint URL: {}", e))?;

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

if let Some(id) = chain_id {
config.chain_id = Some(id);
anvil = anvil.chain_id(id);
}

// Configure block time
if let Some(time) = block_time {
config.block_time = Some(std::time::Duration::from_secs(time));
anvil = anvil.block_time(time);
}

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

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

// Spawn Anvil and return the NodeHandle
let (_api, handle) = anvil::spawn(config).await;
Ok(handle)
anvil.try_spawn().map_err(|e| eyre::eyre!("Failed to spawn Anvil: {}", e))
}
}
4 changes: 2 additions & 2 deletions crates/providers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ alloy-eips = { workspace = true, features = ["kzg"] }
alloy-primitives.workspace = true
alloy-provider.workspace = true
alloy-rpc-client.workspace = true
alloy-rpc-types-beacon = "1.0.37"
alloy-serde = { version = "1.0.37", default-features = false }
alloy-rpc-types-beacon.workspace = true
alloy-serde.workspace = true
alloy-transport.workspace = true

# scroll
Expand Down
2 changes: 2 additions & 0 deletions crates/sequencer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ where
parent_beacon_block_root: None,
prev_randao: Default::default(),
withdrawals: None,
slot_number: None,
target_gas_limit: None,
};

let mut l1_messages = vec![];
Expand Down
1 change: 1 addition & 0 deletions crates/watcher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@ mod tests {
inner: recovered,
block_hash: None,
block_number: None,
block_timestamp: None,
transaction_index: None,
effective_gas_price: None,
};
Expand Down
Loading