Open athei opened 4 years ago
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.
Plus one, this would be very useful for us right now! I had just assumed it was possible until the compiler informed me otherwise :(
Adding mentor to this to encourage it being done. It will be tipped.
With transaction extensions the origin for the call of an extrinsic is not longer determined by the extrinsic type (signed, for signed extrinsic, none for inherent and unsigned), instead the origin of the call is the result of the transaction extension pipeline.
A transaction extension might validate and return a signed origin, some other might validate return another origin.
So it is difficult to determine the origin to calculate the pre dispatch weight.
For now any call which would require the origin information to give weights can put the origin as an argument of the call and ensure the origin given as an argument is equal to the origin of the call. Or have different calls for different origin.
Currently, inside the weight calculation attribute
#[weight = { ... }]
one has access to the arguments of the annotated function with the exception ofOrigin
. It is conceivable that having that available comes in handy.