Skip to content
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

Break up trait Extrinsic into logical components #3571

Open
georgepisaltu opened this issue Mar 5, 2024 · 2 comments
Open

Break up trait Extrinsic into logical components #3571

georgepisaltu opened this issue Mar 5, 2024 · 2 comments
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@georgepisaltu
Copy link
Contributor

In the context of the introduction of TransactionExtensions in #2280 , it became clear that the Extrinsic interface is not fit for the transaction model. Detailed discussion starts here and conclusion is here. To summarize, trait Extrinsic should identify the type of extrinsic for a given instance (inherent or transaction), while the rest of the functionality currently in trait Extrinsic should be moved to different traits:

  1. CreateTransaction: create a transaction (general), have a type for extension
  2. CreateSignedTransaction: create a signed transaction (old-school), have a type for signature and extension (basically what is now trait CreateSignedTransaction and Extrinsic::SignaturePayload)
  3. CreateInherent: create an inherent

UncheckedExtrinsic should still implement all of these. This way users can pick and choose the functionality they need by using only the necessary trait bounds and we provide backwards compatibility.

@georgepisaltu georgepisaltu added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Mar 5, 2024
@gitofdeepanshu
Copy link
Contributor

I can take this up.

@georgepisaltu
Copy link
Contributor Author

I'm actually already working on this issue with a PR to come soon. Are you interested in any of the other related issues created in #2280 ?

georgepisaltu added a commit that referenced this issue Aug 9, 2024
Fixes #3571 

Built on top of #3685.

This PR breaks up `trait Extrinsic` into different self-contained
interfaces as follows:
- `ExtrinsicLike` for querying the type of extrinsic (signed/unsigned)
- `CreateTransaction` for creating a transaction (general)
- `CreateSignedTransaction` for creating a signed transaction
(old-school)
- `CreateInherent` for creating an inherent

---------

Signed-off-by: georgepisaltu <[email protected]>
Co-authored-by: command-bot <>
gui1117 pushed a commit to gui1117/polkadot-sdk that referenced this issue Aug 15, 2024
Fixes paritytech#3571 

Built on top of paritytech#3685.

This PR breaks up `trait Extrinsic` into different self-contained
interfaces as follows:
- `ExtrinsicLike` for querying the type of extrinsic (signed/unsigned)
- `CreateTransaction` for creating a transaction (general)
- `CreateSignedTransaction` for creating a signed transaction
(old-school)
- `CreateInherent` for creating an inherent

---------

Signed-off-by: georgepisaltu <[email protected]>
Co-authored-by: command-bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

No branches or pull requests

2 participants