diff --git a/core/lib/config/src/configs/eth_sender.rs b/core/lib/config/src/configs/eth_sender.rs index cd44daed17f8..84da6a083969 100644 --- a/core/lib/config/src/configs/eth_sender.rs +++ b/core/lib/config/src/configs/eth_sender.rs @@ -24,6 +24,7 @@ impl ETHSenderConfig { aggregate_tx_poll_period: 1, max_txs_in_flight: 30, proof_sending_mode: ProofSendingMode::SkipEveryProof, + enable_linea_estimate_gas: false, max_aggregated_tx_gas: 4000000, max_eth_tx_data_size: 6000000, max_aggregated_blocks_to_commit: 10, @@ -77,6 +78,7 @@ pub struct SenderConfig { pub max_txs_in_flight: u64, /// The mode in which proofs are sent. pub proof_sending_mode: ProofSendingMode, + pub enable_linea_estimate_gas: bool, pub max_aggregated_tx_gas: u32, pub max_eth_tx_data_size: usize, diff --git a/core/lib/env_config/src/eth_sender.rs b/core/lib/env_config/src/eth_sender.rs index f0ee6030b029..c106307360f2 100644 --- a/core/lib/env_config/src/eth_sender.rs +++ b/core/lib/env_config/src/eth_sender.rs @@ -54,6 +54,7 @@ mod tests { l1_batch_min_age_before_execute_seconds: Some(1000), max_acceptable_priority_fee_in_gwei: 100_000_000_000, proof_loading_mode: ProofLoadingMode::OldProofFromDb, + enable_linea_estimate_gas: false, }, gas_adjuster: GasAdjusterConfig { default_priority_fee_per_gas: 20000000000, @@ -93,6 +94,7 @@ mod tests { ETH_SENDER_SENDER_AGGREGATED_BLOCK_PROVE_DEADLINE="3000" ETH_SENDER_SENDER_AGGREGATED_BLOCK_EXECUTE_DEADLINE="4000" ETH_SENDER_SENDER_TIMESTAMP_CRITERIA_MAX_ALLOWED_LAG="30" + ETH_SENDER_SENDER_ENABLE_LINEA_ESTIMATE_GAS="false" ETH_SENDER_SENDER_MAX_AGGREGATED_TX_GAS="4000000" ETH_SENDER_SENDER_MAX_ETH_TX_DATA_SIZE="120000" ETH_SENDER_SENDER_L1_BATCH_MIN_AGE_BEFORE_EXECUTE_SECONDS="1000" diff --git a/core/lib/zksync_core/src/eth_sender/eth_tx_manager.rs b/core/lib/zksync_core/src/eth_sender/eth_tx_manager.rs index 3c9f598c73bc..bd53764e31e4 100644 --- a/core/lib/zksync_core/src/eth_sender/eth_tx_manager.rs +++ b/core/lib/zksync_core/src/eth_sender/eth_tx_manager.rs @@ -189,9 +189,9 @@ impl EthTxManager { const LINEA_TEST_CHAIN_ID: L1ChainId = L1ChainId(59140); const LINEA_MAINNET_CHAIN_ID: L1ChainId = L1ChainId(59144); let current_gate_way_chain_id = self.ethereum_gateway.chain_id(); - let (base_fee_per_gas, priority_fee_per_gas) = if current_gate_way_chain_id + let (base_fee_per_gas, priority_fee_per_gas) = if (current_gate_way_chain_id == LINEA_TEST_CHAIN_ID - || current_gate_way_chain_id == LINEA_MAINNET_CHAIN_ID + || current_gate_way_chain_id == LINEA_MAINNET_CHAIN_ID) && self.config.enable_linea_estimate_gas { let call_request = zksync_types::web3::types::CallRequest::builder() .from(self.ethereum_gateway.sender_account()) diff --git a/etc/env/base/eth_sender.toml b/etc/env/base/eth_sender.toml index f95a70c5f96a..a03ca2a563d1 100644 --- a/etc/env/base/eth_sender.toml +++ b/etc/env/base/eth_sender.toml @@ -28,6 +28,7 @@ aggregated_block_prove_deadline=10 aggregated_block_execute_deadline=10 timestamp_criteria_max_allowed_lag=30 +enable_linea_estimate_gas=false # Based on geth implementation max size of transaction is 128kb. max_eth_tx_data_size=120000