* Support running the pallet benchmarks analysis without running the benchmarks
* Rename `override-results` to `json-input` and update the help comment
* ".git/.scripts/fmt.sh" 1
Co-authored-by: command-bot <>
* Add storage size component to weights
* Rename storage_size to proof_size
* Update primitives/weights/src/weight_v2.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fixes
* cargo fmt
* Implement custom Decode and CompactAs
* Add missing import
* Fixes
* Remove CompactAs implementation
* Properly migrate from 1D weight
* Remove #[pallet::compact] from Weight parameters
* More #[pallet::compact] removals
* Add unit tests
* Set appropriate default block proof size
* cargo fmt
* Remove nonsensical weight constant
* Test only for the reference time weight in frame_system::limits
* Only check for reference time weight on idle
* Use destructuring syntax
* Update test expectations
* Fixes
* Fixes
* Fixes
* Correctly migrate from 1D weights
* cargo fmt
* Migrate using extra extrinsics instead of custom Decode
* Fixes
* Silence dispatch call warnings that were previously allowed
* Fix gas_left test
* Use OldWeight instead of u64
* Fixes
* Only check for reference time weight in election provider
* Fix test expectations
* Fix test expectations
* Use only reference time weight in grandpa test
* Use only reference time weight in examples test
* Use only reference time weight in examples test
* Fix test expectations
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
* used maxunlockingchunks from config
* mhl MaxUnlockingChunks
* no migration needed
* changes as per requested
* fmt
* fix tests
* fix benchmark
* warning in the doc for abrupt changes in the config
* less unnecessary details in the test
* fix tests
Co-authored-by: mrisholukamba <abdulrazzaqlukamba@gmail.com>
Co-authored-by: parity-processbot <>
* 1.Add pruning param "canonical" in sc-cli.
2.Make PruningMode's default value to ArchiveCanonical.
* Update tests in sc-state-db.
* Update tests in sc-state-db.
* 1.Add a new value `AllWithNonFinalized` in `enum BlocksPruning` which Corresponds to `blocks_pruning 0` in CLI .
2.Change value `All` to `AllFinalized` in `enum BlocksPruning` and make it to keep full finalized block history.
* Make some corresponding adjustments based on the content in the conversation.
* Update client/db/src/lib.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Apply suggestions from code review.
* 1.Change `blocks_pruning` to be like `state_pruning` .
* Fmt and add some doc.
* Update client/cli/src/params/pruning_params.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update client/cli/src/params/pruning_params.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
* Update doc.
* Change `new_test_with_tx_storage` to take `BlocksPruning`.
* Fmt
Co-authored-by: Bastian Köcher <git@kchr.de>
* [Enhancement] Remove optional Pool subscription from fast-unstake
* remove nomination-pools pallet dependency
* fixes
* more fixes
* more fixes
* more fixes
* Remove timestamp from SlotInfo
* Expose as millis instead of secs
* Nits
* Fix test after field removal
* Yet another test fix
* On the fly timestamp computation
* Removed slot timestamp from logs
* Removed reference to timestamp from slots subsystem
* Slot based algorithm tests do not require timstamp inherent anymore
* Remove junk files
* Further tests cleanup
* Trigger pipeline
* Apply code suggestions
* Trigger pipeline
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* 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
* Use temporary db for benchmarking
If no db option was given benchmarks shall use temporary database.
Otherwise the test can use locally stored database which maybe
out-of-date causing test to fail.
* nicer syntax
* explanatory comment added
* Update utils/frame/benchmarking-cli/src/lib.rs
Co-authored-by: Bastian Köcher <info@kchr.de>
* Receive and import target block body
* Request target block
* minor: wording
* Check for block body in the test
* Import target block justifications
* Fix: do not fail block validation if no justifications received
* Fix: import target blocks without justifications
Co-authored-by: arkpar <arkady.paronyan@gmail.com>
* 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>
Fix corner case where voter gets a single burst of finality
notifications just when it starts.
The notification stream was consumed by "wait_for_pallet" logic,
then main loop would subscribe to finality notifications, but by that
time some notifications might've been lost.
Fix this by subscribing the main loop to notifications before waiting
for pallet to become available. Share the same stream with the main loop
so that notifications for blocks before pallet available are ignored,
while _all_ notifications after pallet available are processed.
Add regression test for this.
Signed-off-by: acatangiu <adrian@parity.io>