fix session length of Rococo and Wococo (#1304)

This commit is contained in:
Svyatoslav Nikolsky
2022-02-01 11:05:03 +03:00
committed by Bastian Köcher
parent 01ee74c949
commit e190c35c95
4 changed files with 31 additions and 8 deletions
+2 -2
View File
@@ -32,12 +32,12 @@ pub use bp_polkadot_core::*;
/// Rococo Chain /// Rococo Chain
pub type Rococo = PolkadotLike; pub type Rococo = PolkadotLike;
/// The target length of a session (how often authorities change) on Westend measured in of number /// The target length of a session (how often authorities change) on Rococo measured in of number
/// of blocks. /// of blocks.
/// ///
/// Note that since this is a target sessions may change before/after this time depending on network /// Note that since this is a target sessions may change before/after this time depending on network
/// conditions. /// conditions.
pub const SESSION_LENGTH: BlockNumber = 10 * time_units::MINUTES; pub const SESSION_LENGTH: BlockNumber = 1 * time_units::HOURS;
// NOTE: This needs to be kept up to date with the Rococo runtime found in the Polkadot repo. // NOTE: This needs to be kept up to date with the Rococo runtime found in the Polkadot repo.
pub const VERSION: RuntimeVersion = RuntimeVersion { pub const VERSION: RuntimeVersion = RuntimeVersion {
+8 -3
View File
@@ -25,13 +25,18 @@ use sp_std::prelude::*;
pub use bp_polkadot_core::*; pub use bp_polkadot_core::*;
// Rococo runtime = Wococo runtime // Rococo runtime = Wococo runtime
pub use bp_rococo::{ pub use bp_rococo::{WeightToFee, EXISTENTIAL_DEPOSIT, PAY_INBOUND_DISPATCH_FEE_WEIGHT, VERSION};
WeightToFee, EXISTENTIAL_DEPOSIT, PAY_INBOUND_DISPATCH_FEE_WEIGHT, SESSION_LENGTH, VERSION,
};
/// Wococo Chain /// Wococo Chain
pub type Wococo = PolkadotLike; pub type Wococo = PolkadotLike;
/// The target length of a session (how often authorities change) on Wococo measured in of number
/// of blocks.
///
/// Note that since this is a target sessions may change before/after this time depending on network
/// conditions.
pub const SESSION_LENGTH: BlockNumber = 1 * time_units::MINUTES;
// We use this to get the account on Wococo (target) which is derived from Rococo's (source) // We use this to get the account on Wococo (target) which is derived from Rococo's (source)
// account. // account.
pub fn derive_account_from_rococo_id(id: bp_runtime::SourceAccount<AccountId>) -> AccountId { pub fn derive_account_from_rococo_id(id: bp_runtime::SourceAccount<AccountId>) -> AccountId {
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "substrate-relay" name = "substrate-relay"
version = "1.0.0" version = "1.0.1"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -192,8 +192,25 @@ async fn background_task<P: SubstrateFinalitySyncPipeline>(
// there are no (or we don't need to relay them) mandatory headers in the range // there are no (or we don't need to relay them) mandatory headers in the range
// => to avoid scanning the same headers over and over again, remember that // => to avoid scanning the same headers over and over again, remember that
latest_non_mandatory_at_source = mandatory_scan_range.1; latest_non_mandatory_at_source = mandatory_scan_range.1;
log::trace!(
target: "bridge",
"No mandatory {} headers in the range {:?} of {} relay",
P::SourceChain::NAME,
mandatory_scan_range,
relay_task_name,
);
}, },
Err(e) => Err(e) => {
log::warn!(
target: "bridge",
"Failed to scan mandatory {} headers range in {} relay (range: {:?}): {:?}",
P::SourceChain::NAME,
relay_task_name,
mandatory_scan_range,
e,
);
if e.is_connection_error() { if e.is_connection_error() {
relay_utils::relay_loop::reconnect_failed_client( relay_utils::relay_loop::reconnect_failed_client(
FailedClient::Source, FailedClient::Source,
@@ -203,7 +220,8 @@ async fn background_task<P: SubstrateFinalitySyncPipeline>(
) )
.await; .await;
continue continue
}, }
},
} }
} }