Extract MAX_FINALITY_LAG constant from relay_chain_selection (#5159)

* Fix for Issue #4788

* Updated fix. Moved constant to node primitives

* cargo fmt

* Update node/primitives/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/core/dispute-coordinator/src/real/initialized.rs

Co-authored-by: Andronik <write@reusable.software>
This commit is contained in:
Boluwatife Bakre
2022-03-23 15:34:41 +01:00
committed by GitHub
parent 1656c4cd02
commit 91e07d53ad
4 changed files with 17 additions and 10 deletions
@@ -38,6 +38,7 @@
use super::{HeaderProvider, HeaderProviderProvider};
use consensus_common::{Error as ConsensusError, SelectChain};
use futures::channel::oneshot;
use polkadot_node_primitives::MAX_FINALITY_LAG as PRIMITIVES_MAX_FINALITY_LAG;
use polkadot_node_subsystem_util::metrics::{self, prometheus};
use polkadot_overseer::{AllMessages, Handle};
use polkadot_primitives::v2::{
@@ -53,9 +54,9 @@ use std::sync::Arc;
/// or disputes.
///
/// This is a safety net that should be removed at some point in the future.
// Until it's not, make sure to also update `MAX_HEADS_LOOK_BACK` in `approval-voting`
// and `MAX_BATCH_SCRAPE_ANCESTORS` in `dispute-coordinator` when changing its value.
const MAX_FINALITY_LAG: polkadot_primitives::v2::BlockNumber = 500;
// In sync with `MAX_HEADS_LOOK_BACK` in `approval-voting`
// and `MAX_BATCH_SCRAPE_ANCESTORS` in `dispute-coordinator`.
const MAX_FINALITY_LAG: polkadot_primitives::v2::BlockNumber = PRIMITIVES_MAX_FINALITY_LAG;
const LOG_TARGET: &str = "parachain::chain-selection";