Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit 1c6b23b

Browse files
committed
checkpoint
1 parent b3c391a commit 1c6b23b

File tree

12 files changed

+407
-304
lines changed

12 files changed

+407
-304
lines changed

Cargo.lock

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ alloy-primitives = { version = "0.7" }
3636
alloy-consensus = { version = "0.2" }
3737
alloy-eips = { version = "0.2" }
3838
alloy-rpc-types = { version = "0.2" }
39+
alloy-genesis = "0.2"
3940

4041
# revm + reth
4142
revm = { version = "13.0", features = ["optimism", "serde"] }

bin/opt8n/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ reqwest.workspace = true
1919
futures.workspace = true
2020
color-eyre.workspace = true
2121
tracing-subscriber.workspace = true
22-
22+
itertools = "0.13"
2323
# CLI
2424
clap.workspace = true
2525
inquire = { version = "0.7.5", features = ["editor"] }
@@ -34,6 +34,8 @@ alloy-eips.workspace = true
3434
alloy-transport = "0.2"
3535
alloy-provider = "0.2"
3636
alloy-transport-http = "0.2"
37+
alloy-trie = "0.4.1"
38+
alloy-genesis.workspace = true
3739
op-alloy-consensus.workspace = true
3840
op-alloy-network.workspace = true
3941

bin/opt8n/opt8n.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4+
T8N_PATH="$SCRIPT_DIR/../../target/release/opt8n"
5+
T8N_NETWORK_PARAMS=$(cat <<- EOM
6+
optimism_package:
7+
participants:
8+
- el_type: op-geth
9+
cl_type: op-node
10+
additional_services:
11+
- blockscout
12+
network_params:
13+
seconds_per_slot: 2
14+
network_id: 1337
15+
ethereum_package:
16+
participants:
17+
- el_type: reth
18+
cl_type: lighthouse
19+
network_params:
20+
preset: minimal
21+
EOM
22+
)
23+
24+
echo "Building opt8n..."
25+
cargo build --bin opt8n --release
26+
27+
echo "Starting Kurtosis network..."
28+
cd "$KURTOSIS_DIR" || exit 1
29+
kurtosis clean -a
30+
echo "$T8N_NETWORK_PARAMS" > ./network_params.yaml
31+
kurtosis run --enclave devnet . --args-file ./network_params.yaml
32+
33+
echo "Returning to opt8n..."
34+
cd "$SCRIPT_DIR" || exit 1
35+
36+
# Download L2 genesis configs and contract addresses
37+
echo "Downloading L2 genesis configs and contract addresses from devnet..."
38+
kurtosis files download devnet op-genesis-configs
39+
40+
OPTIMISM_PORTAL_PROXY=$(jq -r .OptimismPortalProxy ./op-genesis-configs/kurtosis.json)
41+
GENESIS="./op-genesis-configs/genesis.json"
42+
43+
L1_PORT=$(kurtosis enclave inspect devnet | grep 'el-1-reth-lighthouse' -A5 | grep " rpc:" | awk -F ' -> ' '{print $2}' | awk -F ':' '{print $2}' | tr -d ' \n\r')
44+
L2_PORT=$(kurtosis enclave inspect devnet | grep 'op-el-1-op-geth-op-node' -A5 | grep " rpc:" | awk -F ' -> ' '{print $2}' | awk -F ':' '{print $3}' | tr -d ' \n\r')
45+
46+
$T8N_PATH "$L1_PORT" --l2-port "$L2_PORT" -o "$OPTIMISM_PORTAL_PROXY" --l2-genesis "$GENESIS"
47+
48+
echo "Cleaning up genesis + configs..."
49+
rm -rf ./op-genesis-configs

bin/opt8n/src/cli/deposits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'a> DepositCapture<'a> {
9191
self.cli.optimism_portal_address,
9292
)?;
9393

94-
self.transactions = deposits;
94+
self.transactions.extend(deposits);
9595
Ok(())
9696
}
9797

bin/opt8n/src/cli/l1_info.rs

Lines changed: 0 additions & 120 deletions
This file was deleted.

bin/opt8n/src/cli/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ use std::path::PathBuf;
88
use tokio::sync::broadcast::{self};
99
use tracing::Level;
1010

11-
mod deposits;
12-
mod l1_info;
13-
mod state;
14-
mod t8n;
11+
pub(crate) mod deposits;
12+
pub(crate) mod state;
13+
pub(crate) mod t8n;
1514

1615
/// The root CLI for `opt8n`
1716
#[derive(Parser, Clone, Debug, Default, Eq, PartialEq)]
@@ -25,6 +24,9 @@ pub(crate) struct Cli {
2524
/// The port of the L2 execution layer node.
2625
#[arg(long)]
2726
pub(crate) l2_port: u16,
27+
/// The path to the L2 genesis file.
28+
#[arg(long)]
29+
pub(crate) l2_genesis: PathBuf,
2830
/// The address of the OptimismPortal contract on the L1 chain.
2931
#[arg(long, short)]
3032
pub(crate) optimism_portal_address: Address,

0 commit comments

Comments
 (0)