-
Notifications
You must be signed in to change notification settings - Fork 697
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
FRAME: Meta Transaction (extension based version) #3712
Conversation
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
Signed-off-by: georgepisaltu <[email protected]>
polkadot/runtime/westend/src/lib.rs
Outdated
|
||
// The part of `TxExtension` that has to be provided and signed by user who wants | ||
// the transaciton fee to be sponsored by someone else. | ||
type BaseTxExtension = ( |
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.
FYI there is https://paritytech.github.io/polkadot-sdk/master/frame/runtime/types_common/type.SystemSignedExtensionsOf.html exactly to simplify such setups :)
This is a pretty good #3901 type of work, glad to see a PoC. |
Does this solve the challenges I listed in #266?
i.e. how is the nonce and ED handled? |
#[codec(decode_bound())] | ||
pub struct SetFeeAgent<V: Verify> | ||
where | ||
V: Codec + Debug + Sync + Send + Clone + Eq + PartialEq + StaticTypeInfo, |
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.
better to avoid all those duplicated Codec + Debug + Sync + Send + Clone + Eq + PartialEq + StaticTypeInfo
Possibly dumb question: Why do this through transaction extensions? Even the tx ext set we have now is quite complicated and is seen as some "black magic" by many developers on Polkadot 😆. Would this not be cleaner, clearer, less complicated to understand if it were implemented in a pallet? wdyt? |
@acatangiu I don't think that's possible but I hope I am wrong |
@xlc no, it does not. but I read the thread now, and I like what @shawntabrizi proposed. Basically implementation wont have any workaround for non-registered users, but it should provide a way to setup this feature, where for such users the provider reference can be used to register an account with a nonce. @acatangiu yes, it's possible, and I am working on such option. Here I wanted to try what we can do with new Transaction Extensions and reuse some of them. With a solution based on custom pallet, I think we can still reuse them. I should have answers with examples soon, if we can reuse them and if it worths it. |
It's about to get even more complicated as we shift the signature checking logic from the
It would, for sure. As @muharem said, this is more of an experiment of what it would look like with this new interface. We haven't compared the extension vs pallet approaches yet, but I am confident it would be simpler if implemented in a pallet. The origin "swap" that the transaction extension does can happen in a particular pallet's extrinsic which would then call into the actual extrinsic you want to run with the updated origin. Moreover, this extension we're building here (and any extension we end up using) would obviously be part of the pipeline for all transactions, but would only do useful work when the feature is used (sponsoring a transaction in this case). An extension like The closest example to this idea would be what If the argument for an extension is that it would be easier to use, I'd counter with the fact that it would probably be even worse if we had an extension for |
/// considered before regular transactions. | ||
#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] | ||
#[scale_info(skip_type_params(T))] | ||
pub struct ChargeTransactionPayment<T: Config>(#[codec(compact)] BalanceOf<T>); |
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.
no changes to the API of this type. get_priority
method decoupled to the separate Priority
type to be reused. the withdraw_fee
and can_withdraw_fee
just dropped.
The CI pipeline was cancelled due to failure one of the required jobs. |
I have posted an RFC issue with the current solution and a solution based on a pallet, with some considerations. Please check it out and share you thoughts. |
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/2024-04-23-technical-fellowship-opendev-call/7592/1 |
in favor of #6428 |
Experiment with a new Transaction Extension model that utilizes tx extensions to enable transaction fee sponsorship by an agent.
To see an example, refer to the
meta_tx_works
test case insubstrate/frame/transaction-payment/src/meta_tx.rs
file.This implementation serves to demonstrate the concept and not production ready.
RFC: #4123