Limit the maximum size of a downward message (#1690)

This commit is contained in:
Sergei Shulepov
2020-09-10 17:39:55 +02:00
committed by GitHub
parent f3abba15c6
commit e40ec81685
3 changed files with 11 additions and 1 deletions
@@ -260,6 +260,7 @@ any of dispatchables return an error.
Utility routines.
`queue_downward_message(P: ParaId, M: DownwardMessage)`:
1. Check if the serialized size of `M` exceeds the `config.critical_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`.