Create pallet-duniter-quotas that also handle prioritization
After a lot of reflexion, the easiest and most flexible way is to create our own pallet that handle prioritization and quotas at the same time.
This new pallet will also manage prioritization and fees.
This new pallet should also provide a WeightToFee
and LengthToFee
implementations, that automatically deduce remaining quotas.
The tip
will take on a new meaning, it will indicate the priority level desired by the user, but will not incur any additional fees, because we do not want the richest to systematically go first.
Prioritization must still be "expensive", otherwise everyone can prioritize to the maximum all the time and consequently there is no prioritization. The idea is to consume more quotas if the user indicates a higher prioritization level, according to a multiplier:
tip | consumed quotas |
---|---|
0 | quotas * 1 |
1 | quotas * 2 |
2 | quotas * 3 |
It is also necessary to define a maximum tip
, which will be a parameter of the pallet, named for example MaxPrioritization
.
Prioritized calls
Some special extrinsics will systematically take priority over others, provided that the couple (signer, call) respects specific constraints. For the call, this will be checked via a customizable Filter (defined in the runtime glue code). For the signer, we must find the information in system.account, in order not to increase the basic cost of an extrinsic. The remaining quota quantity should also be stored in system.account. So we have to add one or two fields in AccountData in the duniter-account pallet.
I propose to add a single quota
field, of type u32
, whose 1st bit will indicate if the user has the right to make a priority call, and the remaining 31 bits will indicate the amount of quota remaining.
TODO more details later.
Definitely replace #67 (closed) #77 (closed) #78 (closed) and #80 (closed).