-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
frame/support/src/traits.rs
Outdated
} | ||
|
||
/// An extrinsic on which we can get access to call. | ||
pub trait ExtrinsicCall: sp_runtime::traits::Extrinsic { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this cannot be added inside Extrinsic easily (because OpaqueExtrinsic for instance implements it), thus I extracted it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible to me. Maybe I would call it ExtractCall
or CallOfExtrinsic
, but looks okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My general comment is that the inherent / unsigned story I think is not super clean.
It seems that the difference between an inherent tx and an unsigned tx now is whether the module remembers to write the function is_inherent
.
Maybe this is as good as it gets, but i would actually expect something a little more clean, and without chance of forgetting to implement such a fine detail.
The compiler forces you to implement |
Yes, I also think it needs some documentation somewhere but this is the summary:
No inherent should be accepted in ValidateUnsigned::validate_unsigned, offchain worker must not send inherent too. Otherwise the block producer can include these extrinsics after some non-inherent and the block is invalid. Maybe we can improve on this with some macro attributes on calls themself so that ppl can't mess themself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
audit? burnin? anything :P
there is no client change, so no burnin. |
@thiolliere Can you get merge-able, and then it seems we are good to go |
bot merge |
Trying merge. |
* impl * fix tests * impl in execute_block * fix tests * add a test in frame-executive * fix some panic warning * use trait to get call from extrinsic * remove unused * fix test * fix testing * fix tests * return index of extrinsic on error * fix test * Update primitives/inherents/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * address comments rename trait, and refactor * refactor + doc improvment * fix tests Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Hey, |
fix #6243
fix #8144
polkadot companion: paritytech/polkadot#2560
Breaking change:
ProvideInherent::is_inherent(call) == true
)<$module as ProvideInherent>::is_inherent(call) == true
Description:
We basically introduce
ProvideInherent::is_inherent(call)
function and make use of it in impl_outer_inherent.The implementation consider a signed extrinsic to be not an inherent.
So we can accept calls where
ProvideInherent::is_inherent(call) == true
and are signed. Those are not inherent and can be valid calls.(note: we could refuse those, by adding some checker in extra_signed)
We also don't ensure that inherent call are successful.
And we don't ensure that inherent call are unique.
All we do is:
ProvideInherent::is_inherent(call) == true
to be inherent<$module as ProvideInherent>::is_inherent(call)
is true.