-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mq pallet] Custom next queue selectors #6059
Conversation
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks good
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
/cmd prdoc --bump minor --audience runtime_dev |
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
/cmd bench --pallet pallet_message_queue |
Command "bench --pallet pallet_message_queue" has started 🚀 See logs here |
Command "bench --pallet pallet_message_queue" has finished ✅ See logs here Subweight results:
Command output:❌ Failed to build asset-hub-westend |
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
/cmd bench --pallet pallet_message_queue |
Command "bench --pallet pallet_message_queue" has started 🚀 See logs here |
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
/cmd bench --pallet pallet_message_queue |
Command "bench --pallet pallet_message_queue" has started 🚀 See logs here |
Command "bench --pallet pallet_message_queue" has finished ✅ See logs here Subweight results:
Command output:✅ Successful benchmarks of runtimes/pallets: |
Command "bench --pallet pallet_message_queue" has failed ❌! See logs here Command output:✅ Successful benchmarks of runtimes/pallets: |
/cmd bench --pallet pallet_message_queue |
Command "bench --pallet pallet_message_queue" has started 🚀 See logs here |
Command "bench --pallet pallet_message_queue" has finished ✅ See logs here Subweight results:
Command output:✅ Successful benchmarks of runtimes/pallets: |
All GitHub workflows were cancelled due to failure one of the required jobs. |
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
/cmd prdoc --audience runtime_dev --bump patch --force |
…mp patch --force'
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Changes: - Expose a `force_set_head` function from the `MessageQueue` pallet via a new trait: `ForceSetHead`. This can be used to force the MQ pallet to process this queue next. - The change only exposes an internal function through a trait, no audit is required. ## Context For the Asset Hub Migration (AHM) we need a mechanism to prioritize the inbound upward messages and the inbound downward messages on the AH. To achieve this, a minimal (and no breaking) change is done to the MQ pallet in the form of adding the `force_set_head` function. An example use of how to achieve prioritization is then demonstrated in `integration_test.rs::AhmPrioritizer`. Normally, all queues are scheduled round-robin like this: `| Relay | Para(1) | Para(2) | ... | Relay | ... ` The prioritizer listens to changes to its queue and triggers if either: - The queue processed in the last block (to keep the general round-robin scheduling) - The queue did not process since `n` blocks (to prevent starvation if there are too many other queues) In either situation, it schedules the queue for a streak of three consecutive blocks, such that it would become: `| Relay | Relay | Relay | Para(1) | Para(2) | ... | Relay | Relay | Relay | ... ` It basically transforms the round-robin into an elongated round robin. Although different strategies can be injected into the pallet at runtime, this one seems to strike a good balance between general service level and prioritization. --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: muharem <[email protected]>
Changes:
force_set_head
function from theMessageQueue
pallet via a new trait:ForceSetHead
. This can be used to force the MQ pallet to process this queue next.Context
For the Asset Hub Migration (AHM) we need a mechanism to prioritize the inbound upward messages and the inbound downward messages on the AH. To achieve this, a minimal (and no breaking) change is done to the MQ pallet in the form of adding the
force_set_head
function.An example use of how to achieve prioritization is then demonstrated in
integration_test.rs::AhmPrioritizer
. Normally, all queues are scheduled round-robin like this:| Relay | Para(1) | Para(2) | ... | Relay | ...
The prioritizer listens to changes to its queue and triggers if either:
n
blocks (to prevent starvation if there are too many other queues)In either situation, it schedules the queue for a streak of three consecutive blocks, such that it would become:
| Relay | Relay | Relay | Para(1) | Para(2) | ... | Relay | Relay | Relay | ...
It basically transforms the round-robin into an elongated round robin. Although different strategies can be injected into the pallet at runtime, this one seems to strike a good balance between general service level and prioritization.