From fa73896a0ad2d0a5c4e2a83aaf1f3b4f8bbd8805 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Thu, 3 Feb 2022 16:03:44 +0300 Subject: [PATCH] increase relay balance guard limits for Polkadot<>Kusama bridge (#1308) --- .../src/chains/kusama_headers_to_polkadot.rs | 9 +++++++-- .../src/chains/polkadot_headers_to_kusama.rs | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bridges/relays/bin-substrate/src/chains/kusama_headers_to_polkadot.rs b/bridges/relays/bin-substrate/src/chains/kusama_headers_to_polkadot.rs index f3a2d553045f..0c0ba2272c7e 100644 --- a/bridges/relays/bin-substrate/src/chains/kusama_headers_to_polkadot.rs +++ b/bridges/relays/bin-substrate/src/chains/kusama_headers_to_polkadot.rs @@ -24,8 +24,13 @@ use substrate_relay_helper::{finality_pipeline::SubstrateFinalitySyncPipeline, T /// relay as gone wild. /// /// Actual value, returned by `maximal_balance_decrease_per_day_is_sane` test is approximately 21 -/// DOT, but let's round up to 30 DOT here. -pub(crate) const MAXIMAL_BALANCE_DECREASE_PER_DAY: bp_polkadot::Balance = 30_000_000_000; +/// DOT, and initial value of this constant was rounded up to 30 DOT. But for actual Kusama <> +/// Polkadot deployment we'll be using the same account for delivering finality (free for mandatory +/// headers) and messages. It means that we can't predict maximal loss. But to protect funds against +/// relay/deployment issues, let's limit it so something that is much larger than this estimation - +/// e.g. to 100 DOT. +// TODO: https://github.com/paritytech/parity-bridges-common/issues/1307 +pub(crate) const MAXIMAL_BALANCE_DECREASE_PER_DAY: bp_polkadot::Balance = 100 * 10_000_000_000; /// Description of Kusama -> Polkadot finalized headers bridge. #[derive(Clone, Debug)] diff --git a/bridges/relays/bin-substrate/src/chains/polkadot_headers_to_kusama.rs b/bridges/relays/bin-substrate/src/chains/polkadot_headers_to_kusama.rs index 27bcb2457896..6d118b07caa5 100644 --- a/bridges/relays/bin-substrate/src/chains/polkadot_headers_to_kusama.rs +++ b/bridges/relays/bin-substrate/src/chains/polkadot_headers_to_kusama.rs @@ -24,8 +24,13 @@ use substrate_relay_helper::{finality_pipeline::SubstrateFinalitySyncPipeline, T /// relay as gone wild. /// /// Actual value, returned by `maximal_balance_decrease_per_day_is_sane` test is approximately 0.001 -/// KSM, but let's round up to 0.1 KSM here. -pub(crate) const MAXIMAL_BALANCE_DECREASE_PER_DAY: bp_polkadot::Balance = 100_000_000_000; +/// KSM, and initial value of this constant was rounded up to 0.1 KSM. But for actual Kusama <> +/// Polkadot deployment we'll be using the same account for delivering finality (free for mandatory +/// headers) and messages. It means that we can't predict maximal loss. But to protect funds against +/// relay/deployment issues, let's limit it so something that is much larger than this estimation - +/// e.g. to 2 KSM. +// TODO: https://github.com/paritytech/parity-bridges-common/issues/1307 +pub(crate) const MAXIMAL_BALANCE_DECREASE_PER_DAY: bp_kusama::Balance = 2 * 1_000_000_000_000; /// Description of Polkadot -> Kusama finalized headers bridge. #[derive(Clone, Debug)]