Skip to content

Commit

Permalink
refactor: PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscotobar committed Sep 29, 2023
1 parent 043d3ae commit 915983f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions core/lib/config/src/configs/eth_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::Deserialize;
// Workspace uses
use zksync_types::{network::Network, Address, H256};
// Local uses
use crate::{configs::chain::Eth, envy_load};
use crate::{configs::chain::Eth, envy_load, ETHClientConfig};

/// Configuration for the Rootstock sender crate.
#[derive(Debug, Deserialize, Clone, PartialEq)]
Expand All @@ -20,9 +20,11 @@ impl ETHSenderConfig {
pub fn from_env() -> Self {
let eth: Eth = envy_load!("eth", "CHAIN_ETH_");
let sender: Sender = envy_load!("eth_sender", "ETH_SENDER_SENDER_");
let client: ETHClientConfig = envy_load!("eth_client", "ETH_CLIENT_");

assert!(
!(sender.complete_withdrawals && eth.network == Network::Mainnet),
!(sender.complete_withdrawals
&& (eth.network == Network::Mainnet || client.chain_id == 30)),
"The withdrawals cannot be automatic in mainnet"
);

Expand Down Expand Up @@ -130,6 +132,10 @@ ETH_SENDER_GAS_PRICE_LIMIT_DEFAULT="400000000000"
ETH_SENDER_GAS_PRICE_LIMIT_UPDATE_INTERVAL="150"
ETH_SENDER_GAS_PRICE_LIMIT_SAMPLE_INTERVAL="15"
ETH_SENDER_GAS_PRICE_LIMIT_SCALE_FACTOR="1"
CHAIN_ETH_NETWORK="mainnet"
ETH_CLIENT_CHAIN_ID=30
ETH_CLIENT_GAS_PRICE_FACTOR="1"
ETH_CLIENT_WEB3_URL="http://127.0.0.1:4444"
"#;
set_env(config);

Expand Down Expand Up @@ -174,6 +180,9 @@ ETH_SENDER_GAS_PRICE_LIMIT_UPDATE_INTERVAL="150"
ETH_SENDER_GAS_PRICE_LIMIT_SAMPLE_INTERVAL="15"
ETH_SENDER_GAS_PRICE_LIMIT_SCALE_FACTOR="1"
CHAIN_ETH_NETWORK="mainnet"
ETH_CLIENT_CHAIN_ID=30
ETH_CLIENT_GAS_PRICE_FACTOR="1"
ETH_CLIENT_WEB3_URL="http://127.0.0.1:4444"
"#;
set_env(config);

Expand Down
2 changes: 1 addition & 1 deletion etc/env/mainnet/api.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ url="http://127.0.0.1:8080"
port=3001
use_https=false
url="https://127.0.0.1:3001"
chain_id=30

# Configuration for the JSON RPC server
[api.json_rpc]
Expand All @@ -59,6 +58,7 @@ ws_url="ws://127.0.0.1:3031"
port=3002
url="http://127.0.0.1:3002"
max_block_range=10
chain_id=30

# Configuration for the core private server.
[api.private]
Expand Down
2 changes: 1 addition & 1 deletion etc/env/mainnet/chain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ balance_tree_depth=32

[chain.eth]
# Name of the used RSK network (since Ethers uses localhost for different works as Rootstock, different RSK networks are differentiated by its chain id in eth_client.toml)
network="localhost"
network="mainnet"

[chain.state_keeper]
# Block sizes to be generated by server.
Expand Down

0 comments on commit 915983f

Please sign in to comment.