referrerpolicy=no-referrer-when-downgrade

Trait pallet_bridge_messages::WeightInfoExt

source ·
pub trait WeightInfoExt: WeightInfo {
    // Required methods
    fn expected_extra_storage_proof_size() -> u32;
    fn receive_messages_proof_overhead_from_runtime() -> Weight;
    fn receive_messages_delivery_proof_overhead_from_runtime() -> Weight;

    // Provided methods
    fn receive_messages_proof_weight(
        proof: &impl Size,
        messages_count: u32,
        dispatch_weight: Weight,
    ) -> Weight { ... }
    fn receive_messages_delivery_proof_weight(
        proof: &impl Size,
        relayers_state: &UnrewardedRelayersState,
    ) -> Weight { ... }
    fn receive_messages_proof_outbound_lane_state_overhead() -> Weight { ... }
    fn receive_messages_delivery_proof_overhead() -> Weight { ... }
    fn receive_messages_delivery_proof_messages_overhead(
        messages: MessageNonce,
    ) -> Weight { ... }
    fn receive_messages_delivery_proof_relayers_overhead(
        relayers: MessageNonce,
    ) -> Weight { ... }
    fn storage_proof_size_overhead(proof_size: u32) -> Weight { ... }
    fn message_dispatch_weight(message_size: u32) -> Weight { ... }
}
Expand description

Extended weight info.

Required Methods§

source

fn expected_extra_storage_proof_size() -> u32

Size of proof that is already included in the single message delivery weight.

The message submitter (at source chain) has already covered this cost. But there are two factors that may increase proof size: (1) the message size may be larger than predefined and (2) relayer may add extra trie nodes to the proof. So if proof size is larger than this value, we’re going to charge relayer for that.

source

fn receive_messages_proof_overhead_from_runtime() -> Weight

Extra weight that is added to the receive_messages_proof call weight by signed extensions that are declared at runtime level.

source

fn receive_messages_delivery_proof_overhead_from_runtime() -> Weight

Extra weight that is added to the receive_messages_delivery_proof call weight by signed extensions that are declared at runtime level.

Provided Methods§

source

fn receive_messages_proof_weight( proof: &impl Size, messages_count: u32, dispatch_weight: Weight, ) -> Weight

Weight of message delivery extrinsic.

source

fn receive_messages_delivery_proof_weight( proof: &impl Size, relayers_state: &UnrewardedRelayersState, ) -> Weight

Weight of confirmation delivery extrinsic.

source

fn receive_messages_proof_outbound_lane_state_overhead() -> Weight

Returns weight that needs to be accounted when message delivery transaction (receive_messages_proof) is carrying outbound lane state proof.

source

fn receive_messages_delivery_proof_overhead() -> Weight

Returns weight overhead of delivery confirmation transaction (receive_messages_delivery_proof).

source

fn receive_messages_delivery_proof_messages_overhead( messages: MessageNonce, ) -> Weight

Returns weight that needs to be accounted when receiving confirmations for given a number of messages with delivery confirmation transaction (receive_messages_delivery_proof).

source

fn receive_messages_delivery_proof_relayers_overhead( relayers: MessageNonce, ) -> Weight

Returns weight that needs to be accounted when receiving confirmations for given a number of relayers entries with delivery confirmation transaction (receive_messages_delivery_proof).

source

fn storage_proof_size_overhead(proof_size: u32) -> Weight

Returns weight that needs to be accounted when storage proof of given size is received (either in receive_messages_proof or receive_messages_delivery_proof).

IMPORTANT: this overhead is already included in the ‘base’ transaction cost - e.g. proof size depends on messages count or number of entries in the unrewarded relayers set. So this shouldn’t be added to cost of transaction, but instead should act as a minimal cost that the relayer must pay when it relays proof of given size (even if cost based on other parameters is less than that cost).

source

fn message_dispatch_weight(message_size: u32) -> Weight

Returns dispatch weight of message of given size.

This function would return correct value only if your runtime is configured to run receive_single_message_proof_with_dispatch benchmark. See its requirements for details.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl WeightInfoExt for ()

Implementors§

source§

impl<T: Config> WeightInfoExt for BridgeWeight<T>