From 66449a8e1731933c7ccbfba8a968ef97cb31ed11 Mon Sep 17 00:00:00 2001 From: weichweich Date: Wed, 16 Mar 2022 10:40:40 +0100 Subject: [PATCH 1/9] proxy type for disableling deposit claiming --- runtimes/peregrine/src/lib.rs | 17 +++++++++++++++++ runtimes/spiritnet/src/lib.rs | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/runtimes/peregrine/src/lib.rs b/runtimes/peregrine/src/lib.rs index cb4ea942c6..22b861feaa 100644 --- a/runtimes/peregrine/src/lib.rs +++ b/runtimes/peregrine/src/lib.rs @@ -758,6 +758,7 @@ pub enum ProxyType { Governance, ParachainStaking, CancelProxy, + NonDepositClaiming, } impl Default for ProxyType { @@ -793,6 +794,14 @@ impl InstanceFilter for ProxyType { Call::Utility(..) | Call::ParachainStaking(..) ), + // everything but reclaiming and transferring deposits + ProxyType::NonDepositClaiming => !matches!(c, + Call::Did(did::Call::reclaim_deposit) | + Call::Did(pallet_did_lookup::Call::reclaim_deposit) | + Call::Did(attestation::Call::reclaim_deposit) | + Call::Did(delegation::Call::reclaim_deposit) | + Call::Did(pallet_web3_names::Call::reclaim_deposit) | + ), ProxyType::Governance => matches!( c, Call::Democracy(..) @@ -811,8 +820,16 @@ impl InstanceFilter for ProxyType { fn is_superset(&self, o: &Self) -> bool { match (self, o) { (x, y) if x == y => true, + // "anything" always contains any subset (ProxyType::Any, _) => true, (_, ProxyType::Any) => false, + // reclaiming deposits is part of NonTransfer but not in NonDepositClaiming + (ProxyType::NonDepositClaiming, ProxyType::NonTransfer) => false, + // everything except NonTransfer and Any is part of NonDepositClaiming + (ProxyType::NonDepositClaiming, _) => true, + // Transfers are part of NonDepositClaiming but not in NonTransfer + (ProxyType::NonTransfer, ProxyType::NonDepositClaiming) => false, + // everything except NonDepositClaiming and Any is part of NonTransfer (ProxyType::NonTransfer, _) => true, _ => false, } diff --git a/runtimes/spiritnet/src/lib.rs b/runtimes/spiritnet/src/lib.rs index 6e6808d675..1a10969cae 100644 --- a/runtimes/spiritnet/src/lib.rs +++ b/runtimes/spiritnet/src/lib.rs @@ -763,6 +763,7 @@ pub enum ProxyType { Governance, ParachainStaking, CancelProxy, + NonDepositClaiming, } impl Default for ProxyType { @@ -798,6 +799,14 @@ impl InstanceFilter for ProxyType { Call::Utility(..) | Call::ParachainStaking(..) ), + // everything but reclaiming and transferring deposits + ProxyType::NonDepositClaiming => !matches!(c, + Call::Did(did::Call::reclaim_deposit) | + Call::Did(pallet_did_lookup::Call::reclaim_deposit) | + Call::Did(attestation::Call::reclaim_deposit) | + Call::Did(delegation::Call::reclaim_deposit) | + Call::Did(pallet_web3_names::Call::reclaim_deposit) | + ), ProxyType::Governance => matches!( c, Call::Democracy(..) @@ -816,8 +825,16 @@ impl InstanceFilter for ProxyType { fn is_superset(&self, o: &Self) -> bool { match (self, o) { (x, y) if x == y => true, + // "anything" always contains any subset (ProxyType::Any, _) => true, (_, ProxyType::Any) => false, + // reclaiming deposits is part of NonTransfer but not in NonDepositClaiming + (ProxyType::NonDepositClaiming, ProxyType::NonTransfer) => false, + // everything except NonTransfer and Any is part of NonDepositClaiming + (ProxyType::NonDepositClaiming, _) => true, + // Transfers are part of NonDepositClaiming but not in NonTransfer + (ProxyType::NonTransfer, ProxyType::NonDepositClaiming) => false, + // everything except NonDepositClaiming and Any is part of NonTransfer (ProxyType::NonTransfer, _) => true, _ => false, } From a272df8dc036fe2e750a60baa51d40c477ebd9d2 Mon Sep 17 00:00:00 2001 From: weichweich Date: Wed, 16 Mar 2022 10:58:44 +0100 Subject: [PATCH 2/9] fix --- runtimes/peregrine/src/lib.rs | 13 +++++++------ runtimes/spiritnet/src/lib.rs | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/runtimes/peregrine/src/lib.rs b/runtimes/peregrine/src/lib.rs index 22b861feaa..b4f7c1ffc3 100644 --- a/runtimes/peregrine/src/lib.rs +++ b/runtimes/peregrine/src/lib.rs @@ -795,12 +795,13 @@ impl InstanceFilter for ProxyType { Call::ParachainStaking(..) ), // everything but reclaiming and transferring deposits - ProxyType::NonDepositClaiming => !matches!(c, - Call::Did(did::Call::reclaim_deposit) | - Call::Did(pallet_did_lookup::Call::reclaim_deposit) | - Call::Did(attestation::Call::reclaim_deposit) | - Call::Did(delegation::Call::reclaim_deposit) | - Call::Did(pallet_web3_names::Call::reclaim_deposit) | + ProxyType::NonDepositClaiming => !matches!( + c, + Call::Did(did::Call::reclaim_deposit { .. }) + | Call::DidLookup(pallet_did_lookup::Call::reclaim_deposit { .. }) + | Call::Attestation(attestation::Call::reclaim_deposit { .. }) + | Call::Delegation(delegation::Call::reclaim_deposit { .. }) + | Call::Web3Names(pallet_web3_names::Call::reclaim_deposit { .. }) ), ProxyType::Governance => matches!( c, diff --git a/runtimes/spiritnet/src/lib.rs b/runtimes/spiritnet/src/lib.rs index 1a10969cae..cb0c168c48 100644 --- a/runtimes/spiritnet/src/lib.rs +++ b/runtimes/spiritnet/src/lib.rs @@ -800,12 +800,13 @@ impl InstanceFilter for ProxyType { Call::ParachainStaking(..) ), // everything but reclaiming and transferring deposits - ProxyType::NonDepositClaiming => !matches!(c, - Call::Did(did::Call::reclaim_deposit) | - Call::Did(pallet_did_lookup::Call::reclaim_deposit) | - Call::Did(attestation::Call::reclaim_deposit) | - Call::Did(delegation::Call::reclaim_deposit) | - Call::Did(pallet_web3_names::Call::reclaim_deposit) | + ProxyType::NonDepositClaiming => !matches!( + c, + Call::Did(did::Call::reclaim_deposit { .. }) + | Call::DidLookup(pallet_did_lookup::Call::reclaim_deposit { .. }) + | Call::Attestation(attestation::Call::reclaim_deposit { .. }) + | Call::Delegation(delegation::Call::reclaim_deposit { .. }) + | Call::Web3Names(pallet_web3_names::Call::reclaim_deposit { .. }) ), ProxyType::Governance => matches!( c, From 1aa86538218fdc8382adcdb57dfe4c4d99949207 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 23 Mar 2022 09:26:38 +0100 Subject: [PATCH 3/9] fix: explicit proxy pallet logic for peregrine runtime --- runtimes/peregrine/src/lib.rs | 140 ++++++++++++++++++++++++++-------- 1 file changed, 107 insertions(+), 33 deletions(-) diff --git a/runtimes/peregrine/src/lib.rs b/runtimes/peregrine/src/lib.rs index b4f7c1ffc3..2e070b3e15 100644 --- a/runtimes/peregrine/src/lib.rs +++ b/runtimes/peregrine/src/lib.rs @@ -753,11 +753,18 @@ impl pallet_randomness_collective_flip::Config for Runtime {} Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, scale_info::TypeInfo, )] pub enum ProxyType { + /// Allow for any call. Any, + /// Allow for calls that do not move tokens out of the caller's account. NonTransfer, + /// Allow for governance-related calls. Governance, + /// Allow for staking-related calls. ParachainStaking, + /// Allow for calls that cancel proxy information. CancelProxy, + /// Allow for calls that do not result in a deposit being claimed (e.g., for + /// attestations, delegations, or DIDs). NonDepositClaiming, } @@ -773,49 +780,116 @@ impl InstanceFilter for ProxyType { ProxyType::Any => true, ProxyType::NonTransfer => matches!( c, - Call::System(..) | - Call::Scheduler(..) | - Call::Timestamp(..) | - Call::Indices(pallet_indices::Call::claim{..}) | - Call::Indices(pallet_indices::Call::free{..}) | - Call::Indices(pallet_indices::Call::freeze{..}) | - // Specifically omitting Indices `transfer`, `force_transfer` - // Specifically omitting the entire Balances pallet - Call::Authorship(..) | - Call::Session(..) | - Call::Democracy(..) | - Call::Council(..) | - Call::TechnicalCommittee(..) | - Call::TechnicalMembership(..) | - Call::Treasury(..) | - Call::Vesting(pallet_vesting::Call::vest{..}) | - Call::Vesting(pallet_vesting::Call::vest_other{..}) | - // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` - Call::Utility(..) | - Call::ParachainStaking(..) + Call::Attestation(..) + | Call::Authorship(..) + | Call::Council(..) | Call::Ctype(..) + | Call::Delegation(..) + | Call::Democracy(..) + | Call::Did(..) + | Call::DidLookup(..) + | Call::Indices( + // Excludes `force_transfer`, and `transfer` + pallet_indices::Call::claim { .. } + | pallet_indices::Call::free { .. } + | pallet_indices::Call::freeze { .. } + ) + // Excludes `KiltLaunch` + | Call::ParachainStaking(..) + // Excludes `ParachainSystem` + | Call::Preimage(..) + | Call::Proxy(..) + | Call::Scheduler(..) + | Call::Session(..) + // Excludes `Sudo` + | Call::System(..) + | Call::TechnicalCommittee(..) + | Call::TechnicalMembership(..) + | Call::Timestamp(..) + | Call::Treasury(..) + | Call::Utility(..) + | Call::Vesting( + // Excludes `force_vested_transfer`, `merge_schedules`, and `vested_transfer` + pallet_vesting::Call::vest { .. } + | pallet_vesting::Call::vest_other { .. } + ) + | Call::Web3Names(..), ), - // everything but reclaiming and transferring deposits - ProxyType::NonDepositClaiming => !matches!( + ProxyType::NonDepositClaiming => matches!( c, - Call::Did(did::Call::reclaim_deposit { .. }) - | Call::DidLookup(pallet_did_lookup::Call::reclaim_deposit { .. }) - | Call::Attestation(attestation::Call::reclaim_deposit { .. }) - | Call::Delegation(delegation::Call::reclaim_deposit { .. }) - | Call::Web3Names(pallet_web3_names::Call::reclaim_deposit { .. }) + Call::Attestation( + // Excludes `reclaim_deposit` + attestation::Call::add { .. } + | attestation::Call::remove { .. } + | attestation::Call::revoke { .. } + ) + | Call::Authorship(..) + | Call::Balances(..) + | Call::Council(..) | Call::Ctype(..) + | Call::Delegation( + // Excludes `reclaim_deposit` + delegation::Call::add_delegation { .. } + | delegation::Call::create_hierarchy { .. } + | delegation::Call::remove_delegation { .. } + | delegation::Call::revoke_delegation { .. } + ) + | Call::Democracy(..) + | Call::Did( + // Excludes `reclaim_deposit` + did::Call::add_key_agreement_key { .. } + | did::Call::add_service_endpoint { .. } + | did::Call::create { .. } + | did::Call::delete { .. } + | did::Call::remove_attestation_key { .. } + | did::Call::remove_delegation_key { .. } + | did::Call::remove_key_agreement_key { .. } + | did::Call::remove_service_endpoint { .. } + | did::Call::set_attestation_key { .. } + | did::Call::set_authentication_key { .. } + | did::Call::set_delegation_key { .. } + | did::Call::submit_did_call { .. } + ) + | Call::DidLookup( + // Excludes `reclaim_deposit` + pallet_did_lookup::Call::associate_account { .. } + | pallet_did_lookup::Call::associate_sender { .. } + | pallet_did_lookup::Call::remove_account_association { .. } + | pallet_did_lookup::Call::remove_sender_association { .. } + ) + | Call::Indices(..) + // Excludes `KiltLaunch` + | Call::ParachainStaking(..) + // Excludes `ParachainSystem` + | Call::Preimage(..) + | Call::Proxy(..) + | Call::Scheduler(..) + | Call::Session(..) + // Excludes `Sudo` + | Call::System(..) + | Call::TechnicalCommittee(..) + | Call::TechnicalMembership(..) + | Call::Timestamp(..) + | Call::Treasury(..) + | Call::Utility(..) + | Call::Vesting(..) + | Call::Web3Names( + // Excludes `ban`, and `reclaim_deposit` + pallet_web3_names::Call::claim { .. } + | pallet_web3_names::Call::release_by_owner { .. } + | pallet_web3_names::Call::unban { .. } + ), ), ProxyType::Governance => matches!( c, - Call::Democracy(..) - | Call::Council(..) | Call::TechnicalCommittee(..) - | Call::Treasury(..) | Call::Utility(..) + Call::Council(..) + | Call::Democracy(..) + | Call::TechnicalCommittee(..) | Call::TechnicalMembership(..) + | Call::Treasury(..) | Call::Utility(..) ), ProxyType::ParachainStaking => { matches!(c, Call::ParachainStaking(..) | Call::Session(..) | Call::Utility(..)) } - ProxyType::CancelProxy => { - matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })) - } + ProxyType::CancelProxy => matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })), } } fn is_superset(&self, o: &Self) -> bool { From daeed42e34b2fcda17605d8b03ffb54c6d2cbec5 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 23 Mar 2022 09:35:18 +0100 Subject: [PATCH 4/9] fix: finalise proxy definition for spiritnet --- runtimes/peregrine/src/lib.rs | 3 +- runtimes/spiritnet/src/lib.rs | 139 ++++++++++++++++++++++++++-------- 2 files changed, 108 insertions(+), 34 deletions(-) diff --git a/runtimes/peregrine/src/lib.rs b/runtimes/peregrine/src/lib.rs index 2e070b3e15..8a1e5892f3 100644 --- a/runtimes/peregrine/src/lib.rs +++ b/runtimes/peregrine/src/lib.rs @@ -782,6 +782,7 @@ impl InstanceFilter for ProxyType { c, Call::Attestation(..) | Call::Authorship(..) + // Excludes `Balances` | Call::Council(..) | Call::Ctype(..) | Call::Delegation(..) | Call::Democracy(..) @@ -823,7 +824,7 @@ impl InstanceFilter for ProxyType { | attestation::Call::revoke { .. } ) | Call::Authorship(..) - | Call::Balances(..) + // Excludes `Balances` | Call::Council(..) | Call::Ctype(..) | Call::Delegation( // Excludes `reclaim_deposit` diff --git a/runtimes/spiritnet/src/lib.rs b/runtimes/spiritnet/src/lib.rs index cb0c168c48..4d39096133 100644 --- a/runtimes/spiritnet/src/lib.rs +++ b/runtimes/spiritnet/src/lib.rs @@ -758,11 +758,18 @@ impl pallet_randomness_collective_flip::Config for Runtime {} Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, scale_info::TypeInfo, )] pub enum ProxyType { + /// Allow for any call. Any, + /// Allow for calls that do not move tokens out of the caller's account. NonTransfer, + /// Allow for governance-related calls. Governance, + /// Allow for staking-related calls. ParachainStaking, + /// Allow for calls that cancel proxy information. CancelProxy, + /// Allow for calls that do not result in a deposit being claimed (e.g., for + /// attestations, delegations, or DIDs). NonDepositClaiming, } @@ -778,49 +785,115 @@ impl InstanceFilter for ProxyType { ProxyType::Any => true, ProxyType::NonTransfer => matches!( c, - Call::System(..) | - Call::Scheduler(..) | - Call::Timestamp(..) | - Call::Indices(pallet_indices::Call::claim{..}) | - Call::Indices(pallet_indices::Call::free{..}) | - Call::Indices(pallet_indices::Call::freeze{..}) | - // Specifically omitting Indices `transfer`, `force_transfer` - // Specifically omitting the entire Balances pallet - Call::Authorship(..) | - Call::Session(..) | - Call::Democracy(..) | - Call::Council(..) | - Call::TechnicalCommittee(..) | - Call::TechnicalMembership(..) | - Call::Treasury(..) | - Call::Vesting(pallet_vesting::Call::vest{..}) | - Call::Vesting(pallet_vesting::Call::vest_other{..}) | - // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` - Call::Utility(..) | - Call::ParachainStaking(..) + Call::Attestation(..) + | Call::Authorship(..) + // Excludes `Balances` + | Call::Council(..) | Call::Ctype(..) + | Call::Delegation(..) + | Call::Democracy(..) + | Call::Did(..) + | Call::DidLookup(..) + | Call::Indices( + // Excludes `force_transfer`, and `transfer` + pallet_indices::Call::claim { .. } + | pallet_indices::Call::free { .. } + | pallet_indices::Call::freeze { .. } + ) + // Excludes `KiltLaunch` + | Call::ParachainStaking(..) + // Excludes `ParachainSystem` + | Call::Preimage(..) + | Call::Proxy(..) + | Call::Scheduler(..) + | Call::Session(..) + | Call::System(..) + | Call::TechnicalCommittee(..) + | Call::TechnicalMembership(..) + | Call::Timestamp(..) + | Call::Treasury(..) + | Call::Utility(..) + | Call::Vesting( + // Excludes `force_vested_transfer`, `merge_schedules`, and `vested_transfer` + pallet_vesting::Call::vest { .. } + | pallet_vesting::Call::vest_other { .. } + ) + | Call::Web3Names(..), ), - // everything but reclaiming and transferring deposits - ProxyType::NonDepositClaiming => !matches!( + ProxyType::NonDepositClaiming => matches!( c, - Call::Did(did::Call::reclaim_deposit { .. }) - | Call::DidLookup(pallet_did_lookup::Call::reclaim_deposit { .. }) - | Call::Attestation(attestation::Call::reclaim_deposit { .. }) - | Call::Delegation(delegation::Call::reclaim_deposit { .. }) - | Call::Web3Names(pallet_web3_names::Call::reclaim_deposit { .. }) + Call::Attestation( + // Excludes `reclaim_deposit` + attestation::Call::add { .. } + | attestation::Call::remove { .. } + | attestation::Call::revoke { .. } + ) + | Call::Authorship(..) + // Excludes `Balances` + | Call::Council(..) | Call::Ctype(..) + | Call::Delegation( + // Excludes `reclaim_deposit` + delegation::Call::add_delegation { .. } + | delegation::Call::create_hierarchy { .. } + | delegation::Call::remove_delegation { .. } + | delegation::Call::revoke_delegation { .. } + ) + | Call::Democracy(..) + | Call::Did( + // Excludes `reclaim_deposit` + did::Call::add_key_agreement_key { .. } + | did::Call::add_service_endpoint { .. } + | did::Call::create { .. } + | did::Call::delete { .. } + | did::Call::remove_attestation_key { .. } + | did::Call::remove_delegation_key { .. } + | did::Call::remove_key_agreement_key { .. } + | did::Call::remove_service_endpoint { .. } + | did::Call::set_attestation_key { .. } + | did::Call::set_authentication_key { .. } + | did::Call::set_delegation_key { .. } + | did::Call::submit_did_call { .. } + ) + | Call::DidLookup( + // Excludes `reclaim_deposit` + pallet_did_lookup::Call::associate_account { .. } + | pallet_did_lookup::Call::associate_sender { .. } + | pallet_did_lookup::Call::remove_account_association { .. } + | pallet_did_lookup::Call::remove_sender_association { .. } + ) + | Call::Indices(..) + // Excludes `KiltLaunch` + | Call::ParachainStaking(..) + // Excludes `ParachainSystem` + | Call::Preimage(..) + | Call::Proxy(..) + | Call::Scheduler(..) + | Call::Session(..) + | Call::System(..) + | Call::TechnicalCommittee(..) + | Call::TechnicalMembership(..) + | Call::Timestamp(..) + | Call::Treasury(..) + | Call::Utility(..) + | Call::Vesting(..) + | Call::Web3Names( + // Excludes `ban`, and `reclaim_deposit` + pallet_web3_names::Call::claim { .. } + | pallet_web3_names::Call::release_by_owner { .. } + | pallet_web3_names::Call::unban { .. } + ), ), ProxyType::Governance => matches!( c, - Call::Democracy(..) - | Call::Council(..) | Call::TechnicalCommittee(..) - | Call::Treasury(..) | Call::Utility(..) + Call::Council(..) + | Call::Democracy(..) + | Call::TechnicalCommittee(..) | Call::TechnicalMembership(..) + | Call::Treasury(..) | Call::Utility(..) ), ProxyType::ParachainStaking => { matches!(c, Call::ParachainStaking(..) | Call::Session(..) | Call::Utility(..)) } - ProxyType::CancelProxy => { - matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })) - } + ProxyType::CancelProxy => matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })), } } fn is_superset(&self, o: &Self) -> bool { From 3b59dd2de352ee93758bab064258ea9cdd65a518 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 23 Mar 2022 09:47:59 +0100 Subject: [PATCH 5/9] chore: add explicit encoding value for proxy types --- runtimes/peregrine/src/lib.rs | 12 ++++++------ runtimes/spiritnet/src/lib.rs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runtimes/peregrine/src/lib.rs b/runtimes/peregrine/src/lib.rs index 8a1e5892f3..1822f9ca47 100644 --- a/runtimes/peregrine/src/lib.rs +++ b/runtimes/peregrine/src/lib.rs @@ -754,18 +754,18 @@ impl pallet_randomness_collective_flip::Config for Runtime {} )] pub enum ProxyType { /// Allow for any call. - Any, + Any = 0, /// Allow for calls that do not move tokens out of the caller's account. - NonTransfer, + NonTransfer = 1, /// Allow for governance-related calls. - Governance, + Governance = 2, /// Allow for staking-related calls. - ParachainStaking, + ParachainStaking = 3, /// Allow for calls that cancel proxy information. - CancelProxy, + CancelProxy = 4, /// Allow for calls that do not result in a deposit being claimed (e.g., for /// attestations, delegations, or DIDs). - NonDepositClaiming, + NonDepositClaiming = 5, } impl Default for ProxyType { diff --git a/runtimes/spiritnet/src/lib.rs b/runtimes/spiritnet/src/lib.rs index 4d39096133..458681b621 100644 --- a/runtimes/spiritnet/src/lib.rs +++ b/runtimes/spiritnet/src/lib.rs @@ -759,18 +759,18 @@ impl pallet_randomness_collective_flip::Config for Runtime {} )] pub enum ProxyType { /// Allow for any call. - Any, + Any = 0, /// Allow for calls that do not move tokens out of the caller's account. - NonTransfer, + NonTransfer = 1, /// Allow for governance-related calls. - Governance, + Governance = 2, /// Allow for staking-related calls. - ParachainStaking, + ParachainStaking = 3, /// Allow for calls that cancel proxy information. - CancelProxy, + CancelProxy = 4, /// Allow for calls that do not result in a deposit being claimed (e.g., for /// attestations, delegations, or DIDs). - NonDepositClaiming, + NonDepositClaiming = 5, } impl Default for ProxyType { From a75901ff84650576573a188a619d641053f9d536 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 23 Mar 2022 10:02:12 +0100 Subject: [PATCH 6/9] chore: update mashnet-node with similar proxy structure as peregrine --- runtimes/peregrine/src/lib.rs | 12 ++-- runtimes/spiritnet/src/lib.rs | 12 ++-- runtimes/standalone/src/lib.rs | 113 ++++++++++++++++++++++++++------- 3 files changed, 101 insertions(+), 36 deletions(-) diff --git a/runtimes/peregrine/src/lib.rs b/runtimes/peregrine/src/lib.rs index 1822f9ca47..8a1e5892f3 100644 --- a/runtimes/peregrine/src/lib.rs +++ b/runtimes/peregrine/src/lib.rs @@ -754,18 +754,18 @@ impl pallet_randomness_collective_flip::Config for Runtime {} )] pub enum ProxyType { /// Allow for any call. - Any = 0, + Any, /// Allow for calls that do not move tokens out of the caller's account. - NonTransfer = 1, + NonTransfer, /// Allow for governance-related calls. - Governance = 2, + Governance, /// Allow for staking-related calls. - ParachainStaking = 3, + ParachainStaking, /// Allow for calls that cancel proxy information. - CancelProxy = 4, + CancelProxy, /// Allow for calls that do not result in a deposit being claimed (e.g., for /// attestations, delegations, or DIDs). - NonDepositClaiming = 5, + NonDepositClaiming, } impl Default for ProxyType { diff --git a/runtimes/spiritnet/src/lib.rs b/runtimes/spiritnet/src/lib.rs index 458681b621..4d39096133 100644 --- a/runtimes/spiritnet/src/lib.rs +++ b/runtimes/spiritnet/src/lib.rs @@ -759,18 +759,18 @@ impl pallet_randomness_collective_flip::Config for Runtime {} )] pub enum ProxyType { /// Allow for any call. - Any = 0, + Any, /// Allow for calls that do not move tokens out of the caller's account. - NonTransfer = 1, + NonTransfer, /// Allow for governance-related calls. - Governance = 2, + Governance, /// Allow for staking-related calls. - ParachainStaking = 3, + ParachainStaking, /// Allow for calls that cancel proxy information. - CancelProxy = 4, + CancelProxy, /// Allow for calls that do not result in a deposit being claimed (e.g., for /// attestations, delegations, or DIDs). - NonDepositClaiming = 5, + NonDepositClaiming, } impl Default for ProxyType { diff --git a/runtimes/standalone/src/lib.rs b/runtimes/standalone/src/lib.rs index f7f94bf3d5..914c78aa5c 100644 --- a/runtimes/standalone/src/lib.rs +++ b/runtimes/standalone/src/lib.rs @@ -524,13 +524,15 @@ impl pallet_randomness_collective_flip::Config for Runtime {} Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, scale_info::TypeInfo, )] pub enum ProxyType { + /// Allow for any call. Any, + /// Allow for calls that do not move tokens out of the caller's account. NonTransfer, + /// Allow for staking-related calls. CancelProxy, - Ctype, - Attestation, - Delegation, - Did, + /// Allow for calls that do not result in a deposit being claimed (e.g., for + /// attestations, delegations, or DIDs). + NonDepositClaiming, } impl Default for ProxyType { @@ -545,34 +547,97 @@ impl InstanceFilter for ProxyType { ProxyType::Any => true, ProxyType::NonTransfer => matches!( c, - Call::System(..) | - Call::Timestamp(..) | - Call::Indices(pallet_indices::Call::claim{..}) | - Call::Indices(pallet_indices::Call::free{..}) | - Call::Indices(pallet_indices::Call::freeze{..}) | - // Specifically omitting Indices `transfer`, `force_transfer` - // Specifically omitting the entire Balances pallet - Call::Authorship(..) | - Call::Session(..) | - Call::Vesting(pallet_vesting::Call::vest{..}) | - Call::Vesting(pallet_vesting::Call::vest_other{..}) | - // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` - Call::Utility(..) + Call::Attestation(..) + | Call::Authorship(..) + // Excludes `Balances` + | Call::Ctype(..) + | Call::Delegation(..) + | Call::Did(..) + | Call::DidLookup(..) + | Call::Indices( + // Excludes `force_transfer`, and `transfer` + pallet_indices::Call::claim { .. } + | pallet_indices::Call::free { .. } + | pallet_indices::Call::freeze { .. } + ) + | Call::Proxy(..) + | Call::Session(..) + // Excludes `Sudo` + | Call::System(..) + | Call::Timestamp(..) + | Call::Utility(..) + | Call::Web3Names(..), ), - ProxyType::Ctype => matches!(c, Call::Ctype(..)), - ProxyType::Delegation => matches!(c, Call::Delegation(..)), - ProxyType::Attestation => matches!(c, Call::Attestation(..)), - ProxyType::Did => matches!(c, Call::Did(..)), - ProxyType::CancelProxy => { - matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })) - } + ProxyType::NonDepositClaiming => matches!( + c, + Call::Attestation( + // Excludes `reclaim_deposit` + attestation::Call::add { .. } + | attestation::Call::remove { .. } + | attestation::Call::revoke { .. } + ) + | Call::Authorship(..) + // Excludes `Balances` + | Call::Ctype(..) + | Call::Delegation( + // Excludes `reclaim_deposit` + delegation::Call::add_delegation { .. } + | delegation::Call::create_hierarchy { .. } + | delegation::Call::remove_delegation { .. } + | delegation::Call::revoke_delegation { .. } + ) + | Call::Did( + // Excludes `reclaim_deposit` + did::Call::add_key_agreement_key { .. } + | did::Call::add_service_endpoint { .. } + | did::Call::create { .. } + | did::Call::delete { .. } + | did::Call::remove_attestation_key { .. } + | did::Call::remove_delegation_key { .. } + | did::Call::remove_key_agreement_key { .. } + | did::Call::remove_service_endpoint { .. } + | did::Call::set_attestation_key { .. } + | did::Call::set_authentication_key { .. } + | did::Call::set_delegation_key { .. } + | did::Call::submit_did_call { .. } + ) + | Call::DidLookup( + // Excludes `reclaim_deposit` + pallet_did_lookup::Call::associate_account { .. } + | pallet_did_lookup::Call::associate_sender { .. } + | pallet_did_lookup::Call::remove_account_association { .. } + | pallet_did_lookup::Call::remove_sender_association { .. } + ) + | Call::Indices(..) + | Call::Proxy(..) + | Call::Session(..) + // Excludes `Sudo` + | Call::System(..) + | Call::Timestamp(..) + | Call::Utility(..) + | Call::Web3Names( + // Excludes `ban`, and `reclaim_deposit` + pallet_web3_names::Call::claim { .. } + | pallet_web3_names::Call::release_by_owner { .. } + | pallet_web3_names::Call::unban { .. } + ), + ), + ProxyType::CancelProxy => matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })), } } fn is_superset(&self, o: &Self) -> bool { match (self, o) { (x, y) if x == y => true, + // "anything" always contains any subset (ProxyType::Any, _) => true, (_, ProxyType::Any) => false, + // reclaiming deposits is part of NonTransfer but not in NonDepositClaiming + (ProxyType::NonDepositClaiming, ProxyType::NonTransfer) => false, + // everything except NonTransfer and Any is part of NonDepositClaiming + (ProxyType::NonDepositClaiming, _) => true, + // Transfers are part of NonDepositClaiming but not in NonTransfer + (ProxyType::NonTransfer, ProxyType::NonDepositClaiming) => false, + // everything except NonDepositClaiming and Any is part of NonTransfer (ProxyType::NonTransfer, _) => true, _ => false, } From 5b5ae0a074de2cd48dac92900261a1de7a98de39 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Fri, 25 Mar 2022 08:19:22 +0100 Subject: [PATCH 7/9] chore: clippy --- pallets/attestation/src/mock.rs | 1 + pallets/delegation/src/mock.rs | 1 + pallets/did/src/mock.rs | 3 +-- pallets/pallet-did-lookup/src/mock.rs | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/attestation/src/mock.rs b/pallets/attestation/src/mock.rs index 51665c2b28..8efb034016 100644 --- a/pallets/attestation/src/mock.rs +++ b/pallets/attestation/src/mock.rs @@ -364,6 +364,7 @@ pub(crate) mod runtime { ext } + #[cfg(feature = "runtime-benchmarks")] pub fn build_with_keystore(self) -> sp_io::TestExternalities { let mut ext = self.build(); diff --git a/pallets/delegation/src/mock.rs b/pallets/delegation/src/mock.rs index b096f56a8f..ede4f0cfbf 100644 --- a/pallets/delegation/src/mock.rs +++ b/pallets/delegation/src/mock.rs @@ -506,6 +506,7 @@ pub(crate) mod runtime { ext } + #[cfg(feature = "runtime-benchmarks")] pub fn build_with_keystore(self) -> sp_io::TestExternalities { let mut ext = self.build(); diff --git a/pallets/did/src/mock.rs b/pallets/did/src/mock.rs index 37fb2dcf15..ef765550f8 100644 --- a/pallets/did/src/mock.rs +++ b/pallets/did/src/mock.rs @@ -496,8 +496,7 @@ impl ExtBuilder { ext } - // allowance only required for clippy, this function is actually used - #[allow(dead_code)] + #[cfg(feature = "runtime-benchmarks")] pub fn build_with_keystore(self) -> sp_io::TestExternalities { let mut ext = self.build(None); diff --git a/pallets/pallet-did-lookup/src/mock.rs b/pallets/pallet-did-lookup/src/mock.rs index 568aec4af9..aa5628308a 100644 --- a/pallets/pallet-did-lookup/src/mock.rs +++ b/pallets/pallet-did-lookup/src/mock.rs @@ -158,7 +158,6 @@ impl ExtBuilder { ext } - // allowance only required for clippy, this function is actually used #[cfg(feature = "runtime-benchmarks")] pub fn build_with_keystore(self) -> sp_io::TestExternalities { let mut ext = self.build(); From 8bd1b00a810f02a29dd10328332b1aefda937aad Mon Sep 17 00:00:00 2001 From: kiltbot <> Date: Fri, 25 Mar 2022 08:23:08 +0100 Subject: [PATCH 8/9] cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-proxy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/pallet_proxy.rs --template=.maintain/runtime-weight-template.hbs --- .../peregrine/src/weights/pallet_proxy.rs | 76 +++++++++---------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/runtimes/peregrine/src/weights/pallet_proxy.rs b/runtimes/peregrine/src/weights/pallet_proxy.rs index da9e315e49..d73c27170b 100644 --- a/runtimes/peregrine/src/weights/pallet_proxy.rs +++ b/runtimes/peregrine/src/weights/pallet_proxy.rs @@ -19,8 +19,8 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 +//! DATE: 2022-03-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: // target/release/kilt-parachain @@ -49,40 +49,38 @@ pub struct WeightInfo(PhantomData); impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) fn proxy(p: u32, ) -> Weight { - (22_218_000 as Weight) - // Standard Error: 2_000 - .saturating_add((145_000 as Weight).saturating_mul(p as Weight)) + (19_267_000 as Weight) + // Standard Error: 12_000 + .saturating_add((314_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn proxy_announced(a: u32, p: u32, ) -> Weight { - (52_087_000 as Weight) - // Standard Error: 2_000 - .saturating_add((486_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 2_000 - .saturating_add((140_000 as Weight).saturating_mul(p as Weight)) + (43_254_000 as Weight) + // Standard Error: 12_000 + .saturating_add((461_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 14_000 + .saturating_add((86_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn remove_announcement(a: u32, _p: u32, ) -> Weight { - (35_943_000 as Weight) - // Standard Error: 1_000 - .saturating_add((491_000 as Weight).saturating_mul(a as Weight)) + (29_933_000 as Weight) + // Standard Error: 8_000 + .saturating_add((515_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn reject_announcement(a: u32, p: u32, ) -> Weight { - (35_780_000 as Weight) - // Standard Error: 1_000 - .saturating_add((495_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 1_000 - .saturating_add((3_000 as Weight).saturating_mul(p as Weight)) + fn reject_announcement(a: u32, _p: u32, ) -> Weight { + (30_310_000 as Weight) + // Standard Error: 9_000 + .saturating_add((479_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -90,52 +88,52 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn announce(a: u32, p: u32, ) -> Weight { - (49_742_000 as Weight) - // Standard Error: 2_000 - .saturating_add((487_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 2_000 - .saturating_add((141_000 as Weight).saturating_mul(p as Weight)) + (41_024_000 as Weight) + // Standard Error: 9_000 + .saturating_add((445_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 10_000 + .saturating_add((51_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn add_proxy(p: u32, ) -> Weight { - (41_413_000 as Weight) - // Standard Error: 4_000 - .saturating_add((222_000 as Weight).saturating_mul(p as Weight)) + (33_452_000 as Weight) + // Standard Error: 21_000 + .saturating_add((360_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxy(p: u32, ) -> Weight { - (33_997_000 as Weight) - // Standard Error: 3_000 - .saturating_add((239_000 as Weight).saturating_mul(p as Weight)) + (28_225_000 as Weight) + // Standard Error: 19_000 + .saturating_add((356_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxies(p: u32, ) -> Weight { - (33_792_000 as Weight) - // Standard Error: 2_000 - .saturating_add((140_000 as Weight).saturating_mul(p as Weight)) + (28_040_000 as Weight) + // Standard Error: 19_000 + .saturating_add((232_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) fn anonymous(p: u32, ) -> Weight { - (47_634_000 as Weight) - // Standard Error: 3_000 - .saturating_add((33_000 as Weight).saturating_mul(p as Weight)) + (39_325_000 as Weight) + // Standard Error: 15_000 + .saturating_add((11_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn kill_anonymous(p: u32, ) -> Weight { - (35_811_000 as Weight) - // Standard Error: 3_000 - .saturating_add((140_000 as Weight).saturating_mul(p as Weight)) + (30_673_000 as Weight) + // Standard Error: 14_000 + .saturating_add((205_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } From 1496925e341b142b393f9f8c4bb5487a849675e1 Mon Sep 17 00:00:00 2001 From: kiltbot <> Date: Fri, 25 Mar 2022 08:25:38 +0100 Subject: [PATCH 9/9] cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=pallet-proxy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/pallet_proxy.rs --template=.maintain/runtime-weight-template.hbs --- .../spiritnet/src/weights/pallet_proxy.rs | 80 +++++++++---------- 1 file changed, 38 insertions(+), 42 deletions(-) diff --git a/runtimes/spiritnet/src/weights/pallet_proxy.rs b/runtimes/spiritnet/src/weights/pallet_proxy.rs index a8e6b1c9a7..762a7ff703 100644 --- a/runtimes/spiritnet/src/weights/pallet_proxy.rs +++ b/runtimes/spiritnet/src/weights/pallet_proxy.rs @@ -19,8 +19,8 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-01-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("spiritnet-dev"), DB CACHE: 128 +//! DATE: 2022-03-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("spiritnet-dev"), DB CACHE: 1024 // Executed Command: // target/release/kilt-parachain @@ -49,42 +49,40 @@ pub struct WeightInfo(PhantomData); impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) fn proxy(p: u32, ) -> Weight { - (21_095_000 as Weight) - // Standard Error: 2_000 - .saturating_add((151_000 as Weight).saturating_mul(p as Weight)) + (19_721_000 as Weight) + // Standard Error: 14_000 + .saturating_add((162_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn proxy_announced(a: u32, p: u32, ) -> Weight { - (49_348_000 as Weight) - // Standard Error: 2_000 - .saturating_add((495_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 2_000 - .saturating_add((149_000 as Weight).saturating_mul(p as Weight)) + (42_425_000 as Weight) + // Standard Error: 16_000 + .saturating_add((496_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 18_000 + .saturating_add((155_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn remove_announcement(a: u32, p: u32, ) -> Weight { - (34_130_000 as Weight) - // Standard Error: 2_000 - .saturating_add((498_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 2_000 - .saturating_add((7_000 as Weight).saturating_mul(p as Weight)) + fn remove_announcement(a: u32, _p: u32, ) -> Weight { + (29_958_000 as Weight) + // Standard Error: 11_000 + .saturating_add((499_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn reject_announcement(a: u32, p: u32, ) -> Weight { - (33_599_000 as Weight) - // Standard Error: 4_000 - .saturating_add((507_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 4_000 - .saturating_add((20_000 as Weight).saturating_mul(p as Weight)) + (29_568_000 as Weight) + // Standard Error: 12_000 + .saturating_add((513_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 14_000 + .saturating_add((11_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -92,52 +90,50 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn announce(a: u32, p: u32, ) -> Weight { - (46_734_000 as Weight) - // Standard Error: 2_000 - .saturating_add((494_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 2_000 - .saturating_add((156_000 as Weight).saturating_mul(p as Weight)) + (39_486_000 as Weight) + // Standard Error: 14_000 + .saturating_add((560_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 16_000 + .saturating_add((229_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn add_proxy(p: u32, ) -> Weight { - (39_046_000 as Weight) - // Standard Error: 3_000 - .saturating_add((225_000 as Weight).saturating_mul(p as Weight)) + (34_522_000 as Weight) + // Standard Error: 17_000 + .saturating_add((249_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxy(p: u32, ) -> Weight { - (32_338_000 as Weight) - // Standard Error: 3_000 - .saturating_add((245_000 as Weight).saturating_mul(p as Weight)) + (29_057_000 as Weight) + // Standard Error: 17_000 + .saturating_add((240_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxies(p: u32, ) -> Weight { - (32_023_000 as Weight) - // Standard Error: 2_000 - .saturating_add((146_000 as Weight).saturating_mul(p as Weight)) + (28_744_000 as Weight) + // Standard Error: 19_000 + .saturating_add((184_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) - fn anonymous(p: u32, ) -> Weight { - (45_233_000 as Weight) - // Standard Error: 3_000 - .saturating_add((35_000 as Weight).saturating_mul(p as Weight)) + fn anonymous(_p: u32, ) -> Weight { + (40_665_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } // Storage: Proxy Proxies (r:1 w:1) fn kill_anonymous(p: u32, ) -> Weight { - (33_859_000 as Weight) - // Standard Error: 2_000 - .saturating_add((159_000 as Weight).saturating_mul(p as Weight)) + (31_118_000 as Weight) + // Standard Error: 14_000 + .saturating_add((213_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) }