bridge_hub_rococo_runtime/
bridge_common_config.rs1use super::{weights, AccountId, Balance, Balances, BlockNumber, Runtime, RuntimeEvent};
25use bp_parachains::SingleParaStoredHeaderDataBuilder;
26use bp_relayers::RewardsAccountParams;
27use frame_support::{parameter_types, traits::ConstU32};
28
29parameter_types! {
30 pub const RelayChainHeadersToKeep: u32 = 1024;
31 pub const ParachainHeadsToKeep: u32 = 64;
32
33 pub const WestendBridgeParachainPalletName: &'static str = bp_westend::PARAS_PALLET_NAME;
34 pub const MaxWestendParaHeadDataSize: u32 = bp_westend::MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE;
35
36 pub storage RequiredStakeForStakeAndSlash: Balance = 1_000_000;
37 pub const RelayerStakeLease: u32 = 8;
38 pub const RelayerStakeReserveId: [u8; 8] = *b"brdgrlrs";
39
40 pub storage DeliveryRewardInBalance: u64 = 1_000_000;
41}
42
43pub type BridgeGrandpaWestendInstance = pallet_bridge_grandpa::Instance3;
45impl pallet_bridge_grandpa::Config<BridgeGrandpaWestendInstance> for Runtime {
46 type RuntimeEvent = RuntimeEvent;
47 type BridgedChain = bp_westend::Westend;
48 type MaxFreeHeadersPerBlock = ConstU32<4>;
49 type FreeHeadersInterval = ConstU32<5>;
50 type HeadersToKeep = RelayChainHeadersToKeep;
51 type WeightInfo = weights::pallet_bridge_grandpa::WeightInfo<Runtime>;
52}
53
54pub type BridgeParachainWestendInstance = pallet_bridge_parachains::Instance3;
56impl pallet_bridge_parachains::Config<BridgeParachainWestendInstance> for Runtime {
57 type RuntimeEvent = RuntimeEvent;
58 type WeightInfo = weights::pallet_bridge_parachains::WeightInfo<Runtime>;
59 type BridgesGrandpaPalletInstance = BridgeGrandpaWestendInstance;
60 type ParasPalletName = WestendBridgeParachainPalletName;
61 type ParaStoredHeaderDataBuilder =
62 SingleParaStoredHeaderDataBuilder<bp_bridge_hub_westend::BridgeHubWestend>;
63 type HeadsToKeep = ParachainHeadsToKeep;
64 type MaxParaHeadDataSize = MaxWestendParaHeadDataSize;
65}
66
67pub type RelayersForLegacyLaneIdsMessagesInstance = ();
69impl pallet_bridge_relayers::Config<RelayersForLegacyLaneIdsMessagesInstance> for Runtime {
70 type RuntimeEvent = RuntimeEvent;
71 type RewardBalance = Balance;
72 type Reward = RewardsAccountParams<bp_messages::LegacyLaneId>;
73 type PaymentProcedure = bp_relayers::PayRewardFromAccount<
74 pallet_balances::Pallet<Runtime>,
75 AccountId,
76 bp_messages::LegacyLaneId,
77 Self::RewardBalance,
78 >;
79 type StakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed<
80 AccountId,
81 BlockNumber,
82 Balances,
83 RelayerStakeReserveId,
84 RequiredStakeForStakeAndSlash,
85 RelayerStakeLease,
86 >;
87 type Balance = Balance;
88 type WeightInfo = weights::pallet_bridge_relayers_legacy::WeightInfo<Runtime>;
89}
90
91pub type RelayersForPermissionlessLanesInstance = pallet_bridge_relayers::Instance2;
93impl pallet_bridge_relayers::Config<RelayersForPermissionlessLanesInstance> for Runtime {
94 type RuntimeEvent = RuntimeEvent;
95 type RewardBalance = Balance;
96 type Reward = RewardsAccountParams<bp_messages::HashedLaneId>;
97 type PaymentProcedure = bp_relayers::PayRewardFromAccount<
98 pallet_balances::Pallet<Runtime>,
99 AccountId,
100 bp_messages::HashedLaneId,
101 Self::RewardBalance,
102 >;
103 type StakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed<
104 AccountId,
105 BlockNumber,
106 Balances,
107 RelayerStakeReserveId,
108 RequiredStakeForStakeAndSlash,
109 RelayerStakeLease,
110 >;
111 type Balance = Balance;
112 type WeightInfo = weights::pallet_bridge_relayers_permissionless_lanes::WeightInfo<Runtime>;
113}
114
115pub type BridgeGrandpaRococoBulletinInstance = pallet_bridge_grandpa::Instance4;
117impl pallet_bridge_grandpa::Config<BridgeGrandpaRococoBulletinInstance> for Runtime {
118 type RuntimeEvent = RuntimeEvent;
119 type BridgedChain = bp_polkadot_bulletin::PolkadotBulletin;
120 type MaxFreeHeadersPerBlock = ConstU32<4>;
121 type FreeHeadersInterval = ConstU32<5>;
122 type HeadersToKeep = RelayChainHeadersToKeep;
123 type WeightInfo = weights::pallet_bridge_grandpa::WeightInfo<Runtime>;
132}