Commit e3865cf
Part of #2415
Closes #2436
Related: #6325 #6326
## Summary
Deprecates the `ValidateUnsigned` trait and
`#[pallet::validate_unsigned]` attribute in favor of the new
`TransactionExtension` API. This is a non-breaking change that adds
deprecation warnings to guide users toward the modern transaction
validation approach.
## Motivation
The `ValidateUnsigned` trait was the legacy approach for validating
unsigned transactions in FRAME pallets. The newer `TransactionExtension`
trait provides a more flexible and composable way to handle transaction
validation, including both signed and unsigned transactions.
## Changes
### Deprecated APIs
- ✅ Added `#[deprecated]` attribute to `ValidateUnsigned` trait
- ✅ Added deprecation warning to `#[pallet::validate_unsigned]` macro
attribute
### Migration (Using `TransactionExtensions`)
https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/transaction_extensions
## Impact
- **Non-breaking:** Existing code continues to work with deprecation
warnings
- **Compiler warnings:** Users will see deprecation notices guiding them
to migrate
- **Timeline:** Full removal planned for a future major release (TBD)
## Review Notes
- The `#[pallet::validate_unsigned]` deprecation warning might be
redundant since it's always used together with `ValidateUnsigned`, but
both are included for completeness and clarity.
## Follow-up Tasks
The following pallets and crates need to be migrated to
`TransactionExtension` in subsequent PRs:
**Runtime crates:**
- [ ] `polkadot-runtime-common`
- [ ] `polkadot-runtime-parachains`
**FRAME pallets:**
- [ ] `pallet-babe`
- [ ] `pallet-beefy`
- [ ] `pallet-election-provider-multi-block`
- [ ] `pallet-grandpa`
- [x] `pallet-im-online`
#11235
- [x] `pallet-mixnet`
#11010
**Core:**
- [ ] `frame-executive`
- [ ] `frame-system`
**Examples:**
- [x] `pallet-example-offchain-worker`
#10716
**Testing:**
- [ ] `substrate-test-runtime`
## Open Question
Should we remove the `ValidateUnsigned` bound from the type parameter
`V` in the `Applyable` trait?
---------
Co-authored-by: Guillaume Thiolliere <guillaume.thiolliere@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
1 parent 5c97c0f commit e3865cf
40 files changed
Lines changed: 171 additions & 33 deletions
File tree
- cumulus/pallets/parachain-system/src/block_weight
- polkadot/runtime
- common/src/claims
- parachains/src
- disputes
- paras
- prdoc
- substrate
- frame
- babe/src
- beefy/src
- election-provider-multi-block/src
- unsigned
- election-provider-multi-phase/src
- executive/src
- grandpa/src
- im-online/src
- mixnet/src
- sassafras/src
- support
- procedural/src
- construct_runtime/expand
- pallet
- expand
- parse
- src
- test/tests
- system/src
- primitives/runtime/src
- generic
- traits
- test-utils/runtime/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 29 | + | |
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
| |||
74 | 71 | | |
75 | 72 | | |
76 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| 567 | + | |
567 | 568 | | |
568 | 569 | | |
569 | 570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| 534 | + | |
534 | 535 | | |
535 | 536 | | |
536 | 537 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1365 | 1365 | | |
1366 | 1366 | | |
1367 | 1367 | | |
| 1368 | + | |
1368 | 1369 | | |
1369 | 1370 | | |
1370 | 1371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1457 | 1457 | | |
1458 | 1458 | | |
1459 | 1459 | | |
| 1460 | + | |
1460 | 1461 | | |
1461 | 1462 | | |
1462 | 1463 | | |
| |||
2263 | 2264 | | |
2264 | 2265 | | |
2265 | 2266 | | |
| 2267 | + | |
2266 | 2268 | | |
2267 | 2269 | | |
2268 | 2270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
479 | 480 | | |
480 | 481 | | |
481 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
| 720 | + | |
720 | 721 | | |
721 | 722 | | |
722 | 723 | | |
| |||
0 commit comments