Files
pezkuwi-sdk/pezkuwi/roadmap/implementers-guide/src/runtime/dmp.md
T
pezkuwichain 90fd044766 fix: Complete snowbridge pezpallet rebrand and critical bug fixes
- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs)
- pallet/ directories → pezpallet/ (4 locations)
- Fixed pezpallet.rs self-include recursion bug
- Fixed sc-chain-spec hardcoded crate name in derive macro
- Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API)
- Added BizinikiwiConfig type alias for zombienet tests
- Deleted obsolete session state files

Verified: pezsnowbridge-pezpallet-*, pezpallet-staking,
pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
2025-12-16 09:57:23 +03:00

2.0 KiB

DMP Pezpallet

A module responsible for Downward Message Processing (DMP). See Messaging Overview for more details.

Storage

Storage layout required for implementation of DMP.

/// The downward messages addressed for a certain para.
DownwardMessageQueues: map ParaId => Vec<InboundDownwardMessage>;
/// A mapping that stores the downward message queue MQC head for each para.
///
/// Each link in this chain has a form:
/// `(prev_head, B, H(M))`, where
/// - `prev_head`: is the previous head hash or zero if none.
/// - `B`: is the relay-chain block number in which a message was appended.
/// - `H(M)`: is the hash of the message being appended.
DownwardMessageQueueHeads: map ParaId => Hash;

Initialization

No initialization routine runs for this module.

Routines

Candidate Acceptance Function:

  • check_processed_downward_messages(P: ParaId, relay_parent_number: BlockNumber, processed_downward_messages: u32):
    1. Checks that processed_downward_messages is at least 1 if DownwardMessageQueues for P is not empty at the given relay_parent_number.
    2. Checks that DownwardMessageQueues for P is at least processed_downward_messages long.

Candidate Enactment:

  • prune_dmq(P: ParaId, processed_downward_messages: u32):
    1. Remove the first processed_downward_messages from the DownwardMessageQueues of P.

Utility routines.

queue_downward_message(P: ParaId, M: DownwardMessage): 1. Check if the size of M exceeds the config.max_downward_message_size. If so, return an error. 1. Wrap M into InboundDownwardMessage using the current block number for sent_at. 1. Obtain a new MQC link for the resulting InboundDownwardMessage and replace DownwardMessageQueueHeads for P with the resulting hash. 1. Add the resulting InboundDownwardMessage into DownwardMessageQueues for P.

Session Change

  1. For each P in outgoing_paras (generated by Paras::on_new_session):
    1. Remove all DownwardMessageQueues of P.
    2. Remove DownwardMessageQueueHeads for P.