-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make all cross pallet extrinsics transactional #3827
Comments
Is the default behavior in Substrate v3 now: paritytech/substrate#11431
|
Ok, that is great, but let me ask, if we remove the storage checks, what do we do about the mutation safety barrier? it will be quite misleading I think. Either way, can you make a new issue with this idea, which includes an explicit list of extrinsics, and which also explicitly states that the work is done after benchmark is done. |
Is already the case by default in the new version of Substrate. |
yes |
Background
Substrate now supports
transactional
macro, which means any side-effect in the extrinsic is rolled back if it results in anErr
. Read more here:https://substrate.stackexchange.com/questions/1184/whats-the-overhead-associated-with-the-transactional-macro
The computational overhead is no 0, but its quite low. This is a very substantial change, and deeply impacts how one can write extrinsics: in a more care free way without all the validation up front. I don't think we should abandon our prior methodology of having all verifications up front though, because it really encourages clarity of thinking. However, we have some very sensitive cases in our runtime where I think adding a tranactional protection can really be a good long term protection against errors: cross pallet calls.
Proposal
Identify all cross pallet calls, and make all such extrinsics transactional. This may require benchmarking, as transactionality has some performance implication.
┆Issue is synchronized with this Asana task by Unito
The text was updated successfully, but these errors were encountered: