Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
1955adbf
Unverified
Commit
1955adbf
authored
Sep 02, 2020
by
Sergey Pepyakin
Committed by
GitHub
Sep 02, 2020
Browse files
Allow negotiating the HRMP limits. (#1673)
parent
1e125b31
Pipeline
#105476
passed with stages
in 19 minutes and 5 seconds
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
roadmap/implementers-guide/src/runtime/router.md
View file @
1955adbf
...
...
@@ -71,6 +71,8 @@ struct HrmpChannel {
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 maximum message size that could be put into the channel.
limit_message_size
:
u32
,
/// The current number of messages pending in the channel.
/// Invariant: should be less or equal to `limit_used_places`.
used_places
:
u32
,
...
...
@@ -152,8 +154,10 @@ Candidate Acceptance Function:
1.
If the message kind is
`Dispatchable`
:
1.
Verify that
`RelayDispatchQueueSize`
for
`P`
has enough capacity for the message (NOTE that should include all processed
upward messages of the
`Dispatchable`
kind up to this point!)
1.
If the message kind is
`HrmpInitOpenChannel(recipient)`
:
1.
If the message kind is
`HrmpInitOpenChannel(recipient
, max_places, max_message_size
)`
:
1.
Check that the
`P`
is not
`recipient`
.
1.
Check that
`max_places`
is less or equal to
`config.hrmp_channel_max_places`
.
1.
Check that
`max_message_size`
is less or equal to
`config.hrmp_channel_max_message_size`
.
1.
Check that
`recipient`
is a valid para.
1.
Check that there is no existing channel for
`(P, recipient)`
in
`HrmpChannels`
.
1.
Check that there is no existing open channel request (
`P`
,
`recipient`
) in
`HrmpOpenChannelRequests`
.
...
...
@@ -185,6 +189,7 @@ Candidate Acceptance Function:
*
`verify_outbound_hrmp(sender: ParaId, Vec<OutboundHrmpMessage>)`
:
1.
For each horizontal message
`M`
with the channel
`C`
identified by
`(sender, M.recipient)`
check:
1.
exists
1.
`M`
's payload size doesn't exceed a preconfigured limit
`C.limit_message_size`
1.
`M`
's payload size summed with the
`C.used_bytes`
doesn't exceed a preconfigured limit
`C.limit_used_bytes`
.
1.
`C.used_places + 1`
doesn't exceed a preconfigured limit
`C.limit_used_places`
.
...
...
@@ -213,13 +218,14 @@ Candidate Enactment:
1.
Append the message to
`RelayDispatchQueues`
for
`P`
1.
Increment the size and the count in
`RelayDispatchQueueSize`
for
`P`
.
1.
Ensure that
`P`
is present in
`NeedsDispatch`
.
1.
If the message kind is
`HrmpInitOpenChannel(recipient)`
:
1.
If the message kind is
`HrmpInitOpenChannel(recipient
, max_places, max_message_size
)`
:
1.
Increase
`HrmpOpenChannelRequestCount`
by 1 for
`P`
.
1.
Append
`(P, recipient)`
to
`HrmpOpenChannelRequestsList`
.
1.
Add a new entry to
`HrmpOpenChannelRequests`
for
`(sender, recipient)`
1.
Set
`sender_deposit`
to
`config.hrmp_sender_deposit`
1.
Set
`limit_used_places`
to
`config.hrmp_channel_max_places`
1.
Set
`limit_limit_used_bytes`
to
`config.hrmp_channel_max_size`
1.
Set
`limit_used_places`
to
`max_places`
1.
Set
`limit_message_size`
to
`max_message_size`
1.
Set
`limit_used_bytes`
to
`config.hrmp_channel_max_size`
1.
Reserve the deposit for the
`P`
according to
`config.hrmp_sender_deposit`
1.
If the message kind is
`HrmpAcceptOpenChannel(sender)`
:
1.
Reserve the deposit for the
`P`
according to
`config.hrmp_recipient_deposit`
...
...
roadmap/implementers-guide/src/types/messages.md
View file @
1955adbf
...
...
@@ -60,7 +60,14 @@ enum UpwardMessage {
///
/// Let `origin` be the parachain that sent this upward message. In that case the channel
/// to be opened is (`origin` -> `recipient`).
HrmpInitOpenChannel
(
ParaId
),
HrmpInitOpenChannel
{
/// The receiving party in the channel.
recipient
:
ParaId
,
/// How many messages can be stored in the channel at most.
max_places
:
u32
,
/// The maximum size of a message in this channel.
max_message_size
:
u32
,
},
/// A message that is meant to confirm the HRMP open channel request initiated earlier by the
/// `HrmpInitOpenChannel` by the given `sender`.
///
...
...
roadmap/implementers-guide/src/types/runtime.md
View file @
1955adbf
...
...
@@ -70,6 +70,8 @@ struct HostConfiguration {
pub
hrmp_max_parachain_inbound_channels
:
u32
,
/// The maximum number of inbound HRMP channels a parathread is allowed to accept.
pub
hrmp_max_parathread_inbound_channels
:
u32
,
/// The maximum size of a message that could ever be put into an HRMP channel.
pub
hrmp_channel_max_message_size
:
u32
,
/// The maximum number of outbound HRMP channels a parachain is allowed to open.
pub
hrmp_max_parachain_outbound_channels
:
u32
,
/// The maximum number of outbound HRMP channels a parathread is allowed to open.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment