Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
ea30833
make pool roles optional
kianenigma May 13, 2022
00e8c87
undo lock file changes?
kianenigma May 13, 2022
fa5e95a
add migration
kianenigma May 13, 2022
f2df79e
add the ability for pools to chill themselves
kianenigma May 14, 2022
56cf997
boilerplate of tests
kianenigma May 14, 2022
508bc0a
new system works, tests need fixing
kianenigma May 15, 2022
f83944a
somewhat stable, but I think I found another bug as well
kianenigma May 15, 2022
ac48c37
Fix it all
kianenigma May 16, 2022
cbeb9fb
Master.into()
kianenigma May 16, 2022
031040f
Add more more sophisticated test + capture one more bug.
kianenigma May 16, 2022
efc7b4f
Update frame/staking/src/lib.rs
kianenigma May 16, 2022
60d42f1
reduce the diff a little bit
kianenigma May 17, 2022
02aa7d4
add some test for the slashing bug
kianenigma May 19, 2022
90db26e
cleanup
kianenigma May 19, 2022
5bf6d9c
Merge branch 'kiz-pool-chill' of github.com:paritytech/substrate into…
kianenigma May 19, 2022
1d8c940
Master.into()
kianenigma May 19, 2022
2ec4857
Merge branch 'master' of github.com:paritytech/substrate into kiz-poo…
kianenigma May 20, 2022
a51e408
fix lock file?
kianenigma May 20, 2022
28c8852
Fix
kianenigma May 20, 2022
c9413a2
fmt
kianenigma May 20, 2022
433476d
Merge branch 'master' of github.com:paritytech/substrate into kiz-poo…
kianenigma May 23, 2022
c34b655
Update frame/nomination-pools/src/lib.rs
kianenigma May 23, 2022
d0d75a1
Update frame/nomination-pools/src/lib.rs
kianenigma May 23, 2022
a6afb06
Update frame/nomination-pools/src/lib.rs
kianenigma May 23, 2022
a3a43e7
Update frame/nomination-pools/src/mock.rs
kianenigma May 23, 2022
4b7b0c7
Fix build
kianenigma May 23, 2022
3f66688
Merge branch 'kiz-pool-chill' of github.com:paritytech/substrate into…
kianenigma May 23, 2022
640ec31
fix some fishy tests..
kianenigma May 23, 2022
398ddfe
add one last integrity check for MinCreateBond
kianenigma May 24, 2022
d5dc697
remove bad assertion -- needs to be dealt with later
kianenigma May 24, 2022
05fb517
Merge branch 'master' of github.com:paritytech/substrate into kiz-poo…
kianenigma May 24, 2022
f4dbd0a
nits
shawntabrizi May 25, 2022
0a79c80
Master.into()
kianenigma Jun 8, 2022
78c0310
Merge branch 'kiz-pool-chill' of github.com:paritytech/substrate into…
kianenigma Jun 9, 2022
0fb1125
fix tests and add benchmarks for chill
kianenigma Jun 9, 2022
12773bb
remove stuff
kianenigma Jun 9, 2022
ca475df
fix benchmarks
kianenigma Jun 10, 2022
44a2722
Merge branch 'master' of https://github.com/paritytech/substrate into…
Jun 10, 2022
f027faf
cargo run --quiet --profile=production --features=runtime-benchmarks…
Jun 10, 2022
33b581c
Master.into()
kianenigma Jun 11, 2022
c77613f
Merge branch 'kiz-pool-chill' of github.com:paritytech/substrate into…
kianenigma Jun 11, 2022
d69af2c
remove defensive
kianenigma Jun 11, 2022
d318197
Merge branch 'master' of github.com:paritytech/substrate into kiz-poo…
kianenigma Jun 13, 2022
486a0e9
first working version
kianenigma Jun 13, 2022
9b2113f
Master.into()
kianenigma Jun 14, 2022
36cb484
bring back all tests
kianenigma Jun 14, 2022
723574b
ALL new tests work now
kianenigma Jun 14, 2022
624abe9
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Jun 14, 2022
82287b0
cleanup
kianenigma Jun 14, 2022
e403fb1
make sure benchmarks and all work
kianenigma Jun 15, 2022
4cad93a
Merge branch 'master' of https://github.com/paritytech/substrate into…
Jun 15, 2022
221369b
cargo run --quiet --profile=production --features=runtime-benchmarks…
Jun 15, 2022
696a55e
round of self-review, make arithmetic safe
kianenigma Jun 15, 2022
0689b58
Merge branch 'kiz-fix-reward-pools-2' of github.com:paritytech/substr…
kianenigma Jun 15, 2022
bcb413c
fix warn
kianenigma Jun 15, 2022
bce40f7
add migration code
kianenigma Jun 16, 2022
8fc25ac
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Jun 16, 2022
fc3ad18
Fix doc
kianenigma Jun 17, 2022
03107f3
Merge branches 'kiz-fix-reward-pools-2' and 'master' of github.com:pa…
kianenigma Jun 21, 2022
9f875a9
add precision notes
kianenigma Jun 21, 2022
0513284
make arithmetic fallible
kianenigma Jun 21, 2022
1c43f09
fix node runtime
kianenigma Jun 21, 2022
ef56db6
a lot of precision tests and notes and stuff
kianenigma Jun 22, 2022
3da2364
document MaxPOintsToBalance better
kianenigma Jun 22, 2022
ed5083f
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Jun 23, 2022
3690489
:round of self-review
kianenigma Jun 23, 2022
62d35c8
fmt
kianenigma Jun 23, 2022
1c840b2
fix some comments
kianenigma Jun 23, 2022
7d9d403
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Jun 26, 2022
78b79f2
Master.into()
kianenigma Jul 1, 2022
a8ccd71
Fix proportional slashing logic
kianenigma Jul 5, 2022
60b7641
Update frame/nomination-pools/src/tests.rs
kianenigma Jul 6, 2022
a2082cd
Update frame/nomination-pools/src/tests.rs
kianenigma Jul 6, 2022
ecb7890
Update frame/nomination-pools/src/lib.rs
kianenigma Jul 6, 2022
7e56e1a
track poinst in migration
kianenigma Jul 6, 2022
80b31c0
Merge branch 'kiz-fix-reward-pools-2' of github.com:paritytech/substr…
kianenigma Jul 6, 2022
579da37
fix
kianenigma Jul 6, 2022
51c1608
fmt
kianenigma Jul 6, 2022
3779081
fix migration
kianenigma Jul 6, 2022
9171a13
remove event read
kianenigma Jul 6, 2022
b9ab747
Apply suggestions from code review
kianenigma Jul 7, 2022
d4f45e7
Update frame/staking/src/lib.rs
kianenigma Jul 9, 2022
ca47b05
Update frame/nomination-pools/src/lib.rs
kianenigma Jul 9, 2022
f3e10a9
Update frame/nomination-pools/src/lib.rs
kianenigma Jul 9, 2022
463ddfd
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Jul 10, 2022
51873c7
Merge branch 'kiz-fix-reward-pools-2' of github.com:paritytech/substr…
kianenigma Jul 10, 2022
c205ac3
update
kianenigma Jul 10, 2022
69d1f9c
fmt
kianenigma Jul 10, 2022
3efe9f5
fmt
kianenigma Jul 10, 2022
84a2639
add one last test
kianenigma Jul 10, 2022
e7673f8
fmt
kianenigma Jul 12, 2022
ed2c225
Merge branch 'master' of github.com:paritytech/substrate into kiz-fix…
kianenigma Jul 12, 2022
de9886d
merged
kianenigma Jul 13, 2022
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
1 change: 1 addition & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ impl pallet_nomination_pools::Config for Runtime {
type WeightInfo = ();
type Event = Event;
type Currency = Balances;
type CurrencyBalance = Balance;
type BalanceToU256 = BalanceToU256;
type U256ToBalance = U256ToBalance;
type StakingInterface = pallet_staking::Pallet<Self>;
Expand Down
1 change: 1 addition & 0 deletions frame/nomination-pools/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ impl pallet_nomination_pools::Config for Runtime {
type Event = Event;
type WeightInfo = ();
type Currency = Balances;
type CurrencyBalance = Balance;
type BalanceToU256 = BalanceToU256;
type U256ToBalance = U256ToBalance;
type StakingInterface = Staking;
Expand Down
288 changes: 117 additions & 171 deletions frame/nomination-pools/src/lib.rs

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions frame/nomination-pools/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ impl sp_staking::StakingInterface for StakingMock {
Ok(())
}

#[cfg(feature = "runtime-benchmarks")]
fn nominations(_: Self::AccountId) -> Option<Vec<Self::AccountId>> {
Nominations::get()
}
Expand Down Expand Up @@ -183,6 +184,7 @@ impl pools::Config for Runtime {
type Event = Event;
type WeightInfo = ();
type Currency = Balances;
type CurrencyBalance = Balance;
type BalanceToU256 = BalanceToU256;
type U256ToBalance = U256ToBalance;
type StakingInterface = StakingMock;
Expand Down Expand Up @@ -280,8 +282,8 @@ pub(crate) fn unsafe_set_state(pool_id: PoolId, state: PoolState) -> Result<(),
}

parameter_types! {
static PoolsEvents: usize = 0;
static BalancesEvents: usize = 0;
storage PoolsEvents: u32 = 0;
storage BalancesEvents: u32 = 0;
}

/// All events of this pallet.
Expand All @@ -292,8 +294,8 @@ pub(crate) fn pool_events_since_last_call() -> Vec<super::Event<Runtime>> {
.filter_map(|e| if let Event::Pools(inner) = e { Some(inner) } else { None })
.collect::<Vec<_>>();
let already_seen = PoolsEvents::get();
PoolsEvents::set(events.len());
events.into_iter().skip(already_seen).collect()
PoolsEvents::set(&(events.len() as u32));
events.into_iter().skip(already_seen as usize).collect()
}

/// All events of the `Balances` pallet.
Expand All @@ -304,8 +306,8 @@ pub(crate) fn balances_events_since_last_call() -> Vec<pallet_balances::Event<Ru
.filter_map(|e| if let Event::Balances(inner) = e { Some(inner) } else { None })
.collect::<Vec<_>>();
let already_seen = BalancesEvents::get();
BalancesEvents::set(events.len());
events.into_iter().skip(already_seen).collect()
BalancesEvents::set(&(events.len() as u32));
events.into_iter().skip(already_seen as usize).collect()
}

/// Same as `fully_unbond`, in permissioned setting.
Expand Down
Loading