Skip to content

refactor(l2): improve L2 deployer #4014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
cc31505
Reuse EthOptions
ManuelBilbao Aug 6, 2025
00b3ccc
Change some options
ManuelBilbao Aug 6, 2025
65aa47e
Continue improving CLI
ManuelBilbao Aug 7, 2025
210807c
Remove unused file
ManuelBilbao Aug 7, 2025
ed65554
Remove duplicated code
ManuelBilbao Aug 7, 2025
c6c2494
Improve ownership transfers
ManuelBilbao Aug 7, 2025
cd5eddc
Refactor initializer
ManuelBilbao Aug 7, 2025
c1b8d62
Fix genesis requirement
ManuelBilbao Aug 7, 2025
adb2c1b
Remove duplicated function and improve logs
ManuelBilbao Aug 7, 2025
5d579a3
Write .env on request
ManuelBilbao Aug 7, 2025
4884c98
Improve help messages
ManuelBilbao Aug 8, 2025
27d1c1a
Merge branch 'main' into improve_l2_deployer
ManuelBilbao Aug 11, 2025
0ce3db2
Improve deposits
ManuelBilbao Aug 11, 2025
bf80008
Improve default values
ManuelBilbao Aug 11, 2025
9daca1a
Change names
ManuelBilbao Aug 11, 2025
b87a867
Add support for verifiers VK in CLI
ManuelBilbao Aug 11, 2025
e8402a0
Fix env var names in docs, ci and docker
ManuelBilbao Aug 12, 2025
59a6801
Embed VKs in binary
ManuelBilbao Aug 12, 2025
8ffc8d0
Merge branch 'main' into improve_l2_deployer
ManuelBilbao Aug 12, 2025
0b8675c
Typos
ManuelBilbao Aug 12, 2025
50c59c1
lint
ManuelBilbao Aug 12, 2025
a9a4b96
Fix .env path
ManuelBilbao Aug 12, 2025
9c90d63
Add missing placeholders
ManuelBilbao Aug 13, 2025
acfc3a2
Merge branch 'main' into improve_l2_deployer
ManuelBilbao Aug 13, 2025
f1e31cb
Fix start L1 step
ManuelBilbao Aug 13, 2025
e9d67f3
Update Makefile opts
ManuelBilbao Aug 13, 2025
033a4fb
Fix makefile opts
ManuelBilbao Aug 13, 2025
da91451
Change .env path
ManuelBilbao Aug 18, 2025
7603ebf
Fix docker in CI
ManuelBilbao Aug 18, 2025
e78f9a4
Merge branch 'main' into improve_l2_deployer
ManuelBilbao Aug 18, 2025
0b0d13c
fix doc
ManuelBilbao Aug 18, 2025
314f81d
Remove wrong docker compose
ManuelBilbao Aug 18, 2025
fb70af1
Test CI
ManuelBilbao Aug 18, 2025
e3b8345
Use deployer address if not sequencer registry owner
ManuelBilbao Aug 18, 2025
6de24e6
Fix paths
ManuelBilbao Aug 18, 2025
602777d
Check slice length before converting
ManuelBilbao Aug 18, 2025
7c81398
Fix paths
ManuelBilbao Aug 18, 2025
3d0898d
Fix paths
ManuelBilbao Aug 18, 2025
994032f
Add bridge owner to CI
ManuelBilbao Aug 19, 2025
c77a393
Merge branch 'main' into improve_l2_deployer
ManuelBilbao Aug 19, 2025
4dcfa8d
Merge branch 'main' into improve_l2_deployer
ManuelBilbao Aug 19, 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
5 changes: 2 additions & 3 deletions .github/workflows/main_prover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ jobs:
- name: Start L1 & Deploy contracts
# if: ${{ always() && github.event_name == 'merge_group' }}
run: |
touch cmd/.env
touch .env
cd crates/l2
DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_DEPLOYER_DEPLOY_RICH=true \
ETHREX_DEPLOYER_SP1_DEPLOY_VERIFIER=true \
ETHREX_DEPLOYER_DEPLOY_SP1_VERIFIER=true \
docker compose up --build contract_deployer

- name: Ensure admin permissions in _work
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pr-main_l1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ jobs:
~/.risc0/bin/rzup install cargo-risczero 2.3.1
~/.risc0/bin/rzup install rust

- name: Create placeholder SP1 ELF
- name: Create placeholder for SP1 and RISC0 VKs
run: |
mkdir -p crates/l2/prover/zkvm/interface/sp1/out
mkdir -p crates/l2/prover/zkvm/interface/risc0/out
touch crates/l2/prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-elf
touch crates/l2/prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-vk
touch crates/l2/prover/zkvm/interface/risc0/out/riscv32im-risc0-vk

- name: Run cargo check
run: cargo check --workspace
Expand Down
45 changes: 20 additions & 25 deletions .github/workflows/pr-main_l2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ jobs:
~/.risc0/bin/rzup install cargo-risczero 2.3.1
~/.risc0/bin/rzup install rust

- name: Create placeholder SP1 ELF
- name: Create placeholder for SP1 and RISC0 VKs
run: |
mkdir -p crates/l2/prover/zkvm/interface/sp1/out
mkdir -p crates/l2/prover/zkvm/interface/risc0/out
touch crates/l2/prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-elf
touch crates/l2/prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-vk
touch crates/l2/prover/zkvm/interface/risc0/out/riscv32im-risc0-vk

- name: Run cargo check
run: cargo check --workspace
Expand Down Expand Up @@ -141,15 +144,14 @@ jobs:

- name: Start L1 & Deploy contracts
run: |
touch cmd/.env
touch .env
cd crates/l2
DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_DEPLOYER_DEPLOY_RICH=true \
ETHREX_DEPLOYER_PICO_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_SP1_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_RISC0_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
docker compose up -d ethrex_l1
DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_L2_VALIDIUM=${{ matrix.validium }} \
docker compose up contract_deployer
ETHREX_DEPLOYER_BRIDGE_OWNER_ADDRESS=0x4417092B70a3E5f10Dc504d0947DD256B965fc62 \
docker compose up --no-deps --exit-code-from contract_deployer contract_deployer

- name: Start Sequencer
run: |
Expand Down Expand Up @@ -203,16 +205,14 @@ jobs:

- name: Start L1 & Deploy contracts
run: |
touch cmd/.env
touch .env
cd crates/l2
DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_DEPLOYER_DEPLOY_RICH=true \
ETHREX_DEPLOYER_PICO_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_SP1_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_RISC0_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
docker compose up -d ethrex_l1
DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_DEPLOYER_DEPLOY_BASED_CONTRACTS=true \
COMPILE_CONTRACTS=true \
docker compose up contract_deployer
ETHREX_DEPLOYER_BRIDGE_OWNER_ADDRESS=0x4417092B70a3E5f10Dc504d0947DD256B965fc62 \
docker compose up --no-deps --exit-code-from contract_deployer contract_deployer

- name: Install rex
run: |
Expand All @@ -227,7 +227,6 @@ jobs:

- name: Register sequencer
run: |
cd cmd
SEQUENCER_REGISTRY=$(grep ETHREX_DEPLOYER_SEQUENCER_REGISTRY .env | cut -d= -f2)
export SEQUENCER_REGISTRY

Expand All @@ -240,13 +239,11 @@ jobs:

- name: Start Sequencer
run: |
cd cmd
SEQUENCER_REGISTRY=$(grep ETHREX_DEPLOYER_SEQUENCER_REGISTRY .env | cut -d= -f2)
export SEQUENCER_REGISTRY
cd ../crates/l2
cd crates/l2

DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_COMMITTER_VALIDIUM=false \
ETHREX_WATCHER_BLOCK_DELAY=0 \
ETHREX_BASED=true \
ETHREX_STATE_UPDATER_SEQUENCER_REGISTRY="$SEQUENCER_REGISTRY" \
Expand Down Expand Up @@ -289,15 +286,13 @@ jobs:

- name: Start L1 & Deploy contracts
run: |
touch cmd/.env
touch .env
cd crates/l2
DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_DEPLOYER_DEPLOY_RICH=true \
ETHREX_DEPLOYER_PICO_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_SP1_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
ETHREX_DEPLOYER_RISC0_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
COMPILE_CONTRACTS=true \
docker compose up contract_deployer
docker compose up -d ethrex_l1
DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_DEPLOYER_BRIDGE_OWNER_ADDRESS=0x4417092B70a3E5f10Dc504d0947DD256B965fc62 \
docker compose up --no-deps --exit-code-from contract_deployer contract_deployer

- name: Run tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-main_l2_tdx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ jobs:

- name: Start L1 & Deploy contracts
run: |
touch cmd/.env
touch .env
cd crates/l2
make init-l1-docker;
ETHREX_DEPLOYER_DEPLOY_RICH=true \
ETHREX_DEPLOYER_DEPOSIT_PRIVATE_KEYS_FILE_PATH=./fixtures/keys/private_keys_l1.txt \
ETHREX_DEPLOYER_TDX_DEPLOY_VERIFIER=true \
ETHREX_TDX_DEV_MODE=true \
make deploy-l1
Expand Down
12 changes: 7 additions & 5 deletions cmd/ethrex/l2/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use ethrex_common::{
types::{BYTES_PER_BLOB, BlobsBundle, BlockHeader, batch::Batch, bytes_from_blob},
};
use ethrex_l2_common::{calldata::Value, l1_messages::get_l1_message_hash, state_diff::StateDiff};
use ethrex_l2_rpc::signer::LocalSigner;
use ethrex_l2_sdk::call_contract;
use ethrex_rpc::{
EthClient, clients::beacon::BeaconClient, types::block_identifier::BlockIdentifier,
Expand Down Expand Up @@ -463,13 +464,14 @@ impl Command {

let client = EthClient::new(rpc_url.as_str())?;
if let Some(private_key) = private_key {
let signer = LocalSigner::new(private_key).into();

info!("Pausing OnChainProposer...");
call_contract(&client, &private_key, contract_address, "pause()", vec![])
.await?;
call_contract(&client, &signer, contract_address, "pause()", vec![]).await?;
info!("Doing revert on OnChainProposer...");
call_contract(
&client,
&private_key,
&signer,
contract_address,
"revertBatch(uint256)",
vec![Value::Uint(batch.into())],
Expand Down Expand Up @@ -508,9 +510,9 @@ impl Command {
.await?;

if let Some(private_key) = private_key {
let signer = LocalSigner::new(private_key).into();
info!("Unpausing OnChainProposer...");
call_contract(&client, &private_key, contract_address, "unpause()", vec![])
.await?;
call_contract(&client, &signer, contract_address, "unpause()", vec![]).await?;
}
}
Command::Deploy { options } => {
Expand Down
Loading
Loading