Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix elections-phragmen and proxy issue #7040

Merged
98 commits merged into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
dd4607b
Fix elections-phragmen and proxy issue
kianenigma Sep 7, 2020
6bd6221
remove TODO
kianenigma Sep 7, 2020
57de14e
Update bond to be per-vote
kianenigma Sep 8, 2020
684802e
Update frame/elections-phragmen/src/lib.rs
kianenigma Sep 9, 2020
70852fa
Fix benchmakrs
kianenigma Sep 9, 2020
4b7d0a6
Merge branch 'kiz-fix-proxy-election-drain' of github.com:paritytech/…
kianenigma Sep 9, 2020
77caa5c
Fix weight as well.
kianenigma Sep 9, 2020
06a0aa0
Add license
kianenigma Sep 9, 2020
9943042
Make weight interpreted wasm! 🤦🏻‍♂️
kianenigma Sep 9, 2020
f9bd4a3
Merge branch 'master' into kiz-fix-proxy-election-drain
gavofyork Sep 14, 2020
f9ea73a
Remove a bunch of TODOs
kianenigma Sep 14, 2020
24c416b
Add migration
kianenigma Sep 14, 2020
10e3687
Better storage version.
kianenigma Sep 14, 2020
4495ead
Functionify.
kianenigma Sep 14, 2020
3c1a2ef
Fix deposit scheme.
kianenigma Sep 17, 2020
1b95224
remove legacy bond.
kianenigma Sep 17, 2020
2c677c2
Master.into()
kianenigma Sep 17, 2020
d2ec181
Master.into()
kianenigma Sep 17, 2020
a628850
better logging.
kianenigma Sep 17, 2020
f6189d5
Fix benchmarking test
kianenigma Sep 17, 2020
e812815
Fix confused deposit collection.
kianenigma Sep 18, 2020
498376c
Add fine
kianenigma Sep 21, 2020
d9b2204
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Sep 21, 2020
4691703
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Sep 21, 2020
88db61d
Master.into()
kianenigma Sep 23, 2020
b4e2a7c
Master.into()
kianenigma Oct 12, 2020
c871c81
Better name for storage item
kianenigma Oct 12, 2020
12c18d5
Fix name again.
kianenigma Oct 12, 2020
f900b68
remove unused
kianenigma Oct 12, 2020
6c942b4
Update frame/elections-phragmen/src/lib.rs
kianenigma Oct 13, 2020
8e3c2eb
Update frame/elections-phragmen/src/lib.rs
kianenigma Oct 13, 2020
e674a60
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Oct 13, 2020
a99bebc
Merge remote-tracking branch 'origin/master' into kiz-fix-proxy-elect…
shawntabrizi Oct 13, 2020
f5700cf
cargo run --release --features runtime-benchmarks --manifest-path bin…
shawntabrizi Oct 13, 2020
0564e59
new weight fns
kianenigma Oct 13, 2020
60d7d38
Merge branch 'kiz-fix-proxy-election-drain' of github.com:paritytech/…
kianenigma Oct 13, 2020
1b48d0d
Fix build
kianenigma Oct 13, 2020
960a474
Fix line width
kianenigma Oct 13, 2020
19e9436
fix benchmakrs
kianenigma Oct 13, 2020
76cb36f
fix warning
kianenigma Oct 13, 2020
820d76f
cargo run --release --features runtime-benchmarks --manifest-path bin…
Oct 13, 2020
4caea9f
Tune the stake again
kianenigma Oct 13, 2020
0c1043f
Merge branch 'kiz-fix-proxy-election-drain' of github.com:paritytech/…
kianenigma Oct 13, 2020
df267fa
cargo run --release --features runtime-benchmarks --manifest-path bin…
Oct 13, 2020
1621131
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Oct 22, 2020
c79b522
Merge branch 'kiz-fix-proxy-election-drain' of github.com:paritytech/…
kianenigma Oct 22, 2020
50fa257
Fix builds
kianenigma Nov 17, 2020
8bd074f
All tests work again.
kianenigma Nov 18, 2020
29880e4
A large number of fixes.
kianenigma Nov 18, 2020
d78f6bb
Fix event as well.
kianenigma Nov 18, 2020
5d09983
more fixes.
kianenigma Nov 19, 2020
6668ac1
Fix node build
kianenigma Nov 19, 2020
3dd01d8
Some fixes to benchmarks
kianenigma Nov 19, 2020
694e42a
Merge remote-tracking branch 'origin/master' into kiz-fix-proxy-elect…
Nov 19, 2020
cf94f49
Fix some warnings.
kianenigma Nov 19, 2020
ea69a54
cargo run --release --features=runtime-benchmarks --manifest-path=bin…
Nov 20, 2020
b2f36bd
cargo run --release --features=runtime-benchmarks --manifest-path=bin…
Nov 20, 2020
1fd2b08
Update frame/elections-phragmen/src/lib.rs
kianenigma Nov 25, 2020
585e599
a batch of review comments.
kianenigma Nov 25, 2020
4b9b207
Merge branch 'kiz-fix-proxy-election-drain' of github.com:paritytech/…
kianenigma Nov 25, 2020
ea17535
Master.into()
kianenigma Nov 25, 2020
4b34e72
Fix a test.
kianenigma Nov 25, 2020
ecb0e4e
Fix some more tests.
kianenigma Nov 25, 2020
e810cc7
do migration with pallet version???
kianenigma Nov 25, 2020
e650c02
Master.into()
kianenigma Nov 25, 2020
8742865
Final touches.
kianenigma Nov 26, 2020
d6de615
Remove unused storage.
kianenigma Nov 27, 2020
6cae3da
another rounds of changes and fixes.
kianenigma Nov 30, 2020
3c0d341
Update frame/elections-phragmen/src/lib.rs
kianenigma Nov 30, 2020
3ca1590
Update frame/elections-phragmen/src/lib.rs
kianenigma Nov 30, 2020
9c9819b
Review grumbles.
kianenigma Nov 30, 2020
68ff142
Merge branch 'kiz-fix-proxy-election-drain' of github.com:paritytech/…
kianenigma Nov 30, 2020
797d04c
Fix ocnflics
kianenigma Dec 2, 2020
73a3537
Fix a bit more.
kianenigma Dec 2, 2020
98f349e
Fix build
kianenigma Dec 2, 2020
9454a68
Experimental: independent migration.
kianenigma Dec 2, 2020
c750f74
WIP: isolated migration logics
gui1117 Dec 2, 2020
e11a216
clean up.
kianenigma Dec 2, 2020
1e2c8e9
make migration struct private and move migration to own file
gui1117 Dec 3, 2020
583aa82
add doc
gui1117 Dec 3, 2020
dca4bd5
Merge remote-tracking branch 'origin/master' into kiz-fix-proxy-elect…
gui1117 Dec 3, 2020
c90d25a
Merge remote-tracking branch 'origin/master' into kiz-fix-proxy-elect…
gui1117 Dec 3, 2020
586c61c
fix StorageInstance new syntax
gui1117 Dec 3, 2020
0a0ef71
Update frame/elections-phragmen/src/migrations_3_0_0.rs
gui1117 Dec 4, 2020
a205401
Master.into()
kianenigma Dec 17, 2020
63a4c56
another round of self-review.
kianenigma Dec 17, 2020
ec067c9
bit better formatting
kianenigma Dec 17, 2020
5dab8bc
Merge remote-tracking branch 'origin/master' into kiz-fix-proxy-elect…
Dec 17, 2020
32cb6c1
cargo run --release --features=runtime-benchmarks --manifest-path=bin…
Dec 17, 2020
38881e0
Fix tests.
kianenigma Dec 21, 2020
e4d7464
Master.into()
kianenigma Dec 21, 2020
79d1d5b
Master.into()
kianenigma Jan 19, 2021
7d95b15
Round of self-review
kianenigma Jan 20, 2021
ba12aec
Clean migrations
kianenigma Jan 20, 2021
673aed7
Merge remote-tracking branch 'origin/master' into kiz-fix-proxy-elect…
Jan 20, 2021
99f5fd2
cargo run --release --features=runtime-benchmarks --manifest-path=bin…
Jan 20, 2021
92dbabe
Revert unwanted change to construct-runtime
kianenigma Jan 20, 2021
c688a6f
Merge branch 'kiz-fix-proxy-election-drain' of github.com:paritytech/…
kianenigma Jan 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pallet-contracts = { version = "2.0.0", default-features = false, path = "../../
pallet-contracts-primitives = { version = "2.0.0", default-features = false, path = "../../../frame/contracts/common/" }
pallet-contracts-rpc-runtime-api = { version = "0.8.0", default-features = false, path = "../../../frame/contracts/rpc/runtime-api/" }
pallet-democracy = { version = "2.0.0", default-features = false, path = "../../../frame/democracy" }
pallet-elections-phragmen = { version = "2.0.0", default-features = false, path = "../../../frame/elections-phragmen" }
pallet-elections-phragmen = { version = "3.0.0", default-features = false, path = "../../../frame/elections-phragmen" }
pallet-grandpa = { version = "2.0.0", default-features = false, path = "../../../frame/grandpa" }
pallet-im-online = { version = "2.0.0", default-features = false, path = "../../../frame/im-online" }
pallet-indices = { version = "2.0.0", default-features = false, path = "../../../frame/indices" }
Expand Down
9 changes: 6 additions & 3 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,10 @@ impl pallet_collective::Config<CouncilCollective> for Runtime {

parameter_types! {
pub const CandidacyBond: Balance = 10 * DOLLARS;
pub const VotingBond: Balance = 1 * DOLLARS;
// 1 storage item created, key size is 32 bytes, value size is 16+16.
pub const VotingBondBase: Balance = deposit(1, 64);
gui1117 marked this conversation as resolved.
Show resolved Hide resolved
// additional data per vote is 32 bytes (account id).
pub const VotingBondFactor: Balance = deposit(0, 32);
pub const TermDuration: BlockNumber = 7 * DAYS;
pub const DesiredMembers: u32 = 13;
pub const DesiredRunnersUp: u32 = 7;
Expand All @@ -599,9 +602,9 @@ impl pallet_elections_phragmen::Config for Runtime {
type InitializeMembers = Council;
type CurrencyToVote = U128CurrencyToVote;
type CandidacyBond = CandidacyBond;
type VotingBond = VotingBond;
type VotingBondBase = VotingBondBase;
type VotingBondFactor = VotingBondFactor;
type LoserCandidate = ();
type BadReport = ();
type KickedMember = ();
type DesiredMembers = DesiredMembers;
type DesiredRunnersUp = DesiredRunnersUp;
Expand Down
6 changes: 5 additions & 1 deletion frame/collective/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
//! If there are not, or if no prime is set, then the motion is dropped without being executed.

#![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit="128"]
#![recursion_limit = "128"]

use sp_std::{prelude::*, result};
use sp_core::u32_trait::Value as U32;
Expand Down Expand Up @@ -840,6 +840,10 @@ impl<T: Config<I>, I: Instance> ChangeMembers<T::AccountId> for Module<T, I> {
fn set_prime(prime: Option<T::AccountId>) {
Prime::<T, I>::set(prime);
}

fn get_prime() -> Option<T::AccountId> {
Prime::<T, I>::get()
}
}

impl<T: Config<I>, I: Instance> InitializeMembers<T::AccountId> for Module<T, I> {
Expand Down
24 changes: 24 additions & 0 deletions frame/elections-phragmen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog
All notable changes to this crate will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this crate adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.0] - UNRELEASED

### Added
[Add slashing events to elections-phragmen](https://github.com/paritytech/substrate/pull/7543)

### Changed

### Fixed
[Don't slash all outgoing members](https://github.com/paritytech/substrate/pull/7394)
[Fix wrong outgoing calculation in election](https://github.com/paritytech/substrate/pull/7384)

### Security
\[**Needs Migration**\] [Fix elections-phragmen and proxy issue + Record deposits on-chain](https://github.com/paritytech/substrate/pull/7040)

## [2.0.0] - 2020-09-2020

Initial version from which version tracking has begun.

2 changes: 1 addition & 1 deletion frame/elections-phragmen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-elections-phragmen"
version = "2.0.1"
version = "3.0.0"
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
Loading