From 06c9646146334656cfd06005434e4d154d5bfbb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Mon, 19 Aug 2024 14:18:23 +0200 Subject: [PATCH] feat(c-bridge): add new config params --- bridges/centralized-ethereum/src/config.rs | 12 ++++++++++++ witnet_centralized_ethereum_bridge.toml | 14 +++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/bridges/centralized-ethereum/src/config.rs b/bridges/centralized-ethereum/src/config.rs index eb79db3cb..bc895a1e8 100644 --- a/bridges/centralized-ethereum/src/config.rs +++ b/bridges/centralized-ethereum/src/config.rs @@ -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 @@ -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")] @@ -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)] diff --git a/witnet_centralized_ethereum_bridge.toml b/witnet_centralized_ethereum_bridge.toml index 3a47efa82..1f3909e31 100644 --- a/witnet_centralized_ethereum_bridge.toml +++ b/witnet_centralized_ethereum_bridge.toml @@ -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 @@ -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. @@ -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" +