Benchmark Staking and Session Pallet (#5183)

* starting bench

* More

* more

* Payout Validator

* Give each validator exactly n nominators

* Update with test

* Try to add accounts to chain spec

* Undo changes to chainspec

* Payout nominator

* Rebond and Reap Stash

* Set history depth

* fix smelly code

* cancel deferred slash

* new_era bench

* do_slash benchmark

* Add features

* undo extrinsic move

* lower

* Update new era

* Update benchmarking.rs

* whitespace

* Apply suggestions from code review

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* fixes

* nit

* Refactor tests, initial code

* Move session benchmarks to avoid cyclic deps

* Update lib.rs

* Fix warnings

* Move impl

* Update to do random nominator allocation

* add feature to benchmark pallet

* Remove extra stuff

* Update based on feedback

* Less intrusive

* Remove `transfer_idle_users`

* remove again

* unused dep

* test feature flag

* Update to latest substrate

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Shawn Tabrizi
2020-03-17 15:12:04 +02:00
committed by GitHub
parent d146cc3ae3
commit 9c06d8c6f4
17 changed files with 961 additions and 333 deletions
@@ -0,0 +1,28 @@
[package]
name = "pallet-session-benchmarking"
version = "2.0.0-alpha.3"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
license = "GPL-3.0"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME sessions pallet benchmarking"
[dependencies]
sp-std = { version = "2.0.0-alpha.2", default-features = false, path = "../../../primitives/std" }
sp-runtime = { version = "2.0.0-alpha.2", default-features = false, path = "../../../primitives/runtime" }
frame-system = { version = "2.0.0-alpha.2", default-features = false, path = "../../system" }
frame-benchmarking = { version = "2.0.0-alpha.2", default-features = false, path = "../../benchmarking" }
pallet-staking = { version = "2.0.0-alpha.2", default-features = false, features = ["runtime-benchmarks"], path = "../../staking" }
pallet-session = { version = "2.0.0-alpha.2", default-features = false, path = "../../session" }
[features]
default = ["std"]
std = [
"sp-std/std",
"sp-runtime/std",
"frame-system/std",
"frame-benchmarking/std",
"pallet-staking/std",
"pallet-session/std",
]