Skip to content

Commit

Permalink
feat(c-bridge): add new config params
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Aug 21, 2024
1 parent e00acd7 commit 06c9646
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
12 changes: 12 additions & 0 deletions bridges/centralized-ethereum/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ pub struct Config {
/// Address of the WitnetRequestsBoard contract
pub eth_witnet_oracle: H160,

/// Let the dog out?
pub watch_dog_enabled: bool,
/// Watch dog polling rate
#[serde(default = "default_watch_dog_polling_rate_ms")]
pub watch_dog_polling_rate_ms: u64,

/// Minimum collateral required on data requests read from the WitnetOracle contract
pub witnet_dr_min_collateral_nanowits: u64,
/// Maximium data request transaction fee assumed by the bridge
Expand All @@ -53,6 +59,8 @@ pub struct Config {
pub witnet_jsonrpc_socket: SocketAddr,
/// Running in the witnet testnet?
pub witnet_testnet: bool,
/// Bridge UTXO min value threshold
pub witnet_utxo_min_value_threshold: u64,

/// Storage
#[serde(deserialize_with = "nested_toml_if_using_envy")]
Expand All @@ -69,6 +77,10 @@ fn default_max_batch_size() -> u16 {
256
}

fn default_watch_dog_polling_rate_ms() -> u64 {
900_000
}

/// Gas limits for some methods. If missing, let the client estimate
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
Expand Down
14 changes: 11 additions & 3 deletions witnet_centralized_ethereum_bridge.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,23 @@ eth_txs_timeout_ms = 900000
# Address of the WitnetRequestsBoard deployed contract
eth_witnet_oracle = "0x77703aE126B971c9946d562F41Dd47071dA00777"

# Let the dog out?
watch_dog_enabled = true

# Polling period for checking and tracing global status
watch_dog_polling_rate_ms = 5_000

# Minimum collateral required on data requests read from the WitnetOracle contract
witnet_dr_min_collateral_nanowits = 20000000000
witnet_dr_min_collateral_nanowits = 20_000_000_000

# Maximium data request transaction fee assumed by the bridge
witnet_dr_max_fee_nanowits = 100000
witnet_dr_max_fee_nanowits = 100_000

# Maximum data request result size (in bytes) will accept to report
witnet_dr_max_result_size = 64

# Maximum data request value that the bridge will accept to relay
witnet_dr_max_value_nanowits = 100000000000
witnet_dr_max_value_nanowits = 100_000_000_000

# Polling period for checking resolution of data requests in the Witnet blockchain
witnet_dr_txs_polling_rate_ms = 45000
Expand All @@ -50,6 +55,8 @@ witnet_jsonrpc_socket = "127.0.0.1:21338"
# Running in the witnet testnet?
witnet_testnet = false

# Bridge UTXO min value threshold
witnet_utxo_min_value_threshold = 2_000_000_000

[eth_gas_limits]
# Gas limits for some methods.
Expand All @@ -59,3 +66,4 @@ witnet_testnet = false
[storage]
# Path of the folder where RocksDB storage files will be written to.
db_path = ".witnet_bridge/storage"

0 comments on commit 06c9646

Please sign in to comment.