diff --git a/docs/changelog_for_devs.md b/docs/changelog_for_devs.md index 28b75a85d..491cdde57 100644 --- a/docs/changelog_for_devs.md +++ b/docs/changelog_for_devs.md @@ -14,6 +14,7 @@ APIs/RPC interface. ## v0.3.9 +[#1011]: https://github.com/zeitgeistpm/zeitgeist/pull/1011 [#937]: https://github.com/zeitgeistpm/zeitgeist/pull/937 [#903]: https://github.com/zeitgeistpm/zeitgeist/pull/903 @@ -21,6 +22,9 @@ APIs/RPC interface. - ⚠️ Add `outsider` field to `MarketBonds` struct. In particular, the `Market` struct's layout has changed ([#903]). +- Adjust `deposit` function used to calculate storage fees for the following + pallets: identity, multisig, preimage, proxy. The cost of adding an identity + reduced from a minimum of 125 ZTG to a minimum of 1.5243 ZTG ([#1011]) ### Fixed diff --git a/primitives/src/constants.rs b/primitives/src/constants.rs index 1c66ffcd6..ec0dd7740 100644 --- a/primitives/src/constants.rs +++ b/primitives/src/constants.rs @@ -42,8 +42,10 @@ pub const CENT: Balance = BASE / 100; // 100_000_000 pub const MILLI: Balance = CENT / 10; // 10_000_000 pub const MICRO: Balance = MILLI / 1000; // 10_000 +/// Storage cost per byte and item. +// Approach: Achieve same cost per item and bytes in relation to total supply as on Polkadot. pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 20 * BASE + (bytes as Balance) * 100 * MILLI + items as Balance * 150 * CENT + (bytes as Balance) * 75 * MICRO } // Rikiddo and TokensConfig diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 0d9ee4467..753e92efd 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -119,9 +119,9 @@ parameter_types! { // Identity /// The amount held on deposit for a registered identity - pub const BasicDeposit: Balance = 8 * BASE; + pub const BasicDeposit: Balance = deposit(1, 258); /// The amount held on deposit per additional field for a registered identity. - pub const FieldDeposit: Balance = 256 * CENT; + pub const FieldDeposit: Balance = deposit(0, 66); /// Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O /// required to access an identity, but can be pretty high. pub const MaxAdditionalFields: u32 = 64; @@ -133,7 +133,7 @@ parameter_types! { /// The amount held on deposit for a registered subaccount. This should account for the fact /// that one storage item's value will increase by the size of an account ID, and there will /// be another trie item whose value is the size of an account ID plus 32 bytes. - pub const SubAccountDeposit: Balance = 2 * BASE; + pub const SubAccountDeposit: Balance = deposit(1, 53); // Liquidity Mining parameters /// Pallet identifier, mainly used for named balance reserves. diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 2b550afe9..f2aa054be 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -119,9 +119,9 @@ parameter_types! { // Identity /// The amount held on deposit for a registered identity - pub const BasicDeposit: Balance = 100 * BASE; + pub const BasicDeposit: Balance = deposit(1, 258); /// The amount held on deposit per additional field for a registered identity. - pub const FieldDeposit: Balance = 25 * BASE; + pub const FieldDeposit: Balance = deposit(0, 66); /// Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O /// required to access an identity, but can be pretty high. pub const MaxAdditionalFields: u32 = 16; @@ -133,7 +133,7 @@ parameter_types! { /// The amount held on deposit for a registered subaccount. This should account for the fact /// that one storage item's value will increase by the size of an account ID, and there will /// be another trie item whose value is the size of an account ID plus 32 bytes. - pub const SubAccountDeposit: Balance = 20 * BASE; + pub const SubAccountDeposit: Balance = deposit(1, 53); // Liquidity Mining parameters /// Pallet identifier, mainly used for named balance reserves. DO NOT CHANGE.