Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c90fdf4
First stab at downward messages.
pepyakin Jul 13, 2020
d1ab1fb
Add some structure to the router.
pepyakin Jul 13, 2020
69fe295
Update `ValidationOutputs`
pepyakin Jul 13, 2020
ceaa096
Add `processed_downward_messages` to `ValidationOutputs`.
pepyakin Jul 14, 2020
e952a01
s/AccountId/ParaId
pepyakin Jul 14, 2020
778cc2b
DownwardMessage::ParachainSpecfic
pepyakin Jul 14, 2020
bdb97af
s/ensure_horizontal_messages_fits/ensure_horizontal_messages_fit
pepyakin Jul 14, 2020
921ca3b
Clarify that Router called for each candidate
pepyakin Jul 14, 2020
3fff854
Update the preamble for Router.
pepyakin Jul 14, 2020
8072356
Rewrite the relay-chain extrinsic routines
pepyakin Jul 14, 2020
a622f77
Update gloassary
pepyakin Jul 14, 2020
0309bc5
Add DMP to the glossary
pepyakin Jul 14, 2020
1c75b51
If the queue is empty, `processed_downward_messages` can be 0
pepyakin Jul 14, 2020
c1f8482
Merge remote-tracking branch 'origin/master' into ser-ch-based-hrmp-v…
pepyakin Jul 28, 2020
d781330
WIP
pepyakin Jul 30, 2020
d62803e
Add condemned list
pepyakin Jul 30, 2020
5d09dd8
Pivot to message-storing channel based HRMP
pepyakin Jul 30, 2020
e5f642a
Finished draft
pepyakin Jul 30, 2020
b1e1b28
Tidy up
pepyakin Jul 30, 2020
02ae124
Remove a duplicate glossary entry
pepyakin Jul 30, 2020
5111966
Fix typo
pepyakin Jul 30, 2020
c94ba1d
Fix wording to emphasize that the channel is unidirectional
pepyakin Jul 30, 2020
bf7eb0a
Proper decrement `HrmpOpenChannelRequestCount`
pepyakin Jul 30, 2020
44f9338
Add a comment for `HrmpOpenChannelRequestCount`.
pepyakin Jul 30, 2020
ea1ad39
Remove old configuration values.
pepyakin Jul 30, 2020
012b839
Be more specific about the para{chain,thread} hrmp chan limits.
pepyakin Jul 30, 2020
2edf4c9
Fix indentation so the lists are rendendered properly
pepyakin Jul 30, 2020
50742fd
"to answer **the**" question instead of "a"
pepyakin Jul 30, 2020
09a0c4b
Add a missing call to `check_processed_downward_messages`
pepyakin Jul 30, 2020
7d8abd6
Clean more stuff during offboarding
pepyakin Jul 30, 2020
3f3f051
Fix typo
pepyakin Jul 30, 2020
defd96b
Fix typo for the config
pepyakin Jul 30, 2020
6faf068
Add a call to `prune_dmq`
pepyakin Jul 30, 2020
ca70234
Add explicit invariants for ingress/egress indexes
pepyakin Jul 30, 2020
017885e
Add comments for the sender/reciever deposit config fields
pepyakin Jul 31, 2020
439b02e
Document various fields and structs in Router module
pepyakin Jul 31, 2020
4285e51
More docs
pepyakin Jul 31, 2020
c1b3e0a
Missing docs in Candidate.md
pepyakin Jul 31, 2020
4ea0012
Tabs to spaces in router.md
pepyakin Aug 3, 2020
065f047
Apply Rob's suggestion
pepyakin Aug 3, 2020
0da3cfa
Add the hrmp_ prefix to the router messages
pepyakin Aug 3, 2020
0de4110
Those are entry points
pepyakin Aug 3, 2020
360c518
Use SessionIndex type for the `age` field
pepyakin Aug 3, 2020
3d6195d
Use a struct to represent `HrmpChannelId`
pepyakin Aug 3, 2020
7bd6316
Merge remote-tracking branch 'origin/master' into ser-ch-based-hrmp
pepyakin Aug 3, 2020
ce6e8de
Put only MQCs into the LocalValidationData
pepyakin Aug 4, 2020
eb97502
Close request can be initiated by the runtime directly
pepyakin Aug 4, 2020
5c1f312
Close request can be initiated by the runtime directly
pepyakin Aug 4, 2020
e18b84a
tabs/spaces
pepyakin Aug 4, 2020
1bcfe70
Maintain the list of the outgoing paras in Router
pepyakin Aug 4, 2020
6d42e9b
Update roadmap/implementers-guide/src/runtime/inclusion.md
pepyakin Aug 5, 2020
b1b0fd9
fix typo
pepyakin Aug 5, 2020
c22c5d2
Remove an unnecessary pair of code quotes
pepyakin Aug 5, 2020
ef9dc1e
Merge branch 'ser-ch-based-hrmp' of github.com:paritytech/polkadot in…
pepyakin Aug 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rewrite the relay-chain extrinsic routines
  • Loading branch information
pepyakin committed Jul 14, 2020
commit 8072356505bd1b3d8b78744080d6e20b7a5333f5
30 changes: 18 additions & 12 deletions roadmap/implementers-guide/src/runtime/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

The Router module is responsible for all messaging mechanisms supported between paras and the relay chain, specifically: UMP, DMP, HRMP and later XCMP.

For checking the validity of message passing within a candidate the `ensure_processed_downward_messages` and `ensure_horizontal_messages_fit` routines are called.
When a candidate is enacted the `drain_downward_messages`, `queue_horizontal_messages` and `queue_upward_messages` are called.

## Storage

Storage layout:
Expand Down Expand Up @@ -39,25 +36,34 @@ No initialization routine runs for this module.

## Routines

There are two routines intended for use by the relay chain extrinsics: `ensure_downward_messages_fit`
and `queue_downward_messages`. The former function is used before performing relay chain operations
that results in downward messages sent to a given `recipient` to check if sending those messages will
exceed the limits on the number of messages that the relay chain can send to a single recipient para.
The latter routine is intended to perform the send of the downward messages.
There are situations when actions that took place within the relay chain could lead to a downward message
sent to a para. For example, if an entry-point to transfer some funds to a para was called.

For these cases, there are two routines, `has_dmq_capacity_for_relay_chain` and `send_downward_messages`,
intended for use by the relay chain.

`send_downward_messages` is used for enqueuing one or more downward messages for a certain recipient. Since downward
message queues can hold only so many messages per one sender (and the relay chain is not an exception),
`send_downward_messages` can fail refusing enqueuing a message that would have exceeded the limit. In those cases
`has_dmq_capacity_for_relay_chain` can be used for checking in advance if there is enough space for a given
number of messages.

Note that the HRMP message can only be sent by para candidates.
Note that an HRMP message can only be sent by para candidates.

* `ensure_downward_messages_fit(recipient: ParaId, n: u32)`.
* `has_dmq_capacity_for_relay_chain(recipient: ParaId, n: u32)`.
1. Checks that the sum of the number `RelayChainDownwardMessages` for `recipient` and `n` is less
than or equal to `config.max_relay_chain_downward_messages`.
* `queue_downward_messages(recipient: ParaId, Vec<DownwardMessage>)`.
1. Checks that there is enough capacity in the receipient's downward queue using `ensure_downward_messages_fit`.
* `send_downward_messages(recipient: ParaId, Vec<DownwardMessage>)`.
1. Checks that there is enough capacity in the receipient's downward queue using `has_dmq_capacity_for_relay_chain`.
1. For each downward message `DM`:
1. Checks that `DM` is not of type `HorizontalMessage`.
1. Appends `DM` into the `DownwardMessageQueues` corresponding to `recipient`.
1. Increments `RelayChainDownwardMessages` for the `recipient` according to the number of messages sent.

The following routines are intended for use during the course of inclusion or enactment of para candidates.
For checking the validity of message passing within a candidate the `ensure_processed_downward_messages`
and `ensure_horizontal_messages_fit` routines are called. When a candidate is enacted the
`drain_downward_messages`, `queue_horizontal_messages` and `queue_upward_messages` are called.

* `ensure_processed_downward_messages(recipient: ParaId, processed_downward_messages: u32)`:
1. Checks that `processed_downward_messages` is at least 1,
Expand Down