Skip to content
Merged
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b603f2c
doc
gui1117 Feb 18, 2025
28e0ab3
Merge branch 'master' into gui-improve-doc
gui1117 Feb 18, 2025
e3de76b
Introduce CreateBare and deprecate CreateInherent
gui1117 Feb 19, 2025
2068d7e
Update from gui1117 running command 'prdoc --audience runtime_dev --m…
github-actions[bot] Feb 19, 2025
1565a6a
Update prdoc/pr_7597.prdoc
gui1117 Feb 19, 2025
84a9e90
prdoc
gui1117 Feb 19, 2025
2e14572
Merge branch 'master' into gui-improve-doc
gui1117 Feb 19, 2025
be4e019
Update from gui1117 running command 'fmt'
github-actions[bot] Feb 19, 2025
1a51d59
WIP: automatic create bare implementation
gui1117 Feb 24, 2025
41e0a39
CreatBare usage: non-breaking as possible
gui1117 Feb 24, 2025
2b61876
prdoc + doc
gui1117 Feb 24, 2025
d804858
Update from gui1117 running command 'fmt'
github-actions[bot] Feb 24, 2025
1aa50c0
Merge branch 'master' into gui-improve-doc
gui1117 Feb 24, 2025
9274b16
deprecated create inherent and use create bare
gui1117 Mar 3, 2025
1512357
simply rename trait + new method create_bare + deprecate create_inherent
gui1117 Mar 3, 2025
412b80d
remove warning
gui1117 Mar 3, 2025
ee3836f
missed one
gui1117 Mar 3, 2025
a1afad7
missed some
gui1117 Mar 3, 2025
3f7dbe1
Update from gui1117 running command 'update-ui'
github-actions[bot] Mar 3, 2025
d9da435
revert some change I forgot
gui1117 May 5, 2025
7794fbd
Merge remote-tracking branch 'origin/master' into gui-improve-doc
gui1117 May 5, 2025
f98da0f
better doc
gui1117 May 5, 2025
59b532a
fix merge
gui1117 May 5, 2025
e29ec07
Merge remote-tracking branch 'origin/master' into gui-improve-doc
gui1117 May 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions substrate/frame/system/src/offchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,14 @@ pub trait CreateSignedTransaction<LocalCall>:
}

/// Interface for creating an inherent.
///
/// It can also be used to create an unsigned transaction as they are both the same extrinsic
/// variant: `Bare`. Unsigned transaction are deprecated in favor of general transaction.
pub trait CreateInherent<LocalCall>: CreateTransactionBase<LocalCall> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The naming is still just wrong and trying to fix this via docs is not making it better. As I already said in the original pr, the name of the trait is wrong.

I would propose we introduce a new CreateBare with proper docs and tag this trait deprecated.

Copy link
Copy Markdown
Contributor Author

@gui1117 gui1117 Feb 19, 2025

Choose a reason for hiding this comment

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

I updated the PR: deprecate CreateInherent, introduce CreateBare and replace all usage in polkadot-sdk.

It is a breaking change so I am not sure I can backport anything to 2412, but I will backport it to 2503.

I acknowledge my mistake in transaction extension review, also overall I underestimated the stability and the pace of new feature in polkadot-sdk in 2024.

As a side note I think offchain traits could be improved as well:

  • we could remove LocalCall everywhere, people can bound RuntimeCall: From<Call> in their config
  • CreateTransactionBase could simply bound frame_system::Config as supertrait instead of having a duplicated associated type RuntimeCall that bring name conflict. (We do bound Config as supertrait for SigningTypes).
    But better not to break them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with the offchain trait refactor, but it's probably best to do it after phase 2 of Extrinsic Horizon is done.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
pub trait CreateInherent<LocalCall>: CreateTransactionBase<LocalCall> {
#[deprecated(note = "Please use `CreateBare` instead")]
pub trait CreateInherent<LocalCall>: CreateTransactionBase<LocalCall> {

Copy link
Copy Markdown
Contributor Author

@gui1117 gui1117 Feb 27, 2025

Choose a reason for hiding this comment

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

Then I will also change usage of CreateInherent to CreateBare in pokadot-sdk, in pallets (and runtime but this is less important).

EDIT: otherwise runtime implementing only CreateBare won't be able to use like election-solution pallet which uses CreateInherent.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

EDIT: otherwise runtime implementing only CreateBare won't be able to use like election-solution pallet which uses CreateInherent.

I mean you can still implement CreateInherent, just with a allow(deprecated).

/// Create an inherent.
///
/// It can also be used to create an unsigned transaction as they are both the same extrinsic
/// variant: `Bare`. Unsigned transaction are deprecated in favor of general transaction.
fn create_inherent(call: Self::RuntimeCall) -> Self::Extrinsic;
}

Expand Down
Loading