General Message Queue Pallet (#12485)
* The message queue * Make fully generic * Refactor * Docs * Refactor * Use iter not slice * Per-origin queues * Multi-queue processing * Introduce MaxReady * Remove MaxReady in favour of ready ring * Cleanups * ReadyRing and tests * Stale page reaping * from_components -> from_parts Signed-off-by:Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Move WeightCounter to sp_weights Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add MockedWeightInfo Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Deploy to kitchensink Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use WeightCounter Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Small fixes and logging Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add service_page Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Typo Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Move service_page below service_queue Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add service_message Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use correct weight function Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Overweight execution * Refactor * Missing file * Fix WeightCounter usage in scheduler Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix peek_index Take into account that decoding from a mutable slice modifies it. Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add tests and bench service_page_item Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add debug_info Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add no-progress check to service_queues Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add more benches Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Bound from_message and try_append_message Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add PageReaped event Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Rename BookStateOf and BookStateFor Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update tests and remove logging Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Remove redundant per-message origins; add footprint() and sweep_queue() * Move testing stuff to mock.rs Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add integration test Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix no-progress check Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix debug_info Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixup merge and tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix footprint tracking * Introduce * Formatting * OverweightEnqueued event, auto-servicing config item * Update tests and benchmarks Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Clippy Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Provide change handler * Add missing BookStateFor::insert and call QueueChangeHandler Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Docs Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update benchmarks and weights Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * More tests... Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use weight metering functions Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * weightInfo::process_message_payload is gone Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add defensive_saturating_accrue Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Rename WeightCounter to WeightMeter Ctr+Shift+H should do the trick. Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Test on_initialize Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add module docs Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Remove origin from MaxMessageLen The message origin is not encoded into the heap and does therefore not influence the max message length anymore. Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add BoundedVec::as_slice Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Test Page::{from_message, try_append_message} Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixup docs Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Docs * Do nothing in sweep_queue if the queue does not exist ... otherwise it inserts default values into the storage. Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Test ring (un)knitting Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Upgrade stress-test Change the test to not assume that all queued messages will be processed in the next block but split it over multiple. Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * More tests... Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Beauty fixes Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * clippy Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Rename BoundedVec::as_slice to as_bounded_slice Conflicts with deref().as_slice() otherwise. Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix imports Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Remove ReadyRing struct Was used for testing only. Instead use 'fn assert_ring' which also check the service head and backlinks. Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Beauty fixes Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix stale page watermark Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Cleanup Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix test feature and clippy Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * QueueChanged handler is called correctly Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update benches Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Abstract testing functions Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * More tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Cleanup Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Clippy Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Simplify tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Make stuff compile Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Extend overweight execution benchmark Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Remove TODOs Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Test service queue with faulty MessageProcessor Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update pallet ui tests to 1.65 Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * More docs Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Review doc fixes Co-authored-by:
Robert Klotzner <eskimor@users.noreply.github.com> Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add weight_limit to extrinsic weight of execute_overweight * Correctly return unused weight * Return actual weight consumed in do_execute_overweight * Review fixes Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Set version 7.0.0-dev Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Make it compile Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Switch message_size to u64 Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Switch message_count to u64 Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix benchmarks Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Make CI green Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Docs * Update tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/bench-bot.sh" pallet dev pallet_message_queue * Dont mention README.md in the Cargo.toml Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Remove reference to readme Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: parity-processbot <> Co-authored-by:
Robert Klotzner <eskimor@users.noreply.github.com> Co-authored-by:
Keith Yeung <kungfukeith11@gmail.com>
Showing
- substrate/Cargo.lock 32 additions, 8 deletionssubstrate/Cargo.lock
- substrate/Cargo.toml 1 addition, 0 deletionssubstrate/Cargo.toml
- substrate/bin/node/runtime/Cargo.toml 4 additions, 0 deletionssubstrate/bin/node/runtime/Cargo.toml
- substrate/bin/node/runtime/src/lib.rs 21 additions, 0 deletionssubstrate/bin/node/runtime/src/lib.rs
- substrate/frame/message-queue/Cargo.toml 53 additions, 0 deletionssubstrate/frame/message-queue/Cargo.toml
- substrate/frame/message-queue/src/benchmarking.rs 204 additions, 0 deletionssubstrate/frame/message-queue/src/benchmarking.rs
- substrate/frame/message-queue/src/integration_test.rs 224 additions, 0 deletionssubstrate/frame/message-queue/src/integration_test.rs
- substrate/frame/message-queue/src/lib.rs 1308 additions, 0 deletionssubstrate/frame/message-queue/src/lib.rs
- substrate/frame/message-queue/src/mock.rs 312 additions, 0 deletionssubstrate/frame/message-queue/src/mock.rs
- substrate/frame/message-queue/src/mock_helpers.rs 185 additions, 0 deletionssubstrate/frame/message-queue/src/mock_helpers.rs
- substrate/frame/message-queue/src/tests.rs 1092 additions, 0 deletionssubstrate/frame/message-queue/src/tests.rs
- substrate/frame/message-queue/src/weights.rs 216 additions, 0 deletionssubstrate/frame/message-queue/src/weights.rs
- substrate/frame/scheduler/Cargo.toml 2 additions, 0 deletionssubstrate/frame/scheduler/Cargo.toml
- substrate/frame/scheduler/src/lib.rs 2 additions, 1 deletionsubstrate/frame/scheduler/src/lib.rs
- substrate/frame/support/src/traits.rs 6 additions, 0 deletionssubstrate/frame/support/src/traits.rs
- substrate/frame/support/src/traits/messages.rs 202 additions, 0 deletionssubstrate/frame/support/src/traits/messages.rs
- substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.stderr 3 additions, 3 deletions.../pallet_ui/storage_ensure_span_are_ok_on_wrong_gen.stderr
- substrate/frame/support/test/tests/pallet_ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.stderr 3 additions, 3 deletions...ui/storage_ensure_span_are_ok_on_wrong_gen_unnamed.stderr
- substrate/primitives/core/src/bounded/bounded_vec.rs 7 additions, 0 deletionssubstrate/primitives/core/src/bounded/bounded_vec.rs
- substrate/primitives/weights/src/weight_meter.rs 6 additions, 0 deletionssubstrate/primitives/weights/src/weight_meter.rs
Please register or sign in to comment