1

In Polkadot and Kusama, the deposit function is used to price storage object footprint, it looks like this

    pub const fn deposit(items: u32, bytes: u32) -> Balance {
        items as Balance * 20 * DOLLARS + (bytes as Balance) * 100 * MILLICENTS
    }

The semantics of this seem to be $20 for any map entry and 10c per byte actually consumed by the mapping, which is just counted as the total size of key and value of each mapping. When I use $USD denominations here I am going by the obvious attempt to price in terms of some implied liquid valuation of the native asset. Importantly, this is a general model used across the board, so it's not based on detailed considerations about each map.

The prices this attempts to produce are very large, just in terms of normal diserable costs of using certain basic blockchain features.

The inconsistency seems to be when one comes for example to the balances_pallet, it has the ExistentialDeposit has the implicit storage bond for accounts, serving the exact same purpose, but it has a radically lower price: $1

pub const EXISTENTIAL_DEPOSIT: Balance = 100 * CENTS;

Not only is this much less than the fixed $20, but also does not account for the substantial storage footprint of an account.

So here is my question: if the purpose of all of these deposits is to discourage state bloat attacks, isn't all that matters the smallest price of being able to add anything in storage at a given size? If so, having these gigantic deposit differentials would seem to be inconsistent and useless, because all that matters is whether (in this case) the balances_pallet is protected or not.

Also, why such a gigantic pricing of the other deposits?

1 Answer 1

1

I guess you already had somehow an answer here ? Computing deposits in Polkadot

Even though I don't think this is the answer you are going after; You want to call deposit on your runtime when you are looking for a more precise value depending on the number of elements and size you are expecting to maintain on storage. Though, you could configure any arbitrary value as a mean to avoid spam and bloat as long as they make sense and match the context they are being applied to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.