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

Glutton pallet #12833

Merged
merged 103 commits into from
Feb 21, 2023
Merged

Glutton pallet #12833

merged 103 commits into from
Feb 21, 2023

Conversation

Szegoo
Copy link
Contributor

@Szegoo Szegoo commented Dec 3, 2022

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_idle hook of the pallet starts off by consuming the proof size and after that, if some ref-time is left over it runs the waste_ref_time function 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 the initialize_pallet extrinsic 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.

It has the double meaning of one who over-consumes (the parachain), but also one who relishes in enduring something (i.e. "glutton for punishment"), and it is seeing how much validators can endure from parachains.

Closes: #12772

Polkadot address: 126X27SbhrV19mBFawys3ovkyBS87SGfYwtwa8J2FjHrtbmA

frame/pov-limit/src/lib.rs Outdated Show resolved Hide resolved
frame/pov-limit/src/lib.rs Outdated Show resolved Hide resolved
@Szegoo Szegoo marked this pull request as ready for review December 6, 2022 21:20
frame/pov-limit/src/lib.rs Outdated Show resolved Hide resolved
frame/pov-limit/src/lib.rs Outdated Show resolved Hide resolved
@Szegoo Szegoo requested a review from bkchr December 8, 2022 07:45
frame/pov-limit/src/weights.rs Outdated Show resolved Hide resolved
frame/pov-limit/src/lib.rs Outdated Show resolved Hide resolved
@Szegoo Szegoo marked this pull request as draft December 13, 2022 08:59
@ggwpez
Copy link
Member

ggwpez commented Feb 20, 2023

bot bench $ pallet dev pallet_glutton

frame/glutton/src/lib.rs Outdated Show resolved Hide resolved
frame/glutton/src/lib.rs Outdated Show resolved Hide resolved

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
Copy link
Contributor

Choose a reason for hiding this comment

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

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.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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?

Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Member

Choose a reason for hiding this comment

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

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).

Copy link
Contributor

Choose a reason for hiding this comment

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

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".

frame/glutton/src/lib.rs Outdated Show resolved Hide resolved
frame/glutton/README.md Outdated Show resolved Hide resolved
ggwpez and others added 2 commits February 20, 2023 15:49
Co-authored-by: Koute <koute@users.noreply.github.com>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez
Copy link
Member

ggwpez commented Feb 20, 2023

bot rebase

@ggwpez
Copy link
Member

ggwpez commented Feb 20, 2023

bot bench $ pallet dev pallet_glutton

@ggwpez
Copy link
Member

ggwpez commented Feb 20, 2023

bot clean

@command-bot command-bot bot deleted a comment from substrate-tip-bot bot Feb 20, 2023
@command-bot command-bot bot deleted a comment from substrate-tip-bot bot Feb 20, 2023
@command-bot command-bot bot deleted a comment from paritytech-processbot bot Feb 20, 2023
@command-bot
Copy link

command-bot bot commented Feb 20, 2023

@ggwpez Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_glutton has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2418567 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2418567/artifacts/download.

@ggwpez
Copy link
Member

ggwpez commented Feb 21, 2023

Any last words? Otherwise going to merge in a few hours.

@ggwpez
Copy link
Member

ggwpez commented Feb 21, 2023

bot merge

@paritytech-processbot paritytech-processbot bot merged commit ea18266 into paritytech:master Feb 21, 2023
ltfschoen pushed a commit to ltfschoen/substrate that referenced this pull request Feb 22, 2023
* 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>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* 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>
Ank4n pushed a commit that referenced this pull request Feb 28, 2023
* 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>
@Polkadot-Forum
Copy link

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

ukint-vs pushed a commit to gear-tech/substrate that referenced this pull request Apr 10, 2023
* 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>
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* 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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B1-note_worthy Changes should be noted in the release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit T1-runtime This PR/Issue is related to the topic “runtime”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PoV Limit Pallet
7 participants