pub trait UmpSink {
    // Required method
    fn process_upward_message(
        origin: ParaId,
        msg: &[u8],
        max_weight: Weight
    ) -> Result<Weight, (MessageId, Weight)>;
}
Expand description

All upward messages coming from parachains will be funneled into an implementation of this trait.

The message is opaque from the perspective of UMP. The message size can range from 0 to config.max_upward_message_size.

It’s up to the implementation of this trait to decide what to do with a message as long as it returns the amount of weight consumed in the process of handling. Ignoring a message is a valid strategy.

There are no guarantees on how much time it takes for the message sent by a candidate to end up in the sink after the candidate was enacted. That typically depends on the UMP traffic, the sizes of upward messages and the configuration of UMP.

It is possible that by the time the message is sank the origin parachain was offboarded. It is up to the implementer to check that if it cares.

Required Methods§

source

fn process_upward_message( origin: ParaId, msg: &[u8], max_weight: Weight ) -> Result<Weight, (MessageId, Weight)>

Process an incoming upward message and return the amount of weight it consumed, or None if it did not begin processing a message since it would otherwise exceed max_weight.

See the trait docs for more details.

Implementations on Foreign Types§

source§

impl UmpSink for ()

An implementation of a sink that just swallows the message without consuming any weight. Returns Some(0) indicating that no messages existed for it to process.

Implementors§

source§

impl<XcmExecutor: ExecuteXcm<C::RuntimeCall>, C: Config> UmpSink for XcmSink<XcmExecutor, C>