Skip to content

Commit

Permalink
remove delegated staking from prod runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ank4n committed Jun 24, 2024
1 parent 8fbd75c commit 163a4da
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 57 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added

- Delegated nomination pool staking ([polkadot-fellows/runtimes#322](https://github.com/polkadot-fellows/runtimes/pull/322)).
FAIL-CI @ggwpez
FAIL-CI @ggwpez (should skip mentioning this)

## [1.2.7] 14.06.2024

Expand Down
2 changes: 0 additions & 2 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ pallet-collator-selection = { version = "16.0.0", default-features = false }
pallet-collective = { version = "35.0.0", default-features = false }
pallet-conviction-voting = { version = "35.0.0", default-features = false }
pallet-core-fellowship = { version = "19.0.0", default-features = false }
pallet-delegated-staking = { version = "2.0.0", default-features = false }
pallet-election-provider-multi-phase = { version = "34.0.0", default-features = false }
pallet-election-provider-support-benchmarking = { version = "34.0.0", default-features = false }
pallet-encointer-balances = { version = "~6.1.0", default-features = false }
Expand Down
4 changes: 0 additions & 4 deletions relay/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
pallet-grandpa = { workspace = true }
pallet-nis = { workspace = true }
pallet-delegated-staking = { workspace = true }
pallet-indices = { workspace = true }
pallet-message-queue = { workspace = true }
pallet-mmr = { workspace = true }
Expand Down Expand Up @@ -209,7 +208,6 @@ std = [
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
"pallet-delegated-staking/std"
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
Expand Down Expand Up @@ -260,7 +258,6 @@ runtime-benchmarks = [
"sp-staking/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"pallet-delegated-staking/runtime-benchmarks"
]
try-runtime = [
"frame-election-provider-support/try-runtime",
Expand Down Expand Up @@ -309,7 +306,6 @@ try-runtime = [
"polkadot-runtime-common/try-runtime",
"runtime-parachains/try-runtime",
"sp-runtime/try-runtime",
"pallet-delegated-staking/try-runtime"
]

# Enable metadata hash generation at compile time for the `CheckMetadataHash` extension.
Expand Down
24 changes: 2 additions & 22 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ impl pallet_staking::Config for Runtime {
type HistoryDepth = frame_support::traits::ConstU32<84>;
type MaxControllersInDeprecationBatch = ConstU32<5169>;
type BenchmarkingConfig = polkadot_runtime_common::StakingBenchmarkingConfig;
type EventListeners = (NominationPools, DelegatedStaking);
type EventListeners = NominationPools;
type DisablingStrategy = pallet_staking::UpToLimitDisablingStrategy;
type WeightInfo = weights::pallet_staking::WeightInfo<Runtime>;
}
Expand All @@ -769,22 +769,6 @@ impl pallet_fast_unstake::Config for Runtime {
type WeightInfo = weights::pallet_fast_unstake::WeightInfo<Runtime>;
}

parameter_types! {
pub const DelegatedStakingPalletId: PalletId = PalletId(*b"py/dlstk");
pub const SlashRewardFraction: Perbill = Perbill::from_percent(1);
}

impl pallet_delegated_staking::Config for Runtime {
// FAIL-CI @ankan
type RuntimeEvent = RuntimeEvent;
type PalletId = DelegatedStakingPalletId;
type Currency = Balances;
type OnSlash = ();
type SlashRewardFraction = SlashRewardFraction;
type RuntimeHoldReason = RuntimeHoldReason;
type CoreStaking = Staking;
}

parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const ProposalBondMinimum: Balance = 2000 * CENTS;
Expand Down Expand Up @@ -1550,7 +1534,7 @@ impl pallet_nomination_pools::Config for Runtime {
type BalanceToU256 = BalanceToU256;
type U256ToBalance = U256ToBalance;
type StakeAdapter =
pallet_nomination_pools::adapter::DelegateStake<Self, Staking, DelegatedStaking>;
pallet_nomination_pools::adapter::TransferStake<Self, Staking>;
type PostUnbondingPoolsWindow = ConstU32<4>;
type MaxMetadataLen = ConstU32<256>;
// we use the same number of allowed unlocking chunks as with staking.
Expand Down Expand Up @@ -1712,8 +1696,6 @@ construct_runtime! {
// Fast unstake pallet: extension to staking.
FastUnstake: pallet_fast_unstake = 42,

DelegatedStaking: pallet_delegated_staking = 46,

// Parachains pallets. Start indices at 50 to leave room.
ParachainsOrigin: parachains_origin = 50,
Configuration: parachains_configuration = 51,
Expand Down Expand Up @@ -2253,7 +2235,6 @@ mod benches {
[pallet_bounties, Bounties]
[pallet_child_bounties, ChildBounties]
[pallet_conviction_voting, ConvictionVoting]
[pallet_delegated_staking, DelegatedStaking]
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
[frame_election_provider_support, ElectionProviderBench::<Runtime>]
[pallet_fast_unstake, FastUnstake]
Expand Down Expand Up @@ -2773,7 +2754,6 @@ sp_api::impl_runtime_apis! {
NominationPools::api_balance_to_points(pool_id, new_funds)
}

// FAIL-CI @ankan this is copy&pasted from Westend
fn pool_pending_slash(pool_id: pallet_nomination_pools::PoolId) -> Balance {
NominationPools::api_pool_pending_slash(pool_id)
}
Expand Down
4 changes: 0 additions & 4 deletions relay/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pallet-beefy = { workspace = true }
pallet-beefy-mmr = { workspace = true }
pallet-bounties = { workspace = true }
pallet-child-bounties = { workspace = true }
pallet-delegated-staking = { workspace = true }
pallet-transaction-payment = { workspace = true }
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
pallet-conviction-voting = { workspace = true }
Expand Down Expand Up @@ -206,7 +205,6 @@ std = [
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
"pallet-delegated-staking/std"
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
Expand Down Expand Up @@ -255,7 +253,6 @@ runtime-benchmarks = [
"sp-staking/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"pallet-delegated-staking/runtime-benchmarks"
]
try-runtime = [
"frame-election-provider-support/try-runtime",
Expand Down Expand Up @@ -302,7 +299,6 @@ try-runtime = [
"polkadot-runtime-common/try-runtime",
"runtime-parachains/try-runtime",
"sp-runtime/try-runtime",
"pallet-delegated-staking/try-runtime"
]

# Enable metadata hash generation at compile time for the `CheckMetadataHash` extension.
Expand Down
25 changes: 2 additions & 23 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ impl pallet_staking::Config for Runtime {
type HistoryDepth = frame_support::traits::ConstU32<84>;
type MaxControllersInDeprecationBatch = ConstU32<5314>;
type BenchmarkingConfig = polkadot_runtime_common::StakingBenchmarkingConfig;
type EventListeners = (NominationPools, DelegatedStaking);
type EventListeners = NominationPools;
type DisablingStrategy = pallet_staking::UpToLimitDisablingStrategy;
type WeightInfo = weights::pallet_staking::WeightInfo<Runtime>;
}
Expand All @@ -836,22 +836,6 @@ impl pallet_fast_unstake::Config for Runtime {
type WeightInfo = weights::pallet_fast_unstake::WeightInfo<Runtime>;
}

parameter_types! {
pub const DelegatedStakingPalletId: PalletId = PalletId(*b"py/dlstk");
pub const SlashRewardFraction: Perbill = Perbill::from_percent(1);
}

impl pallet_delegated_staking::Config for Runtime {
// FAIL-CI @ankan
type RuntimeEvent = RuntimeEvent;
type PalletId = DelegatedStakingPalletId;
type Currency = Balances;
type OnSlash = ();
type SlashRewardFraction = SlashRewardFraction;
type RuntimeHoldReason = RuntimeHoldReason;
type CoreStaking = Staking;
}

parameter_types! {
// Minimum 4 CENTS/byte
pub const BasicDeposit: Balance = deposit(1, 258);
Expand Down Expand Up @@ -1574,7 +1558,7 @@ impl pallet_nomination_pools::Config for Runtime {
type BalanceToU256 = polkadot_runtime_common::BalanceToU256;
type U256ToBalance = polkadot_runtime_common::U256ToBalance;
type StakeAdapter =
pallet_nomination_pools::adapter::DelegateStake<Self, Staking, DelegatedStaking>;
pallet_nomination_pools::adapter::TransferStake<Self, Staking>;
type PostUnbondingPoolsWindow = frame_support::traits::ConstU32<4>;
type MaxMetadataLen = frame_support::traits::ConstU32<256>;
// we use the same number of allowed unlocking chunks as with staking.
Expand Down Expand Up @@ -1763,8 +1747,6 @@ construct_runtime! {
// Fast unstake pallet: extension to staking.
FastUnstake: pallet_fast_unstake = 40,

DelegatedStaking: pallet_delegated_staking = 41,

// Parachains pallets. Start indices at 50 to leave room.
ParachainsOrigin: parachains_origin = 50,
Configuration: parachains_configuration = 51,
Expand Down Expand Up @@ -2003,7 +1985,6 @@ mod benches {
[frame_benchmarking::baseline, Baseline::<Runtime>]
[pallet_bounties, Bounties]
[pallet_child_bounties, ChildBounties]
[pallet_delegated_staking, DelegatedStaking]
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
[frame_election_provider_support, ElectionProviderBench::<Runtime>]
[pallet_fast_unstake, FastUnstake]
Expand Down Expand Up @@ -2101,7 +2082,6 @@ sp_api::impl_runtime_apis! {
NominationPools::api_balance_to_points(pool_id, new_funds)
}

// FAIL-CI @ankan this is copy&pasted from Westend
fn pool_pending_slash(pool_id: pallet_nomination_pools::PoolId) -> Balance {
NominationPools::api_pool_pending_slash(pool_id)
}
Expand All @@ -2128,7 +2108,6 @@ sp_api::impl_runtime_apis! {
Staking::api_eras_stakers_page_count(era, account)
}

// FAIL-CI @ankan please check here and in Kusama
fn pending_rewards(era: sp_staking::EraIndex, account: AccountId) -> bool {
Staking::api_pending_rewards(era, account)
}
Expand Down

0 comments on commit 163a4da

Please sign in to comment.