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 211 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
29 changes: 29 additions & 0 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions node/network/approval-distribution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1270,11 +1270,11 @@ impl State {
let candidate_entry = match block_entry.candidates.get(index as usize) {
None => {
gum::debug!(
target: LOG_TARGET,
?hash,
?index,
"`get_approval_signatures`: could not find candidate entry for given hash and index!"
);
target: LOG_TARGET,
?hash,
?index,
"`get_approval_signatures`: could not find candidate entry for given hash and index!"
);
continue
},
Some(e) => e,
Expand Down
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/v4/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 @@ -210,6 +210,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.
#[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 @@ -224,6 +225,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 @@ -1706,6 +1725,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)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
Expand Down
39 changes: 36 additions & 3 deletions roadmap/implementers-guide/src/runtime/inclusion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Inclusion Module

The inclusion module is responsible for inclusion and availability of scheduled parachains and parathreads.
The inclusion module is responsible for inclusion and availability of scheduled parachains and parathreads. It also manages the UMP dispatch queue of each parachain/thread.

## Storage

Expand Down Expand Up @@ -35,11 +35,27 @@ PendingAvailability: map ParaId => CandidatePendingAvailability;
PendingAvailabilityCommitments: map ParaId => CandidateCommitments;
```

## Config Dependencies

* `MessageQueue`:
The message queue provides general queueing and processing functionality. Currently it
replaces the old `UMP` dispatch queue. Other use-cases can be implemented as well by
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
adding new variants to `AggregateMessageOrigin`. Normally it should be set to an instance
of the `MessageQueue` pallet.

## Session Change

1. Clear out all candidates pending availability.
1. Clear out all validator bitfields.

Optional:
1. The UMP queue of all outgoing paras can be "swept". This would prevent the dispatch queue from automatically being serviced. It is a consideration for the chain and specific behaviour is not defined.

## Initialization

No initialization routine runs for this module. However, the initialization of the `MessageQueue` pallet will attempt to process any pending UMP messages.


## Routines

All failed checks should lead to an unrecoverable error making the block invalid.
Expand Down Expand Up @@ -88,7 +104,7 @@ All failed checks should lead to an unrecoverable error making the block invalid
1. Ensure that any code upgrade scheduled by the candidate does not happen within `config.validation_upgrade_cooldown` of `Paras::last_code_upgrade(para_id, true)`, if any, comparing against the value of `Paras::FutureCodeUpgrades` for the given para ID.
1. Check the collator's signature on the candidate data.
1. check the backing of the candidate using the signatures and the bitfields, comparing against the validators assigned to the groups, fetched with the `group_validators` lookup.
1. call `Ump::check_upward_messages(para, commitments.upward_messages)` to check that the upward messages are valid.
1. call `check_upward_messages(config, para, commitments.upward_messages)` to check that the upward messages are valid.
1. call `Dmp::check_processed_downward_messages(para, commitments.processed_downward_messages)` to check that the DMQ is properly drained.
1. call `Hrmp::check_hrmp_watermark(para, commitments.hrmp_watermark)` for each candidate to check rules of processing the HRMP watermark.
1. using `Hrmp::check_outbound_hrmp(sender, commitments.horizontal_messages)` ensure that the each candidate sent a valid set of horizontal messages
Expand All @@ -99,7 +115,7 @@ All failed checks should lead to an unrecoverable error making the block invalid
1. If the receipt contains a code upgrade, Call `Paras::schedule_code_upgrade(para_id, code, relay_parent_number, config)`.
> TODO: Note that this is safe as long as we never enact candidates where the relay parent is across a session boundary. In that case, which we should be careful to avoid with contextual execution, the configuration might have changed and the para may de-sync from the host's understanding of it.
1. Reward all backing validators of each candidate, contained within the `backers` field.
1. call `Ump::receive_upward_messages` for each backed candidate, using the [`UpwardMessage`s](../types/messages.md#upward-message) from the [`CandidateCommitments`](../types/candidate.md#candidate-commitments).
1. call `receive_upward_messages` for each backed candidate, using the [`UpwardMessage`s](../types/messages.md#upward-message) from the [`CandidateCommitments`](../types/candidate.md#candidate-commitments).
1. call `Dmp::prune_dmq` with the para id of the candidate and the candidate's `processed_downward_messages`.
1. call `Hrmp::prune_hrmp` with the para id of the candiate and the candidate's `hrmp_watermark`.
1. call `Hrmp::queue_outbound_hrmp` with the para id of the candidate and the list of horizontal messages taken from the commitment,
Expand All @@ -118,3 +134,20 @@ All failed checks should lead to an unrecoverable error making the block invalid
* `candidate_pending_availability(ParaId) -> Option<CommittedCandidateReceipt>`: returns the `CommittedCandidateReceipt` pending availability for the para provided, if any.
* `pending_availability(ParaId) -> Option<CandidatePendingAvailability>`: returns the metadata around the candidate pending availability for the para, if any.
* `collect_disputed(disputed: Vec<CandidateHash>) -> Vec<CoreIndex>`: Sweeps through all paras pending availability. If the candidate hash is one of the disputed candidates, then clean up the corresponding storage for that candidate and the commitments. Return a vector of cleaned-up core IDs.

These functions were formerly part of the UMP pallet:

* `check_upward_messages(P: ParaId, Vec<UpwardMessage>)`:
1. Checks that the parachain is not currently offboarding and error otherwise.
1. Checks that there are at most `config.max_upward_message_num_per_candidate` messages to be enqueued.
1. Checks that no message exceeds `config.max_upward_message_size`.
1. Checks that the total resulting queue size would not exceed `co`.
1. Verify that queuing up the messages could not result in exceeding the queue's footprint
according to the config items `config.max_upward_queue_count` and `config.max_upward_queue_size`. 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. Place in the dispatch queue according to its para ID (or handle it immediately).
87 changes: 0 additions & 87 deletions roadmap/implementers-guide/src/runtime/ump.md

This file was deleted.

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 @@ -63,11 +63,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
Loading