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