From a31733a4218d82004517a59371238da2341dcda2 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Thu, 4 Jul 2024 20:30:19 +0200 Subject: [PATCH] renamed according to the review --- Node/src/ethereum_l1/mod.rs | 10 +++++----- Node/src/main.rs | 2 +- Node/src/taiko/l2_tx_lists.rs | 2 +- Node/src/utils/config.rs | 15 ++++++++------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Node/src/ethereum_l1/mod.rs b/Node/src/ethereum_l1/mod.rs index 4959334..445924a 100644 --- a/Node/src/ethereum_l1/mod.rs +++ b/Node/src/ethereum_l1/mod.rs @@ -12,7 +12,7 @@ use std::str::FromStr; pub struct EthereumL1 { rpc_url: reqwest::Url, wallet: EthereumWallet, - new_block_proposal_contract_address: Address, + taiko_preconfirming_address: Address, } sol!( @@ -46,7 +46,7 @@ impl EthereumL1 { pub fn new( rpc_url: &str, private_key: &str, - new_block_proposal_contract_address: &str, + taiko_preconfirming_address: &str, ) -> Result { let signer = PrivateKeySigner::from_str(private_key)?; let wallet = EthereumWallet::from(signer); @@ -54,7 +54,7 @@ impl EthereumL1 { Ok(Self { rpc_url: rpc_url.parse()?, wallet, - new_block_proposal_contract_address: new_block_proposal_contract_address.parse()?, + taiko_preconfirming_address: taiko_preconfirming_address.parse()?, }) } @@ -68,7 +68,7 @@ impl EthereumL1 { .wallet(self.wallet.clone()) .on_http(self.rpc_url.clone()); - let contract = PreconfTaskManager::new(self.new_block_proposal_contract_address, provider); + let contract = PreconfTaskManager::new(self.taiko_preconfirming_address, provider); let block_params = BlockParams { assignedProver: Address::ZERO, @@ -111,7 +111,7 @@ impl EthereumL1 { Ok(Self { rpc_url, wallet, - new_block_proposal_contract_address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" // some random address for test + taiko_preconfirming_address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" // some random address for test .parse()?, }) } diff --git a/Node/src/main.rs b/Node/src/main.rs index 0adc7c4..0c705b8 100644 --- a/Node/src/main.rs +++ b/Node/src/main.rs @@ -23,7 +23,7 @@ async fn main() -> Result<(), Error> { let ethereum_l1 = ethereum_l1::EthereumL1::new( &config.mev_boost_url, &config.ethereum_private_key, - &config.new_block_proposal_contract_address, + &config.taiko_preconfirming_address, )?; let mev_boost = mev_boost::MevBoost::new(&config.mev_boost_url); let node = node::Node::new(node_rx, avs_p2p_tx, taiko, ethereum_l1, mev_boost); diff --git a/Node/src/taiko/l2_tx_lists.rs b/Node/src/taiko/l2_tx_lists.rs index db10ca3..d842710 100644 --- a/Node/src/taiko/l2_tx_lists.rs +++ b/Node/src/taiko/l2_tx_lists.rs @@ -5,7 +5,7 @@ use serde_json::Value; #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "PascalCase")] pub struct RPCReplyL2TxLists { - pub tx_lists: Value, + pub tx_lists: Value, // TODO: decode and create tx_list_bytes on AVS node side #[serde(deserialize_with = "deserialize_tx_lists_bytes")] pub tx_list_bytes: Vec>, #[serde(deserialize_with = "deserialize_parent_meta_hash")] diff --git a/Node/src/utils/config.rs b/Node/src/utils/config.rs index b93b86d..6bddc74 100644 --- a/Node/src/utils/config.rs +++ b/Node/src/utils/config.rs @@ -5,27 +5,28 @@ pub struct Config { pub taiko_driver_url: String, pub ethereum_private_key: String, pub mev_boost_url: String, - pub new_block_proposal_contract_address: String, + pub taiko_preconfirming_address: String, } impl Config { pub fn read_env_variables() -> Self { const ETHEREUM_PRIVATE_KEY: &str = "ETHEREUM_PRIVATE_KEY"; - const NEW_BLOCK_PROPOSAL_CONTRACT_ADDRESS: &str = "NEW_BLOCK_PROPOSAL_CONTRACT_ADDRESS"; + const TAIKO_PRECONFIRMING_ADDRESS: &str = "TAIKO_PRECONFIRMING_ADDRESS"; let config = Self { taiko_proposer_url: std::env::var("TAIKO_PROPOSER_URL") .unwrap_or_else(|_| "http://127.0.0.1:1234".to_string()), taiko_driver_url: std::env::var("TAIKO_DRIVER_URL") .unwrap_or_else(|_| "http://127.0.0.1:1235".to_string()), - new_block_proposal_contract_address: std::env::var(NEW_BLOCK_PROPOSAL_CONTRACT_ADDRESS) - .unwrap_or_else(|_| { + taiko_preconfirming_address: std::env::var(TAIKO_PRECONFIRMING_ADDRESS).unwrap_or_else( + |_| { warn!( "No new block proposal contract address found in {} env var, using default", - NEW_BLOCK_PROPOSAL_CONTRACT_ADDRESS + TAIKO_PRECONFIRMING_ADDRESS ); "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2".to_string() - }), + }, + ), ethereum_private_key: std::env::var(ETHEREUM_PRIVATE_KEY).unwrap_or_else(|_| { warn!( "No Ethereum private key found in {} env var, using default", @@ -42,7 +43,7 @@ impl Config { config.taiko_proposer_url, config.taiko_driver_url, config.mev_boost_url, - config.new_block_proposal_contract_address + config.taiko_preconfirming_address ); config