substrate icon indicating copy to clipboard operation
substrate copied to clipboard

General Message Queue Pallet

Open gavofyork opened this issue 3 years ago • 1 comments

Closes #6129

A general pallet for paginated queuing of messages from origins. This makes minimal assumptions on the nature of an origin and message and is generic over one with the other being a blob. Each origin has its own queue and queues are serviced in a fair manner.

This pallet is aware of, and well-bounded regarding, weights and in particular PoV weight. The weight_limit provided to service_queues will be efficiently respected.

The queuing mechanism is designed to be performant and efficient with regards to compute, MEL estimation and proof size and work well for an unpredictable assortment of message sizes. It is also designed to be easily configurable to allow for optimisation of page size.

This is intended to be used with an XCM adapter struct implementing the ProcessMessage trait, to be made at a later time in the Polkadot codebase as a single, general queue for XCMP, DMP, UMP and local dispatch/queuing.

TODO:

  • [ ] Benchmarks & weights.
    • [ ] Refactor service_queue into a separate inner call and ensure weight is respected on ancillary compute/storage access. See Scheduler pallet for an example of this.
  • [ ] Overweight dispatch.
  • [ ] Stale/ancient page removal.
  • [ ] Comprehensive tests.
  • [ ] Docs.

gavofyork avatar Oct 12 '22 17:10 gavofyork

Do you think it would make sense to have a StoragePagedList as primitive or just tailor it in this MR?

ggwpez avatar Oct 12 '22 18:10 ggwpez

How could it be made a primitive?

gavofyork avatar Oct 24 '22 14:10 gavofyork

bot rebase

ggwpez avatar Nov 25 '22 23:11 ggwpez

Rebased

bot rebase

ggwpez avatar Nov 30 '22 22:11 ggwpez

Rebased

Final reviews would be helpful @eskimor @ggwpez

gavofyork avatar Dec 01 '22 14:12 gavofyork

bot rebase

gavofyork avatar Dec 05 '22 12:12 gavofyork

Rebased

@eskimor an approval would be good so we can move things along.

gavofyork avatar Dec 05 '22 14:12 gavofyork

@eskimor an approval would be good so we can move things along.

On it. Had a few other things to take care of and that code is a bit outside of my usual domain, so a proper review takes me a bit. I should be through by tomorrow though.

eskimor avatar Dec 05 '22 14:12 eskimor

/cmd queue -c bench-bot $ pallet dev pallet_message_queue

ggwpez avatar Dec 08 '22 22:12 ggwpez

@ggwpez https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2138777 was started for your command "$PIPELINE_SCRIPTS_DIR/bench-bot.sh" pallet dev pallet_message_queue. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment /cmd cancel 39-3547ab8e-4a55-43dc-a1c8-99410d2d403e to cancel this command or /cmd cancel to cancel all commands in this pull request.

command-bot[bot] avatar Dec 08 '22 22:12 command-bot[bot]

@ggwpez Command "$PIPELINE_SCRIPTS_DIR/bench-bot.sh" pallet dev pallet_message_queue has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2138777 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2138777/artifacts/download.

command-bot[bot] avatar Dec 08 '22 23:12 command-bot[bot]

@joao-paulo-parity done.

gavofyork avatar Dec 09 '22 10:12 gavofyork

bot merge

gavofyork avatar Dec 09 '22 10:12 gavofyork

Error: 1 review requesting changes and 2 approving reviews by reviewers with write access.

bot merge

joao-paulo-parity avatar Dec 09 '22 10:12 joao-paulo-parity

Waiting for commit status.

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-36/1529/1

Polkadot-Forum avatar Dec 22 '22 09:12 Polkadot-Forum