Skip to content
Open
10 changes: 7 additions & 3 deletions cmd/ethrex/l2/deployer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ use std::{
use bytes::Bytes;
use clap::Parser;
use ethrex_common::H256;
use ethrex_common::utils::keccak;
use ethrex_common::{
Address, U256,
types::{Genesis, TxType},
};
use ethrex_l2::utils::test_data_io::read_genesis_file;
use ethrex_l2::{sequencer::utils::get_git_commit_hash, utils::test_data_io::read_genesis_file};
use ethrex_l2_common::{calldata::Value, prover::ProverType, utils::get_address_from_secret_key};
use ethrex_l2_rpc::signer::{LocalSigner, Signer};
use ethrex_l2_sdk::{
Expand Down Expand Up @@ -539,8 +540,8 @@ const SP1_VERIFIER_BYTECODE: &[u8] = include_bytes!(concat!(
"/contracts/solc_out/SP1Verifier.bytecode"
));

const INITIALIZE_ON_CHAIN_PROPOSER_SIGNATURE_BASED: &str = "initialize(bool,address,bool,bool,bool,bool,address,address,address,address,bytes32,bytes32,bytes32,address,uint256)";
const INITIALIZE_ON_CHAIN_PROPOSER_SIGNATURE: &str = "initialize(bool,address,bool,bool,bool,bool,address,address,address,address,bytes32,bytes32,bytes32,address[],uint256)";
const INITIALIZE_ON_CHAIN_PROPOSER_SIGNATURE_BASED: &str = "initialize(bool,address,bool,bool,bool,bool,address,address,address,address,bytes32,bytes32,bytes32,bytes32,address,uint256)";
const INITIALIZE_ON_CHAIN_PROPOSER_SIGNATURE: &str = "initialize(bool,address,bool,bool,bool,bool,address,address,address,address,bytes32,bytes32,bytes32,bytes32,address[],uint256)";

const INITIALIZE_BRIDGE_ADDRESS_SIGNATURE: &str = "initializeBridgeAddress(address)";
const TRANSFER_OWNERSHIP_SIGNATURE: &str = "transferOwnership(address)";
Expand Down Expand Up @@ -1027,6 +1028,7 @@ async fn initialize_contracts(
let risc0_vk = get_vk(ProverType::RISC0, opts)?;

info!("Risc0 vk read");
let commit_hash = keccak(get_git_commit_hash());

let deployer_address = get_address_from_secret_key(&opts.private_key.secret_bytes())
.map_err(DeployerError::InternalError)?;
Expand All @@ -1048,6 +1050,7 @@ async fn initialize_contracts(
Value::Address(contract_addresses.aligned_aggregator_address),
Value::FixedBytes(sp1_vk),
Value::FixedBytes(risc0_vk),
Value::FixedBytes(commit_hash.0.to_vec().into()),
Value::FixedBytes(genesis.compute_state_root().0.to_vec().into()),
Value::Address(contract_addresses.sequencer_registry_address),
Value::Uint(genesis.config.chain_id.into()),
Expand Down Expand Up @@ -1157,6 +1160,7 @@ async fn initialize_contracts(
Value::Address(contract_addresses.aligned_aggregator_address),
Value::FixedBytes(sp1_vk),
Value::FixedBytes(risc0_vk),
Value::FixedBytes(commit_hash.0.to_vec().into()),
Value::FixedBytes(genesis.compute_state_root().0.to_vec().into()),
Value::Array(vec![
Value::Address(opts.committer_l1_address),
Expand Down
Loading