Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a9f1127
feat: integrate l2geth in docker-compose e2e tests
Jul 31, 2025
c431b54
Merge branch 'main' into e2e-test-integrate-l2geth
Aug 1, 2025
21fe045
Merge branch 'main' into e2e-test-integrate-l2geth
colinlyguo Aug 7, 2025
e3bb57f
support local genesis
Aug 12, 2025
cd57546
Merge branch 'main' into feat-support-genesis-file
colinlyguo Aug 13, 2025
39dc24c
address comments
Aug 13, 2025
21c7f2d
fix CI
Aug 13, 2025
c71aea3
Merge branch 'main' into e2e-test-integrate-l2geth
colinlyguo Aug 15, 2025
bf3dcb1
update scripts
Aug 15, 2025
13a7364
increase log level
Aug 15, 2025
cf2b45c
update gas limits
Aug 15, 2025
eff6dd2
Merge branch 'feat-support-genesis-file' into e2e-test-integrate-l2geth
Aug 15, 2025
0abcdc5
update reth commit
Aug 15, 2025
15b2ebc
Merge remote-tracking branch 'origin/main' into e2e-test-integrate-l2…
jonastheis Sep 1, 2025
1c89b47
cargo.lock
jonastheis Sep 1, 2025
5cec77b
fix compile errors
jonastheis Sep 2, 2025
5eff652
add initial test
jonastheis Sep 2, 2025
e35185d
Merge remote-tracking branch 'origin/main' into e2e-test-integrate-l2…
jonastheis Sep 4, 2025
0d665cb
fix lint
jonastheis Sep 4, 2025
0b19260
launch l2geth sequencer and read active signer from L1
jonastheis Sep 5, 2025
622474a
launch l2geth follower
jonastheis Sep 5, 2025
e534fc0
Merge remote-tracking branch 'origin/main' into e2e-test-integrate-l2…
jonastheis Sep 5, 2025
fb88f9e
fix issue with custom genesis where fields are missing and mixed up
jonastheis Sep 5, 2025
7562397
adjust chain id to arbitrary number to avoid conflict with named chain
jonastheis Sep 5, 2025
8429e33
rollup node follower can follow chain produced by l2geth sequencer
jonastheis Sep 5, 2025
e12af9d
configure rollup node sequencer correctly and connect to other nodes
jonastheis Sep 8, 2025
f668874
add health check for l1-node to make sure it is fully set up before l…
jonastheis Sep 8, 2025
41662ff
Merge remote-tracking branch 'origin/main' into e2e-test-integrate-l2…
jonastheis Sep 8, 2025
4ede953
refactor DockerComposeEnv and add more convenience functions for test…
jonastheis Sep 9, 2025
9e8c498
Merge remote-tracking branch 'origin/main' into e2e-test-integrate-l2…
jonastheis Sep 9, 2025
fae1c34
fix CI
jonastheis Sep 9, 2025
58b3507
remove todos
jonastheis Sep 10, 2025
c994e52
avoid building Docker image when only Docker integration test changes
jonastheis Sep 10, 2025
7956b64
Merge remote-tracking branch 'origin/main' into e2e-test-integrate-l2…
jonastheis Sep 10, 2025
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
1,331 changes: 680 additions & 651 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ alloy-consensus = { version = "1.0.13", default-features = false }
alloy-eips = { version = "1.0.13", default-features = false }
alloy-json-rpc = { version = "1.0.13", default-features = false }
alloy-network = { version = "1.0.13", default-features = false }
alloy-primitives = { version = "1.2.0", default-features = false }
alloy-primitives = { version = "1.3.1", default-features = false }
alloy-provider = { version = "1.0.13", default-features = false }
alloy-rpc-client = { version = "1.0.13", default-features = false }
alloy-rpc-types-engine = { version = "1.0.13", default-features = false }
Expand Down Expand Up @@ -186,7 +186,7 @@ scroll-wire = { path = "crates/scroll-wire" }
scroll-migration = { path = "crates/database/migration" }

# misc
arbitrary = { version = "1.4", default-features = false }
arbitrary = { version = "1.4", default-features = false, features = ["derive"] }
async-trait = "0.1"
auto_impl = "1.2"
bitvec = { version = "1.0", default-features = false }
Expand Down
2 changes: 2 additions & 0 deletions crates/node/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ impl ScrollRollupNodeConfig {
db.insert_genesis_block(genesis_hash)
.await
.expect("failed to insert genesis block (custom chain)");

tracing::info!(target: "scroll::node::args", ?genesis_hash, "Overwriting genesis hash for custom chain");
}

// Wrap the database in an Arc
Expand Down
5 changes: 3 additions & 2 deletions crates/node/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,9 +1320,10 @@ async fn test_custom_genesis_block_production_and_propagation() -> eyre::Result<
"l1MessageQueueAddress": "0x0d7E906BD9cAFa154b048cFa766Cc1E54E39AF9B",
"l1MessageQueueV2Address": "0x000000000000000000000000000000000003dead",
"scrollChainAddress": "0x000000000000000000000000000000000003dead",
"l2SystemConfigAddress": "0x000000000000000000000000000000000003dead",
"l2SystemConfigAddress": "0x0000000000000000000000000000000dddd3dead",
"systemContractAddress": "0x110000000000000000000000000000000003dead",
"numL1MessagesPerBlock": 10,
"l1MessageQueueV2DeploymentBlock": 12345
"startL1Block": 12345
}
}
},
Expand Down
42 changes: 37 additions & 5 deletions crates/primitives/src/node/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,27 +96,59 @@ impl NodeConfig {
return Ok(Self::from_named_chain(named_chain));
}

// Note: It is important to make sure the chain id is not a named chain accidentally.
// For example, a custom `chain id=1337` will be treated as a named chain as it
// matches the dev chain. https://github.com/scroll-tech/rollup-node/issues/303
// If not a named chain, extract the configuration from the chain spec
let config = chain_spec.chain_config();

let genesis = chain_spec.genesis();
let l1_message_queue_v2_deployment_block = genesis

// let l1_message_queue_v2_deployment_block = genesis
// .config
// .extra_fields
// .get("scroll")
// .and_then(|scroll| scroll.get("l1Config"))
// .and_then(|l1_config| l1_config.get("l1MessageQueueV2DeploymentBlock"))
// .and_then(|v| v.as_u64())
// .ok_or_else(|| eyre::eyre!("Invalid or missing 'l1MessageQueueV2DeploymentBlock'"))?;

let start_l1_block = genesis
.config
.extra_fields
.get("scroll")
.and_then(|scroll| scroll.get("l1Config"))
.and_then(|l1_config| l1_config.get("l1MessageQueueV2DeploymentBlock"))
.and_then(|l1_config| l1_config.get("startL1Block"))
.and_then(|v| v.as_u64())
.ok_or_else(|| eyre::eyre!("Invalid or missing 'l1MessageQueueV2DeploymentBlock'"))?;
.ok_or_else(|| eyre::eyre!("Invalid or missing 'startL1Block'"))?;

let system_contract_address = genesis
.config
.extra_fields
.get("scroll")
.and_then(|scroll| scroll.get("l1Config"))
.and_then(|l1_config| l1_config.get("systemContractAddress"))
.and_then(|v| v.as_str())
.and_then(|s| s.parse().ok())
.ok_or_else(|| eyre::eyre!("Invalid or missing 'systemContractAddress'"))?;

// TODO:
// - config.l1_config.l2_system_config_address is not used here.
// - start_l1_block is not present currently in the config.
// - system_contract_address is not extracted from the config in https://github.com/scroll-tech/reth/blob/scroll/crates/scroll/chainspec/src/genesis.rs#L20
// - do we need: l1_message_queue_v2_deployment_block? maybe instead we could use
// v2_message_queue_starting_index
// - ultimately we want to make sure all relevant config is extracted from `ScrollChainInfo`
// and not partially here. see https://github.com/scroll-tech/rollup-node/issues/303

Ok(Self {
address_book: ScrollAddressBook {
rollup_node_contract_address: config.l1_config.scroll_chain_address,
v1_message_queue_address: config.l1_config.l1_message_queue_address,
v2_message_queue_address: config.l1_config.l1_message_queue_v2_address,
system_contract_address: config.l1_config.l2_system_config_address,
system_contract_address,
},
start_l1_block: l1_message_queue_v2_deployment_block,
start_l1_block,
})
}

Expand Down
3 changes: 3 additions & 0 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ tokio = { workspace = true, features = ["rt", "time"] }
eyre = { workspace = true }
getrandom = { workspace = true }
tracing = { workspace = true }
reth-tracing = { workspace = true }
serde = { workspace = true }
serde_json = "1.0"
1 change: 0 additions & 1 deletion tests/discovery-secret

This file was deleted.

72 changes: 56 additions & 16 deletions tests/docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
version: '3.8'

services:
l1-node:
image: ghcr.io/foundry-rs/foundry:latest
container_name: l1-node
entrypoint: [ "bash", "/launch_l1.bash" ]
ports:
- "8544:8545"
volumes:
- ./launch_l1.bash:/launch_l1.bash:ro
healthcheck:
test: ["CMD", "bash", "-c", "[ \"$(cast storage 0x55B150d210356452e4E79cCb6B778b4e1B167091 0x67 --rpc-url http://localhost:8545)\" = \"0x000000000000000000000000b674ff99cca262c99d3eab5b32796a99188543da\" ]"]
interval: 3s
timeout: 10s
retries: 30
start_period: 0s

rollup-node-sequencer:
build:
context: ../
dockerfile: Dockerfile
container_name: rollup-node-sequencer
entrypoint: ["bash", "/launch_rollup_node_sequencer.bash"]
environment:
- ENV=dev
- RUST_LOG=info
ports:
- "8545:8545" # JSON-RPC
- "8546:8546" # WebSocket
- "6060:6060" # Metrics
volumes:
- ./launch_rollup_node_sequencer.bash:/launch_rollup_node_sequencer.bash:ro
- ./discovery-secret:/l2reth/discovery-secret:ro
- ./l2reth-genesis-e2e.json:/l2reth/l2reth-genesis-e2e.json:ro
- l2reth-sequencer:/l2reth
networks:
- test-scroll-network
depends_on:
l1-node:
condition: service_healthy

rollup-node-follower:
build:
Expand All @@ -28,24 +40,52 @@ services:
container_name: rollup-node-follower
entrypoint: ["bash", "/launch_rollup_node_follower.bash"]
environment:
- ENV=dev
- RUST_LOG=info
ports:
- "8547:8545" # JSON-RPC
- "8548:8546" # WebSocket
- "8546:8545" # JSON-RPC
- "6061:6060" # Metrics
volumes:
- ./launch_rollup_node_follower.bash:/launch_rollup_node_follower.bash:ro
- ./l2reth-genesis-e2e.json:/l2reth/l2reth-genesis-e2e.json:ro
- l2reth-follower:/l2reth
networks:
- test-scroll-network
depends_on:
- rollup-node-sequencer
l1-node:
condition: service_healthy

networks:
test-scroll-network:
driver: bridge
l2geth-sequencer:
image: scrolltech/l2geth:scroll-v5.9.4
platform: linux/amd64
container_name: l2geth-sequencer
entrypoint: ["bash", "/launch_l2geth.bash"]
ports:
- "8547:8545" # JSON-RPC
- "6062:6060" # Metrics
volumes:
- ./l2geth-genesis-e2e.json:/l2geth-genesis-e2e.json:ro
- ./launch_l2geth_sequencer.bash:/launch_l2geth.bash:ro
- l2geth-sequencer:/l2geth
depends_on:
l1-node:
condition: service_healthy

l2geth-follower:
image: scrolltech/l2geth:scroll-v5.9.4
platform: linux/amd64
container_name: l2geth-follower
entrypoint: ["bash", "/launch_l2geth.bash"]
ports:
- "8548:8545" # JSON-RPC
- "6063:6060" # Metrics
volumes:
- ./l2geth-genesis-e2e.json:/l2geth-genesis-e2e.json:ro
- ./launch_l2geth_follower.bash:/launch_l2geth.bash:ro
- l2geth-follower:/l2geth
depends_on:
l1-node:
condition: service_healthy

volumes:
l2reth-sequencer:
l2reth-follower:
l2geth-sequencer:
l2geth-follower:
Loading
Loading