frequency
frequency copied to clipboard
`messages` pallet assumes all IPFS-hosted content is a multi-user batch file
Describe
Currently in the messages pallet, we have the ability to post two different kinds of content: OnChain and Ipfs. The storage state for messages data contains two fields, provider_id and msa_id, populated as follows:
- For
OnChaincontent,provider_idalways contains the MSA ID of the user that submitted the transaction. This may be a Provider, or a User MSA.- If the transaction indicates that it is being submitted
on_behalf_ofanother user, delgation grants are checked, and the message'smsa_idis populated with the User MSA that the message is being posted on behalf of - Otherwise, the
msa_idis set to the same value asprovider_id, to indicate that the User is acting directly, not via a Provider
- If the transaction indicates that it is being submitted
All well and good.
- For
Ipfscontent, it is assumed that the content is a batch file containing content on behalf of multiple MSAs; therefore themsa_idis set toNone. It is expected that the content will contain individual records containing MSA IDs for which delegation authority can be validated off-chain.
However, we do not make any provisions for a use case wherein a Provider posts Ipfs content on a single user's behalf, where the content schema does not contain the user's MSA ID for off-chain validation.
Some points to consider:
- Should this use case be accounted for?
- Would it make sense to enhance the
message::add_ipfs_messageextrinsic to accept anon_behalf_ofparameter, the same asmessages::add_onchain_message? - Would it make sense to enhance the Schema metadata to indicate whether it represents batch or single-user data?