We currently use the dec_ / inc_ functions for provider, consumer and sufficient across pallets.
These references are anonymous and a pallet has no way to check whether an account has a specific reference or not.
This has caused issues in the past, at last with the Currency Migration (https://github.com/paritytech/substrate/pull/12951).
I would propose to have named types for all references, similar to Holds and Freezes. This would mean the introduction of:
RuntimeAccountProviderReason
RuntimeAccountConsumerReason
RuntimeAccountSufficientReason
with each being the aggregate across all pallets' Account..Reason enums. We should already have macro infrastructure in place to implement this without much overhead.
Migration
We then need to do some migration over to the named references. Possibly lazy, by first trying to access anonymous refs and then placing named references. Or through a MBM.
We currently use the
dec_ / inc_
functions forprovider
,consumer
andsufficient
across pallets.These references are anonymous and a pallet has no way to check whether an account has a specific reference or not.
This has caused issues in the past, at last with the Currency Migration (https://github.com/paritytech/substrate/pull/12951).
I would propose to have named types for all references, similar to Holds and Freezes. This would mean the introduction of:
RuntimeAccountProviderReason
RuntimeAccountConsumerReason
RuntimeAccountSufficientReason
with each being the aggregate across all pallets'
Account..Reason
enums. We should already have macro infrastructure in place to implement this without much overhead.Migration
We then need to do some migration over to the named references. Possibly lazy, by first trying to access anonymous refs and then placing named references. Or through a MBM.