-
Notifications
You must be signed in to change notification settings - Fork 694
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
[Tx ext stage 2: 2/4] Introduce #[pallet::authorize(...)]
macro attribute and AuthorizeCall
system transaction extension
#6324
Open
gui1117
wants to merge
8
commits into
master
Choose a base branch
from
gui-tx-ext-stage-2-part-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gui1117
changed the title
Introduce
[2/4] Introduce Nov 1, 2024
#[pallet::authorize(...)]
macro attribute and AuthorizeCall
system transaction extension#[pallet::authorize(...)]
macro attribute and AuthorizeCall
system transaction extension
gui1117
changed the title
[2/4] Introduce
[Tx ext stage 2: 2/4] Introduce Nov 1, 2024
#[pallet::authorize(...)]
macro attribute and AuthorizeCall
system transaction extension#[pallet::authorize(...)]
macro attribute and AuthorizeCall
system transaction extension
This was referenced Nov 1, 2024
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 13, 2024
…tionExtension::validate` (#6323) ## Meta This PR is part of 4 PR: * #6323 * #6324 * #6325 * #6326 ## Description One goal of transaction extension is to get rid or unsigned transactions. But unsigned transaction validation has access to the `TransactionSource`. The source is used for unsigned transactions that the node trust and don't want to pay upfront. Instead of using transaction source we could do: the transaction is valid if it is signed by the block author, conceptually it should work, but it doesn't look so easy. This PR add `TransactionSource` to the validate function for transaction extensions
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 13, 2024
…tionExtension::validate` (#6323) ## Meta This PR is part of 4 PR: * #6323 * #6324 * #6325 * #6326 ## Description One goal of transaction extension is to get rid or unsigned transactions. But unsigned transaction validation has access to the `TransactionSource`. The source is used for unsigned transactions that the node trust and don't want to pay upfront. Instead of using transaction source we could do: the transaction is valid if it is signed by the block author, conceptually it should work, but it doesn't look so easy. This PR add `TransactionSource` to the validate function for transaction extensions
gui1117
added a commit
that referenced
this pull request
Nov 14, 2024
…tionExtension::validate` (#6323) ## Meta This PR is part of 4 PR: * #6323 * #6324 * #6325 * #6326 ## Description One goal of transaction extension is to get rid or unsigned transactions. But unsigned transaction validation has access to the `TransactionSource`. The source is used for unsigned transactions that the node trust and don't want to pay upfront. Instead of using transaction source we could do: the transaction is valid if it is signed by the block author, conceptually it should work, but it doesn't look so easy. This PR add `TransactionSource` to the validate function for transaction extensions (cherry picked from commit 8e3d929)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Meta
This PR is part of 4 PR:
TransactionSource
as argument inTransactionExtension::validate
#6323#[pallet::authorize(...)]
macro attribute andAuthorizeCall
system transaction extension #6324#[pallet::authorize(...)]
to migrate unsigned in system: tasks + apply_authorized_call #6325#[pallet::authorize(...)]
to migrate all unsigned in polkadot-sdk #6326Description
#[pallet::authorize(..)]
, this attributes takes a function which returns the validity of the call.#[pallet::weight_of_authorize(..)]
, same as#[pallet::weight(..)]
defines the pre dispatch weight of theauthorize
function. It can also be retrieved fromWeightInfo
under the name:authorize_$call_name
.Authorize
in frame-support: implemented on the call for pallets and runtime, and used byAuthorizeCall
transaction extension in frame-system.Origin::Authorized
: a bit similar toUnsigned
but used for general transactions.AuthorizeCall
in frame system. This is meant to be used first in the transaction extension pipeline. It will call the authorize function and change the origin to authorizedensure_authorized
.Usage