Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add on_idle hook #8209

Merged
merged 48 commits into from
Mar 11, 2021
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d49a114
add in idle hook
JesseAbram Feb 26, 2021
7bb95a3
remaining weight passed through to on_idle
JesseAbram Feb 26, 2021
3bf72c5
added weight return
JesseAbram Feb 26, 2021
c4bebca
remove TODO
JesseAbram Feb 26, 2021
ad2adb9
weight adjustment fix
JesseAbram Mar 1, 2021
99a8bce
added adjusted weight into tuple
JesseAbram Mar 1, 2021
848f147
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
cf010e4
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
ff4826e
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
1a41fd1
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
4879b79
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
84820f7
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
4933986
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
45fb696
compile errors for on_idle in dispatch
JesseAbram Mar 1, 2021
c62f496
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
5f54ce2
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
39ba7a9
Update frame/support/src/dispatch.rs
JesseAbram Mar 1, 2021
5e0e9d2
on idle tuple clean up
JesseAbram Mar 1, 2021
423d5bf
register reduced weight
JesseAbram Mar 1, 2021
faeb2ce
collect and add reduced wait from on idle call
JesseAbram Mar 1, 2021
fbc2947
better demo example
JesseAbram Mar 2, 2021
4c49899
Update frame/support/procedural/src/pallet/expand/hooks.rs
JesseAbram Mar 2, 2021
d36b806
added tests to dispatch.rs
JesseAbram Mar 3, 2021
188bbdf
idle test on executive
JesseAbram Mar 3, 2021
a05b383
skip on idle if remaining weight is 0
JesseAbram Mar 4, 2021
fc8ba2b
Update frame/executive/src/lib.rs
JesseAbram Mar 4, 2021
ebb2d98
Update frame/support/src/dispatch.rs
JesseAbram Mar 4, 2021
3501d4d
abstract common logic out to functions
JesseAbram Mar 4, 2021
9e03788
docs
JesseAbram Mar 4, 2021
7f404ca
remove demo example
JesseAbram Mar 4, 2021
4e03e2c
remove debug
JesseAbram Mar 4, 2021
3c30ff3
spacing
JesseAbram Mar 4, 2021
3c76f0b
docs
JesseAbram Mar 4, 2021
b9f7bdf
revert template pallet to master
JesseAbram Mar 5, 2021
ae9a00d
Merge branch 'master' of github.com:paritytech/substrate into jesse-o…
JesseAbram Mar 5, 2021
84ead6f
change reduced weight to used weight
JesseAbram Mar 5, 2021
622fe37
remove empty line
apopiak Mar 5, 2021
7ae5ad6
lint
JesseAbram Mar 5, 2021
d3660cd
spacing
JesseAbram Mar 8, 2021
5d52fba
Update frame/support/src/traits.rs
JesseAbram Mar 8, 2021
ffbc58a
documentation
JesseAbram Mar 8, 2021
17393fc
Update frame/support/procedural/src/pallet/expand/hooks.rs
JesseAbram Mar 9, 2021
4623537
docs
JesseAbram Mar 9, 2021
84c7180
Update frame/support/src/traits.rs
JesseAbram Mar 9, 2021
9386c71
docs
JesseAbram Mar 9, 2021
02a42e3
Update frame/support/src/traits.rs
JesseAbram Mar 11, 2021
b4061e4
Update frame/support/src/traits.rs
JesseAbram Mar 11, 2021
855413b
Update frame/support/src/traits.rs
JesseAbram Mar 11, 2021
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
Update frame/support/src/traits.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
  • Loading branch information
JesseAbram and apopiak authored Mar 9, 2021
commit 84c7180ff83188eb340f9d096ec3b8339b6763c0
8 changes: 5 additions & 3 deletions frame/support/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1524,10 +1524,12 @@ pub trait OnFinalize<BlockNumber> {
/// before on finalize and based on if a remaining weight threshold is met.
pub trait OnIdle<BlockNumber> {
JesseAbram marked this conversation as resolved.
Show resolved Hide resolved
/// The block is being finalized.
/// Implement to have something happen if the remaining_weight is high enough.
/// Implement to have something happen in case there if left over weight.
/// Check the passed `remaining_weight` to make sure it is high enough to allow for
/// your pallet's extra computation.
///
/// NOTE: This function is called AFTER ALL extrinsics in a block are applied,
/// but, before on_finalize. This includes inherent extrinsics.
/// NOTE: This function is called AFTER ALL extrinsics - including inherent extrinsics -
/// in a block are applied but before `on_finalize` is executed.
fn on_idle(
_n: BlockNumber,
_remaining_weight: crate::weights::Weight
Expand Down