Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Staking] Make exits manual, patch lack of delay for {increasing, decreasing} bonds #810

Merged
merged 95 commits into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
aff6d66
init
4meta5 Aug 22, 2021
9fe7dba
stash
4meta5 Aug 26, 2021
13bb466
Merge branch 'master' into amar-manual-exit
4meta5 Sep 2, 2021
be1d11b
checkpoint
4meta5 Sep 3, 2021
a10e51d
checkpoint
4meta5 Sep 3, 2021
f1af2d9
checkpoint
4meta5 Sep 6, 2021
52adea5
save middle of refactor
4meta5 Sep 9, 2021
85ded1f
save
4meta5 Sep 10, 2021
70b0a04
checkpoint
4meta5 Sep 12, 2021
b10b90c
clean
4meta5 Sep 12, 2021
dac742f
clean
4meta5 Sep 13, 2021
4da906d
clean
4meta5 Sep 13, 2021
9bdd560
clean init collator candidate helper functions
4meta5 Sep 14, 2021
96acd90
checkpoint
4meta5 Sep 15, 2021
6bbff55
stash
4meta5 Sep 17, 2021
b436ffc
merged execute and cancel functions but kept events different for exe…
4meta5 Sep 20, 2021
b5dba7a
clean
4meta5 Sep 20, 2021
573c9d3
init unit test updates st tests compile now but 62 fail
4meta5 Sep 21, 2021
79a53cf
gradual progress
4meta5 Sep 22, 2021
d047df6
fix origins according to review feedback, only a few more tests left
4meta5 Sep 24, 2021
193233f
3 unit tests left
4meta5 Sep 28, 2021
9bfff66
2
4meta5 Sep 28, 2021
d18a8b7
all unit tests pass, update all runtime configs
4meta5 Sep 29, 2021
9769d58
update existing precompile code
4meta5 Sep 29, 2021
6ff2540
update chainspecs
4meta5 Sep 30, 2021
bc03c05
into master
4meta5 Oct 2, 2021
00db29f
update integration test imports
4meta5 Oct 2, 2021
6dd55c1
update benchmarking wip
4meta5 Oct 5, 2021
05631a7
update bond more bond less benchmarking
4meta5 Oct 5, 2021
7c4c573
more unit tests for new execute and leave extrinsics
4meta5 Oct 7, 2021
0667b27
cancel delegation request unit tests for all delegation request types
4meta5 Oct 11, 2021
7888e4c
update unit test utils
4meta5 Oct 12, 2021
7143426
finish excecute and cancel extrinsic benchmarking with hardcoded unif…
4meta5 Oct 13, 2021
4d35221
nits and start adding schedule to prefix old extrinsic names because …
4meta5 Oct 13, 2021
e59d96d
fix constraints to allow making and executing delegation requests whi…
4meta5 Oct 14, 2021
8c649b8
runtime upgrade first pass, needs unit tests
4meta5 Oct 18, 2021
1e3db7c
clean
4meta5 Oct 18, 2021
1033a9a
finish runtime migration and add unit tests
4meta5 Oct 19, 2021
1229e34
clean
4meta5 Oct 19, 2021
91624d0
clean
4meta5 Oct 19, 2021
85ef3d9
Merge branch 'master' into amar-manual-exit
4meta5 Oct 19, 2021
df0843c
try partial update TS
4meta5 Oct 19, 2021
e7c23fa
ts progress and change name of nominate extrinsic to delegate
4meta5 Oct 20, 2021
7d32bd1
clean TS and remove duplicate tests
4meta5 Oct 20, 2021
0022bee
try add ts types to types bundle
4meta5 Oct 26, 2021
65d81d0
try into master
4meta5 Oct 26, 2021
bc14867
fix
4meta5 Oct 27, 2021
1f230ce
fix
4meta5 Oct 27, 2021
1226776
fix
4meta5 Oct 27, 2021
ee1ca7e
fix
4meta5 Oct 27, 2021
7b8a2d5
fix
4meta5 Oct 27, 2021
218560d
try fix TS test
4meta5 Oct 27, 2021
e0cece4
fix
4meta5 Oct 27, 2021
eba95ae
fix
4meta5 Oct 28, 2021
111e547
Merge branch 'master' into amar-manual-exit
4meta5 Oct 28, 2021
b6cf71d
move migration into pallet migrations and add pre checks and post checks
4meta5 Oct 29, 2021
2280fdb
fix
4meta5 Oct 29, 2021
a8f6afa
cargo lock
4meta5 Oct 29, 2021
b074aef
into master
4meta5 Oct 30, 2021
85f699c
address most review comments
4meta5 Nov 5, 2021
2c9303c
master.into
4meta5 Nov 5, 2021
802c31b
improve readability of can_leave calls
4meta5 Nov 5, 2021
d0f9753
more
4meta5 Nov 5, 2021
85719da
revert mixing migrations
4meta5 Nov 7, 2021
be00bcb
remove unnecessary constraint to enable making and executing candidat…
4meta5 Nov 11, 2021
bf3d75a
into master
4meta5 Nov 12, 2021
a0da3ae
into master
4meta5 Nov 12, 2021
d33a9ef
fix merge
4meta5 Nov 13, 2021
efa1e5e
more nominator - and nomination -
4meta5 Nov 15, 2021
333eace
revert mistake
4meta5 Nov 15, 2021
3269c0b
update precompile
4meta5 Nov 15, 2021
7649930
add execute and cancel fns to staking precompile
4meta5 Nov 16, 2021
d437aca
more precompile unit coverage wip
4meta5 Nov 17, 2021
8f181c0
precompile unit test coverage
4meta5 Nov 17, 2021
d75d4d0
Merge branch 'master' into amar-manual-exit
4meta5 Nov 18, 2021
7866dc8
finish updating precompiles with new extrinsic names and add tests fo…
4meta5 Nov 18, 2021
77de409
fix test utils to panic at line where error occurs instead of line in…
4meta5 Nov 18, 2021
60b5a17
fix benchmarking code for execute leave candidates
4meta5 Nov 18, 2021
cec247a
try fix benchmarking
4meta5 Nov 18, 2021
3e0db82
try
4meta5 Nov 18, 2021
4e87128
try debug
4meta5 Nov 18, 2021
fb3114e
try again
4meta5 Nov 18, 2021
459c813
benchmark and weights for leave candidates extrinsics
4meta5 Nov 18, 2021
d5428bf
last todos
4meta5 Nov 18, 2021
e5c3593
into master
4meta5 Nov 18, 2021
ce5ab61
update src contracts and revert unnecessary bench changes
4meta5 Nov 19, 2021
28a387a
accept notlesh suggestions
4meta5 Nov 19, 2021
d2d1195
and update precompile tests with pallet changes just made
4meta5 Nov 19, 2021
16a2700
compiled StakingDelegationAttaker contract
4meta5 Nov 19, 2021
d974e63
prettier
4meta5 Nov 19, 2021
826ce61
clean unit tests and fix bench again
4meta5 Nov 19, 2021
b654f68
Merge branch 'master' into amar-manual-exit
4meta5 Nov 19, 2021
662b652
improve deprecated docs for StakingInterface.sol
4meta5 Nov 19, 2021
567029e
increase max block weight safety margin to 50 percent
4meta5 Nov 19, 2021
8b15b9f
remove outdated comment
4meta5 Nov 19, 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.

8 changes: 4 additions & 4 deletions node/service/src/chain_spec/moonbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn development_chain_spec(mnemonic: Option<String>, num_accounts: Option<u32
get_from_seed::<NimbusId>("Alice"),
1_000 * UNIT,
)],
// Nominations
// Delegations
vec![],
accounts.clone(),
3_000_000 * UNIT,
Expand Down Expand Up @@ -133,7 +133,7 @@ pub fn get_chain_spec(para_id: ParaId) -> ChainSpec {
1_000 * UNIT,
),
],
// Nominations
// Delegations
vec![],
vec![
AccountId::from_str("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac").unwrap(),
Expand Down Expand Up @@ -186,7 +186,7 @@ pub fn testnet_genesis(
council_members: Vec<AccountId>,
tech_comittee_members: Vec<AccountId>,
candidates: Vec<(AccountId, NimbusId, Balance)>,
nominations: Vec<(AccountId, AccountId, Balance)>,
delegations: Vec<(AccountId, AccountId, Balance)>,
endowed_accounts: Vec<AccountId>,
crowdloan_fund_pot: Balance,
para_id: ParaId,
Expand Down Expand Up @@ -246,7 +246,7 @@ pub fn testnet_genesis(
.cloned()
.map(|(account, _, bond)| (account, bond))
.collect(),
nominations,
delegations,
inflation_config: moonbeam_inflation_config(),
},
council_collective: CouncilCollectiveConfig {
Expand Down
8 changes: 4 additions & 4 deletions node/service/src/chain_spec/moonbeam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn development_chain_spec(mnemonic: Option<String>, num_accounts: Option<u32
get_from_seed::<NimbusId>("Alice"),
1_000 * GLMR,
)],
// Nominations
// Delegations
vec![],
accounts.clone(),
3_000_000 * GLMR,
Expand Down Expand Up @@ -116,7 +116,7 @@ pub fn get_chain_spec(para_id: ParaId) -> ChainSpec {
1_000 * GLMR,
),
],
// Nominations
// Delegations
vec![],
vec![
AccountId::from_str("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac").unwrap(),
Expand Down Expand Up @@ -167,7 +167,7 @@ pub fn moonbeam_inflation_config() -> InflationInfo<Balance> {
pub fn testnet_genesis(
root_key: AccountId,
candidates: Vec<(AccountId, NimbusId, Balance)>,
nominations: Vec<(AccountId, AccountId, Balance)>,
delegations: Vec<(AccountId, AccountId, Balance)>,
endowed_accounts: Vec<AccountId>,
crowdloan_fund_pot: Balance,
para_id: ParaId,
Expand Down Expand Up @@ -227,7 +227,7 @@ pub fn testnet_genesis(
.cloned()
.map(|(account, _, bond)| (account, bond))
.collect(),
nominations,
delegations,
inflation_config: moonbeam_inflation_config(),
},
council_collective: CouncilCollectiveConfig {
Expand Down
8 changes: 4 additions & 4 deletions node/service/src/chain_spec/moonriver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn development_chain_spec(mnemonic: Option<String>, num_accounts: Option<u32
get_from_seed::<NimbusId>("Alice"),
1_000 * MOVR,
)],
// Nominations
// Delegations
vec![],
accounts.clone(),
3_000_000 * MOVR,
Expand Down Expand Up @@ -112,7 +112,7 @@ pub fn get_chain_spec(para_id: ParaId) -> ChainSpec {
1_000 * MOVR,
),
],
// Nominations
// Delegations
vec![],
vec![
AccountId::from_str("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac").unwrap(),
Expand Down Expand Up @@ -162,7 +162,7 @@ pub fn moonbeam_inflation_config() -> InflationInfo<Balance> {

pub fn testnet_genesis(
candidates: Vec<(AccountId, NimbusId, Balance)>,
nominations: Vec<(AccountId, AccountId, Balance)>,
delegations: Vec<(AccountId, AccountId, Balance)>,
endowed_accounts: Vec<AccountId>,
crowdloan_fund_pot: Balance,
para_id: ParaId,
Expand Down Expand Up @@ -221,7 +221,7 @@ pub fn testnet_genesis(
.cloned()
.map(|(account, _, bond)| (account, bond))
.collect(),
nominations,
delegations,
inflation_config: moonbeam_inflation_config(),
},
council_collective: CouncilCollectiveConfig {
Expand Down
2 changes: 1 addition & 1 deletion node/service/src/chain_spec/test_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn staking_spec(para_id: ParaId) -> ChainSpec {
1_000 * UNIT,
),
],
// Nominations
// Delegations
vec![],
// Endowed accounts (each minted 1 << 80 balance)
vec![
Expand Down
2 changes: 1 addition & 1 deletion pallets/parachain-staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "parachain-staking"
authors = [ "PureStake" ]
description = "parachain staking pallet for collator selection and reward distribution"
edition = "2018"
version = "2.1.1"
version = "3.0.0"

[dependencies]
log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion pallets/parachain-staking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Implements Delegated Proof of Stake to

1. select the active set of eligible block producers
2. reward block authors
3. enable nominators and collators to participate in inflationary rewards
3. enable delegators and collators to participate in inflationary rewards

Links:

Expand Down
9 changes: 9 additions & 0 deletions pallets/parachain-staking/migrations.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Migration History

## Manual Exits and Patch Lack of Delay for bond\_{more, less}

- [Migration PR `#810`](https://github.com/PureStake/moonbeam/pull/810)
- [Migration Removal PR `#?`]()

## Purge Stale Storage

- [Migration PR `#970`](https://github.com/PureStake/moonbeam/pull/970)

## Delay nominator exits by changing NominatorState and ExitQueue

- [Migration PR `#610`](https://github.com/PureStake/moonbeam/pull/610)
Expand Down
Loading