diff --git a/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml b/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml index 8896522951..cb7f55d336 100644 --- a/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml +++ b/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml @@ -17,6 +17,7 @@ bp-messages = { path = "../../primitives/messages", default-features = false } frame-system = { git = "/~https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-support = { git = "/~https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-api = { git = "/~https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-std = { git = "/~https://github.com/paritytech/substrate", branch = "master", default-features = false } # Polkadot Dependencies polkadot-primitives = { git = "/~https://github.com/paritytech/polkadot", branch = "master", default-features = false } @@ -29,5 +30,6 @@ std = [ "frame-system/std", "frame-support/std", "sp-api/std", + "sp-std/std", "polkadot-primitives/std", ] diff --git a/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs index 6eab5a53a0..74c6618275 100644 --- a/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs @@ -29,6 +29,12 @@ use frame_support::{ weights::constants, }; use frame_system::limits; +use sp_std::time::Duration; + +/// Average block interval in Cumulus-based parachains. +/// +/// Corresponds to the `MILLISECS_PER_BLOCK` from `parachains_common` crate. +pub const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(12); /// All cumulus bridge hubs allow normal extrinsics to fill block up to 75 percent. /// diff --git a/bridges/relays/client-bridge-hub-rococo/src/lib.rs b/bridges/relays/client-bridge-hub-rococo/src/lib.rs index b14a9baa61..80c075cd0d 100644 --- a/bridges/relays/client-bridge-hub-rococo/src/lib.rs +++ b/bridges/relays/client-bridge-hub-rococo/src/lib.rs @@ -16,6 +16,7 @@ //! Types used to connect to the BridgeHub-Rococo-Substrate parachain. +use bp_bridge_hub_rococo::AVERAGE_BLOCK_INTERVAL; use bp_bridge_hub_wococo::PolkadotSignedExtension; use bp_messages::MessageNonce; use codec::Encode; @@ -44,7 +45,7 @@ impl Chain for BridgeHubRococo { const TOKEN_ID: Option<&'static str> = None; const BEST_FINALIZED_HEADER_ID_METHOD: &'static str = bp_bridge_hub_rococo::BEST_FINALIZED_BRIDGE_HUB_ROCOCO_HEADER_METHOD; - const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6); + const AVERAGE_BLOCK_INTERVAL: Duration = AVERAGE_BLOCK_INTERVAL; type SignedBlock = bp_bridge_hub_rococo::SignedBlock; type Call = runtime::Call; diff --git a/bridges/relays/client-bridge-hub-wococo/src/lib.rs b/bridges/relays/client-bridge-hub-wococo/src/lib.rs index abc820ed62..7af310bfd4 100644 --- a/bridges/relays/client-bridge-hub-wococo/src/lib.rs +++ b/bridges/relays/client-bridge-hub-wococo/src/lib.rs @@ -16,7 +16,7 @@ //! Types used to connect to the BridgeHub-Wococo-Substrate parachain. -use bp_bridge_hub_wococo::PolkadotSignedExtension; +use bp_bridge_hub_wococo::{PolkadotSignedExtension, AVERAGE_BLOCK_INTERVAL}; use bp_messages::MessageNonce; use codec::Encode; use relay_substrate_client::{ @@ -44,7 +44,7 @@ impl Chain for BridgeHubWococo { const TOKEN_ID: Option<&'static str> = None; const BEST_FINALIZED_HEADER_ID_METHOD: &'static str = bp_bridge_hub_wococo::BEST_FINALIZED_BRIDGE_HUB_WOCOCO_HEADER_METHOD; - const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6); + const AVERAGE_BLOCK_INTERVAL: Duration = AVERAGE_BLOCK_INTERVAL; type SignedBlock = bp_bridge_hub_wococo::SignedBlock; type Call = runtime::Call;