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

MQ pallet: add discard_overweight call #13877

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

ggwpez
Copy link
Member

@ggwpez ggwpez commented Apr 11, 2023

Changes:

  • Adds a discard_overweight call to the MQ pallet for polkadot#6271 to discard overweight (but not yet stale) messages. The reap_page functionality to remove stale pages is not sufficient in the case that the number of max-stale pages is not reachable by the maximal number of configured messages. This allows to still remove overweight messages and not clog up the queue.
  • Adds a discard_overweight to the ServiceQueues trait.
  • Adds AsEnsureOriginWithContainsPair: An EnsureOrigin that is filtered through a ContainsPair predicate.
  • Adds EitherOfWithArg: A homogenous typed EitherOf that additionally takes an argument.

Context

The DiscardOverweightOrigin will be configured in Polkadot to allow each parachain's sovereign account to discard overweight messages from their UMP queue.

ggwpez added 7 commits April 11, 2023 14:45
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez marked this pull request as ready for review April 15, 2023 21:50
ggwpez added 4 commits April 16, 2023 00:16
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez added A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited B1-note_worthy Changes should be noted in the release notes T1-runtime This PR/Issue is related to the topic “runtime”. labels Apr 15, 2023
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez requested a review from gavofyork April 15, 2023 22:28
@ggwpez
Copy link
Member Author

ggwpez commented Apr 15, 2023

bot bench $ pallet dev pallet_message_queue

@paritytech paritytech deleted a comment from command-bot bot Apr 15, 2023
@paritytech paritytech deleted a comment from command-bot bot Apr 15, 2023
ggwpez added 2 commits April 17, 2023 11:37
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez changed the title MQ pallet: add discard overweight call MQ pallet: add discard_overweight call Apr 17, 2023
@ggwpez ggwpez self-assigned this Apr 17, 2023
@kianenigma kianenigma requested review from gpestana and sam0x17 May 1, 2023 10:04
@kianenigma kianenigma self-requested a review May 1, 2023 10:04
Copy link
Contributor

@sam0x17 sam0x17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, just a few nits and questions

frame/message-queue/src/benchmarking.rs Outdated Show resolved Hide resolved
frame/system/src/lib.rs Outdated Show resolved Hide resolved
ggwpez added 3 commits May 17, 2023 17:28
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez requested a review from a team May 17, 2023 15:39
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-check-benches
Logs: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2852750

frame/message-queue/src/lib.rs Outdated Show resolved Hide resolved
frame/message-queue/src/lib.rs Outdated Show resolved Hide resolved
frame/support/src/traits/messages.rs Show resolved Hide resolved
ggwpez added 3 commits June 6, 2023 11:58
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez requested a review from a team June 6, 2023 10:26
ggwpez added 2 commits June 6, 2023 15:47
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B1-note_worthy Changes should be noted in the release notes C1-low PR touches the given topic and has a low impact on builders. D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited T1-runtime This PR/Issue is related to the topic “runtime”.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants