mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
Identity pallet improvements (#2048)
This PR is a follow up to #1661 - [x] rename the `simple` module to `legacy` - [x] fix benchmarks to disregard the number of additional fields - [x] change the storage deposits to charge per encoded byte of the identity information instance, removing the need for `fn additional(&self) -> usize` in `IdentityInformationProvider` - [x] ~add an extrinsic to rejig deposits to account for the change above~ - [ ] ~ensure through proper configuration that the new byte-based deposit is always lower than whatever is reserved now~ - [x] remove `IdentityFields` from the `set_fields` extrinsic signature, as per [this discussion](https://github.com/paritytech/polkadot-sdk/pull/1661#discussion_r1371703403) > ensure through proper configuration that the new byte-based deposit is always lower than whatever is reserved now Not sure this is needed anymore. If the new deposits are higher than what is currently on chain and users don't have enough funds to reserve what is needed, the extrinisc fails and they're basically grandfathered and frozen until they add more funds and/or make a change to their identity. This behavior seems fine to me. Original idea [here](https://github.com/paritytech/polkadot-sdk/pull/1661#issuecomment-1779606319). > add an extrinsic to rejig deposits to account for the change above This was initially implemented but now removed from this PR in favor of the implementation detailed [here](https://github.com/paritytech/polkadot-sdk/pull/2088). --------- Signed-off-by: georgepisaltu <george.pisaltu@parity.io> Co-authored-by: joepetrowski <joe@parity.io>
This commit is contained in:
@@ -60,7 +60,7 @@ use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce};
|
||||
use pallet_asset_conversion::{NativeOrAssetId, NativeOrAssetIdConverter};
|
||||
use pallet_broker::{CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600};
|
||||
use pallet_election_provider_multi_phase::{GeometricDepositBase, SolutionAccuracyOf};
|
||||
use pallet_identity::simple::IdentityInfo;
|
||||
use pallet_identity::legacy::IdentityInfo;
|
||||
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
|
||||
use pallet_nfts::PalletFeatures;
|
||||
use pallet_nis::WithMaximumOf;
|
||||
@@ -1459,8 +1459,10 @@ impl pallet_grandpa::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const BasicDeposit: Balance = 10 * DOLLARS; // 258 bytes on-chain
|
||||
pub const FieldDeposit: Balance = 250 * CENTS; // 66 bytes on-chain
|
||||
// difference of 26 bytes on-chain for the registration and 9 bytes on-chain for the identity
|
||||
// information, already accounted for by the byte deposit
|
||||
pub const BasicDeposit: Balance = deposit(1, 17);
|
||||
pub const ByteDeposit: Balance = deposit(0, 1);
|
||||
pub const SubAccountDeposit: Balance = 2 * DOLLARS; // 53 bytes on-chain
|
||||
pub const MaxSubAccounts: u32 = 100;
|
||||
pub const MaxAdditionalFields: u32 = 100;
|
||||
@@ -1471,10 +1473,9 @@ impl pallet_identity::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type BasicDeposit = BasicDeposit;
|
||||
type FieldDeposit = FieldDeposit;
|
||||
type ByteDeposit = ByteDeposit;
|
||||
type SubAccountDeposit = SubAccountDeposit;
|
||||
type MaxSubAccounts = MaxSubAccounts;
|
||||
type MaxAdditionalFields = MaxAdditionalFields;
|
||||
type IdentityInformation = IdentityInfo<MaxAdditionalFields>;
|
||||
type MaxRegistrars = MaxRegistrars;
|
||||
type Slashed = Treasury;
|
||||
|
||||
Reference in New Issue
Block a user