Membership handler weight accounting
Currently, an extrinsic and a hook in the pallet membership call do_remove_membership
, which in turn calls the membership handler. This handler either calls remove_member
in the authority-members pallet or on_removed_member
in the universal-dividend pallet.
-
universal-dividend::on_removed_member
has a complexity parameter that is not taken into account in the actual accounting of every membership function callingmembership::do_remove_membership
in the wot instance. - The
pallet::membership::revoke_membership
has a hidden complexity parameter, bonded byT::MaxPastReeval
of the universal-dividend pallet, which poses a problem becauseT::MaxPastReeval
is not accessible in the membership pallet, and secondly, because it is an instance pallet. One way to get past that is to use theDispatchResultWithPostInfo
with weight accounting inside the extrinsic that will be instance-dependent and include the complexity parameter to avoid overcounting.
To do:
-
Propagate weight through the provider from universal-dividend::on_removed_member
topallet_membership::do_remove_membership
. -
Correct hook weight using the propagated weight. -
Compute the extrinsic weight using membership::do_remove_membership
with the worst-case scenario ofT::MaxPastReeval
i.e. arbitrary high block number during benchmark. -
Use the DispatchResultWithPostInfo
and the propagated weight to correct the weight used by the wot instance.
Edited by Benjamin Gallois