polkadot-sdk icon indicating copy to clipboard operation
polkadot-sdk copied to clipboard

Re-consideration `poke` for Deposits

Open kianenigma opened this issue 1 year ago • 7 comments

Many pallets are collecting deposits to prevent spam. Some hard-code values that indicate what that deposit is, some use the newer Consideration API. Some efforts exist to migrate more pallets to the new API: https://github.com/paritytech/polkadot-sdk/issues/226

In both cases, the pallets should be capable of adjusting the deposit in a lazy manner. As in, if the "deposit formula" (regardless of how it is expressed) changes, we can re-adjust it.

This should be done lazily, via a permissionless fn poke() transaction that is free in the case of a successful adjustment, and a paid noop otherwise.

Pallets in scope of migration:

  • [x] pallet-indices #7587

  • [x] pallet-multisig: #7700

  • [x] pallet-proxy: #7801

  • [x] pallet-society: #7833 Deposit reserved here: 1

  • [ ] pallet-bounties: #8382 Deposit reserved here: 1, 2

  • [x] pallet-recovery: #7882 Deposit reserved here: 1, 2

kianenigma avatar Sep 04 '24 15:09 kianenigma

Yeah we should have lot more utility pallets to reduce number of non-business logic code in each pallet. pallet-parameters is one improve that eliminates the needs to implement parameter handling logics. We could have a similar pallet handles all the deposits and poke etc.

xlc avatar Sep 04 '24 22:09 xlc

good name: fn reconisder(origin).

kianenigma avatar Sep 11 '24 09:09 kianenigma

I would like to see one example of this created as a learning demo, and it would allow then many ppl to start working on this in parallel.

kianenigma avatar Oct 07 '24 14:10 kianenigma

Learning demo can be pallet indices: https://github.com/polkadot-fellows/runtimes/pull/577#discussion_r1941920392

ggwpez avatar Feb 06 '25 11:02 ggwpez

Taking pallet-proxy next.

UtkarshBhardwaj007 avatar Feb 25 '25 12:02 UtkarshBhardwaj007

for bounties pallets you probably need the poke call only for this https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/bounties/src/lib.rs#L985 the rest is reserve based on the curator fee, not the storage usage fee

muharem avatar Mar 05 '25 16:03 muharem

for bounties pallets you probably need the poke call only for this https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/bounties/src/lib.rs#L985 the rest is reserve based on the curator fee, not the storage usage fee

Similarly for child bounties, the only deposit reserved is for curators which is calculated based on a multiplier and not storage. So this won't need poke_deposit as well. I have the last PR out for this issue for pallet-bounties.

UtkarshBhardwaj007 avatar Apr 30 '25 12:04 UtkarshBhardwaj007

Added Poke deposit extrinsic to all the pallets. Closing the issue @kianenigma @muharem

UtkarshBhardwaj007 avatar May 27 '25 18:05 UtkarshBhardwaj007