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

Add retry mechanics to pallet-scheduler #3060

Merged
merged 44 commits into from
Feb 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
328d0cd
Add option to retry task in scheduler
georgepisaltu Jan 23, 2024
6f56d9f
Add unit tests for retry scheduler
georgepisaltu Jan 23, 2024
22800c5
Add benchmarks for retry scheduler
georgepisaltu Jan 24, 2024
9315c2e
Add some docs to retry functions
georgepisaltu Jan 25, 2024
5bbd31e
Remove redundant clone
georgepisaltu Jan 25, 2024
3eb8016
Add real weights to scheduler pallet
georgepisaltu Jan 25, 2024
9ecae46
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Jan 25, 2024
fcff15c
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_sched…
Jan 25, 2024
a8fd732
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_sched…
Jan 25, 2024
3e6e77e
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
Jan 25, 2024
9120d60
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_sched…
Jan 25, 2024
4167d6f
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_sched…
Jan 25, 2024
816906a
Use `TaskAddress` in `set_retry`
georgepisaltu Jan 26, 2024
8a28ea5
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Jan 26, 2024
900d2d5
Add prdoc
georgepisaltu Jan 26, 2024
05cbdfc
Refactor agenda query in `set_retry`
georgepisaltu Jan 26, 2024
5fc62f4
Minor renames and fixes
georgepisaltu Jan 26, 2024
5e305e1
Refactor `schedule_retry` return type
georgepisaltu Jan 26, 2024
5943dcc
Implement `ensure_privilege`
georgepisaltu Jan 26, 2024
690f2b8
Add event for setting retry config
georgepisaltu Jan 26, 2024
4a81417
Make retry fail if insufficient weight
georgepisaltu Jan 29, 2024
438effb
Remove redundant weight parameter in `set_retry`
georgepisaltu Jan 29, 2024
d048760
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Jan 29, 2024
3c2b540
Add test for dropping insufficient weight retry
georgepisaltu Jan 29, 2024
7a39a69
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Jan 29, 2024
2e8f954
Clean up retry config on cancel
georgepisaltu Feb 1, 2024
7dfb517
Small refactor
georgepisaltu Feb 1, 2024
2e26707
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Feb 1, 2024
40b567d
Add docs to retry config map
georgepisaltu Feb 1, 2024
2b35465
Add retry count to `RetrySet` event
georgepisaltu Feb 2, 2024
a43df52
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Feb 2, 2024
9da58c6
Make retries independent of periodic runs
georgepisaltu Feb 7, 2024
2976dac
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Feb 7, 2024
8ce66f7
Small refactoring
georgepisaltu Feb 13, 2024
dc9ef2e
Add `cancel_retry` extrinsics
georgepisaltu Feb 13, 2024
945a095
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Feb 13, 2024
39eb209
Add e2e unit test for retry schedule
georgepisaltu Feb 14, 2024
2290240
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Feb 14, 2024
50a2010
Simplify `schedule_retry`
georgepisaltu Feb 15, 2024
e9cc27e
Add docs for `as_retry`
georgepisaltu Feb 15, 2024
497100c
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Feb 15, 2024
863bec7
Update doc comments for `set_retry`
georgepisaltu Feb 16, 2024
7a16648
Merge remote-tracking branch 'upstream/master' into retry-schedule
georgepisaltu Feb 16, 2024
b72da0c
Move common logic under `do_cancel_retry`
georgepisaltu Feb 16, 2024
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
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_sched…
…uler
command-bot committed Jan 25, 2024
commit a8fd732f4f8633e9caec2e9423a73fb21da357af
129 changes: 66 additions & 63 deletions polkadot/runtime/westend/src/weights/pallet_scheduler.rs
Original file line number Diff line number Diff line change
@@ -17,22 +17,23 @@
//! Autogenerated weights for `pallet_scheduler`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-01-25, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-01-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `Georges-MacBook-Pro.local`, CPU: `<UNKNOWN>`
//! HOSTNAME: `runner-grjcggob-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("westend-dev")`, DB CACHE: 1024

// Executed Command:
// ./target/release/polkadot
// target/production/polkadot
// benchmark
// pallet
// --chain=westend-dev
// --steps=2
// --repeat=2
// --pallet=pallet_scheduler
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_scheduler
// --chain=westend-dev
// --header=./polkadot/file_header.txt
// --output=./polkadot/runtime/westend/src/weights/

@@ -53,8 +54,8 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `69`
// Estimated: `1489`
// Minimum execution time: 4_000_000 picoseconds.
Weight::from_parts(7_000_000, 0)
// Minimum execution time: 3_220_000 picoseconds.
Weight::from_parts(3_512_000, 0)
.saturating_add(Weight::from_parts(0, 1489))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -64,22 +65,22 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[0, 50]`.
fn service_agenda_base(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `42 + s * (178 ±0)`
// Measured: `116 + s * (177 ±0)`
// Estimated: `42428`
// Minimum execution time: 5_000_000 picoseconds.
Weight::from_parts(6_000_000, 0)
// Minimum execution time: 3_565_000 picoseconds.
Weight::from_parts(6_102_216, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 28_284
.saturating_add(Weight::from_parts(420_000, 0).saturating_mul(s.into()))
// Standard Error: 1_413
.saturating_add(Weight::from_parts(339_016, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
fn service_task_base() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_000_000 picoseconds.
Weight::from_parts(5_000_000, 0)
// Minimum execution time: 2_940_000 picoseconds.
Weight::from_parts(3_070_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: `Preimage::PreimageFor` (r:1 w:1)
@@ -91,13 +92,13 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[128, 4194304]`.
fn service_task_fetched(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `210 + s * (1 ±0)`
// Estimated: `3676 + s * (1 ±0)`
// Minimum execution time: 19_000_000 picoseconds.
Weight::from_parts(19_904_705, 0)
.saturating_add(Weight::from_parts(0, 3676))
// Standard Error: 2
.saturating_add(Weight::from_parts(744, 0).saturating_mul(s.into()))
// Measured: `217 + s * (1 ±0)`
// Estimated: `3682 + s * (1 ±0)`
// Minimum execution time: 16_602_000 picoseconds.
Weight::from_parts(16_834_000, 0)
.saturating_add(Weight::from_parts(0, 3682))
// Standard Error: 10
.saturating_add(Weight::from_parts(1_307, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into()))
@@ -108,47 +109,47 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_000_000 picoseconds.
Weight::from_parts(7_000_000, 0)
// Minimum execution time: 4_202_000 picoseconds.
Weight::from_parts(4_383_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
fn service_task_periodic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_000_000 picoseconds.
Weight::from_parts(5_000_000, 0)
// Minimum execution time: 2_917_000 picoseconds.
Weight::from_parts(3_043_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
fn execute_dispatch_signed() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_000_000 picoseconds.
Weight::from_parts(4_000_000, 0)
// Minimum execution time: 1_707_000 picoseconds.
Weight::from_parts(1_802_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
fn execute_dispatch_unsigned() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_000_000 picoseconds.
Weight::from_parts(4_000_000, 0)
// Minimum execution time: 1_671_000 picoseconds.
Weight::from_parts(1_796_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(38963), added: 41438, mode: `MaxEncodedLen`)
/// The range of component `s` is `[0, 49]`.
fn schedule(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `42 + s * (178 ±0)`
// Measured: `116 + s * (177 ±0)`
// Estimated: `42428`
// Minimum execution time: 16_000_000 picoseconds.
Weight::from_parts(17_000_000, 0)
// Minimum execution time: 9_313_000 picoseconds.
Weight::from_parts(12_146_613, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 22_817
.saturating_add(Weight::from_parts(336_734, 0).saturating_mul(s.into()))
// Standard Error: 1_381
.saturating_add(Weight::from_parts(360_418, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -161,11 +162,11 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `116 + s * (177 ±0)`
// Estimated: `42428`
// Minimum execution time: 18_000_000 picoseconds.
Weight::from_parts(20_479_591, 0)
// Minimum execution time: 13_079_000 picoseconds.
Weight::from_parts(12_921_017, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 68_451
.saturating_add(Weight::from_parts(520_408, 0).saturating_mul(s.into()))
// Standard Error: 1_112
.saturating_add(Weight::from_parts(538_089, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
@@ -176,13 +177,13 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[0, 49]`.
fn schedule_named(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `42 + s * (191 ±0)`
// Measured: `293 + s * (185 ±0)`
// Estimated: `42428`
// Minimum execution time: 15_000_000 picoseconds.
Weight::from_parts(15_500_000, 0)
// Minimum execution time: 12_458_000 picoseconds.
Weight::from_parts(16_009_539, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 42_072
.saturating_add(Weight::from_parts(479_591, 0).saturating_mul(s.into()))
// Standard Error: 2_260
.saturating_add(Weight::from_parts(399_245, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
@@ -193,13 +194,13 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[1, 50]`.
fn cancel_named(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `140 + s * (188 ±0)`
// Measured: `319 + s * (185 ±0)`
// Estimated: `42428`
// Minimum execution time: 17_000_000 picoseconds.
Weight::from_parts(17_734_693, 0)
// Minimum execution time: 15_173_000 picoseconds.
Weight::from_parts(15_602_728, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 87_183
.saturating_add(Weight::from_parts(765_306, 0).saturating_mul(s.into()))
// Standard Error: 1_302
.saturating_add(Weight::from_parts(557_878, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
@@ -210,13 +211,15 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
/// Storage: `Scheduler::Lookup` (r:0 w:1)
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
/// The range of component `s` is `[1, 50]`.
fn check_retry(_s: u32, ) -> Weight {
fn check_retry(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `197`
// Estimated: `42428`
// Minimum execution time: 15_000_000 picoseconds.
Weight::from_parts(16_510_204, 0)
// Minimum execution time: 13_531_000 picoseconds.
Weight::from_parts(13_985_249, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 619
.saturating_add(Weight::from_parts(39_068, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -229,11 +232,11 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `116 + s * (177 ±0)`
// Estimated: `42428`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(12_275_510, 0)
// Minimum execution time: 8_050_000 picoseconds.
Weight::from_parts(8_440_627, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 77_711
.saturating_add(Weight::from_parts(224_489, 0).saturating_mul(s.into()))
// Standard Error: 788
.saturating_add(Weight::from_parts(237_669, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -246,13 +249,13 @@ impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[1, 50]`.
fn set_retry_named(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `138 + s * (190 ±0)`
// Measured: `325 + s * (185 ±0)`
// Estimated: `42428`
// Minimum execution time: 13_000_000 picoseconds.
Weight::from_parts(13_612_244, 0)
// Minimum execution time: 10_876_000 picoseconds.
Weight::from_parts(11_708_172, 0)
.saturating_add(Weight::from_parts(0, 42428))
// Standard Error: 64_536
.saturating_add(Weight::from_parts(387_755, 0).saturating_mul(s.into()))
// Standard Error: 1_114
.saturating_add(Weight::from_parts(261_854, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
Loading