Skip to content

Address some issues around tx mortality#2025

Merged
jsdw merged 9 commits into
masterfrom
jsdw-mortality-config-tweaks
Jun 23, 2025
Merged

Address some issues around tx mortality#2025
jsdw merged 9 commits into
masterfrom
jsdw-mortality-config-tweaks

Conversation

@jsdw

@jsdw jsdw commented Jun 19, 2025

Copy link
Copy Markdown
Contributor
  • Make it a runtime error if you explicitly set an extrinsic to be .mortal(..) when providing params to it, but then are constructing it offline which prevents this from working. Previously we'd turn the extrinsic into an immortal one.

  • Expose mortal_from_unchecked in the DefaultExtrinsicParamsBuilder to make it a little more ergonomic to set the relevant mortality params when constructing eg an offline extrinsic. Previously You'd have to do:

    let params = DefaultExtrinsicParamsBuilder::new();
    params.5 = CheckMortalityParams::mortal_from_unchecked(for_n_blocks, from_block_n, from_block_hash);
  • Clarify the docs on these functions to make it clear that you can't use mortal() with offline extrinsics.

  • Actually construct mortal transactions by default. I think this was the intended behaviour, but it may have been accidentally broken because the default Params actually led to immortal transactions.

  • This led to uncovering an issue decoding Eras, and so now there is a proper implementation of EncodeAsType and DecodeAsType for it.

Closes #2024

@jsdw jsdw requested a review from a team June 19, 2025 16:32
@jsdw jsdw changed the title Clarify mortality config Address some issues around mortality Jun 20, 2025
@jsdw jsdw changed the title Address some issues around mortality Address some issues around tx mortality Jun 20, 2025

@lexnv lexnv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jsdw jsdw merged commit 77b6abc into master Jun 23, 2025
13 checks passed
@jsdw jsdw deleted the jsdw-mortality-config-tweaks branch June 23, 2025 14:22
@jsdw jsdw mentioned this pull request Jul 17, 2025
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.

Misleading usability with create_partial_offline and mortal txs

2 participants