Skip to content
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

Merged
merged 25 commits into from
Feb 14, 2025
Merged

[mq pallet] Custom next queue selectors #6059

merged 25 commits into from
Feb 14, 2025

Conversation

ggwpez
Copy link
Member

@ggwpez ggwpez commented Oct 14, 2024

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]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
@ggwpez ggwpez marked this pull request as ready for review October 17, 2024 20:50
@ggwpez ggwpez requested a review from a team as a code owner October 17, 2024 20:50
@ggwpez ggwpez added the T2-pallets This PR/Issue is related to a particular pallet. label Oct 17, 2024
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Copy link
Contributor

@seadanda seadanda left a comment

Choose a reason for hiding this comment

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

Nice, looks good

@ggwpez
Copy link
Member Author

ggwpez commented Feb 12, 2025

/cmd prdoc --bump minor --audience runtime_dev

@ggwpez
Copy link
Member Author

ggwpez commented Feb 12, 2025

/cmd bench --pallet pallet_message_queue

Copy link
Contributor

Command "bench --pallet pallet_message_queue" has started 🚀 See logs here

Copy link
Contributor

Command "bench --pallet pallet_message_queue" has finished ✅ See logs here

Subweight results:
File Extrinsic Old New Change [%]
cumulus/pallets/collator-selection/src/weights.rs leave_intent - - ERROR
cumulus/pallets/collator-selection/src/weights.rs new_session - - ERROR
cumulus/pallets/collator-selection/src/weights.rs register_as_candidate - - ERROR
cumulus/pallets/collator-selection/src/weights.rs set_invulnerables - - ERROR
cumulus/pallets/collator-selection/src/weights.rs take_candidate_slot - - ERROR
cumulus/pallets/collator-selection/src/weights.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
polkadot/runtime/westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmen - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmms - - ERROR
polkadot/runtime/westend/src/weights/pallet_message_queue.rs service_page_item 175.27us 518.97us +196.10
substrate/frame/message-queue/src/weights.rs force_set_head 131.44us Added
polkadot/runtime/westend/src/weights/pallet_message_queue.rs force_set_head 136.77us Added
polkadot/runtime/rococo/src/weights/pallet_message_queue.rs force_set_head 133.27us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_queue_base 127.88us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_page_item 470.28us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_page_base_no_completion 130.14us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_page_base_completion 130.18us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs reap_page 331.73us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs ready_ring_unknit 388.24us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs ready_ring_knit 289.74us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs force_set_head 131.57us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 421.99us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 358.75us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs bump_service_head 157.86us Added
Command output:

❌ Failed to build asset-hub-westend
❌ Failed to build asset-hub-rococo
❌ Failed to build bridge-hub-rococo
❌ Failed to build bridge-hub-westend
❌ Failed to build collectives-westend
❌ Failed to build coretime-rococo
❌ Failed to build coretime-westend
❌ Failed to build glutton-westend
❌ Failed to build people-rococo
❌ Failed to build people-westend
✅ Successful benchmarks of runtimes/pallets:
-- dev: ['pallet_message_queue']
-- westend: ['pallet_message_queue']
-- rococo: ['pallet_message_queue']
-- contracts-rococo: ['pallet_message_queue']

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
@ggwpez
Copy link
Member Author

ggwpez commented Feb 12, 2025

/cmd bench --pallet pallet_message_queue

Copy link
Contributor

Command "bench --pallet pallet_message_queue" has started 🚀 See logs here

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
@ggwpez
Copy link
Member Author

ggwpez commented Feb 12, 2025

/cmd bench --pallet pallet_message_queue

Copy link
Contributor

Command "bench --pallet pallet_message_queue" has started 🚀 See logs here

Copy link
Contributor

Command "bench --pallet pallet_message_queue" has finished ✅ See logs here

Subweight results:
File Extrinsic Old New Change [%]
cumulus/pallets/collator-selection/src/weights.rs leave_intent - - ERROR
cumulus/pallets/collator-selection/src/weights.rs new_session - - ERROR
cumulus/pallets/collator-selection/src/weights.rs register_as_candidate - - ERROR
cumulus/pallets/collator-selection/src/weights.rs set_invulnerables - - ERROR
cumulus/pallets/collator-selection/src/weights.rs take_candidate_slot - - ERROR
cumulus/pallets/collator-selection/src/weights.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
polkadot/runtime/westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmen - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmms - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs service_page_item 58.75us 480.47us +717.82
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs service_page_item 59.51us 470.20us +690.19
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs service_page_item 59.96us 472.45us +687.91
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs service_page_item 59.51us 468.74us +687.73
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs service_page_item 59.96us 471.76us +686.76
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs service_page_item 59.96us 468.42us +681.18
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs service_page_item 59.96us 467.63us +679.87
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs service_page_item 90.93us 463.07us +409.26
polkadot/runtime/westend/src/weights/pallet_message_queue.rs service_page_item 175.27us 523.60us +198.74
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 321.93us 435.27us +35.21
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 323.67us 433.67us +33.99
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 323.67us 432.69us +33.68
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 323.67us 432.62us +33.66
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 323.67us 424.02us +31.01
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 331.15us 430.52us +30.01
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 331.15us 426.65us +28.84
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs service_page_item 370.80us 455.84us +22.94
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 302.51us 369.73us +22.22
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs service_page_item 377.42us 460.45us +22.00
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 301.42us 362.89us +20.39
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 301.42us 362.50us +20.26
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 310.54us 366.89us +18.15
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 310.54us 365.71us +17.77
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 310.54us 363.81us +17.16
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 359.38us 420.60us +17.04
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs reap_page 291.37us 339.71us +16.59
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 361.63us 421.48us +16.55
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs reap_page 290.65us 336.79us +15.88
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs reap_page 291.37us 337.38us +15.79
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 310.54us 358.26us +15.37
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs reap_page 291.37us 335.94us +15.30
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs reap_page 290.65us 335.02us +15.27
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 367.53us 422.36us +14.92
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs reap_page 296.81us 340.40us +14.68
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs reap_page 291.37us 331.07us +13.63
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 320.34us 360.50us +12.54
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 318.91us 358.69us +12.47
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 324.40us 358.27us +10.44
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs reap_page 304.11us 332.45us +9.32
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs reap_page 303.50us 331.47us +9.22
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs reap_page 309.09us 331.51us +7.25
substrate/frame/message-queue/src/weights.rs set_service_head 131.42us Added
polkadot/runtime/westend/src/weights/pallet_message_queue.rs set_service_head 136.77us Added
polkadot/runtime/rococo/src/weights/pallet_message_queue.rs set_service_head 133.41us Added
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs set_service_head 131.61us Added
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs set_service_head 131.54us Added
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs set_service_head 131.48us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs set_service_head 131.39us Added
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs set_service_head 131.44us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs set_service_head 131.56us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_queue_base 127.96us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_page_item 477.75us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_page_base_no_completion 130.31us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_page_base_completion 130.17us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs reap_page 332.26us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs ready_ring_unknit 388.22us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs ready_ring_knit 289.72us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 425.75us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 360.81us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs bump_service_head 157.76us Added
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs set_service_head 131.75us Added
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs set_service_head 132.82us Added
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs set_service_head 132.67us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs set_service_head 132.60us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs set_service_head 132.46us Added
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- dev: ['pallet_message_queue']
-- westend: ['pallet_message_queue']
-- rococo: ['pallet_message_queue']
-- asset-hub-westend: ['pallet_message_queue']
-- asset-hub-rococo: ['pallet_message_queue']
-- bridge-hub-rococo: ['pallet_message_queue']
-- bridge-hub-westend: ['pallet_message_queue']
-- collectives-westend: ['pallet_message_queue']
-- contracts-rococo: ['pallet_message_queue']
-- coretime-rococo: ['pallet_message_queue']
-- coretime-westend: ['pallet_message_queue']
-- glutton-westend: ['pallet_message_queue']
-- people-rococo: ['pallet_message_queue']
-- people-westend: ['pallet_message_queue']

Copy link
Contributor

Command "bench --pallet pallet_message_queue" has failed ❌! See logs here

Command output:

✅ Successful benchmarks of runtimes/pallets:
-- dev: ['pallet_message_queue']
-- westend: ['pallet_message_queue']
-- rococo: ['pallet_message_queue']
-- asset-hub-westend: ['pallet_message_queue']
-- asset-hub-rococo: ['pallet_message_queue']
-- bridge-hub-rococo: ['pallet_message_queue']
-- bridge-hub-westend: ['pallet_message_queue']
-- collectives-westend: ['pallet_message_queue']
-- contracts-rococo: ['pallet_message_queue']
-- coretime-rococo: ['pallet_message_queue']
-- coretime-westend: ['pallet_message_queue']
-- glutton-westend: ['pallet_message_queue']
-- people-rococo: ['pallet_message_queue']
-- people-westend: ['pallet_message_queue']

@ggwpez
Copy link
Member Author

ggwpez commented Feb 12, 2025

/cmd bench --pallet pallet_message_queue

Copy link
Contributor

Command "bench --pallet pallet_message_queue" has started 🚀 See logs here

Copy link
Contributor

Command "bench --pallet pallet_message_queue" has finished ✅ See logs here

Subweight results:
File Extrinsic Old New Change [%]
cumulus/pallets/collator-selection/src/weights.rs leave_intent - - ERROR
cumulus/pallets/collator-selection/src/weights.rs new_session - - ERROR
cumulus/pallets/collator-selection/src/weights.rs register_as_candidate - - ERROR
cumulus/pallets/collator-selection/src/weights.rs set_invulnerables - - ERROR
cumulus/pallets/collator-selection/src/weights.rs take_candidate_slot - - ERROR
cumulus/pallets/collator-selection/src/weights.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs update_bond - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs take_candidate_slot - - ERROR
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_collator_selection.rs update_bond - - ERROR
polkadot/runtime/westend/src/weights/pallet_preimage.rs ensure_updated - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmen - - ERROR
substrate/frame/election-provider-support/src/weights.rs phragmms - - ERROR
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs service_page_item 58.75us 479.33us +715.87
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs service_page_item 59.51us 476.51us +700.79
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs service_page_item 59.51us 472.18us +693.51
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs service_page_item 59.96us 475.17us +692.44
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs service_page_item 59.96us 472.18us +687.46
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs service_page_item 59.96us 469.52us +683.02
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs service_page_item 59.96us 468.23us +680.86
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs service_page_item 90.93us 465.12us +411.52
polkadot/runtime/westend/src/weights/pallet_message_queue.rs service_page_item 175.27us 541.62us +209.02
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 323.67us 441.25us +36.33
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 321.93us 433.19us +34.56
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 323.67us 428.47us +32.38
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 323.67us 425.82us +31.56
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 323.67us 422.75us +30.61
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 331.15us 428.92us +29.52
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 331.15us 428.67us +29.45
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs service_page_item 370.80us 472.72us +27.49
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs service_page_item 377.42us 468.85us +24.22
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 302.51us 367.13us +21.36
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 301.42us 363.68us +20.65
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 361.63us 434.13us +20.05
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 301.42us 361.46us +19.92
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs execute_overweight_page_updated 359.38us 428.09us +19.12
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 310.54us 367.33us +18.29
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 310.54us 363.30us +16.99
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs reap_page 291.37us 339.63us +16.56
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 310.54us 360.62us +16.13
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs reap_page 291.37us 337.42us +15.81
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs reap_page 290.65us 335.72us +15.51
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs reap_page 290.65us 335.60us +15.47
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 310.54us 358.41us +15.42
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 367.53us 423.08us +15.11
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs reap_page 291.37us 334.12us +14.67
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs reap_page 296.81us 340.11us +14.59
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs reap_page 291.37us 331.52us +13.78
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 320.34us 363.98us +13.63
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs execute_overweight_page_removed 318.91us 358.64us +12.46
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs reap_page 304.11us 337.32us +10.92
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 324.40us 359.67us +10.87
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs reap_page 303.50us 332.29us +9.49
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs reap_page 309.09us 331.88us +7.37
substrate/frame/message-queue/src/weights.rs set_service_head 131.48us Added
polkadot/runtime/westend/src/weights/pallet_message_queue.rs set_service_head 136.74us Added
polkadot/runtime/rococo/src/weights/pallet_message_queue.rs set_service_head 133.17us Added
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_message_queue.rs set_service_head 131.65us Added
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs set_service_head 131.52us Added
cumulus/parachains/runtimes/glutton/glutton-westend/src/weights/pallet_message_queue.rs set_service_head 131.49us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_message_queue.rs set_service_head 131.56us Added
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs set_service_head 131.46us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs set_service_head 131.58us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_queue_base 127.89us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_page_item 461.25us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_page_base_no_completion 130.16us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs service_page_base_completion 129.99us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs reap_page 331.55us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs ready_ring_unknit 388.20us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs ready_ring_knit 289.65us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_updated 422.50us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs execute_overweight_page_removed 358.86us Added
cumulus/parachains/runtimes/contracts/contracts-rococo/src/weights/pallet_message_queue.rs bump_service_head 157.79us Added
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_message_queue.rs set_service_head 131.88us Added
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_message_queue.rs set_service_head 132.79us Added
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_message_queue.rs set_service_head 132.96us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_message_queue.rs set_service_head 132.48us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_message_queue.rs set_service_head 132.35us Added
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- dev: ['pallet_message_queue']
-- westend: ['pallet_message_queue']
-- rococo: ['pallet_message_queue']
-- asset-hub-westend: ['pallet_message_queue']
-- asset-hub-rococo: ['pallet_message_queue']
-- bridge-hub-rococo: ['pallet_message_queue']
-- bridge-hub-westend: ['pallet_message_queue']
-- collectives-westend: ['pallet_message_queue']
-- contracts-rococo: ['pallet_message_queue']
-- coretime-rococo: ['pallet_message_queue']
-- coretime-westend: ['pallet_message_queue']
-- glutton-westend: ['pallet_message_queue']
-- people-rococo: ['pallet_message_queue']
-- people-westend: ['pallet_message_queue']

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/13292690562
Failed job name: cargo-clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
@ggwpez
Copy link
Member Author

ggwpez commented Feb 12, 2025

/cmd prdoc --audience runtime_dev --bump patch --force

@ggwpez ggwpez enabled auto-merge February 13, 2025 17:11
@ggwpez ggwpez added this pull request to the merge queue Feb 14, 2025
Merged via the queue into master with commit 7aac886 Feb 14, 2025
219 of 233 checks passed
@ggwpez ggwpez deleted the oty-queue-priority branch February 14, 2025 06:03
clangenb pushed a commit to clangenb/polkadot-sdk that referenced this pull request Feb 19, 2025
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
Status: Done
Status: Backlog
Development

Successfully merging this pull request may close these issues.

4 participants