Skip to content

Commit f9642e9

Browse files
authored
Merge pull request #754 from matter-labs/dvush/turn_eth_sender_off
turn sender off
2 parents b3c72cd + 531bdd3 commit f9642e9

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

core/models/src/config_options.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub struct EthSenderOptions {
6060
pub tx_poll_period: Duration,
6161
pub wait_confirmations: u64,
6262
pub max_txs_in_flight: u64,
63+
pub is_enabled: bool,
6364
}
6465

6566
impl EthSenderOptions {
@@ -73,6 +74,7 @@ impl EthSenderOptions {
7374
tx_poll_period: Duration::new(tx_poll_period_secs, 0),
7475
wait_confirmations: parse_env("ETH_WAIT_CONFIRMATIONS"),
7576
max_txs_in_flight: parse_env("ETH_MAX_TXS_IN_FLIGHT"),
77+
is_enabled: parse_env("ETH_IS_ENABLED"),
7678
}
7779
}
7880
}

core/server/src/eth_sender/mod.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,12 @@ impl<ETH: EthereumInterface, DB: DatabaseAccess> ETHSender<ETH, DB> {
198198
.await
199199
.unwrap_or_default();
200200

201-
// ...and proceed them.
202-
self.proceed_next_operations().await;
203-
204-
// Update the gas adjuster to maintain the up-to-date max gas price limit.
205-
self.gas_adjuster.keep_updated(&self.db);
201+
if self.options.is_enabled {
202+
// ...and proceed them.
203+
self.proceed_next_operations().await;
204+
// Update the gas adjuster to maintain the up-to-date max gas price limit.
205+
self.gas_adjuster.keep_updated(&self.db);
206+
}
206207
}
207208
}
208209

core/server/src/eth_sender/tests/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ fn build_eth_sender(
399399
expected_wait_time_block: super::EXPECTED_WAIT_TIME_BLOCKS,
400400
wait_confirmations: super::WAIT_CONFIRMATIONS,
401401
tx_poll_period: Default::default(),
402+
is_enabled: true,
402403
};
403404

404405
let current_zksync_info = CurrentZksyncInfo::with_block_number(0);

etc/env/dev.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ ETH_GAS_PRICE_LIMIT_UPDATE_INTERVAL=150
6060
# Scale factor for gas price limit (used by GasAdjuster)
6161
# Defaults to 1.5: every time we can increase the price by no more than 50%.
6262
ETH_GAS_PRICE_LIMIT_SCALE_FACTOR=1.5
63+
ETH_IS_ENABLED=true
6364

6465
# Prover options
6566
# Interval values in milliseconds

0 commit comments

Comments
 (0)