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 type OnNewHead = ();
66}
67
68pub type RelayersForLegacyLaneIdsMessagesInstance = ();
70impl pallet_bridge_relayers::Config<RelayersForLegacyLaneIdsMessagesInstance> for Runtime {
71 type RuntimeEvent = RuntimeEvent;
72 type RewardBalance = Balance;
73 type Reward = RewardsAccountParams<bp_messages::LegacyLaneId>;
74 type PaymentProcedure = bp_relayers::PayRewardFromAccount<
75 pallet_balances::Pallet<Runtime>,
76 AccountId,
77 bp_messages::LegacyLaneId,
78 Self::RewardBalance,
79 >;
80 type StakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed<
81 AccountId,
82 BlockNumber,
83 Balances,
84 RelayerStakeReserveId,
85 RequiredStakeForStakeAndSlash,
86 RelayerStakeLease,
87 >;
88 type Balance = Balance;
89 type WeightInfo = weights::pallet_bridge_relayers_legacy::WeightInfo<Runtime>;
90}
91
92pub type RelayersForPermissionlessLanesInstance = pallet_bridge_relayers::Instance2;
94impl pallet_bridge_relayers::Config<RelayersForPermissionlessLanesInstance> for Runtime {
95 type RuntimeEvent = RuntimeEvent;
96 type RewardBalance = Balance;
97 type Reward = RewardsAccountParams<bp_messages::HashedLaneId>;
98 type PaymentProcedure = bp_relayers::PayRewardFromAccount<
99 pallet_balances::Pallet<Runtime>,
100 AccountId,
101 bp_messages::HashedLaneId,
102 Self::RewardBalance,
103 >;
104 type StakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed<
105 AccountId,
106 BlockNumber,
107 Balances,
108 RelayerStakeReserveId,
109 RequiredStakeForStakeAndSlash,
110 RelayerStakeLease,
111 >;
112 type Balance = Balance;
113 type WeightInfo = weights::pallet_bridge_relayers_permissionless_lanes::WeightInfo<Runtime>;
114}
115
116pub type BridgeGrandpaRococoBulletinInstance = pallet_bridge_grandpa::Instance4;
118impl pallet_bridge_grandpa::Config<BridgeGrandpaRococoBulletinInstance> for Runtime {
119 type RuntimeEvent = RuntimeEvent;
120 type BridgedChain = bp_polkadot_bulletin::PolkadotBulletin;
121 type MaxFreeHeadersPerBlock = ConstU32<4>;
122 type FreeHeadersInterval = ConstU32<5>;
123 type HeadersToKeep = RelayChainHeadersToKeep;
124 type WeightInfo = weights::pallet_bridge_grandpa::WeightInfo<Runtime>;
133}