* staking admin can set min commission
* ".git/.scripts/bench-bot.sh" pallet dev pallet_staking
* fmt
* fix for pr comments
Co-authored-by: command-bot <>
* bounding election provider with kian
* multi phase implement bounded election provider
* election provider blanket implementation
* staking compiles
* fix test for election provider support
* fmt
* fixing epmp tests, does not compile yet
* fix epmp tests
* fix staking tests
* fmt
* fix runtime tests
* fmt
* remove outdated wip tags
* add enum error
* sort and truncate supports
* comment
* error when unsupported number of election winners
* compiling wip after kian's suggestions
* fix TODOs
* remove,fix tags
* ensure validator count does not exceed maxwinners
* clean up
* some more clean up and todos
* handle too many winners
* rename parameter for mock
* todo
* add sort and truncate rule if there are too many winners
* fmt
* fail, not swallow emergency result bound not met
* remove too many winners resolution as it can be guaranteed to be bounded
* fix benchmark
* give MaxWinners more contextual name
* make ready solution generic over T
* kian feedback
* fix stuff
* Kian's way of solvign this
* comment fix
* fix compile
* remove use of BoundedExecution
* fmt
* comment out failing integrity test
* cap validator count increment to max winners
* dont panic
* add test for bad data provider
* Update frame/staking/src/pallet/impls.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* fix namespace conflict and add test for onchain max winners less than desired targets
* defensive unwrap
* early convert to bounded vec
* fix syntax
* fmt
* fix doc
* fix rustdoc
* fmt
* fix maxwinner count for benchmarking
* add instant election for noelection
* fmt
* fix compile
* pr feedbacks
* always error at validator count exceeding max winners
* add useful error message
* pr comments
* import fix
* add checked_desired_targets
* fmt
* fmt
* fix rust doc
Co-authored-by: parity-processbot <>
Co-authored-by: kianenigma <kian@parity.io>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.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>
* 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
* 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
* Fix benchmarks and adds CI to test them
Instead of waiting for benchmarks failing in Polkadot CI, we also can just test them in Substrate :P
* Do not overflow
* Update UI test output for rust 1.62.1
* switch ci to staging image to check that everything works
* fix artifacts node-bench-regression-guard
* Imeplement `scale_info::TypeInfo` manually to silence aggressive rust warning
* Fix more clippy lints
* Make clippy happy by relying on auto-deref were possible
* Add tracking issue to the comments
* pin ci image
Co-authored-by: alvicsam <alvicsam@gmail.com>
* generate_storage_alias: Rewrite as proc macro attribute
This rewrites the `generate_storage_alias!` declarative macro as proc-macro attribute. While doing
this the name is changed to `storage_alias`. The prefix can now also be the name of a pallet. This
makes storage aliases work in migrations for all kind of chains and not just for the ones that use
predefined prefixes.
* Fix compilation and FMT
* Moare fixes
* 🤦
* ......
* Rework the syntax and support instancing
* FMT
* Prefix variants with `Storage`
* Make it compile
* Fix where clause on rust stable
* staking: Proportional ledger slashing
* Some comment cleanup
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Fix benchmarks
* FMT
* Try fill in all staking configs
* round of feedback and imp from kian
* demonstrate per_thing usage
* Update some tests
* FMT
* Test that era offset works correctly
* Update mocks
* Remove unnescary docs
* Remove unlock_era
* Update frame/staking/src/lib.rs
* Adjust tests to account for only remove when < ED
* Remove stale TODOs
* Remove dupe test
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: kianenigma <kian@parity.io>
* Allow `pallet-election-provider` to accept smaller
solutions, issue #9478
* Fixing a typo
* Adding some more tests
Removing a seemingly outdated comment
* making it a URL
* Updating test name as per suggestion
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Updating documentation to be more explicit
And to follow the general guidelines
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Fixing formatting
* `Fallback` now of type `InstantElectionProvider`
Some cleanups
* Allow `pallet-election-provider` to accept smaller
solutions, issue #9478
* Fixing a typo
* Adding some more tests
Removing a seemingly outdated comment
* making it a URL
* Updating test name as per suggestion
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Updating documentation to be more explicit
And to follow the general guidelines
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Fixing formatting
* `Fallback` now of type `InstantElectionProvider`
Some cleanups
* Merging types into one type with generics
* Removing `ConstUSize` and use `ConstU32`
* cleaning up the code
* deprecating `OnChainSequentialPhragmen`
Renaming it to `UnboundedSequentialPhragmen` which should only be used
at genesis and for testing.
Use preferrably `BoundedOnChainSequentialPhragmen`
* Amending docs
* Adding some explicit imports
* Implementing generic `BoundedOnchainExecution`
Removing the deprecated `OnChainSequentialPhragmen`
* Use the right Balancing strategy
* Refactoring `onchain::Config`
Creating `onchain::ExecutionConfig`
* Merge master
* fmt
* Name cleanups after review suggestions
* cosmetics
* renaming `instant_elect` to `elect_with_bounds`
Other corresponding changes as per @kianenigma feedback
* `BoundedOnchainExecution` -> `BoundedExecution`
And `UnboundedOnchainExecution` -> `UnboundedExecution`
* feedback from kian
* fmt + unneeded import
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: kianenigma <kian@parity.io>
* Upgraded dependencies
* Adapting code to scale v3
* Empty commit to trigger CI
* Triggering CI
* Fixing UI test
* Remove superfluous dev-dep added by #9228
* Cryout for CI
* Use proper bounded vector type for nominations
* add docs and tweak chill_other for cleanup purposes
* Fix the build
* remove TODO
* add a bit more doc
* even more docs
gushc
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* Fix the nasty bug
* also bound the Snapshot type
* fix doc test
* document bounded_vec
* self-review
* remove unused
* Fix build
* frame-support: repetition overload for bounded_vec
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* fix
* remove the need to allocate into unbounded voters etc etc
* Don't expect
* unbreal the build again
* handle macro a bit better
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Remove all stale on_runtime_upgrade hooks in the runtime
* add docs
* cleanup
* fix warn
* fix more warnings
* fix offence test
* overwrite the damn UItest
* Introduce `SecretUri`
* `inspect-key`: Adds support for `expect-public`
`expect-public` can be used to check that a given secret uri corresponds to the given public key.
This is mainly useful when the secret uri is protected by a password and a new derived account
should be generated. With `--expect-public` the user can pass the public key/account-id of the
"base" secret uri aka the one without any derivation to ensure the correct password was inserted.
* Fixes
* 🤦
* Apply suggestions from code review
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Review feedback
* FMT
* Bump the versions
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>