Skip to content

Commit

Permalink
Merge branch 'dev' into sb-fix-reorg-dependency-for-fea
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless authored Mar 25, 2021
2 parents c5b2f5a + d322c9c commit 674650a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/bin/zksync_forced_exit_requests/src/eth_watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ where
.await
.expect("Failed to restore state for ForcedExit eth_watcher");

let mut timer = time::interval(Duration::from_secs(1));
let mut timer = time::interval(self.config.forced_exit_requests.poll_interval());

loop {
timer.tick().await;
Expand Down
9 changes: 9 additions & 0 deletions core/lib/config/src/configs/forced_exit_requests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::time::Duration;

use crate::envy_load;
/// External uses
use serde::Deserialize;
Expand Down Expand Up @@ -25,6 +27,7 @@ struct ForcedExitRequestsInternalConfig {
pub sender_account_address: Address,
pub expiration_period: u64,
pub blocks_check_amount: u64,
pub eth_node_poll_interval: u64,
}

#[derive(Debug, Deserialize, Clone, PartialEq)]
Expand All @@ -41,6 +44,7 @@ pub struct ForcedExitRequestsConfig {
pub sender_account_address: Address,
pub expiration_period: u64,
pub blocks_check_amount: u64,
pub eth_node_poll_interval: u64,
}

// Checks that in no way the price will overlap with the requests id space
Expand Down Expand Up @@ -82,6 +86,11 @@ impl ForcedExitRequestsConfig {
sender_account_address: config.sender_account_address,
expiration_period: config.expiration_period,
blocks_check_amount: config.blocks_check_amount,
eth_node_poll_interval: config.eth_node_poll_interval,
}
}

pub fn poll_interval(&self) -> Duration {
Duration::from_millis(self.eth_node_poll_interval)
}
}
5 changes: 5 additions & 0 deletions etc/env/base/forced_exit_requests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ withdrawal_threshold=1000000000000000000
# to set the same account as the one that sends the txs for retrieving the fees from the smart contract
fee_receiver="0x1963917ba0b44A879cf6248387C1d51A0F11669d"


# The amount of blocks we look into beyound the waiting confirmations
# Basically this ensures that we do not skip a transaction that has become too old due to a
# reorg
blocks_check_amount=10

# How often we want to poll the Ethereum node (in milliseconds).
eth_node_poll_interval=300

0 comments on commit 674650a

Please sign in to comment.