This repository was archived by the owner on Nov 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
roadmap/implementers-guide/src Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,7 @@ any of dispatchables return an error.
260260Utility routines.
261261
262262` queue_downward_message(P: ParaId, M: DownwardMessage) ` :
263+ 1. Check if the serialized size of ` M ` exceeds the ` config.critical_downward_message_size ` . If so, return an error.
263264 1. Wrap ` M ` into ` InboundDownwardMessage ` using the current block number for ` sent_at ` .
264265 1. Obtain a new MQC link for the resulting ` InboundDownwardMessage ` and replace ` DownwardMessageQueueHeads ` for ` P ` with the resulting hash.
265266 1. Add the resulting ` InboundDownwardMessage ` into ` DownwardMessageQueues ` for ` P ` .
Original file line number Diff line number Diff line change @@ -108,10 +108,12 @@ struct InboundHrmpMessage {
108108
109109## Downward Message
110110
111- ` DownwardMessage ` - is a message that goes down from the relay chain to a parachain. Such a message
111+ ` DownwardMessage ` - is a message that goes down from the relay chain to a parachain. Such a message
112112could be seen as a notification, however, it is conceivable that they might be used by the relay
113113chain to send a request to the parachain (likely, through the ` ParachainSpecific ` variant).
114114
115+ The serialized size of the message is limited by the ` config.critical_downward_message_size ` parameter.
116+
115117``` rust,ignore
116118enum DownwardMessage {
117119 /// Some funds were transferred into the parachain's account. The hash is the identifier that
Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ struct HostConfiguration {
5656 pub dispatchable_upward_message_critical_weight : u32 ,
5757 /// The maximum number of messages that a candidate can contain.
5858 pub max_upward_message_num_per_candidate : u32 ,
59+ /// The maximum size of a message that can be put in a downward message queue.
60+ ///
61+ /// Since we require receiving at least one DMP message the obvious upper bound of the size is
62+ /// the PoV size. Of course, there is a lot of other different things that a parachain may
63+ /// decide to do with its PoV so this value in practice will be picked as a fraction of the PoV
64+ /// size.
65+ pub critical_downward_message_size : u32 ,
5966 /// Number of sessions after which an HRMP open channel request expires.
6067 pub hrmp_open_request_ttl : u32 ,
6168 /// The deposit that the sender should provide for opening an HRMP channel.
You can’t perform that action at this time.
0 commit comments