Skip to content

feat: support custom transaction extension values - #2273

Open
DenzelPenzel wants to merge 3 commits into
masterfrom
denzelpenzel/custom-transaction-extension-values
Open

feat: support custom transaction extension values#2273
DenzelPenzel wants to merge 3 commits into
masterfrom
denzelpenzel/custom-transaction-extension-values

Conversation

@DenzelPenzel

@DenzelPenzel DenzelPenzel commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Allow callers to provide metadata-aware values for custom transaction extensions without implementing a new Config:

let params = PolkadotExtrinsicParamsBuilder::new()
    .custom_extension("RestrictOrigins", true)
    .build();

The value is encoded against the extension type from runtime metadata. This fixes signing on chains such as Paseo Asset Hub, where RestrictOrigins contains a bare bool.

Fixes #2265.

Implementation

  • Preserve known default extension behavior and parameter access.
  • Encode custom values using runtime metadata.
  • Reject duplicate names, overrides of known extensions, and non-empty implicit data.
  • Restore the output buffer on encoding errors.

Breaking changes

DefaultTransactionExtensions<T> and its Params type changed from public tuple aliases to structs with private fields, so that custom extension values can be carried alongside the known ones. The tuples live on under new names: KnownDefaultTransactionExtensions<T> and KnownDefaultExtrinsicParams<T>.

Code which configures transactions via the builder and passes the params through opaquely is source-compatible and produces byte-identical transactions. Code which relied on the tuple shape of the params migrates as follows:

Before After
constructing the params tuple manually DefaultExtrinsicParams::from_known(tuple)
mutating an element, e.g. params.5 = ... params.known_mut().5 = ...
reading an element, e.g. &params.7 &params.known().7

Given the above, this should land in 0.51 rather than a 0.50.x patch.

Notes

@DenzelPenzel
DenzelPenzel force-pushed the denzelpenzel/custom-transaction-extension-values branch from 66a7dba to 0d59be4 Compare August 13, 2026 22:40
@DenzelPenzel
DenzelPenzel force-pushed the denzelpenzel/custom-transaction-extension-values branch from 249fd60 to 9d1ea0b Compare August 14, 2026 14:52
@DenzelPenzel
DenzelPenzel force-pushed the denzelpenzel/custom-transaction-extension-values branch from 9d1ea0b to ce9a555 Compare August 14, 2026 14:56
@DenzelPenzel
DenzelPenzel marked this pull request as ready for review August 14, 2026 15:39
@DenzelPenzel
DenzelPenzel requested a review from lexnv August 14, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot sign for a chain with a custom transaction extension without defining a whole new Config

1 participant