Skip to content

Commit

Permalink
fix session length of Rococo and Wococo (paritytech#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
svyatonik authored Feb 1, 2022
1 parent c3cf8b3 commit f99e79f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
4 changes: 2 additions & 2 deletions primitives/chain-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ pub use bp_polkadot_core::*;
/// Rococo Chain
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.
///
/// Note that since this is a target sessions may change before/after this time depending on network
/// 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.
pub const VERSION: RuntimeVersion = RuntimeVersion {
Expand Down
11 changes: 8 additions & 3 deletions primitives/chain-wococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ use sp_std::prelude::*;

pub use bp_polkadot_core::*;
// Rococo runtime = Wococo runtime
pub use bp_rococo::{
WeightToFee, EXISTENTIAL_DEPOSIT, PAY_INBOUND_DISPATCH_FEE_WEIGHT, SESSION_LENGTH, VERSION,
};
pub use bp_rococo::{WeightToFee, EXISTENTIAL_DEPOSIT, PAY_INBOUND_DISPATCH_FEE_WEIGHT, VERSION};

/// Wococo Chain
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)
// account.
pub fn derive_account_from_rococo_id(id: bp_runtime::SourceAccount<AccountId>) -> AccountId {
Expand Down
2 changes: 1 addition & 1 deletion relays/bin-substrate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "substrate-relay"
version = "1.0.0"
version = "1.0.1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
22 changes: 20 additions & 2 deletions relays/lib-substrate-relay/src/on_demand_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
// => to avoid scanning the same headers over and over again, remember that
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() {
relay_utils::relay_loop::reconnect_failed_client(
FailedClient::Source,
Expand All @@ -203,7 +220,8 @@ async fn background_task<P: SubstrateFinalitySyncPipeline>(
)
.await;
continue
},
}
},
}
}

Expand Down

0 comments on commit f99e79f

Please sign in to comment.