-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow multiple transaction extension version in UncheckedExtrinsic type.
#7035
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
Merged
Merged
Changes from 42 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
b5c95b1
WIP
gui1117 582cbb9
WIP
gui1117 32159f9
WIP
gui1117 2350e93
WIP
gui1117 143b50a
WIP
gui1117 17a8dc0
cleanup
gui1117 a38fac3
WIP
gui1117 3f657ac
WIP
gui1117 06da89b
Structure done: todo: renames and format
gui1117 b03b4eb
Merge remote-tracking branch 'origin/master' into gui-transaction-ext…
gui1117 cfddfa1
renames
gui1117 3aacd46
reorganize
gui1117 e060cac
fixes
gui1117 2c1e2fc
description draft
gui1117 d39156e
Merge remote-tracking branch 'origin/master' into gui-transaction-ext…
gui1117 0cc8f0c
refactor
gui1117 049ec5d
doc
gui1117 d9eb5b8
tests + fmt
gui1117 8e32689
multi version support 26 versions
gui1117 c6aa890
simplify bounds
gui1117 bfadf05
refactor test
gui1117 dc7944f
remove unneeded bounds
gui1117 ad9e9ba
more tests
gui1117 1812860
make invalid version safer
gui1117 9967ab0
Merge remote-tracking branch 'origin/master' into gui-transaction-ext…
gui1117 082ab90
fmt
gui1117 a4a87f5
prdoc
gui1117 b657487
prdoc fmt
gui1117 4d7e494
semver
gui1117 0b0d980
remove unused
gui1117 90b8297
explicit re-export + fix doc
gui1117 d1bdbd9
explicit reexport
gui1117 a59da7b
refactor and doc
gui1117 370bb33
Merge remote-tracking branch 'origin/master' into gui-transaction-ext…
gui1117 ef48bc7
remove useless type info breaking subxt
gui1117 f263366
doc
gui1117 a66d24d
fix rust doc link
gui1117 ecc7cc7
fix rustdoc test
gui1117 4b6ef76
better type info
gui1117 31ea43d
better rename + impl revive
gui1117 b2621eb
prdoc
gui1117 8284dc8
fix revive
gui1117 acf6904
Apply suggestions from code review
gui1117 4b08c49
Update substrate/frame/support/test/tests/tx_ext_multi_version.rs
gui1117 316e623
Update substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs
gui1117 64cfd4c
Apply suggestion from @franciscoaguirre
gui1117 0071ee2
better doc and comments
gui1117 e071249
use unreachable
gui1117 a9942a8
remove metadata ir extension v0 type
gui1117 a49294c
remove ExtensionV0 type in metadata
gui1117 5bb9d50
rename
gui1117 fcafaac
fix unused
gui1117 7a6eaf0
Merge branch 'master' into gui-transaction-extension-multiple-version
gui1117 1879c54
fmt
gui1117 5451991
Update substrate/primitives/runtime/src/traits/vers_tx_ext/mod.rs
gui1117 cfc4375
Update substrate/frame/revive/src/evm/runtime.rs
gui1117 22f7bcc
improve comments
gui1117 2abb369
merge PipelineWeight directly into Pipeline
gui1117 1d822d9
Merge remote-tracking branch 'origin/master' into gui-transaction-ext…
gui1117 1a81f0a
extrinsic metadata better doc
gui1117 c1009cf
fmt + taplo
gui1117 5b5f23a
Merge branch 'master' into gui-transaction-extension-multiple-version
gui1117 17c1f8f
fix test: have a correct metadata ir
gui1117 5c353e4
Merge branch 'master' into gui-transaction-extension-multiple-version
gui1117 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| flowchart TD | ||
| E(Extrinsic) ---> I(Inherent); | ||
| E --> T(Transaction) | ||
| T --> ST("Signed (aka. Transaction)") | ||
| T --> UT(Unsigned) | ||
| E(Extrinsic) ---> B(Bare); | ||
| E --> S(Signed Transaction) | ||
| E --> G(General Transaction) | ||
| B --> I(Inherent); | ||
| B --> U(Unsigned Transaction (deprecated)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| title: Allow declaration and usage of multiple transaction extension version in FRAME and primitives | ||
|
|
||
| doc: | ||
| - audience: Runtime Dev | ||
| description: | | ||
| This PR enhance `UncheckedExtrinsic` type with a new optional generic: `ExtensionOtherVersions`. | ||
| This generic defaults to `InvalidVersion` meaning there is not other version than the regular version 0. This is the same behavior as before this PR. | ||
|
|
||
| # Breaking change | ||
|
|
||
| The types `Preamble`, `CheckedExtrinsic` and `ExtrinsicFormat` also have this new optional generic. Their type definition also have changed a bit, the `General` variant was 2 fields, the version and the extension, it is now only one field, the extension, and the version can be retrieve by calling `extension.version()` | ||
|
gui1117 marked this conversation as resolved.
Outdated
|
||
|
|
||
| Some trait such as `ExtrinsicMetadata` and `EthExtraImpl` changed their associated type named `Extension` to `ExtensionV0` and have new associated type `ExtensionOtherVersions`. This is because multiple version are now supported. | ||
| You can always use `InvalidVersions` for `ExtensionOtherVersions` and keep the old `Extension` for `ExtensionV0` to keep the same behavior as before this PR. | ||
|
gui1117 marked this conversation as resolved.
Outdated
|
||
|
|
||
| The type inference for those types may fail because of this PR, to update the code by writing the concrete types. | ||
|
|
||
| # New feature | ||
|
|
||
| To use this new feature, you can use the new types `TxExtLineAtVers` and `MultiVersion` to define a transaction extension with multiple version: | ||
|
|
||
| ```rust | ||
| pub type TransactionExtensionV0 = (); | ||
| pub type TransactionExtensionV4 = (); | ||
| pub type TransactionExtensionV7 = (); | ||
|
|
||
| pub type OtherVersions = MultiVersion< | ||
| TxExtLineAtVers<4, TransactionExtensionV4>; | ||
| TxExtLineAtVers<7, TransactionExtensionV7>; | ||
| >; | ||
|
|
||
| pub type UncheckedExtrinsic = generic::UncheckedExtrinsic< | ||
| AccountId, | ||
| RuntimeCall, | ||
| UintAuthorityId, | ||
| TransactionExtensionV0, // The version 0, same as before | ||
| OtherVersions, // The other versions. | ||
| >; | ||
| ``` | ||
|
|
||
| crates: | ||
| - name: node-testing | ||
| bump: major | ||
| - name: pallet-revive | ||
| bump: major | ||
| - name: frame-support-procedural | ||
| bump: major | ||
| - name: frame-support | ||
| bump: major | ||
| - name: frame-support-test | ||
| bump: major | ||
| - name: sp-runtime | ||
| bump: major | ||
| - name: sp-metadata-ir | ||
| bump: major | ||
| - name: pallet-transaction-payment | ||
| bump: major | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.