mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-23 17:28:23 +00:00
fix: set username grace period and deposit (#416)
### Summary Set username deletion to use a 30‑day grace period (in blocks) and added a non‑zero username deposit, both based on the Moonbeam's runtimes. This makes username unbinding wait before deletion and makes authority‑issued usernames non‑free, mitigating the sybil vector while aligning with existing identity config patterns. ### Changes - Configures for `pallet_identity` - `UsernameGracePeriod = 30 * DAYS` - `UsernameGracePeriod = deposit(0, MaxUsernameLength::get())`
This commit is contained in:
parent
819cde5a02
commit
91987daf1e
4 changed files with 12 additions and 6 deletions
|
|
@ -595,6 +595,8 @@ parameter_types! {
|
|||
pub const MaxAdditionalFields: u32 = 100;
|
||||
pub const MaxRegistrars: u32 = 20;
|
||||
pub const PendingUsernameExpiration: u32 = 7 * DAYS;
|
||||
pub const UsernameGracePeriod: u32 = 30 * DAYS;
|
||||
pub const UsernameDeposit: Balance = deposit(0, MaxUsernameLength::get());
|
||||
pub const MaxSuffixLength: u32 = 7;
|
||||
pub const MaxUsernameLength: u32 = 32;
|
||||
}
|
||||
|
|
@ -626,8 +628,8 @@ impl pallet_identity::Config for Runtime {
|
|||
type MaxSuffixLength = MaxSuffixLength;
|
||||
type MaxUsernameLength = MaxUsernameLength;
|
||||
type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;
|
||||
type UsernameDeposit = ();
|
||||
type UsernameGracePeriod = ();
|
||||
type UsernameDeposit = UsernameDeposit;
|
||||
type UsernameGracePeriod = UsernameGracePeriod;
|
||||
|
||||
// TODO: Re-enable after upgrade to Polkadot SDK stable2412-8
|
||||
// see https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-stable2412-8
|
||||
|
|
|
|||
|
|
@ -592,6 +592,8 @@ parameter_types! {
|
|||
pub const MaxAdditionalFields: u32 = 100;
|
||||
pub const MaxRegistrars: u32 = 20;
|
||||
pub const PendingUsernameExpiration: u32 = 7 * DAYS;
|
||||
pub const UsernameGracePeriod: u32 = 30 * DAYS;
|
||||
pub const UsernameDeposit: Balance = deposit(0, MaxUsernameLength::get());
|
||||
pub const MaxSuffixLength: u32 = 7;
|
||||
pub const MaxUsernameLength: u32 = 32;
|
||||
}
|
||||
|
|
@ -623,8 +625,8 @@ impl pallet_identity::Config for Runtime {
|
|||
type MaxSuffixLength = MaxSuffixLength;
|
||||
type MaxUsernameLength = MaxUsernameLength;
|
||||
type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;
|
||||
type UsernameDeposit = ();
|
||||
type UsernameGracePeriod = ();
|
||||
type UsernameDeposit = UsernameDeposit;
|
||||
type UsernameGracePeriod = UsernameGracePeriod;
|
||||
|
||||
// TODO: Re-enable after upgrade to Polkadot SDK stable2412-8
|
||||
// see https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-stable2412-8
|
||||
|
|
|
|||
|
|
@ -595,6 +595,8 @@ parameter_types! {
|
|||
pub const MaxAdditionalFields: u32 = 100;
|
||||
pub const MaxRegistrars: u32 = 20;
|
||||
pub const PendingUsernameExpiration: u32 = 7 * DAYS;
|
||||
pub const UsernameGracePeriod: u32 = 30 * DAYS;
|
||||
pub const UsernameDeposit: Balance = deposit(0, MaxUsernameLength::get());
|
||||
pub const MaxSuffixLength: u32 = 7;
|
||||
pub const MaxUsernameLength: u32 = 32;
|
||||
}
|
||||
|
|
@ -626,8 +628,8 @@ impl pallet_identity::Config for Runtime {
|
|||
type MaxSuffixLength = MaxSuffixLength;
|
||||
type MaxUsernameLength = MaxUsernameLength;
|
||||
type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;
|
||||
type UsernameDeposit = ();
|
||||
type UsernameGracePeriod = ();
|
||||
type UsernameDeposit = UsernameDeposit;
|
||||
type UsernameGracePeriod = UsernameGracePeriod;
|
||||
|
||||
// TODO: Re-enable after upgrade to Polkadot SDK stable2412-8
|
||||
// see https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-stable2412-8
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue