From 73bcda030ae4c3168a13bf18f8ee39210b1c3c29 Mon Sep 17 00:00:00 2001 From: mikhailUshakoff Date: Thu, 24 Jul 2025 22:57:09 +0200 Subject: [PATCH 1/2] feat: set batch proposer to any address --- node/src/ethereum_l1/config.rs | 1 + node/src/ethereum_l1/execution_layer.rs | 12 ++++++++++-- node/src/ethereum_l1/propose_batch_builder.rs | 13 +++++++++---- node/src/main.rs | 4 ++++ node/src/utils/config.rs | 10 ++++++++++ 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/node/src/ethereum_l1/config.rs b/node/src/ethereum_l1/config.rs index e5a0a36e..8f5adad7 100644 --- a/node/src/ethereum_l1/config.rs +++ b/node/src/ethereum_l1/config.rs @@ -49,5 +49,6 @@ pub struct EthereumL1Config { pub delay_between_tx_attempts_sec: u64, pub signer: Arc, pub preconfer_address: Option
, + pub batch_proposer_address: Option
, pub extra_gas_percentage: u64, } diff --git a/node/src/ethereum_l1/execution_layer.rs b/node/src/ethereum_l1/execution_layer.rs index 601a3562..e4b28e47 100644 --- a/node/src/ethereum_l1/execution_layer.rs +++ b/node/src/ethereum_l1/execution_layer.rs @@ -34,6 +34,7 @@ const DELAYED_L1_PROPOSAL_BUFFER: u64 = 4; pub struct ExecutionLayer { provider_ws: DynProvider, preconfer_address: Address, + batch_proposer_address: Address, contract_addresses: ContractAddresses, pacaya_config: taiko_inbox::ITaikoInbox::Config, extra_gas_percentage: u64, @@ -55,7 +56,10 @@ impl ExecutionLayer { config.preconfer_address, ) .await?; - info!("AVS node address: {}", preconfer_address); + info!("AVS preconfer address: {}", preconfer_address); + + let batch_proposer_address = config.batch_proposer_address.unwrap_or(preconfer_address); + info!("AVS proposer address: {}", batch_proposer_address); let extra_gas_percentage = config.extra_gas_percentage; @@ -88,6 +92,7 @@ impl ExecutionLayer { Ok(Self { provider_ws, preconfer_address, + batch_proposer_address, contract_addresses: config.contract_addresses, pacaya_config, extra_gas_percentage, @@ -212,6 +217,7 @@ impl ExecutionLayer { .build_propose_batch_tx( self.preconfer_address, self.contract_addresses.preconf_router, + self.batch_proposer_address, tx_lists_bytes, blocks.clone(), last_anchor_origin_height, @@ -466,7 +472,7 @@ impl ExecutionLayer { info: &ForcedInclusionInfo, ) -> BatchParams { ProposeBatchBuilder::build_forced_inclusion_batch( - self.preconfer_address, + self.batch_proposer_address, coinbase, last_anchor_origin_height, last_l2_block_timestamp, @@ -523,6 +529,7 @@ impl ExecutionLayer { preconf_heartbeat_ms: 1000, signer: Arc::new(Signer::PrivateKey(hex::encode(private_key.to_bytes()))), preconfer_address: Some(preconfer_address.parse()?), + batch_proposer_address: Some(preconfer_address.parse()?), min_priority_fee_per_gas_wei: 1000000000000000000, tx_fees_increase_percentage: 5, max_attempts_to_send_tx: 4, @@ -536,6 +543,7 @@ impl ExecutionLayer { Ok(Self { provider_ws: provider_ws.clone(), preconfer_address: preconfer_address.parse()?, + batch_proposer_address: preconfer_address.parse()?, contract_addresses: ethereum_l1_config.contract_addresses.clone(), pacaya_config: taiko_inbox::ITaikoInbox::Config { chainId: 1, diff --git a/node/src/ethereum_l1/propose_batch_builder.rs b/node/src/ethereum_l1/propose_batch_builder.rs index 4f932f2a..2fa89a5b 100644 --- a/node/src/ethereum_l1/propose_batch_builder.rs +++ b/node/src/ethereum_l1/propose_batch_builder.rs @@ -50,6 +50,7 @@ impl ProposeBatchBuilder { &self, from: Address, to: Address, + batch_proposer: Address, tx_list: Vec, blocks: Vec, last_anchor_origin_height: u64, @@ -62,6 +63,7 @@ impl ProposeBatchBuilder { .build_propose_batch_blob( from, to, + batch_proposer, &tx_list, blocks.clone(), last_anchor_origin_height, @@ -119,6 +121,7 @@ impl ProposeBatchBuilder { .build_propose_batch_calldata( from, to, + batch_proposer, tx_list, blocks.clone(), last_anchor_origin_height, @@ -260,6 +263,7 @@ impl ProposeBatchBuilder { &self, from: Address, to: Address, + batch_proposer: Address, tx_list: Vec, blocks: Vec, last_anchor_origin_height: u64, @@ -277,7 +281,7 @@ impl ProposeBatchBuilder { }; let batch_params = BatchParams { - proposer: from, + proposer: batch_proposer, coinbase, parentMetaHash: FixedBytes::from(&[0u8; 32]), anchorBlockId: last_anchor_origin_height, @@ -321,6 +325,7 @@ impl ProposeBatchBuilder { &self, from: Address, to: Address, + batch_proposer: Address, tx_list: &[u8], blocks: Vec, last_anchor_origin_height: u64, @@ -341,7 +346,7 @@ impl ProposeBatchBuilder { let num_blobs = u8::try_from(sidecar.blobs.len())?; let batch_params = BatchParams { - proposer: from, + proposer: batch_proposer, coinbase, parentMetaHash: FixedBytes::from(&[0u8; 32]), anchorBlockId: last_anchor_origin_height, @@ -382,14 +387,14 @@ impl ProposeBatchBuilder { } pub fn build_forced_inclusion_batch( - proposer: Address, + batch_proposer: Address, coinbase: Address, last_anchor_origin_height: u64, last_l2_block_timestamp: u64, info: &ForcedInclusionInfo, ) -> BatchParams { BatchParams { - proposer, + proposer: batch_proposer, coinbase, parentMetaHash: FixedBytes::from(&[0u8; 32]), anchorBlockId: last_anchor_origin_height, diff --git a/node/src/main.rs b/node/src/main.rs index c937b4b1..27a7ac2b 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -93,6 +93,10 @@ async fn main() -> Result<(), Error> { s.parse() .expect("Preconfer address is not a valid Ethereum address") }), + batch_proposer_address: config.batch_proposer_address.clone().map(|s| { + s.parse() + .expect("Batch proposer address is not a valid Ethereum address") + }), extra_gas_percentage: config.extra_gas_percentage, }, transaction_error_sender, diff --git a/node/src/utils/config.rs b/node/src/utils/config.rs index fa20097f..c0dde4d6 100644 --- a/node/src/utils/config.rs +++ b/node/src/utils/config.rs @@ -5,6 +5,7 @@ use crate::utils::blob::constants::MAX_BLOB_DATA_SIZE; pub struct Config { pub preconfer_address: Option, + pub batch_proposer_address: Option, pub taiko_geth_ws_rpc_url: String, pub taiko_geth_auth_rpc_url: String, pub taiko_driver_url: String, @@ -92,6 +93,9 @@ impl Config { ); } + const BATCH_PROPOSER_ADDRESS: &str = "BATCH_PROPOSER_ADDRESS"; + let batch_proposer_address = std::env::var(BATCH_PROPOSER_ADDRESS).ok(); + const TAIKO_INBOX_ADDRESS: &str = "TAIKO_INBOX_ADDRESS"; let taiko_inbox = std::env::var(TAIKO_INBOX_ADDRESS).unwrap_or_else(|_| { warn!( @@ -357,6 +361,7 @@ impl Config { let config = Self { preconfer_address, + batch_proposer_address, taiko_geth_ws_rpc_url: std::env::var("TAIKO_GETH_WS_RPC_URL") .unwrap_or("ws://127.0.0.1:1234".to_string()), taiko_geth_auth_rpc_url: std::env::var("TAIKO_GETH_AUTH_RPC_URL") @@ -449,6 +454,7 @@ amount to bridge from l2 to l1: {} disable bridging: {} simulate not submitting at the end of epoch: {} propose_forced_inclusion: {} +batch_proposer_address: {} "#, if let Some(preconfer_address) = &config.preconfer_address { format!("\npreconfer address: {preconfer_address}") @@ -495,6 +501,10 @@ propose_forced_inclusion: {} config.disable_bridging, config.simulate_not_submitting_at_the_end_of_epoch, config.propose_forced_inclusion, + config + .batch_proposer_address + .as_ref() + .unwrap_or(&"not set".to_string()), ); config From 0f5a975cb2036ff5d8967e944275a18449cff7e7 Mon Sep 17 00:00:00 2001 From: mikhailUshakoff Date: Thu, 24 Jul 2025 22:57:54 +0200 Subject: [PATCH 2/2] bump version --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cce81a77..fde43e1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4906,7 +4906,7 @@ dependencies = [ [[package]] name = "p2p-boot-node" -version = "0.2.115" +version = "0.2.116" dependencies = [ "anyhow", "discv5", @@ -4918,7 +4918,7 @@ dependencies = [ [[package]] name = "p2p-network" -version = "0.2.115" +version = "0.2.116" dependencies = [ "discv5", "futures", @@ -4933,7 +4933,7 @@ dependencies = [ [[package]] name = "p2p-node" -version = "0.2.115" +version = "0.2.116" dependencies = [ "anyhow", "jsonrpsee", @@ -6511,7 +6511,7 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "taiko_preconf_avs_node" -version = "0.2.115" +version = "0.2.116" dependencies = [ "alloy", "alloy-json-rpc", diff --git a/Cargo.toml b/Cargo.toml index cae7edc6..f2b0161c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ resolver = "2" default-members = ["node"] [workspace.package] -version = "0.2.115" +version = "0.2.116" edition = "2024" repository = "https://github.com/NethermindEth/Taiko-Preconf-AVS" license = "MIT"