referrerpolicy=no-referrer-when-downgrade

Crate pallet_bridge_messages

Source
Expand description

Runtime module that allows sending and receiving messages using lane concept:

  1. the message is sent using send_message() call;
  2. every outbound message is assigned nonce;
  3. the messages are stored in the storage;
  4. external component (relay) delivers messages to bridged chain;
  5. messages are processed in order (ordered by assigned nonce);
  6. relay may send proof-of-delivery back to this chain.

Once message is sent, its progress can be tracked by looking at module events. The assigned nonce is reported using MessageAccepted event. When message is delivered to the the bridged chain, it is reported using MessagesDelivered event.

IMPORTANT NOTE: after generating weights (custom WeighInfo implementation) for your runtime (where this module is plugged to), please add test for these weights. The test should call the ensure_weights_are_correct function from this module. If this test fails with your weights, then either weights are computed incorrectly, or some benchmarks assumptions are broken for your runtime.

Re-exports§

pub use weights::WeightInfo;
pub use pallet::*;

Modules§

benchmarking
Messages pallet benchmarking.
messages_generation
Helpers for generating message storage proofs, that are used by tests and by benchmarks.
migration
A module that is responsible for migration of storage.
pallet
The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.
weights
Autogenerated weights for pallet_bridge_messages

Structs§

CallHelper
Helper struct that provides methods for working with a call supported by MessagesCallInfo.
InboundLane
Inbound messages lane.
LanesManager
Message lanes manager.
OutboundLane
Outbound messages lane.
RuntimeInboundLaneStorage
Runtime inbound lane storage.
RuntimeOutboundLaneStorage
Runtime outbound lane storage.
SendMessageArgs
Structure, containing a validated message payload and all the info required to send it on the bridge.
StoredInboundLaneData
Inbound lane data wrapper that implements MaxEncodedLen.

Enums§

LanesManagerError
Lanes manager errors.
ReceptionConfirmationError
Result of messages receival confirmation.

Constants§

EXPECTED_DEFAULT_MESSAGE_LENGTH
Size of the message being delivered in benchmarks.
EXTRA_STORAGE_PROOF_SIZE
Number of extra bytes (excluding size of storage value itself) of storage proof. This mostly depends on number of entries (and their density) in the storage trie. Some reserve is reserved to account future chain growth.
LOG_TARGET
The target that will be used when publishing logs related to this pallet.

Traits§

CallSubType
Trait representing a call that is a sub type of pallet_bridge_messages::Call.
InboundLaneStorage
Inbound lane storage.
OutboundLaneStorage
Outbound lane storage.
WeightInfoExt
Extended weight info.

Functions§

ensure_able_to_receive_confirmation
Ensure that we’re able to receive maximal confirmation from other chain.
ensure_able_to_receive_message
Ensure that we’re able to receive maximal (by-size and by-weight) message from other chain.
ensure_maximal_message_dispatch
Ensure that we are able to dispatch maximal size messages.
ensure_weights_are_correct
Ensure that weights from WeightInfoExt implementation are looking correct.

Type Aliases§

StoredMessagePayload
Outbound message data wrapper that implements MaxEncodedLen.