Skip to content

Commit 7370222

Browse files
svyatonikbkchr
authored andcommitted
fix bridge hubs blocks interval (#1836)
1 parent f0c4073 commit 7370222

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ bp-messages = { path = "../../primitives/messages", default-features = false }
1717
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
1818
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
1919
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
20+
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
2021

2122
# Polkadot Dependencies
2223
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }
@@ -29,5 +30,6 @@ std = [
2930
"frame-system/std",
3031
"frame-support/std",
3132
"sp-api/std",
33+
"sp-std/std",
3234
"polkadot-primitives/std",
3335
]

bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ use frame_support::{
2929
weights::constants,
3030
};
3131
use frame_system::limits;
32+
use sp_std::time::Duration;
33+
34+
/// Average block interval in Cumulus-based parachains.
35+
///
36+
/// Corresponds to the `MILLISECS_PER_BLOCK` from `parachains_common` crate.
37+
pub const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(12);
3238

3339
/// All cumulus bridge hubs allow normal extrinsics to fill block up to 75 percent.
3440
///

bridges/relays/client-bridge-hub-rococo/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
//! Types used to connect to the BridgeHub-Rococo-Substrate parachain.
1818
19+
use bp_bridge_hub_rococo::AVERAGE_BLOCK_INTERVAL;
1920
use bp_bridge_hub_wococo::PolkadotSignedExtension;
2021
use bp_messages::MessageNonce;
2122
use codec::Encode;
@@ -44,7 +45,7 @@ impl Chain for BridgeHubRococo {
4445
const TOKEN_ID: Option<&'static str> = None;
4546
const BEST_FINALIZED_HEADER_ID_METHOD: &'static str =
4647
bp_bridge_hub_rococo::BEST_FINALIZED_BRIDGE_HUB_ROCOCO_HEADER_METHOD;
47-
const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6);
48+
const AVERAGE_BLOCK_INTERVAL: Duration = AVERAGE_BLOCK_INTERVAL;
4849

4950
type SignedBlock = bp_bridge_hub_rococo::SignedBlock;
5051
type Call = runtime::Call;

bridges/relays/client-bridge-hub-wococo/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
//! Types used to connect to the BridgeHub-Wococo-Substrate parachain.
1818
19-
use bp_bridge_hub_wococo::PolkadotSignedExtension;
19+
use bp_bridge_hub_wococo::{PolkadotSignedExtension, AVERAGE_BLOCK_INTERVAL};
2020
use bp_messages::MessageNonce;
2121
use codec::Encode;
2222
use relay_substrate_client::{
@@ -44,7 +44,7 @@ impl Chain for BridgeHubWococo {
4444
const TOKEN_ID: Option<&'static str> = None;
4545
const BEST_FINALIZED_HEADER_ID_METHOD: &'static str =
4646
bp_bridge_hub_wococo::BEST_FINALIZED_BRIDGE_HUB_WOCOCO_HEADER_METHOD;
47-
const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6);
47+
const AVERAGE_BLOCK_INTERVAL: Duration = AVERAGE_BLOCK_INTERVAL;
4848

4949
type SignedBlock = bp_bridge_hub_wococo::SignedBlock;
5050
type Call = runtime::Call;

0 commit comments

Comments
 (0)