implement quotas and refund transaction fees
This MR implements a way to link an account to an identity in order to use identity's quotas of free transactions to refund fees in on_idle
.
See https://forum.duniter.org/t/implementation-des-quotas/11543 for whole discussion.
TODO
-
automatically link the account of a newly created identity -
choose whether quotas should be decoupled from identity pallet -
find better names for coupling types and traits -
replace hardcoded RELOAD_RATE
andMAX_QUOTAS
by parameters -
test quotas reloading behavior (easier with parametric reload rate and max quotas) -
test hooks when identity status change -
propagate changes brought to gdev to other runtimes -
get new_owner_key and link_identity tests working (see forum) -
rebase on !182 (merged) to have well defined treasury initial value add error message when the identity is not eligible to be refunded (add 'Disabled' state ?)discuss return type of quotas functions (result or infallible)discuss ifIdtyData
should really be a runtime type
Benchmark and opti
-
rebase on !185 (merged) to get benchmarks from other pallets fixed -
use benchmark weight in estimation of batch refund -
benchmark calls(will go in separate MR) - (optimization) avoid calling treasury account_id
Documentation (to do on duniter website)
- document user calls to link / unlink identity to an account
- document global quotas behavior in a friendly manner (user doc goes to duniter.org website)
Edited by Hugo Trentesaux
Merge request reports
Activity
Filter activity
changed milestone to %runtime-700
added RN-runtime label
assigned to @HugoTrentesaux
After moving quotas to a separate pallet, it becomes obvious that it was the good approach:
- modularity
- better unit testing
- all quotas-related features in one place
- avoid storing quotas in
AccountData
runtime type
And the discussion points become more obvious too.
-
on_idle
functions should not fail, but we could add events to make it easier to observe that a refund failed (→ is it necessary?)
added 1 commit
- 3a7b25c5 - automatically link account of newly created identity
Please register or sign in to reply