Expand description
Runtime module that allows sending and receiving messages using lane concept:
- the message is sent using
send_message()
call; - every outbound message is assigned nonce;
- the messages are stored in the storage;
- external component (relay) delivers messages to bridged chain;
- messages are processed in order (ordered by assigned nonce);
- 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§
- Call
Helper - Helper struct that provides methods for working with a call supported by
MessagesCallInfo
. - Inbound
Lane - Inbound messages lane.
- Lanes
Manager - Message lanes manager.
- Outbound
Lane - Outbound messages lane.
- Runtime
Inbound Lane Storage - Runtime inbound lane storage.
- Runtime
Outbound Lane Storage - Runtime outbound lane storage.
- Send
Message Args - Structure, containing a validated message payload and all the info required to send it on the bridge.
- Stored
Inbound Lane Data - Inbound lane data wrapper that implements
MaxEncodedLen
.
Enums§
- Lanes
Manager Error - Lanes manager errors.
- Reception
Confirmation Error - 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§
- Call
SubType - Trait representing a call that is a sub type of
pallet_bridge_messages::Call
. - Inbound
Lane Storage - Inbound lane storage.
- Outbound
Lane Storage - Outbound lane storage.
- Weight
Info Ext - 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§
- Stored
Message Payload - Outbound message data wrapper that implements
MaxEncodedLen
.