Glutton pallet#12833
Conversation
|
bot bench $ pallet dev pallet_glutton |
|
|
||
| let clobber = Self::waste_ref_time_iter(vec![0u8; 64], n); | ||
|
|
||
| // By casting it into a vec we can hopefully prevent the compiler from optimizing it |
There was a problem hiding this comment.
Usually you'd use something like std::ptr::read_volatile to prevent the compiler from optimizing a variable out. (These reads are guaranteed to not be elided or reordered by the compiler.)
There was a problem hiding this comment.
Interesting. Didn't know about this feature in rust. IIUC this is an unsafe function but since we are not using std::ptr::write_volatile this is kind of safe. But I still think we are better off here using our current approach. @ggwpez Thoughts?
There was a problem hiding this comment.
Yea I would rather not put unsafe into the runtime code - even if that is the more correct way.
I think it should be fine in this case, or?
There was a problem hiding this comment.
Yes, the code should be also okay the way it is. unsafe isn't that bad and we also use unsafe in the runtime (but just hidden :P).
There was a problem hiding this comment.
The way to go would probably be to just make an utility function somewhere that would wrap the unsafe call and make 100% sure it's always safe. There's at least one more place that I know of where this would be useful, if not more. :P
The thing with unsafe isn't that it should never be used, it's just that its use should be limited (it shouldn't be sprinkled all over the code), neatly encapsulated in a safe interface, and very carefully written and reviewed (ideally by experts).
But yeah, if it works then the way it is now is fine for now. It was more of a drive-by comment rather than a "hey, change this".
Co-authored-by: Koute <koute@users.noreply.github.com>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
|
bot rebase |
|
bot bench $ pallet dev pallet_glutton |
|
bot clean |
|
@ggwpez Command |
|
Any last words? Otherwise going to merge in a few hours. |
|
bot merge |
* Pov-Limit pallet * use Perbill & fixes * fixes * reads & writes * update docs * tests * calculate weight * fmt * benchmark * logic fix * naming fix * caclulate computation weight limit * make the Hasher generic * make the code compile * generate weight * fix on_idle * fix * fix * make reading generic * fix? * fixes * remove warning * fix * hasher fix :D * change value * test * actual weight and expected weight are the same * update * fix * add events * remove useless line * using actual hashing algorithm * better readability * fix nits * Update Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * add migration * hardcode proof_size in weights.rs * format * fixes * Fix weight * docs * fix * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * empty on_ilde & update weight.rs * remove migration & fix benchmark * remove migration from migrations * initialize_pallet * use blake2 * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * rename pallet * make the wasters non-generic * rename to glutton * fix * small fixes & run benchmark * increase left over ref-time in tests * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * or values * fix * generate weight * Update frame/glutton/Cargo.toml Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix nits * Adjustments Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Tweak constants Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * remove genesis config * passing tests * More precise results Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * update node-executor test * Calculate number of iterations in advance Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * increase criteria * Final fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update frame/glutton/src/tests.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * fix typos * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * expand/shrink * fmt * Revert "Update frame/glutton/src/lib.rs" This reverts commit 98a237a. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use CountedStorageMap Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add benchmark Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use manual map counter Something with the R/W count in the benchmarking result did not add up. Need to investigate but for now just using a manual counter. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use new template Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Doc+typos Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton * Apply suggestions from code review Co-authored-by: Koute <koute@users.noreply.github.com> * Add minimal README Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by: Koute <koute@users.noreply.github.com>
* Pov-Limit pallet * use Perbill & fixes * fixes * reads & writes * update docs * tests * calculate weight * fmt * benchmark * logic fix * naming fix * caclulate computation weight limit * make the Hasher generic * make the code compile * generate weight * fix on_idle * fix * fix * make reading generic * fix? * fixes * remove warning * fix * hasher fix :D * change value * test * actual weight and expected weight are the same * update * fix * add events * remove useless line * using actual hashing algorithm * better readability * fix nits * Update Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * add migration * hardcode proof_size in weights.rs * format * fixes * Fix weight * docs * fix * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * empty on_ilde & update weight.rs * remove migration & fix benchmark * remove migration from migrations * initialize_pallet * use blake2 * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * rename pallet * make the wasters non-generic * rename to glutton * fix * small fixes & run benchmark * increase left over ref-time in tests * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * or values * fix * generate weight * Update frame/glutton/Cargo.toml Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix nits * Adjustments Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Tweak constants Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * remove genesis config * passing tests * More precise results Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * update node-executor test * Calculate number of iterations in advance Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * increase criteria * Final fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update frame/glutton/src/tests.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * fix typos * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * expand/shrink * fmt * Revert "Update frame/glutton/src/lib.rs" This reverts commit 98a237a. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use CountedStorageMap Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add benchmark Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use manual map counter Something with the R/W count in the benchmarking result did not add up. Need to investigate but for now just using a manual counter. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use new template Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Doc+typos Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton * Apply suggestions from code review Co-authored-by: Koute <koute@users.noreply.github.com> * Add minimal README Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by: Koute <koute@users.noreply.github.com>
* Pov-Limit pallet * use Perbill & fixes * fixes * reads & writes * update docs * tests * calculate weight * fmt * benchmark * logic fix * naming fix * caclulate computation weight limit * make the Hasher generic * make the code compile * generate weight * fix on_idle * fix * fix * make reading generic * fix? * fixes * remove warning * fix * hasher fix :D * change value * test * actual weight and expected weight are the same * update * fix * add events * remove useless line * using actual hashing algorithm * better readability * fix nits * Update Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * add migration * hardcode proof_size in weights.rs * format * fixes * Fix weight * docs * fix * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * empty on_ilde & update weight.rs * remove migration & fix benchmark * remove migration from migrations * initialize_pallet * use blake2 * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * rename pallet * make the wasters non-generic * rename to glutton * fix * small fixes & run benchmark * increase left over ref-time in tests * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * or values * fix * generate weight * Update frame/glutton/Cargo.toml Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix nits * Adjustments Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Tweak constants Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * remove genesis config * passing tests * More precise results Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * update node-executor test * Calculate number of iterations in advance Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * increase criteria * Final fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update frame/glutton/src/tests.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * fix typos * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * expand/shrink * fmt * Revert "Update frame/glutton/src/lib.rs" This reverts commit 98a237a. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use CountedStorageMap Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add benchmark Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use manual map counter Something with the R/W count in the benchmarking result did not add up. Need to investigate but for now just using a manual counter. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use new template Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Doc+typos Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton * Apply suggestions from code review Co-authored-by: Koute <koute@users.noreply.github.com> * Add minimal README Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by: Koute <koute@users.noreply.github.com>
|
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-39/2277/1 |
* Pov-Limit pallet * use Perbill & fixes * fixes * reads & writes * update docs * tests * calculate weight * fmt * benchmark * logic fix * naming fix * caclulate computation weight limit * make the Hasher generic * make the code compile * generate weight * fix on_idle * fix * fix * make reading generic * fix? * fixes * remove warning * fix * hasher fix :D * change value * test * actual weight and expected weight are the same * update * fix * add events * remove useless line * using actual hashing algorithm * better readability * fix nits * Update Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * add migration * hardcode proof_size in weights.rs * format * fixes * Fix weight * docs * fix * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * empty on_ilde & update weight.rs * remove migration & fix benchmark * remove migration from migrations * initialize_pallet * use blake2 * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * rename pallet * make the wasters non-generic * rename to glutton * fix * small fixes & run benchmark * increase left over ref-time in tests * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * or values * fix * generate weight * Update frame/glutton/Cargo.toml Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix nits * Adjustments Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Tweak constants Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * remove genesis config * passing tests * More precise results Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * update node-executor test * Calculate number of iterations in advance Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * increase criteria * Final fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update frame/glutton/src/tests.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * fix typos * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * expand/shrink * fmt * Revert "Update frame/glutton/src/lib.rs" This reverts commit 98a237a. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use CountedStorageMap Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add benchmark Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use manual map counter Something with the R/W count in the benchmarking result did not add up. Need to investigate but for now just using a manual counter. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use new template Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Doc+typos Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton * Apply suggestions from code review Co-authored-by: Koute <koute@users.noreply.github.com> * Add minimal README Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by: Koute <koute@users.noreply.github.com>
* Pov-Limit pallet * use Perbill & fixes * fixes * reads & writes * update docs * tests * calculate weight * fmt * benchmark * logic fix * naming fix * caclulate computation weight limit * make the Hasher generic * make the code compile * generate weight * fix on_idle * fix * fix * make reading generic * fix? * fixes * remove warning * fix * hasher fix :D * change value * test * actual weight and expected weight are the same * update * fix * add events * remove useless line * using actual hashing algorithm * better readability * fix nits * Update Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * add migration * hardcode proof_size in weights.rs * format * fixes * Fix weight * docs * fix * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * empty on_ilde & update weight.rs * remove migration & fix benchmark * remove migration from migrations * initialize_pallet * use blake2 * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/pov-limit/Cargo.toml Co-authored-by: Bastian Köcher <git@kchr.de> * rename pallet * make the wasters non-generic * rename to glutton * fix * small fixes & run benchmark * increase left over ref-time in tests * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * or values * fix * generate weight * Update frame/glutton/Cargo.toml Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix nits * Adjustments Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Tweak constants Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * remove genesis config * passing tests * More precise results Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * update node-executor test * Calculate number of iterations in advance Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * increase criteria * Final fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update frame/glutton/src/tests.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/glutton/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * fix typos * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/glutton/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * expand/shrink * fmt * Revert "Update frame/glutton/src/lib.rs" This reverts commit 98a237a. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use CountedStorageMap Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add benchmark Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use manual map counter Something with the R/W count in the benchmarking result did not add up. Need to investigate but for now just using a manual counter. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use new template Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Doc+typos Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton * Apply suggestions from code review Co-authored-by: Koute <koute@users.noreply.github.com> * Add minimal README Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_glutton --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: command-bot <> Co-authored-by: Koute <koute@users.noreply.github.com>
Glutton
Pallet
The purpose of the pallet is to test the limits of Kusama. The root origin can configure what percentage of the ref-time and proof size to consume from the leftover weight.
The
on_idlehook of the pallet starts off by consuming the proof size and after that, if some ref-time is left over it runs thewaste_ref_timefunction which hashes some arbitrary data using the Blake2 hashing algorithm.The proof size consumption is achieved by reading from a storage map inside the pallet called
TrashData. The data inside this storage map has to be initialized by calling theinitialize_palletextrinsic which is only callable by the root origin.Glutton Parachains
The parachains that will be used for testing the limits of Kusama will be called
Glutton Parachains.Closes: #12772
Polkadot address: 126X27SbhrV19mBFawys3ovkyBS87SGfYwtwa8J2FjHrtbmA