paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.87k stars 683 forks source link

Re-consideration `poke` for Deposits #5591

Open kianenigma opened 2 months ago

kianenigma commented 2 months ago

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.

xlc commented 2 months ago

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.

kianenigma commented 1 month ago

good name: fn reconisder(origin).

kianenigma commented 1 month ago

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.