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
Document various fields and structs in Router module
  • Loading branch information
pepyakin committed Jul 31, 2020
commit 439b02e3b5af94212086aba99a500269a98dc117
32 changes: 23 additions & 9 deletions roadmap/implementers-guide/src/runtime/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
age: u32,
/// 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,
/// The identifier of an HRMP channel to be closed.
id: HrmpChannelId,
}

/// 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,
Copy link
Contributor

Choose a reason for hiding this comment

The 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,
}
```
Expand All @@ -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:
Expand Down Expand Up @@ -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)`:

Expand Down