-
Notifications
You must be signed in to change notification settings - Fork 699
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 Origin accessible in weight calculation #355
Comments
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. |
* Update README.md * Fix path
Plus one, this would be very useful for us right now! I had just assumed it was possible until the compiler informed me otherwise :( |
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* call dispatch origin * Update modules/call-dispatch/src/lib.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * cargo fmt --all Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
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.The text was updated successfully, but these errors were encountered: