transactional: Wrap pallet::calls directly in storage layers#11927
transactional: Wrap pallet::calls directly in storage layers#11927
pallet::calls directly in storage layers#11927Conversation
Before this pr we only wrapped `pallet::calls` into storage layers when executing the calls with `dispatch`. This pr is solving that by wrapping each call function inside a storage layer.
| item_impl.items.iter_mut().for_each(|i| { | ||
| if let syn::ImplItem::Method(method) = i { | ||
| let block = &method.block; | ||
| method.block = syn::parse_quote! {{ |
There was a problem hiding this comment.
This pr is solving that by wrapping each call function inside a storage layer
You change the logic of an extrinsic to be wrapped inside a with_storage_layer here?
So we now have the invariant that the logic inside an extrinsic is always transactional, no matter how its called?
There was a problem hiding this comment.
That's the idea, if you are thinking of making it configurable, there is this PR that attempts to solve it.
There was a problem hiding this comment.
Yeah, we should make it configurable eventually
|
I'm an idiot when code touches the primitives, maybe someone else can review? |
shawntabrizi
left a comment
There was a problem hiding this comment.
I am not sure about the state-machine basic changes, but otherwise awesome.
ty basti
| Self::halt(&error); | ||
| Err(DispatchErrorWithPostInfo { post_info, error }) | ||
| Self::halt(error); | ||
| Ok(().into()) |
There was a problem hiding this comment.
Why is there no post dispatch weight correction anymore?
Again in line 748
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
cheme
left a comment
There was a problem hiding this comment.
Big thanks for switching basic.rs to use the overlaychanges.
Logic looks good to me, added a few question to be sure I did not miss something.
Co-authored-by: cheme <emericchevalier.pro@gmail.com>
Before this pr we only wrapped
pallet::callsinto storage layers when executing the calls withdispatch. This pr is solving that by wrapping each call function inside a storage layer.