Skip to content

Commit

Permalink
Merge pull request matter-labs#15 from zkLinkProtocol/add-linea-config
Browse files Browse the repository at this point in the history
feat: add enable_linea_estimate_gas config
  • Loading branch information
zkbenny authored Mar 28, 2024
2 parents b4341ce + 82b9aa8 commit 8da1ea3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/lib/config/src/configs/eth_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions core/lib/env_config/src/eth_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions core/lib/zksync_core/src/eth_sender/eth_tx_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions etc/env/base/eth_sender.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8da1ea3

Please sign in to comment.