Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply a few minor fixes found while addressing the fellows PR for weights. #7098

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions bridges/bin/runtime-common/src/integrity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

use bp_header_chain::ChainWithGrandpa;
use bp_messages::{ChainWithMessages, InboundLaneData, MessageNonce};
use bp_runtime::Chain;
use bp_runtime::{AccountIdOf, Chain};
use codec::Encode;
use frame_support::{storage::generator::StorageValue, traits::Get, weights::Weight};
use frame_system::limits;
use pallet_bridge_messages::WeightInfoExt as _;
use pallet_bridge_messages::{ThisChainOf, WeightInfoExt as _};

// Re-export to avoid include all dependencies everywhere.
#[doc(hidden)]
Expand Down Expand Up @@ -364,8 +364,11 @@ pub fn check_message_lane_weights<
);

// check that weights allow us to receive delivery confirmations
let max_incoming_inbound_lane_data_proof_size =
InboundLaneData::<()>::encoded_size_hint_u32(this_chain_max_unrewarded_relayers as _);
let max_incoming_inbound_lane_data_proof_size = InboundLaneData::<
AccountIdOf<ThisChainOf<T, MessagesPalletInstance>>,
>::encoded_size_hint_u32(
this_chain_max_unrewarded_relayers as _
);
pallet_bridge_messages::ensure_able_to_receive_confirmation::<Weights<T, MessagesPalletInstance>>(
C::max_extrinsic_size(),
C::max_extrinsic_weight(),
Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ pub mod pallet {
// why do we need to know the weight of this (`receive_messages_proof`) call? Because
// we may want to return some funds for not-dispatching (or partially dispatching) some
// messages to the call origin (relayer). And this is done by returning actual weight
// from the call. But we only know dispatch weight of every messages. So to refund
// relayer because we have not dispatched Message, we need to:
// from the call. But we only know dispatch weight of every message. So to refund
// relayer because we have not dispatched message, we need to:
//
// ActualWeight = DeclaredWeight - Message.DispatchWeight
//
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ mod benches {
[polkadot_runtime_parachains::initializer, Initializer]
[polkadot_runtime_parachains::paras_inherent, ParaInherent]
[polkadot_runtime_parachains::paras, Paras]
[polkadot_runtime_parachains::assigner_on_demand, OnDemandAssignmentProvider]
[polkadot_runtime_parachains::on_demand, OnDemandAssignmentProvider]
// Substrate
[pallet_balances, Balances]
[pallet_balances, NisCounterpartBalances]
Expand Down
Loading