Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Use Message Queue pallet for UMP dispatch #6271

Merged
merged 216 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from 124 commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
534593f
Add ProcessXcmMessage struct
gavofyork Nov 1, 2022
8258780
Migrate away from weights in host config
gavofyork Nov 11, 2022
de6da2c
New well-known key to report UMPQ capacity
gavofyork Nov 11, 2022
c30a4fd
Add missing file
gavofyork Nov 11, 2022
89ab8b9
Fixes
gavofyork Nov 11, 2022
34b8a40
Remove original UMP files
gavofyork Nov 11, 2022
c7fcf41
Docs
gavofyork Nov 11, 2022
b074ec3
Update runtime/parachains/src/inclusion/mod.rs
gavofyork Nov 14, 2022
aa4b7e5
Add benchmarking
gavofyork Nov 14, 2022
e9a68e7
Merge branch 'gav-message-queue' of github.com:paritytech/polkadot in…
gavofyork Nov 14, 2022
802eec5
Merge remote-tracking branch 'origin/master' into gav-message-queue
gavofyork Nov 14, 2022
92ca0c4
Benchmarks
gavofyork Nov 14, 2022
417b028
Merge remote-tracking branch 'origin/master' into gav-message-queue
gavofyork Nov 15, 2022
99b4a5f
Mock example of using the QueueChangeHandler to update the WKK
gavofyork Nov 15, 2022
bba31ca
Use master Cargo.lock
ggwpez Jan 9, 2023
9cd496d
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Jan 9, 2023
972f4d3
Update Cargo.lock
ggwpez Jan 11, 2023
e48d6ef
Update remove-weight migration
ggwpez Jan 11, 2023
cd5b50d
Add message- to dispatch-origin conversion for XCM processing
ggwpez Jan 11, 2023
130a48a
DNM: Temporarily comment code since XCMv3 is not merged yet
ggwpez Jan 11, 2023
b583ddf
Use u64 for queue-wide limits on UmpAcceptanceCheckErr
ggwpez Jan 11, 2023
b8b0998
Define one sub-queue per *MP queue
ggwpez Jan 11, 2023
435f743
Harden check_upward_messages
ggwpez Jan 11, 2023
67b3136
Add type-safe well_known_keys
ggwpez Jan 11, 2023
bea3a0e
Add message-queue weights
ggwpez Jan 11, 2023
f35e2cf
Deploy MessageQueue to Polkadot
ggwpez Jan 11, 2023
d0ec96e
Update Cargo.toml
ggwpez Jan 11, 2023
3c34375
Migrate to parachain config V5
ggwpez Jan 11, 2023
63322ab
Update UMP tests
ggwpez Jan 11, 2023
a02df6f
Cleanup
ggwpez Jan 11, 2023
cdb1821
fmt
ggwpez Jan 11, 2023
59dc6d7
Revert messed up merge :facepalm:
ggwpez Jan 11, 2023
1019b44
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Jan 11, 2023
8e2e4c3
Update remove-weight migration
ggwpez Jan 11, 2023
be65a1d
Add message- to dispatch-origin conversion for XCM processing
ggwpez Jan 11, 2023
42b5eed
DNM: Temporarily comment code since XCMv3 is not merged yet
ggwpez Jan 11, 2023
5047b69
Use u64 for queue-wide limits on UmpAcceptanceCheckErr
ggwpez Jan 11, 2023
567358e
Define one sub-queue per *MP queue
ggwpez Jan 11, 2023
41182cc
Harden check_upward_messages
ggwpez Jan 11, 2023
76721c0
Add type-safe well_known_keys
ggwpez Jan 11, 2023
1d4ab90
Add message-queue weights
ggwpez Jan 11, 2023
694200c
Deploy MessageQueue to Polkadot
ggwpez Jan 11, 2023
19ec4eb
Update Cargo.toml
ggwpez Jan 11, 2023
55e889a
Migrate to parachain config V5
ggwpez Jan 11, 2023
4f6a723
Update UMP tests
ggwpez Jan 11, 2023
3448b00
Cleanup
ggwpez Jan 11, 2023
b88f962
fmt
ggwpez Jan 11, 2023
2fce623
Make stuff compile
ggwpez Jan 11, 2023
d070742
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Jan 23, 2023
dee2378
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Jan 24, 2023
c3471d4
Move DMP and HRMP messages to the MessageQueue
ggwpez Jan 24, 2023
f23dec3
Diener for CI
ggwpez Jan 24, 2023
0694f0a
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Jan 24, 2023
5aa44a5
diener update cargo.lock
ggwpez Jan 24, 2023
628d55f
Cleanup
ggwpez Jan 24, 2023
0947c3c
Revert wrong changes
ggwpez Feb 1, 2023
02bf965
Revert "DNM: Temporarily comment code since XCMv3 is not merged yet"
ggwpez Feb 1, 2023
11745ad
Make compile
ggwpez Feb 1, 2023
408c9c5
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Feb 1, 2023
82a8bc1
Fixup runtimes
ggwpez Feb 1, 2023
ed0f034
fmt
ggwpez Feb 1, 2023
a810818
Define benchmarks
ggwpez Feb 1, 2023
1d091a5
Cleanup
ggwpez Feb 2, 2023
91e523f
Fix migration
ggwpez Feb 2, 2023
0da1bc1
Use master Cargo.lock
ggwpez Feb 2, 2023
25c5ab8
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Feb 2, 2023
752552d
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Feb 2, 2023
c08a7a0
Lockfile
ggwpez Feb 2, 2023
5c42d8e
Fix test
ggwpez Feb 2, 2023
541c790
Add AggregateMessageOrigin
ggwpez Feb 23, 2023
fe5df72
Forbid UMP for off-boarding paras
ggwpez Feb 23, 2023
01cb9bf
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Feb 23, 2023
b8f01e1
Delete stupid test
ggwpez Feb 23, 2023
86f1782
Use BoundedVec for upward messages
ggwpez Feb 23, 2023
d7b325b
Add weights and fix MessageProcessor
ggwpez Feb 23, 2023
2aba96b
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Feb 23, 2023
dd0ee2d
Bound receive_upward_messages and check bound in configuration pallet
ggwpez Feb 23, 2023
cf0c6ec
Bound Debug impl
ggwpez Feb 23, 2023
da54497
fmt
ggwpez Feb 23, 2023
ab3ec43
clippy
ggwpez Feb 23, 2023
0713f40
Fix test runtime
ggwpez Feb 23, 2023
38b506a
Fix xcm-simulator
ggwpez Feb 24, 2023
5777e18
Properly fix xcm-simulator and fuzzer
ggwpez Feb 24, 2023
f54bfd6
Fix tests
ggwpez Feb 24, 2023
50ffb2f
fmt
ggwpez Feb 24, 2023
f979ffc
cargo update -p sp-io
ggwpez Feb 25, 2023
dba85e8
Adapt to upstream Substrate changes
ggwpez Feb 25, 2023
10e7fc4
Fix ProcesseMessage impls
ggwpez Feb 25, 2023
7b331cc
Some tests
ggwpez Feb 25, 2023
6a1f547
Use master Cargo.lock
ggwpez Feb 25, 2023
90e3ebb
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Feb 25, 2023
35a7dc0
cargo update -p sp-io
ggwpez Feb 25, 2023
8f99357
Use new MQ API
ggwpez Feb 28, 2023
ebc84e9
Fix test
ggwpez Feb 28, 2023
3639a33
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Feb 28, 2023
6bf7613
Fix migration
ggwpez Feb 28, 2023
6f93487
Update Cargo.lock
ggwpez Feb 28, 2023
3ba9380
Add UMP while Para offboarding tests
ggwpez Feb 28, 2023
8a0bded
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Feb 28, 2023
f85531e
fmt
ggwpez Feb 28, 2023
b152901
Use Mocked message processor for benchmarking
ggwpez Feb 28, 2023
f92f041
Use variables for constants
ggwpez Feb 28, 2023
e4105db
Add MQ pallet weights
ggwpez Feb 28, 2023
861f8d3
Use MQ pallet weights
ggwpez Feb 28, 2023
cdb67e0
Configure QueueChangeHandler
ggwpez Feb 28, 2023
3c87b33
fmt
ggwpez Feb 28, 2023
51bf97e
Add config test
ggwpez Feb 28, 2023
c7f6f64
Fix MQ serive weight
ggwpez Feb 28, 2023
9c29f58
Cleanup
ggwpez Feb 28, 2023
f0d6cd8
Cleanup outgoing UMP dispatch queues
ggwpez Feb 28, 2023
2c6ecee
Use Master Cargo.lock
ggwpez Feb 28, 2023
d04a0cc
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Feb 28, 2023
a725028
Update Cargo.lock
ggwpez Feb 28, 2023
7ced507
Weight mul is not const
ggwpez Feb 28, 2023
f6d2fa0
Clippy
ggwpez Feb 28, 2023
ba87c22
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Mar 3, 2023
7fc3718
Remove merge marker
ggwpez Mar 3, 2023
6b36873
Update runtime/parachains/src/inclusion/mod.rs
ggwpez Mar 3, 2023
53cb04f
Update runtime/kusama/src/lib.rs
ggwpez Mar 9, 2023
8ad38b3
Use lowercase UMP
ggwpez Mar 9, 2023
a50f39a
Clarify comment
ggwpez Mar 9, 2023
acd9b29
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Mar 9, 2023
3372576
Use Weight::from_parts
ggwpez Mar 9, 2023
e5e7e33
Fix test
ggwpez Mar 9, 2023
b989dd0
Fix doc
ggwpez Mar 16, 2023
fac282f
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Mar 16, 2023
0caef3d
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Mar 17, 2023
638058b
Emit event after the fact
ggwpez Mar 22, 2023
34a41b1
Add defensive_proof to receive_upward_messages
ggwpez Mar 22, 2023
076126f
Reapply "Remove original UMP files"
ggwpez Nov 11, 2022
cf1fd77
Remove old files
ggwpez Mar 22, 2023
01ca8dd
Rename MaxUmpMessageLen -> MaxUmpMessageLenOf
ggwpez Mar 22, 2023
ed652a0
Test defensive message dropping of receive_upward_messages
ggwpez Mar 22, 2023
4e7c46d
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Mar 22, 2023
c5db770
Fixup imports
ggwpez Mar 22, 2023
0d41cb4
Update implementors guide
ggwpez Mar 22, 2023
ef9de05
Fix tests
ggwpez Mar 22, 2023
b29f2ca
Remove FAIL-CI mark
ggwpez Mar 22, 2023
dd76bca
Delete unused code
ggwpez Mar 22, 2023
b559f6d
Add another test for MQ change hook
ggwpez Mar 22, 2023
62a299c
Imports
ggwpez Mar 22, 2023
7d240ad
Keep Kusama runtime formatting
ggwpez Mar 22, 2023
7c62e42
Revert "Delete unused code"
ggwpez Mar 22, 2023
1b45cb8
Feature gate mock functions
ggwpez Mar 22, 2023
90b463a
Review: Use saturating_add
ggwpez Mar 22, 2023
1a964af
Test RelayDispatchQueueSize storage key
ggwpez Apr 5, 2023
2da269d
Move migration to own file to avoid merge conflicts
ggwpez Apr 6, 2023
b7b56cc
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Apr 6, 2023
89a3b74
Migration in own file
ggwpez Apr 6, 2023
9ad255b
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Apr 11, 2023
099e2f0
Fixup migration
ggwpez Apr 11, 2023
b9c15e8
Rococo: configure MQ pallet
ggwpez Apr 11, 2023
88f1cbe
Fixup tests
ggwpez Apr 11, 2023
32cb688
Revert "Rococo: configure MQ pallet"
ggwpez Apr 13, 2023
a4d1c21
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Apr 13, 2023
1aab21c
Revert "Fixup tests"
ggwpez Apr 13, 2023
9b3c2aa
Fixup migration
ggwpez Apr 13, 2023
f0c8200
Fix migration
ggwpez Apr 13, 2023
968c462
fmt
ggwpez Apr 13, 2023
7124a62
Fix CI
ggwpez Apr 13, 2023
4b8c046
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Apr 14, 2023
5967ad1
Fix migration
ggwpez Apr 14, 2023
425e8a9
Fix other migration
ggwpez Apr 17, 2023
530734b
Bump MAX_CODE_SIZE to 10MiB
ggwpez Apr 19, 2023
28a6c59
Add ForceUpdateUmpLimits migration
ggwpez Apr 19, 2023
1a4486e
fmt
ggwpez Apr 19, 2023
dad295e
clippy
ggwpez Apr 19, 2023
9d4d351
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Apr 19, 2023
24964aa
clippy
ggwpez Apr 19, 2023
545d056
imports
ggwpez Apr 19, 2023
4b0be4d
Use defensive instead of defensive_proof
ggwpez Apr 19, 2023
79f475e
Rename to ScheduleConfigUpdate
ggwpez Apr 20, 2023
a17f1e8
Fixup migration checks
ggwpez Apr 20, 2023
7caffb0
Add MAX_CODE_SIZE to ScheduleConfigUpdate
ggwpez Apr 20, 2023
103ffba
Set MAX_CODE_SIZE to 4MiB
ggwpez Apr 20, 2023
438e918
Fix benchmark
ggwpez Apr 21, 2023
ec8111f
Fix formatting
ggwpez Apr 21, 2023
bfde291
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Apr 25, 2023
e366446
Revert "Add MAX_CODE_SIZE to ScheduleConfigUpdate"
ggwpez Apr 25, 2023
3595684
Revert "Set MAX_CODE_SIZE to 4MiB"
ggwpez Apr 25, 2023
7503530
Revert "Bump MAX_CODE_SIZE to 10MiB"
ggwpez Apr 25, 2023
1519705
Remove consistency check from migration
ggwpez Apr 25, 2023
1fbc01c
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez Apr 27, 2023
131fd38
Fix constants
ggwpez Apr 28, 2023
20c21c6
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez May 2, 2023
5f8385a
Bump MAX_UPWARD_MESSAGE_SIZE_BOUND for Westend
ggwpez May 2, 2023
a4c81c5
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez May 8, 2023
4c1f5d5
Fix migrations
ggwpez May 8, 2023
74f3178
Use old nightly for fmt
ggwpez May 8, 2023
37bba27
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez May 10, 2023
f829c49
Fixes
KiChjang May 12, 2023
0c94097
cargo fmt
KiChjang May 12, 2023
adc9473
Fix tests
ggwpez May 12, 2023
d858fde
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez May 12, 2023
031d40c
Fix tests
ggwpez May 12, 2023
c3d046d
Fixes
KiChjang May 12, 2023
31bb588
Add MQ pallet to fuzzer
ggwpez May 12, 2023
a326a28
Fmt
ggwpez May 12, 2023
c253fdc
Fix XMC simulator example
ggwpez May 12, 2023
e1f2bb0
Remove runtime-benchmarks from fuzzers
ggwpez May 12, 2023
1e5e9a2
Revert "Remove runtime-benchmarks from fuzzers"
ggwpez May 12, 2023
d9537da
Fix example simulator
ggwpez May 12, 2023
3338e7b
Add V6 migration and remove old ones
ggwpez May 12, 2023
5c9cb08
Actually make old migrations reusable
ggwpez May 12, 2023
181da58
Dont delete old migrations
ggwpez May 12, 2023
9ad4c35
Future proof AggregateMessageOrigin and review fixes
ggwpez May 13, 2023
8d3b806
More cleanup
ggwpez May 13, 2023
69dcd7b
fmt
ggwpez May 13, 2023
e2210a8
fix benchmarks
ggwpez May 13, 2023
117bca9
Fix fuzzer build
ggwpez May 13, 2023
9debdda
Review
ggwpez May 16, 2023
6b51601
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez May 17, 2023
dd0be23
Remove old migration
ggwpez May 19, 2023
583eaaa
Set MQ service weight to 20%
ggwpez May 19, 2023
ad9b579
Fix tabs in Markdown
ggwpez May 19, 2023
efc6a9d
Merge remote-tracking branch 'origin/master' into gav-message-queue
ggwpez May 19, 2023
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
27 changes: 27 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
//! Polkadot chain configurations.

use beefy_primitives::crypto::AuthorityId as BeefyId;
use frame_support::weights::Weight;
use grandpa::AuthorityId as GrandpaId;
#[cfg(feature = "kusama-native")]
use kusama_runtime as kusama;
Expand Down Expand Up @@ -189,7 +188,6 @@ fn default_parachains_host_configuration(
max_upward_queue_count: 8,
max_upward_queue_size: 1024 * 1024,
max_downward_message_size: 1024 * 1024,
ump_service_total_weight: Weight::from_parts(100_000_000_000, MAX_POV_SIZE as u64),
max_upward_message_size: 50 * 1024,
max_upward_message_num_per_candidate: 5,
hrmp_sender_deposit: 0,
Expand Down
57 changes: 56 additions & 1 deletion primitives/src/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub type ValidatorSignature = validator_app::Signature;

/// A declarations of storage keys where an external observer can find some interesting data.
pub mod well_known_keys {
use super::{HrmpChannelId, Id};
use super::{HrmpChannelId, Id, WellKnownKey};
use hex_literal::hex;
use parity_scale_codec::Encode as _;
use sp_io::hashing::twox_64;
Expand Down Expand Up @@ -193,6 +193,7 @@ pub mod well_known_keys {
///
/// - `count: u32`, the number of messages currently in the queue for given para,
/// - `total_size: u32`, the total size of all messages in the queue.
KiChjang marked this conversation as resolved.
Show resolved Hide resolved
#[deprecated = "Use `relay_dispatch_queue_remaining_capacity` instead"]
pub fn relay_dispatch_queue_size(para_id: Id) -> Vec<u8> {
let prefix = hex!["f5207f03cfdce586301014700e2c2593fad157e461d71fd4c1f936839a5f1f3e"];

Expand All @@ -207,6 +208,24 @@ pub mod well_known_keys {
})
}

/// Type safe version of `relay_dispatch_queue_size`.
#[deprecated = "Use `relay_dispatch_queue_remaining_capacity` instead"]
pub fn relay_dispatch_queue_size_typed(para: Id) -> WellKnownKey<(u32, u32)> {
#[allow(deprecated)]
relay_dispatch_queue_size(para).into()
}

/// The upward message dispatch queue remaining capacity for the given para id.
///
/// The storage entry stores a tuple of two values:
///
/// - `count: u32`, the number of additional messages which may be enqueued for the given para,
/// - `total_size: u32`, the total size of additional messages which may be enqueued for the
/// given para.
pub fn relay_dispatch_queue_remaining_capacity(para_id: Id) -> WellKnownKey<(u32, u32)> {
(b":relay_dispatch_queue_remaining_capacity", para_id).encode().into()
}

/// The HRMP channel for the given identifier.
///
/// The storage entry should be accessed as an `AbridgedHrmpChannel` encoded value.
Expand Down Expand Up @@ -1689,6 +1708,42 @@ impl PvfCheckStatement {
}
}

/// A well-known and typed storage key.
///
/// Allows for type-safe access to raw well-known storage keys.
pub struct WellKnownKey<T> {
/// The raw storage key.
pub key: Vec<u8>,
_p: sp_std::marker::PhantomData<T>,
}

impl<T> From<Vec<u8>> for WellKnownKey<T> {
fn from(key: Vec<u8>) -> Self {
Self { key, _p: Default::default() }
}
}

impl<T> AsRef<[u8]> for WellKnownKey<T> {
fn as_ref(&self) -> &[u8] {
self.key.as_ref()
}
}

impl<T: Decode> WellKnownKey<T> {
/// Gets the value or `None` if it does not exist or decoding failed.
pub fn get(&self) -> Option<T> {
sp_io::storage::get(&self.key)
.and_then(|raw| parity_scale_codec::DecodeAll::decode_all(&mut raw.as_ref()).ok())
}
}

impl<T: Encode> WellKnownKey<T> {
/// Sets the value.
pub fn set(&self, value: T) {
sp_io::storage::set(&self.key, &value.encode());
}
}

/// Type discriminator for PVF preparation timeouts
#[derive(Encode, Decode, TypeInfo, Clone, Copy, Debug, PartialEq, Eq)]
pub enum PvfPrepTimeoutKind {
Expand Down
32 changes: 7 additions & 25 deletions roadmap/implementers-guide/src/runtime/ump.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,18 @@ Candidate Acceptance Function:
* `check_upward_messages(P: ParaId, Vec<UpwardMessage>`):
1. Checks that there are at most `config.max_upward_message_num_per_candidate` messages.
1. Checks that no message exceeds `config.max_upward_message_size`.
1. Verify that `RelayDispatchQueueSize` for `P` has enough capacity for the messages
1. Verify that queuing up the messages could not result in exceeding the queue's footprint
according to the config items. The queue's current footprint is provided in well_known_keys
in order to facilitate oraclisation on to the para.

Candidate Enactment:

* `receive_upward_messages(P: ParaId, Vec<UpwardMessage>)`:
1. Process each upward message `M` in order:
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`.

The following routine is meant to execute pending entries in upward message queues. This function doesn't fail, even if
dispatching any of individual upward messages returns an error.

`process_pending_upward_messages()`:
1. Initialize a cumulative weight counter `T` to 0
1. Iterate over items in `NeedsDispatch` cyclically, starting with `NextDispatchRoundStartWith`. If the item specified is `None` start from the beginning. For each `P` encountered:
1. Dequeue the first upward message `D` from `RelayDispatchQueues` for `P`
1. Decrement the size of the message from `RelayDispatchQueueSize` for `P`
1. Delegate processing of the message to the runtime. The weight consumed is added to `T`.
1. If `T >= config.ump_service_total_weight`, set `NextDispatchRoundStartWith` to `P` and finish processing.
1. If `RelayDispatchQueues` for `P` became empty, remove `P` from `NeedsDispatch`.
1. If `NeedsDispatch` became empty then finish processing and set `NextDispatchRoundStartWith` to `None`.
> NOTE that in practice we would need to approach the weight calculation more thoroughly, i.e. incorporate all operations
> that could take place on the course of handling these upward messages.
1. Place in the dispatch queue according to its para ID (or handle it immediately).

## Session Change

1. For each `P` in `outgoing_paras` (generated by `Paras::on_new_session`):
1. Remove `RelayDispatchQueueSize` of `P`.
1. Remove `RelayDispatchQueues` of `P`.
1. Remove `P` if it exists in `NeedsDispatch`.
1. If `P` is in `NextDispatchRoundStartWith`, then reset it to `None`
- Note that if we don't remove the open/close requests since they are going to die out naturally at the end of the session.
1. Nothing specific needs to be done, however the channel's dispatch queue may possibly be "swept"
which would prevent the dispatch queue from automatically being serviced. This is a consideration
for the chain and specific behaviour is not defined.
5 changes: 0 additions & 5 deletions roadmap/implementers-guide/src/types/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ struct HostConfiguration {
/// no further messages may be added to it. If it exceeds this then the queue may contain only
/// a single message.
pub max_upward_queue_size: u32,
/// The amount of weight we wish to devote to the processing the dispatchable upward messages
/// stage.
///
/// NOTE that this is a soft limit and could be exceeded.
pub ump_service_total_weight: Weight,
/// The maximum size of an upward message that can be sent by a candidate.
///
/// This parameter affects the upper bound of size of `CandidateCommitments`.
Expand Down
1 change: 1 addition & 0 deletions runtime/common/src/assigned_slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ mod tests {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = parachains_paras::TestWeightInfo;
type UnsignedPriority = ParasUnsignedPriority;
type UmpQueueTracker = ();
type NextSessionRotation = crate::mock::TestNextSessionRotation;
}

Expand Down
1 change: 1 addition & 0 deletions runtime/common/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ impl paras::Config for Test {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = paras::TestWeightInfo;
type UnsignedPriority = ParasUnsignedPriority;
type UmpQueueTracker = ();
type NextSessionRotation = crate::mock::TestNextSessionRotation;
}

Expand Down
1 change: 1 addition & 0 deletions runtime/common/src/paras_registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ mod tests {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = paras::TestWeightInfo;
type UnsignedPriority = ParasUnsignedPriority;
type UmpQueueTracker = ();
type NextSessionRotation = crate::mock::TestNextSessionRotation;
}

Expand Down
7 changes: 2 additions & 5 deletions runtime/common/src/paras_sudo_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use primitives::Id as ParaId;
use runtime_parachains::{
configuration, dmp, hrmp,
paras::{self, ParaGenesisArgs},
ump, ParaLifecycle,
ParaLifecycle,
};
use sp_std::boxed::Box;

Expand All @@ -38,10 +38,7 @@ pub mod pallet {

#[pallet::config]
#[pallet::disable_frame_system_supertrait_check]
pub trait Config:
configuration::Config + paras::Config + dmp::Config + ump::Config + hrmp::Config
{
}
pub trait Config: configuration::Config + paras::Config + dmp::Config + hrmp::Config {}

#[pallet::error]
pub enum Error<T> {
Expand Down
4 changes: 4 additions & 0 deletions runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "m
pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-message-queue = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-nomination-pools = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -157,6 +158,7 @@ std = [
"pallet-im-online/std",
"pallet-indices/std",
"pallet-membership/std",
"pallet-message-queue/std",
"pallet-multisig/std",
"pallet-nomination-pools/std",
"pallet-nomination-pools-runtime-api/std",
Expand Down Expand Up @@ -224,6 +226,7 @@ runtime-benchmarks = [
"pallet-im-online/runtime-benchmarks",
"pallet-indices/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-nomination-pools/runtime-benchmarks",
"pallet-nomination-pools-benchmarking/runtime-benchmarks",
Expand Down Expand Up @@ -275,6 +278,7 @@ try-runtime = [
"pallet-im-online/try-runtime",
"pallet-indices/try-runtime",
"pallet-membership/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-multisig/try-runtime",
"pallet-nomination-pools/try-runtime",
"pallet-offences/try-runtime",
Expand Down
Loading