mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Fast Unstake Pallet (#12129)
* add failing test for itamar * an ugly example of fast unstake * Revert "add failing test for itamar" This reverts commit 16c4d8015698a0684c090c54fce8b470a2d2feb2. * fast unstake wip * clean it up a bit * some comments * on_idle logic * fix * comment * new working version, checks all pass, looking good * some notes * add mock boilerplate * more boilerplate * simplify the weight stuff * ExtBuilder for pools * fmt * rm bags-list, simplify setup_works * mock + tests boilerplate * make some benchmarks work * mock boilerplate * tests boilerplate * run_to_block works * add Error enums * add test * note * make UnstakeRequest fields pub * some tests * fix origin * fmt * add fast_unstake_events_since_last_call * text * rewrite some benchmes and fix them -- the outcome is still strange * Fix weights * cleanup * Update frame/election-provider-support/solution-type/src/single_page.rs * fix build * Fix pools tests * iterate teset + mock * test unfinished * cleanup and add some tests * add test successful_multi_queue * comment * rm Head check * add TODO * complete successful_multi_queue * + test early_exit * fix a lot of things above the beautiful atlantic ocean 🌊 * seemingly it is finished now * Fix build * ".git/.scripts/fmt.sh" 1 * Fix slashing amount as well * better docs * abstract types * rm use * import * Update frame/nomination-pools/benchmarking/src/lib.rs Co-authored-by: Nitwit <47109040+nitwit69@users.noreply.github.com> * Update frame/fast-unstake/src/types.rs Co-authored-by: Nitwit <47109040+nitwit69@users.noreply.github.com> * Fix build * fmt * Update frame/fast-unstake/src/lib.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * make bounded * feedback from code review with Ankan * Update frame/fast-unstake/src/lib.rs Co-authored-by: Roman Useinov <roman.useinov@gmail.com> * Update frame/fast-unstake/src/lib.rs Co-authored-by: Roman Useinov <roman.useinov@gmail.com> * Update frame/fast-unstake/src/lib.rs Co-authored-by: Roman Useinov <roman.useinov@gmail.com> * Update frame/fast-unstake/src/lib.rs Co-authored-by: Roman Useinov <roman.useinov@gmail.com> * Update frame/fast-unstake/src/lib.rs Co-authored-by: Roman Useinov <roman.useinov@gmail.com> * Update frame/fast-unstake/src/lib.rs Co-authored-by: Roman Useinov <roman.useinov@gmail.com> * Update frame/fast-unstake/src/lib.rs Co-authored-by: Roman Useinov <roman.useinov@gmail.com> * Update frame/fast-unstake/src/lib.rs Co-authored-by: Roman Useinov <roman.useinov@gmail.com> * Update frame/fast-unstake/src/lib.rs Co-authored-by: Roman Useinov <roman.useinov@gmail.com> * Update frame/fast-unstake/src/mock.rs * update to master * some final review comments * fmt * fix clippy * remove unused * ".git/.scripts/fmt.sh" 1 * make it all build again * fmt * undo fishy change Co-authored-by: Ross Bulat <ross@jkrbinvestments.com> Co-authored-by: command-bot <> Co-authored-by: Nitwit <47109040+nitwit69@users.noreply.github.com> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
This commit is contained in:
@@ -68,6 +68,7 @@ pallet-democracy = { version = "4.0.0-dev", default-features = false, path = "..
|
||||
pallet-election-provider-multi-phase = { version = "4.0.0-dev", default-features = false, path = "../../../frame/election-provider-multi-phase" }
|
||||
pallet-election-provider-support-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../../frame/election-provider-support/benchmarking", optional = true }
|
||||
pallet-elections-phragmen = { version = "5.0.0-dev", default-features = false, path = "../../../frame/elections-phragmen" }
|
||||
pallet-fast-unstake = { version = "4.0.0-dev", default-features = false, path = "../../../frame/fast-unstake" }
|
||||
pallet-gilt = { version = "4.0.0-dev", default-features = false, path = "../../../frame/gilt" }
|
||||
pallet-grandpa = { version = "4.0.0-dev", default-features = false, path = "../../../frame/grandpa" }
|
||||
pallet-im-online = { version = "4.0.0-dev", default-features = false, path = "../../../frame/im-online" }
|
||||
@@ -142,6 +143,7 @@ std = [
|
||||
"pallet-conviction-voting/std",
|
||||
"pallet-democracy/std",
|
||||
"pallet-elections-phragmen/std",
|
||||
"pallet-fast-unstake/std",
|
||||
"frame-executive/std",
|
||||
"pallet-gilt/std",
|
||||
"pallet-grandpa/std",
|
||||
@@ -220,6 +222,7 @@ runtime-benchmarks = [
|
||||
"pallet-election-provider-multi-phase/runtime-benchmarks",
|
||||
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
|
||||
"pallet-elections-phragmen/runtime-benchmarks",
|
||||
"pallet-fast-unstake/runtime-benchmarks",
|
||||
"pallet-gilt/runtime-benchmarks",
|
||||
"pallet-grandpa/runtime-benchmarks",
|
||||
"pallet-identity/runtime-benchmarks",
|
||||
@@ -272,6 +275,7 @@ try-runtime = [
|
||||
"pallet-democracy/try-runtime",
|
||||
"pallet-election-provider-multi-phase/try-runtime",
|
||||
"pallet-elections-phragmen/try-runtime",
|
||||
"pallet-fast-unstake/try-runtime",
|
||||
"pallet-gilt/try-runtime",
|
||||
"pallet-grandpa/try-runtime",
|
||||
"pallet-im-online/try-runtime",
|
||||
|
||||
@@ -579,6 +579,13 @@ impl pallet_staking::Config for Runtime {
|
||||
type BenchmarkingConfig = StakingBenchmarkingConfig;
|
||||
}
|
||||
|
||||
impl pallet_fast_unstake::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type SlashPerEra = ConstU128<{ DOLLARS }>;
|
||||
type ControlOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
// phase durations. 1/4 of the last session for each.
|
||||
pub const SignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4;
|
||||
@@ -1655,6 +1662,7 @@ construct_runtime!(
|
||||
NominationPools: pallet_nomination_pools,
|
||||
RankedPolls: pallet_referenda::<Instance2>,
|
||||
RankedCollective: pallet_ranked_collective,
|
||||
FastUnstake: pallet_fast_unstake,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1741,6 +1749,7 @@ mod benches {
|
||||
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
|
||||
[pallet_election_provider_support_benchmarking, EPSBench::<Runtime>]
|
||||
[pallet_elections_phragmen, Elections]
|
||||
[pallet_fast_unstake, FastUnstake]
|
||||
[pallet_gilt, Gilt]
|
||||
[pallet_grandpa, Grandpa]
|
||||
[pallet_identity, Identity]
|
||||
|
||||
Reference in New Issue
Block a user