Skip to content

[FRAME] Introduce TransactionExtension (V2 SE) #2160

@ggwpez

Description

@ggwpez

@gavofyork proposed an overhaul of the current SignedExtension to allow for a few new things; called TransactionExtension. The key points that should be possible with the new solution are:

  • Arbitrary origin conversion in the form of Option<Origin> -> Option<Origin> by pre_validate.
  • Attaching additional data to unsigned TX (this is important to make good use of the origin conversion).
  • Removing the distinction between signed and unsigned TX and instead moving the signature check into a TE.
  • Merging pre_dispatch_unsigned/pre_dispatch and validate_unsigned/validate.

Concretely, this would mean that pre_dispatch would change like this:

 	fn pre_dispatch(
 		self,
-		who: &Self::AccountId,
+		who: &Option<<Self::Call as Dispatchable>::RuntimeOrigin>,
 		call: &Self::Call,
 		info: &DispatchInfoOf<Self::Call>,
 		len: usize,
-	) -> Result<Self::Pre, TransactionValidityError>;
+	) -> Result<(Self::Pre, Option<<Self::Call as Dispatchable>::RuntimeOrigin>), TransactionValidityError>;

In the process of this we will probably bump the transaction version. Gav considered to keep it backwards compatible by a TE that can read the old signatures, but it was discarded since we would need to keep this compatibility TE forever until we decide to bump the TX version. Having the 6 months deprecation cycle is preferred here.

cc @bkchr @gupnik

Metadata

Metadata

Assignees

No one assigned

    Labels

    T1-FRAMEThis PR/Issue is related to core FRAME, the framework.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions