This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Backport Staking Fixes for Polkadot v0.8.31#9135
Closed
shawntabrizi wants to merge 24 commits intopolkadot-v0.8.30from
Closed
Backport Staking Fixes for Polkadot v0.8.31#9135shawntabrizi wants to merge 24 commits intopolkadot-v0.8.30from
shawntabrizi wants to merge 24 commits intopolkadot-v0.8.30from
Conversation
* [pallet-staking] Refund unused weight for `payout_stakers` fixes #8428 * Use periods in comments * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Address Shawn's Feedback * Assert monotomic weights && improve test note * Remove stray new line * debug_assert payout_count <= max * Only track payouts to nominators; not validators * Trivial comment update Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
* Bring back the on_finalize weighg of stakin. * Better logs * Also make a few things pub * Fix build * Add assertions * Add test. * remove dbg * Update frame/election-provider-multi-phase/src/unsigned.rs * Update frame/staking/src/tests.rs * Fix * Fix * Update frame/election-provider-multi-phase/src/unsigned.rs
* helper macro to create storage types on the fly * Update frame/support/src/lib.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * update lock * fix test; * Fix line width Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* Removed can_report api from OnOffenceHandler * Removed DeferredOffences and create a storage migration * Removed missing comments * Mock set_deferred_offences and deferred_offences methods * OnOffenceHandler::on_offence always succeed * Fix benchmark tests * Fix runtime-benchmark cfg methods * Removed 'applied' attribute from Offence event * refactor deprecated deferred offences getter * Validate if offences are submited after on_runtime_upgrade * update changelog * Remove empty lines * Fix remove_deferred_storage weights * Remove Offence::on_runtime_upgrade benchmark * Revert CHANGELOG.md update * Deprecate DeferredOffenceOf type * Update copyright Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Add migration logs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Fix migration log * Remove unused import * Add migration tests * rustfmt * use generate_storage_alias! macro * Refactor should_resubmit_deferred_offences test * Replace spaces by tabs * Refactor should_resubmit_deferred_offences test * Removed WeightSoftLimit * Removed WeightSoftLimit from tests and mocks * Remove unused imports * Apply suggestions from code review Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Emit `Bonded` event when rebonding * fix borrow checker * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs Co-authored-by: Parity Bot <admin@parity.io>
* Migrate staking pallet to pallet attribute macro. * HistoryDepth default value. * Make all calls public. * Update frame/staking/src/lib.rs * remove externalities again * Update lib.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
…mission. (#8912) * Implementation but weird initial era in tests * Emergency mode for elections. (#8918) * do some testing, some logging. * some testing apparatus * genesis election provider (#8970) * genesis election provider * fix historical stuff * Fix test * remove dbg * Apply suggestions from code review Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> * capitalize comment and name without conflict * fix log * Update frame/election-provider-multi-phase/src/lib.rs * Update frame/election-provider-multi-phase/src/lib.rs Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> * apply suggestion on tests * remove testing modifications * Apply suggestions from code review Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Dmitry Kashitsyn <korvin@deeptown.org> * apply suggestion * fix master merge Co-authored-by: kianenigma <kian@parity.io> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> Co-authored-by: Dmitry Kashitsyn <korvin@deeptown.org>
* start count * track count * add max limit * min bonds for participating * respect min bond when unbonding * revert a bit of u32 * fix merge * more merge fixes * update to `Current*` * add helper functions * Update frame/staking/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * fix * minbond as storage * checkpoint * chill_other * better bond tracking * MinBond to MinNominatorBond * better doc * use helper function * oops * simple hard limits to validators / nominators. * better doc * update storage version * fix tests * enable migrations * min bond tests * chill other tests * tests for max cap * check `None` on cap too * benchmarks * Update frame/staking/src/lib.rs * Update frame/staking/src/lib.rs Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> * Update frame/staking/src/lib.rs Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> * Update frame/staking/src/tests.rs Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> * fix benchmark * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs * nits * fix reap_stash benchmark * remove lower bound to min bond Co-authored-by: kianenigma <kian@parity.io> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Parity Bot <admin@parity.io> Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>
kianenigma
approved these changes
Jun 17, 2021
Contributor
kianenigma
left a comment
There was a problem hiding this comment.
Diff itself is too big, looking into staking and election changes, but commits all look okay.
Member
Author
Diff outside of staking should be very reviewable. |
shawntabrizi
commented
Jun 17, 2021
shawntabrizi
commented
Jun 17, 2021
Comment on lines
+105
to
+106
| fn on_runtime_upgrade() -> Weight { | ||
| migration::remove_deferred_storage::<T>() |
Member
Author
There was a problem hiding this comment.
^ Migration for Offences
shawntabrizi
commented
Jun 17, 2021
Comment on lines
+1385
to
1389
| if StorageVersion::<T>::get() == Releases::V6_0_0 { | ||
| migrations::v7::migrate::<T>() | ||
| } else { | ||
| T::DbWeight::get().reads(1) | ||
| } |
Member
Author
There was a problem hiding this comment.
^ Migration for Staking
* unused mmr * more unused * dyn in executor * remove `doc(inline)` * fix dyn for sp-api-test * update benchmarks * Update primitives/core/benches/bench.rs * Update primitives/core/benches/bench.rs * update another bench * fix benchmark? Co-authored-by: adoerr <0xad@gmx.net>
emostov
reviewed
Jun 17, 2021
Contributor
emostov
left a comment
There was a problem hiding this comment.
looks fine to me from eyeballing it. going to use try-runtime to double check the migration
coriolinus
approved these changes
Jun 17, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR backports a bunch of Staking pallet updates to the v0.8.30 branch of Substrate to be used for a Polkadot v0.8.31 release.
Most notably:
polkadot companion: paritytech/polkadot#3285
Need backporting to polkadot: