This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implementer's guide: downward messages and HRMP, take 2 #1503
Merged
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 d1ab1fb
Add some structure to the router.
pepyakin 69fe295
Update `ValidationOutputs`
pepyakin ceaa096
Add `processed_downward_messages` to `ValidationOutputs`.
pepyakin e952a01
s/AccountId/ParaId
pepyakin 778cc2b
DownwardMessage::ParachainSpecfic
pepyakin bdb97af
s/ensure_horizontal_messages_fits/ensure_horizontal_messages_fit
pepyakin 921ca3b
Clarify that Router called for each candidate
pepyakin 3fff854
Update the preamble for Router.
pepyakin 8072356
Rewrite the relay-chain extrinsic routines
pepyakin a622f77
Update gloassary
pepyakin 0309bc5
Add DMP to the glossary
pepyakin 1c75b51
If the queue is empty, `processed_downward_messages` can be 0
pepyakin c1f8482
Merge remote-tracking branch 'origin/master' into ser-ch-based-hrmp-v…
pepyakin d781330
WIP
pepyakin d62803e
Add condemned list
pepyakin 5d09dd8
Pivot to message-storing channel based HRMP
pepyakin e5f642a
Finished draft
pepyakin b1e1b28
Tidy up
pepyakin 02ae124
Remove a duplicate glossary entry
pepyakin 5111966
Fix typo
pepyakin c94ba1d
Fix wording to emphasize that the channel is unidirectional
pepyakin bf7eb0a
Proper decrement `HrmpOpenChannelRequestCount`
pepyakin 44f9338
Add a comment for `HrmpOpenChannelRequestCount`.
pepyakin ea1ad39
Remove old configuration values.
pepyakin 012b839
Be more specific about the para{chain,thread} hrmp chan limits.
pepyakin 2edf4c9
Fix indentation so the lists are rendendered properly
pepyakin 50742fd
"to answer **the**" question instead of "a"
pepyakin 09a0c4b
Add a missing call to `check_processed_downward_messages`
pepyakin 7d8abd6
Clean more stuff during offboarding
pepyakin 3f3f051
Fix typo
pepyakin defd96b
Fix typo for the config
pepyakin 6faf068
Add a call to `prune_dmq`
pepyakin ca70234
Add explicit invariants for ingress/egress indexes
pepyakin 017885e
Add comments for the sender/reciever deposit config fields
pepyakin 439b02e
Document various fields and structs in Router module
pepyakin 4285e51
More docs
pepyakin c1b3e0a
Missing docs in Candidate.md
pepyakin 4ea0012
Tabs to spaces in router.md
pepyakin 065f047
Apply Rob's suggestion
pepyakin 0da3cfa
Add the hrmp_ prefix to the router messages
pepyakin 0de4110
Those are entry points
pepyakin 360c518
Use SessionIndex type for the `age` field
pepyakin 3d6195d
Use a struct to represent `HrmpChannelId`
pepyakin 7bd6316
Merge remote-tracking branch 'origin/master' into ser-ch-based-hrmp
pepyakin ce6e8de
Put only MQCs into the LocalValidationData
pepyakin eb97502
Close request can be initiated by the runtime directly
pepyakin 5c1f312
Close request can be initiated by the runtime directly
pepyakin e18b84a
tabs/spaces
pepyakin 1bcfe70
Maintain the list of the outgoing paras in Router
pepyakin 6d42e9b
Update roadmap/implementers-guide/src/runtime/inclusion.md
pepyakin b1b0fd9
fix typo
pepyakin c22c5d2
Remove an unnecessary pair of code quotes
pepyakin ef9dc1e
Merge branch 'ser-ch-based-hrmp' of github.com:paritytech/polkadot in…
pepyakin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Document various fields and structs in Router module
- Loading branch information
commit 439b02e3b5af94212086aba99a500269a98dc117
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,34 +29,48 @@ HRMP related structs: | |
| /// A type used to designate a HRMP channel between a (sender, recipient). | ||
| type HrmpChannelId = (ParaId, ParaId); | ||
|
|
||
| /// A description of a request to open an HRMP channel. | ||
| struct HrmpOpenChannelRequest { | ||
| /// The sender and the initiator of this request. | ||
| sender: ParaId, | ||
| /// The recipient of the opened request. | ||
| recipient: ParaId, | ||
| /// Indicates if this request was confirmed by the recipient. | ||
| confirmed: bool, | ||
| /// How many session boundaries this request has seen. | ||
pepyakin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| age: u32, | ||
pepyakin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /// The amount that the sender supplied at the time of creation of this request. | ||
| sender_deposit: Balance, | ||
| /// The maximum number of messages that can be pending in the channel at once. | ||
| limit_used_places: u32, | ||
| /// The maximum total size of the messages that can be pending in the channel at once. | ||
| limit_used_bytes: u32, | ||
| } | ||
|
|
||
| /// A description of a request to close an opened HRMP channel. | ||
| struct HrmpCloseChannelRequest { | ||
| // invariant: equals either to sender or recipient. | ||
| /// The para which initiated closing an existing channel. | ||
| /// invariant: equals either to sender or recipient. | ||
| initiator: ParaId, | ||
pepyakin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /// The identifier of an HRMP channel to be closed. | ||
| id: HrmpChannelId, | ||
pepyakin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /// A metadata of an HRMP channel. | ||
| struct HrmpChannel { | ||
| // deposits taken from both sides. | ||
| // consider merging if symmetrical. | ||
| /// The amount that the sender supplied as a deposit when opening this channel. | ||
| sender_deposit: Balance, | ||
| /// The amount that the recipient supplied as a deposit when accepting opening this channel. | ||
| recipient_deposit: Balance, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the actual deposit mechanism? What actions are prevented and how might the accounting work in practice? |
||
|
|
||
| /// The maximum number of messages that can be pending in the channel at once. | ||
| limit_used_places: u32, | ||
| /// The maximum total size of the messages that can be pending in the channel at once. | ||
| limit_used_bytes: u32, | ||
|
|
||
| // The number of messages placed in the channel by the sender and the total number of bytes | ||
| // the occupy. | ||
| /// The current number of messages pending in the channel. | ||
| /// Invariant: should be less or equal to `limit_used_places`. | ||
| used_places: u32, | ||
| /// The total size in bytes of all message payloads in the channel. | ||
| /// Invariant: should be less or equal to `limit_used_bytes`. | ||
| used_bytes: u32, | ||
| } | ||
| ``` | ||
|
|
@@ -73,7 +87,7 @@ HrmpCloseChannelRequests: Vec<HrmpCloseChannelRequest>; | |
|
|
||
| HrmpWatermarks: map ParaId => Option<BlockNumber>; | ||
|
|
||
| HrmpChannels: map HrmpChannelId => Option<Channel>; | ||
| HrmpChannels: map HrmpChannelId => Option<HrmpChannel>; | ||
|
|
||
| /// The indexes that map all senders to their recievers and vise versa. | ||
| /// Invariants: | ||
|
|
@@ -187,7 +201,7 @@ TODO: What happens with the deposits in channels or open requests? | |
| 1. Insert `recipient` into the set `HrmpEgressChannelsIndex` for the `sender`. | ||
| 1. decrement `HrmpOpenChannelRequestCount` for `R.sender` by 1. | ||
| 1. remove `R` | ||
| 1. For each request `R` in `HrmpCloseChannelRequests` remove the channel identified by `R.id`. | ||
| 1. For each request `R` in `HrmpCloseChannelRequests` remove the channel identified by `R.id`, if exists. | ||
|
|
||
| To remove a channel `C` identified with a tuple `(sender, recipient)`: | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.