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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
39d653d
wip
ggwpez Oct 14, 2024
7764f54
Add QueueNextSelector
ggwpez Oct 14, 2024
d24bac9
test
ggwpez Oct 17, 2024
f6b1817
Merge remote-tracking branch 'origin/master' into oty-queue-priority
ggwpez Oct 17, 2024
05d0442
benchmark
ggwpez Oct 17, 2024
22bca9a
cleanup
ggwpez Oct 17, 2024
1a70335
fix
ggwpez Oct 17, 2024
a0530a1
Merge remote-tracking branch 'origin/master' into oty-queue-priority
ggwpez Feb 12, 2025
551350f
add mocked weights
ggwpez Feb 12, 2025
b5f4865
Update from ggwpez running command 'prdoc --bump minor --audience run…
github-actions[bot] Feb 12, 2025
604a4ec
major prdoc, since weight trait was modified
ggwpez Feb 12, 2025
7eeefb7
Update from ggwpez running command 'bench --pallet pallet_message_queue'
github-actions[bot] Feb 12, 2025
99f67a5
more weight
ggwpez Feb 12, 2025
298bad0
more weights
ggwpez Feb 12, 2025
8b7cbf1
fml
ggwpez Feb 12, 2025
b106307
Merge branch 'master' into oty-queue-priority
ggwpez Feb 12, 2025
ae94788
Update from ggwpez running command 'bench --pallet pallet_message_queue'
github-actions[bot] Feb 12, 2025
cbb3082
Update from ggwpez running command 'bench --pallet pallet_message_queue'
github-actions[bot] Feb 12, 2025
610fc25
clippy
ggwpez Feb 12, 2025
4350733
Update from ggwpez running command 'prdoc --audience runtime_dev --bu…
github-actions[bot] Feb 12, 2025
47a059c
Apply suggestions from code review
ggwpez Feb 12, 2025
2e6a4eb
Apply suggestions from code review
ggwpez Feb 13, 2025
744e830
prdoc
ggwpez Feb 13, 2025
3cc0f8c
Merge branch 'master' into oty-queue-priority
ggwpez Feb 13, 2025
e86b1e7
Merge branch 'master' into oty-queue-priority
muharem Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
benchmark
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Oct 17, 2024
commit 05d0442a956899f7b471301f30c261c54de2c246
16 changes: 16 additions & 0 deletions substrate/frame/message-queue/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,22 @@ mod benchmarks {
assert_eq!(weight.consumed(), T::WeightInfo::bump_service_head());
}

// Worst case for calling `bump_service_head`.
#[benchmark]
fn force_set_head() {
setup_bump_service_head::<T>(0.into(), 1.into());
let mut weight = WeightMeter::new();
assert_eq!(ServiceHead::<T>::get().unwrap(), 0u32.into());

#[block]
{
assert!(MessageQueue::<T>::set_service_head(&mut weight, &1u32.into()).unwrap());
}

assert_eq!(ServiceHead::<T>::get().unwrap(), 1u32.into());
assert_eq!(weight.consumed(), T::WeightInfo::set_service_head());
}

#[benchmark]
fn reap_page() {
// Mock the storage to get a *cullable* but not *reapable* page.
Expand Down
6 changes: 6 additions & 0 deletions substrate/frame/message-queue/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ impl crate::weights::WeightInfo for MockedWeightInfo {
.copied()
.unwrap_or(DefaultWeightForCall::get())
}
fn set_service_head() -> Weight {
WeightForCall::get()
.get("set_service_head")
.copied()
.unwrap_or(DefaultWeightForCall::get())
}
fn service_page_item() -> Weight {
WeightForCall::get()
.get("service_page_item")
Expand Down
19 changes: 19 additions & 0 deletions substrate/frame/message-queue/src/weights.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading