Skip to content

Commit dc05f96

Browse files
author
Ivo Georgiev
committed
set unsignable promilles in the config
1 parent f36ae73 commit dc05f96

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

docs/config/dev.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ msgs_find_limit = 10
88

99
heartbeat_time = 30000
1010
health_threshold_promilles = 950
11+
health_unsignable_promilles = 750
1112
propagation_timeout = 1000
1213

1314
list_timeout = 5000
@@ -24,4 +25,4 @@ creators_whitelist = []
2425
minimal_deposit = "0"
2526
minimal_fee = "0"
2627
token_address_whitelist = []
27-
validators_whitelist = []
28+
validators_whitelist = []

docs/config/prod.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ msgs_find_limit = 10
1010

1111
heartbeat_time = 60000
1212
health_threshold_promilles = 970
13+
health_unsignable_promilles = 770
1314
propagation_timeout = 3000
1415

1516
list_timeout = 10000

primitives/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub struct Config {
2525
pub channels_find_limit: u32,
2626
pub events_find_limit: u32,
2727
pub health_threshold_promilles: u32,
28+
pub health_unsignable_promilles: u32,
2829
pub propagation_timeout: u32,
2930
pub fetch_timeout: u32,
3031
pub list_timeout: u32,

validator_worker/src/follower.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,13 @@ async fn on_new_state<'a, A: Adapter + 'static>(
8484
}
8585

8686
let health = get_health(&iface.channel, balances, &proposed_balances);
87-
// @TODO: don't hardcode that
88-
if health < (750 as u64).into() {
87+
if health < u64::from(iface.config.health_unsignable_promilles).into() {
8988
return Ok(on_error(&iface, &new_state, InvalidNewState::Health).await);
9089
}
9190

9291
let signature = iface.adapter.sign(&new_state.state_root)?;
93-
let health_threshold = u64::from(iface.config.health_threshold_promilles).into();
94-
let is_healthy = &health >= &health_threshold;
92+
let health_threshold = u64::from(iface.config.health_threshold_promilles);
93+
let is_healthy = health >= health_threshold;
9594

9695
iface
9796
.propagate(&[&MessageTypes::ApproveState(ApproveState {

0 commit comments

Comments
 (0)