* Properly set the max proof size weight on defaults and tests
* cargo fmt
* Set proper max proof size for contracts pallet tests
* Properly set max proof size for node
* Properly set max proof size for frame system mock
* Update test expectations
* Update test expectations
* Properly set max proof size for balances mock
* Update test expectations
* Update test expectations
* Properly set max proof size for democracy mock
* Properly set max proof size for scheduler mock
* Properly set max proof size for fast unstake mock
* Properly set max proof size for tx payment mock
* Properly set max proof size for elections phragmen mock
* Properly set max proof size for node template
* add failing test for itamar
* an ugly example of fast unstake
* Revert "add failing test for itamar"
This reverts commit 16c4d8015698a0684c090c54fce8b470a2d2feb2.
* fast unstake wip
* clean it up a bit
* some comments
* on_idle logic
* fix
* comment
* new working version, checks all pass, looking good
* some notes
* add mock boilerplate
* more boilerplate
* simplify the weight stuff
* ExtBuilder for pools
* fmt
* rm bags-list, simplify setup_works
* mock + tests boilerplate
* make some benchmarks work
* mock boilerplate
* tests boilerplate
* run_to_block works
* add Error enums
* add test
* note
* make UnstakeRequest fields pub
* some tests
* fix origin
* fmt
* add fast_unstake_events_since_last_call
* text
* rewrite some benchmes and fix them -- the outcome is still strange
* Fix weights
* cleanup
* Update frame/election-provider-support/solution-type/src/single_page.rs
* fix build
* Fix pools tests
* iterate teset + mock
* test unfinished
* cleanup and add some tests
* add test successful_multi_queue
* comment
* rm Head check
* add TODO
* complete successful_multi_queue
* + test early_exit
* fix a lot of things above the beautiful atlantic ocean 🌊
* seemingly it is finished now
* Fix build
* ".git/.scripts/fmt.sh" 1
* Fix slashing amount as well
* better docs
* abstract types
* rm use
* import
* Update frame/nomination-pools/benchmarking/src/lib.rs
Co-authored-by: Nitwit <47109040+nitwit69@users.noreply.github.com>
* Update frame/fast-unstake/src/types.rs
Co-authored-by: Nitwit <47109040+nitwit69@users.noreply.github.com>
* Fix build
* fmt
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* make bounded
* feedback from code review with Ankan
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/fast-unstake/src/lib.rs
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Update frame/fast-unstake/src/mock.rs
* update to master
* some final review comments
* fmt
* fix clippy
* remove unused
* ".git/.scripts/fmt.sh" 1
* make it all build again
* fmt
* undo fishy change
Co-authored-by: Ross Bulat <ross@jkrbinvestments.com>
Co-authored-by: command-bot <>
Co-authored-by: Nitwit <47109040+nitwit69@users.noreply.github.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* replace pallet level unboundedness to individual storage items
* bound structs
* bounding history depth
* defensive error
* use the era history depth from config
* clean up history depth from storage in v11
* keep the name HistoryDepth for the new configuration value
* use u32 for history depth in node runtime
* improve doc comments
* add HistoryDepth to mock runtimes with pallet-staking
* rustfmt
* refactor and doc improve
* apply re-benchmarked weight for staking
* pr feedback improvements
* test for claimed rewards following the expected bounds
* refactor test to calculate first and last reward era programmatically
* verify previous eras cannot be claimed
* add migration v12
* ".git/.scripts/bench-bot.sh" pallet dev pallet_staking
* fix compiler error
* corrupting history depth does not lead to catastrophic issue
* fix new line
* remove unused import
* fmt
* add test to document scenario where history depth is reduced without migration
* fmt
* Update frame/staking/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Update frame/staking/src/migrations.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* doc for all storage items bounded by HistoryDepth
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Update frame/staking/src/tests.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* pr feedback fixes
* Update frame/staking/src/tests.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* remove extra checks
* fix merge
* fmt
Co-authored-by: command-bot <>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: kianenigma <kian@parity.io>
* Use `array-bytes` for All Array/Bytes/Hex Operations
Signed-off-by: Xavier Lau <xavier@inv.cafe>
* Reorder
* Self Review
* Format
* Fix Tests
* Bump `array-bytes`
* Optimize large test res
Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: parity-processbot <>
* BREAKING: Rename Origin
* more renaming
* a bit more renaming
* fix
* more fixing
* fix in frame_support
* even more fixes
* fix
* small fix
* ...
* update .stderr
* docs
* update docs
* update docs
* docs
* initial setup
* add WhitelistedStorageKeys trait
* add (A, B) tuple implementation for whitelisted_storage_keys()
* fix formatting
* implement WhitelistedStorageKeys for all tuple combinations
* impl_for_tuples up to 128 for WhitelistedStorageKeys
* refactor to #[benchmarking(cached)]
* tweak error message and mark BlockNumber as cached
* add benchmarking(cached) to the other default types
* add docs for benchmarking(cached)
* properly parse storage type declaration
* make storage_alias structs public so we can use them in this macro
* use BTreeMap since TrackedStorageKey missing Ord outside of std
* make WhitelistedStorageKeys accessible
* basic detection of benchmarking(cached) 💥
* proper parsing of #[benchmarking(cached)] from pallet parse macro
* store presence of #[benchmarking(cached)] macro on StorageDef
* will be used for later expansion
* compiling blank impl for WhitelistedStorageKeys
* move impl to expand_pallet_struct
* use frame_support::sp_std::vec::Vec properly
* successfully compiling with storage info loaded into a variable 💥
* plausible implementation for whitelisted_storage_keys()
* depends on the assumption that storage_info.encode() can be loaded
into TrackedStorageKey::new(..)
* use Pallet::whitelisted_storage_keys() instead of hard-coded list
* AllPallets::whitelisted_storage_keys() properly working 💥
* collect storage names
* whitelisted_storage_keys() impl working 💥
* clean up
* fix compiler error
* just one compiler error
* fix doc compiler error
* use better import path
* fix comment
* whoops
* whoops again
* fix macro import issue
* cargo fmt
* mark example as ignore
* use keyword tokens instead of string parsing
* fix keyword-based parsing of benchmarking(cached)
* preliminary spec for check_whitelist()
* add additional test for benchmarking whitelist
* add TODO note
* remove irrelevant line from example
* use filter_map instead of filter and map
* simplify syntax
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* clean up
* fix test
* fix tests
* use keyword parsing instead of string parsing
* use collect() instead of a for loop
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* fix compiler error
* clean up benchmarking(cached) marking code
* use cloned()
* refactor to not use panic! and remove need for pub types in storage_alias
* remove unneeded use
Co-authored-by: Bastian Köcher <info@kchr.de>
* remove unneeded visibility changes
* don't manually hard code hash for treasury account as hex
* proper Ord, PartialOrd, and Hash impls for TrackedStorageKey
* now based just on key, and available in no-std
* use BTreeSet instead of BTreeMap
* fix comments
* cargo fmt
* switch to pallet::whitelist and re-do it basti's way :D
* make PartialOrd for TrackedStorageKey consistent with Ord
* more correct implementation of hash-related traits for TrackedStorageKey
* fix integration test
* update TODO
* remove unused keyword
* remove more unused keywords
* use into_iter()
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* Update frame/support/procedural/src/pallet/parse/mod.rs
Co-authored-by: Bastian Köcher <info@kchr.de>
* add docs for whitelisted
* fix comment
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
* Fetch babe config data from runtime state
* Some renaming
* More renaming
* Final nits
* Fix tests and benches
* Rename to in BabeConfiguration
* Remove duplicate babe parameter description
Already specified over the 'PRIMARY_PROBABILITY' constant value
* trigger pipeline
* trigger pipeline
* update api
* update
* remove unused
* remove `one` api
* fix unused
* fmt
* add saturating accrue
* remove `Weight::new()`
* use some macros
* div makes no sense
* Update weight_v2.rs
* missed some
* more patch
* fixes
* more fixes
* more fix
* more fix
* Update frame/support/src/weights/weight_v2.rs
* not needed
* fix weight file
* add missing version to dependencies
* Huh
* add features more
* more fixing
* last touches
* it all finally works
* remove some feature gates
* remove unused
* fix old macro
* make it work again
* fmt
* remove unused import
* ".git/.scripts/fmt.sh" 1
* Cleanup more
* fix and rename everything
* a few clippy fixes
* Add try-runtime feature
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* small fixes
* fmt
* Update bin/node-template/runtime/src/lib.rs
* fix build
* Update utils/frame/try-runtime/cli/src/lib.rs
Co-authored-by: David <dvdplm@gmail.com>
* Update utils/frame/try-runtime/cli/src/commands/execute_block.rs
Co-authored-by: David <dvdplm@gmail.com>
* address all review comments
* fix typos
* revert spec change
* last touches
* update docs
* fmt
* remove some debug_assertions
* fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: David <dvdplm@gmail.com>
* Alliance pallet: add force_set_members instead of init_members function
* benchmark with witness data
* remove invalid limit for clear
* Apply suggestions from code review
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Revert "remove invalid limit for clear"
This reverts commit dba54e3071b63bfea908087aef213f4640e3ccbf.
* compile constructor only for test
* Update comments for force_set_members
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* ".git/.scripts/bench-bot.sh" pallet dev pallet_alliance
* benchmark - founders count range
* Revert "benchmark - founders count range"
This reverts commit aad16796f8dfed48079fb7f587b8f5b59382cda6.
* witness members count instead votable members count
* update the doc
* use decode_len for witness data checks
* change witness data member count to voting member count; update clear limits
* ".git/.scripts/bench-bot.sh" pallet dev pallet_alliance
* merge master
* fixes after merge master
* revert to cb3e63
* disband alliance and return deposits
* revert debug changes
* weights
* update docs
* update test comments
* Apply Joe suggestions from code review
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* rename event from AllianceDisband to AllianceDisbanded
* ".git/.scripts/bench-bot.sh" pallet dev pallet_alliance
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: command-bot <>
* Transaction payment RPC calls: query call info
* transaction payment pallet - runtime api - add query_call info and fee_details
* remove unused deps
* separate call runtime api
* undo fmt for unchanged code
* system config call bounded to GetDispatchInfo, drop Call generic for query call info/fee
* impl GetDispatchInfo for Extrinsics within runtime test-utils
* introduced runtime api methods accept encoded Call instead of Call type
* replace Bytes by Vec, docs for for new api, drop len argument, drop GetDispatchInfo bound from system_Config::Call
* clean up toml and extra impl for dropped bound
* panic if Call can not be decoded
* revert to d43ba2f
* fmt and docs
* rustfmt
* make pool roles optional
* undo lock file changes?
* add migration
* add the ability for pools to chill themselves
* boilerplate of tests
* somewhat stable, but I think I found another bug as well
* Fix it all
* Add more more sophisticated test + capture one more bug.
* Update frame/staking/src/lib.rs
* reduce the diff a little bit
* add some test for the slashing bug
* cleanup
* fix lock file?
* Fix
* fmt
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/mock.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix build
* fix some fishy tests..
* add one last integrity check for MinCreateBond
* remove bad assertion -- needs to be dealt with later
* nits
* fix tests and add benchmarks for chill
* remove stuff
* fix benchmarks
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* remove defensive
* first working version
* bring back all tests
* ALL new tests work now
* cleanup
* make sure benchmarks and all work
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_nomination_pools --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/nomination-pools/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* round of self-review, make arithmetic safe
* fix warn
* add migration code
* Fix doc
* add precision notes
* make arithmetic fallible
* fix node runtime
* a lot of precision tests and notes and stuff
* document MaxPOintsToBalance better
* :round of self-review
* fmt
* fix some comments
* Fix proportional slashing logic
* Update frame/nomination-pools/src/tests.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/tests.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* track poinst in migration
* fix
* fmt
* fix migration
* remove event read
* Apply suggestions from code review
* Update frame/staking/src/lib.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Update frame/nomination-pools/src/lib.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* update
* fmt
* fmt
* add one last test
* fmt
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Parity Bot <admin@parity.io>
* save
* builds and old tests pass
save: temporary value dropped while borrowed
save: finally builds
test updated but still fails
* type names enhanced
* VarSizedKey bounded to new Config param
* improved wasm runtime updated funcs
* unstable-interface tests fixed
* benchmarks fixed
* Apply suggestions from code review
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
* fixes on feedback
* fixes on feedback applied + make it build
* benchmarks build but fail (old)
* "Original code too large"
* seal_clear_storage bench fixed (code size workaround hack removal tbd)
* bench_seal_clear_storage pass
* bench_seal_take_storage ... ok
* added new seal_set_storage + updated benchmarks
* added new seal_get_storage + updated benchmarks
* added new seal_contains_storage + updated benchmarks
* added tests for _transparent exec functions
* wasm test for clear_storage
* wasm test for take_storage
* wasm test for new set_storage
* wasm test for new get_storage
* wasm test for new contains_storage
* CI fix
* ci fix
* ci fix
* ci fix
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* fixes according to the review feedback
* tests & benchmarks fixed
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* refactoring
* fix to runtime api
* ci fix
* ctx.get_storage() factored out
* ctx.contains_storage() factored out
* number of batches reduced for transparent hashing storage benchmarks
* contracts RPC & pallet::get_storage to use transparent hashing
* node and rpc updated to use get_storage with VarSizedKey
* refactored (more concize)
* refactored contains_storage (DRYed)
* refactored contains_storage (DRYed)
* fix rpc
* fmt fix
* more fixes in rpc
* rollback `Pallet:get_storage` to Vec<u8> and rpc and node parts related to it
* added `KeyDecodingFailed` error
* Revert weird "fmt fix"
This reverts commit c582cfff4b5cb2c9929fd5e3b45519bb24aeb657.
* node-executor basic test update
* fix node-executor basic test
* benchmarks fix
* more benchmarks fix
* FixedSizedKey is hidden from pub, VarSizedKey is exported as StorageKey
* ci fix
* set_storage benchmark fix
* ci fix
* ci fix
* comments improved
* new error code to rpc: KEY_DECODING_FAILED
* Put `rusty-cachier` before PR merge into `master` for `cargo-check-benches` job
* cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* minor optimization
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Vladimir Istyufeev <vladimir@parity.io>
Co-authored-by: command-bot <>
* Initial implementation of mms
* Some more attempts at `mms`
* Functioning `MMS` algorithm implementation.
Adding some tests too
* More tests and typos fixed.
* Adding fuzzer for `mms`
(but could not test it on Mac M1)
* Missing imports
* Fixing rustdoc
* More accurate implementation of `mms`
* Removing the fuzzer `mms` implementation
* Implementing `NposSolver` for `MMS`
had to add the `Clone` trait, maybe I could see if I can get rid of it.
* Fixing rust docs by adding () to resolve ambiguity
* Amending `unwrap` to `expect`
removing unneeded `Clone` trait
* Removing redundant `mms3.rs`
* Implementing `BalancingConfig` and rustdoc changes
* Implementing `weight` for `MMS`
* Implementing `weight` for `MMS`
* Fixing post merge
* Initial implementation of mms
* Some more attempts at `mms`
* Functioning `MMS` algorithm implementation.
Adding some tests too
* More tests and typos fixed.
* Adding fuzzer for `mms`
(but could not test it on Mac M1)
* Missing imports
* Fixing rustdoc
* More accurate implementation of `mms`
* Removing the fuzzer `mms` implementation
* Implementing `NposSolver` for `MMS`
had to add the `Clone` trait, maybe I could see if I can get rid of it.
* Amending `unwrap` to `expect`
removing unneeded `Clone` trait
* Fixing rust docs by adding () to resolve ambiguity
* Removing redundant `mms3.rs`
* Implementing `BalancingConfig` and rustdoc changes
* Implementing `weight` for `MMS`
* Implementing `weight` for `MMS`
* Fixing post merge
* Removing left over from rebase
* Fixing tests
* Removing unneeded import
* Removing unneeded functions
* Removing useless imports
Co-authored-by: kianenigma <kian@parity.io>
* Ranked Collective pallet
* Fixes
* benchmarks
* Weights
* Allow class voting in rank
Use bare ayes for calculating support.
Allow only promotion/demotion by one rank only.
Allow removal of member with rank zero only.
Use new Tally API
* Index by rank, still O(1).
* Custom vote weights
* Formatting
* Update frame/ranked-collective/src/lib.rs
* Broken :(
* origin guard; cleanup uses new API
* Formatting
* Promote/demote by rank
* Formatting
* Use new API
* Remove code in another PR
* Remove code in another PR
* Formatting
* Remove code in another PR
* Docs
* Docs
* Bump
* Fixes
* Formatting
* Fixes
* Introduce `WeightToFee` trait instead of `WeightToFeePolynomial` and make `WeightToFeePolynomial` implement it instead
* Rename `WeightToFee::calc()` to `WeightToFee::wight_to_fee()`
* Fix typo