Skip to content

Commit

Permalink
BACKPORT-CONFLICT
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur authored and github-actions[bot] committed Nov 28, 2024
1 parent 14d2282 commit f32624c
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions bridges/modules/relayers/src/extension/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub struct BridgeRelayersSignedExtension<Runtime, Config, LaneId>(
impl<R, C, LaneId> BridgeRelayersSignedExtension<R, C, LaneId>
where
Self: 'static + Send + Sync,
R: RelayersConfig<LaneId = LaneId>
R: RelayersConfig<C::BridgeRelayersPalletInstance, LaneId = LaneId>
+ BridgeMessagesConfig<C::BridgeMessagesPalletInstance, LaneId = LaneId>
+ TransactionPaymentConfig,
C: ExtensionConfig<Runtime = R, LaneId = LaneId>,
Expand Down Expand Up @@ -250,7 +250,7 @@ where
// let's also replace the weight of slashing relayer with the weight of rewarding relayer
if call_info.is_receive_messages_proof_call() {
post_info_weight = post_info_weight.saturating_sub(
<R as RelayersConfig>::WeightInfo::extra_weight_of_successful_receive_messages_proof_call(),
<R as RelayersConfig<C::BridgeRelayersPalletInstance>>::WeightInfo::extra_weight_of_successful_receive_messages_proof_call(),
);
}

Expand All @@ -277,7 +277,7 @@ where
impl<R, C, LaneId> SignedExtension for BridgeRelayersSignedExtension<R, C, LaneId>
where
Self: 'static + Send + Sync,
R: RelayersConfig<LaneId = LaneId>
R: RelayersConfig<C::BridgeRelayersPalletInstance, LaneId = LaneId>
+ BridgeMessagesConfig<C::BridgeMessagesPalletInstance, LaneId = LaneId>
+ TransactionPaymentConfig,
C: ExtensionConfig<Runtime = R, LaneId = LaneId>,
Expand Down Expand Up @@ -320,8 +320,15 @@ where
};

// we only boost priority if relayer has staked required balance
<<<<<<< HEAD
if !RelayersPallet::<R>::is_registration_active(who) {
return Ok(Default::default())
=======
if !RelayersPallet::<R, C::BridgeRelayersPalletInstance>::is_registration_active(
&data.relayer,
) {
return Ok((Default::default(), Some(data), origin))
>>>>>>> 9ec8009c (Multiple instances for pallet-bridge-relayers fix (#6684))
}

// compute priority boost
Expand Down Expand Up @@ -381,7 +388,11 @@ where
match call_result {
RelayerAccountAction::None => (),
RelayerAccountAction::Reward(relayer, reward_account, reward) => {
RelayersPallet::<R>::register_relayer_reward(reward_account, &relayer, reward);
RelayersPallet::<R, C::BridgeRelayersPalletInstance>::register_relayer_reward(
reward_account,
&relayer,
reward,
);

log::trace!(
target: LOG_TARGET,
Expand All @@ -393,7 +404,7 @@ where
);
},
RelayerAccountAction::Slash(relayer, slash_account) =>
RelayersPallet::<R>::slash_and_deregister(
RelayersPallet::<R, C::BridgeRelayersPalletInstance>::slash_and_deregister(
&relayer,
ExplicitOrAccountParams::Params(slash_account),
),
Expand Down

0 comments on commit f32624c

Please sign in to comment.