Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9eda6ff
deprecate ValidateUnsigned trait
RomarQ Oct 27, 2025
f9b7b5d
deprecate #[pallet::validate_unsigned] attribute
RomarQ Oct 28, 2025
f29fbbe
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Oct 28, 2025
49bd3f6
add PR doc
RomarQ Oct 28, 2025
fb44eb7
fix PR doc
RomarQ Oct 28, 2025
d655b01
allow deprecation warning
RomarQ Oct 28, 2025
94bbdb8
improve documentation
RomarQ Oct 28, 2025
110eda9
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Oct 28, 2025
05ee407
fixes
RomarQ Oct 28, 2025
7834cdf
update pallet-example-offchain-worker example
RomarQ Oct 28, 2025
814d10b
fix logic
RomarQ Oct 30, 2025
f15815b
use pallet::authorize
RomarQ Oct 31, 2025
cf471a9
Update documentation
RomarQ Oct 31, 2025
6d0fb03
format code
RomarQ Nov 4, 2025
5ab83fa
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Nov 4, 2025
f61760a
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Nov 8, 2025
897a5e9
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Nov 18, 2025
7421569
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Nov 27, 2025
e43100d
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Dec 3, 2025
0329348
allow deprecation use
RomarQ Dec 4, 2025
e15bf85
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Dec 4, 2025
eb26bb0
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Dec 12, 2025
09e423d
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Dec 14, 2025
5a960e8
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Dec 27, 2025
3007161
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Jan 1, 2026
e8a31e4
revert offchain-worker/README.md changes
RomarQ Jan 3, 2026
f9bcd0b
keep doc
RomarQ Jan 3, 2026
b0df7d0
modify macro
RomarQ Jan 3, 2026
9ba2f91
revert pallet changes in favor #10716
RomarQ Jan 3, 2026
9456518
Update substrate/frame/support/procedural/src/pallet/expand/validate_…
RomarQ Jan 4, 2026
a00b83f
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Jan 10, 2026
881864a
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Jan 20, 2026
93d29ce
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Feb 6, 2026
cc4bdad
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Feb 11, 2026
d3ec1e1
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Feb 19, 2026
c9b3cab
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Feb 22, 2026
e979eac
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Mar 2, 2026
e17382f
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Mar 27, 2026
05913d6
Merge branch 'master' into rq/deprecate-validate-unsigned
shawntabrizi Mar 27, 2026
75b2645
Merge branch 'master' into rq/deprecate-validate-unsigned
RomarQ Mar 30, 2026
8c4727d
Improve ValidateUnsigned deprecation notice with specific migration p…
RomarQ Mar 30, 2026
0eb2dd2
Update pallet::validate_unsigned macro deprecation message with speci…
RomarQ Mar 30, 2026
0d416f5
Merge remote-tracking branch 'paritytech/master' into rq/deprecate-va…
RomarQ Mar 30, 2026
a970cb8
fix clippy
RomarQ Mar 30, 2026
fd8696e
Update prdoc/pr_10150.prdoc
bkontur Mar 30, 2026
7ef88a9
Fix CI: add #[allow(deprecated)] to parachain-system mock, update prd…
RomarQ Mar 30, 2026
929aa22
Merge branch 'master' into rq/deprecate-validate-unsigned
bkontur Apr 2, 2026
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
10 changes: 6 additions & 4 deletions polkadot/runtime/common/src/claims/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ use frame_support::{
};
use frame_system::RawOrigin;
use secp_utils::*;
use sp_runtime::{
traits::{DispatchTransaction, ValidateUnsigned},
DispatchResult,
};
use sp_runtime::{traits::DispatchTransaction, DispatchResult};

const SEED: u32 = 0;

Expand Down Expand Up @@ -74,6 +71,9 @@ fn create_claim_attest<T: Config>(input: u32) -> DispatchResult {
mod benchmarks {
use super::*;

#[allow(deprecated)]
use sp_runtime::traits::ValidateUnsigned;

// Benchmark `claim` including `validate_unsigned` logic.
#[benchmark]
fn claim() -> Result<(), BenchmarkError> {
Expand Down Expand Up @@ -104,6 +104,7 @@ mod benchmarks {
{
let call = <Call<T> as Decode>::decode(&mut &*call_enc)
.expect("call is encoded above, encoding must be correct");
#[allow(deprecated)]
super::Pallet::<T>::validate_unsigned(source, &call)
.map_err(|e| -> &'static str { e.into() })?;
call.dispatch_bypass_filter(RawOrigin::None.into())?;
Expand Down Expand Up @@ -168,6 +169,7 @@ mod benchmarks {
{
let call = <Call<T> as Decode>::decode(&mut &*call_enc)
.expect("call is encoded above, encoding must be correct");
#[allow(deprecated)]
super::Pallet::<T>::validate_unsigned(source, &call)
.map_err(|e| -> &'static str { e.into() })?;
call.dispatch_bypass_filter(RawOrigin::None.into())?;
Expand Down
1 change: 1 addition & 0 deletions polkadot/runtime/common/src/claims/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ pub mod pallet {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
1 change: 1 addition & 0 deletions polkadot/runtime/common/src/claims/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ fn real_eth_sig_works() {
}

#[test]
#[allow(deprecated)]
fn validate_unsigned_works() {
use sp_runtime::traits::ValidateUnsigned;
let source = sp_runtime::transaction_validity::TransactionSource::External;
Expand Down
1 change: 1 addition & 0 deletions polkadot/runtime/parachains/src/disputes/slashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ pub mod pallet {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
1 change: 1 addition & 0 deletions polkadot/runtime/parachains/src/paras/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,7 @@ pub mod pallet {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
2 changes: 2 additions & 0 deletions polkadot/runtime/parachains/src/paras/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,7 @@ fn pvf_check_submit_vote() {

let call =
Call::include_pvf_check_statement { stmt: stmt.clone(), signature: signature.clone() };
#[allow(deprecated)]
let validate_unsigned =
<Paras as ValidateUnsigned>::validate_unsigned(TransactionSource::InBlock, &call)
.map(|_| ());
Expand Down Expand Up @@ -2263,6 +2264,7 @@ fn apply_authorized_force_set_current_code_works() {
code: ValidationCode|
-> (Result<_, _>, DispatchResultWithPostInfo) {
let call = Call::apply_authorized_force_set_current_code { para, new_code: code.clone() };
#[allow(deprecated)]
let validate_unsigned =
<Paras as ValidateUnsigned>::validate_unsigned(TransactionSource::InBlock, &call)
.map(|_| ());
Expand Down
38 changes: 38 additions & 0 deletions prdoc/pr_10150.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
title: Deprecate `ValidateUnsigned` trait and `#[pallet::validate_unsigned]` attribute.

doc:
- audience: [Runtime Dev, Runtime User]
description: |
Deprecate the `ValidateUnsigned` trait and `#[pallet::validate_unsigned]` attribute as part of phase 2 of Extrinsic Horizon.

crates:
- name: sp-runtime
bump: minor
- name: frame-system
bump: patch
- name: frame-support
bump: patch
- name: frame-support-procedural
bump: minor
- name: polkadot-runtime-common
bump: patch
- name: polkadot-runtime-parachains
bump: patch
- name: pallet-babe
bump: patch
- name: pallet-beefy
bump: patch
- name: pallet-election-provider-multi-phase
bump: patch
- name: pallet-election-provider-multi-block
bump: patch
- name: frame-executive
bump: patch
- name: pallet-grandpa
bump: patch
- name: pallet-im-online
bump: patch
- name: pallet-mixnet
bump: patch
- name: substrate-test-runtime
bump: patch
1 change: 1 addition & 0 deletions substrate/frame/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ pub mod pallet {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/babe/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ fn report_equivocation_invalid_equivocation_proof() {
}

#[test]
#[allow(deprecated)]
fn report_equivocation_validate_unsigned_prevents_duplicates() {
use sp_runtime::transaction_validity::{
InvalidTransaction, TransactionPriority, TransactionSource, TransactionValidity,
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ pub mod pallet {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/beefy/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@ fn report_double_voting_invalid_equivocation_proof() {
}

#[test]
#[allow(deprecated)]
fn report_double_voting_validate_unsigned_prevents_duplicates() {
use sp_runtime::transaction_validity::{
InvalidTransaction, TransactionPriority, TransactionSource, TransactionValidity,
Expand Down
6 changes: 3 additions & 3 deletions substrate/frame/election-provider-multi-block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2751,9 +2751,7 @@ mod election_provider {
Phase,
};
use frame_election_provider_support::{BoundedSupport, BoundedSupports, ElectionProvider};
use frame_support::{
assert_storage_noop, testing_prelude::bounded_vec, unsigned::ValidateUnsigned,
};
use frame_support::{assert_storage_noop, testing_prelude::bounded_vec};

// This is probably the most important test of all, a basic, correct scenario. This test should
// be studied in detail, and all of the branches of how it can go wrong or diverge from the
Expand Down Expand Up @@ -3057,7 +3055,9 @@ mod election_provider {
}

#[test]
#[allow(deprecated)]
fn call_to_elect_should_prevent_any_submission() {
use frame_support::unsigned::ValidateUnsigned;
ExtBuilder::full().build_and_execute(|| {
roll_to_signed_open();
assert!(MultiBlock::current_phase().is_signed());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ mod benchmarks {

#[block]
{
assert_ok!(Pallet::<T>::validate_unsigned(TransactionSource::Local, &call));
#[allow(deprecated)]
let result = Pallet::<T>::validate_unsigned(TransactionSource::Local, &call);
assert_ok!(result);
}

Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ mod pallet {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down Expand Up @@ -370,6 +371,7 @@ mod pallet {
}

#[cfg(test)]
#[allow(deprecated)]
mod validate_unsigned {
use frame_election_provider_support::Support;
use frame_support::{
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/election-provider-multi-phase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,7 @@ pub mod pallet {
PreDispatchDifferentRound,
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
10 changes: 9 additions & 1 deletion substrate/frame/election-provider-multi-phase/src/unsigned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1108,13 +1108,17 @@ mod tests {
use sp_runtime::{
bounded_vec,
offchain::storage_lock::{BlockAndTime, StorageLock},
traits::{Dispatchable, ValidateUnsigned, Zero},
traits::{Dispatchable, Zero},
ModuleError, PerU16,
};

#[allow(deprecated)]
use sp_runtime::traits::ValidateUnsigned;

type Assignment = crate::unsigned::Assignment<Runtime>;

#[test]
#[allow(deprecated)]
fn validate_unsigned_retracts_wrong_phase() {
ExtBuilder::default().desired_targets(0).build_and_execute(|| {
let solution = RawSolution::<TestNposSolution> {
Expand Down Expand Up @@ -1187,6 +1191,7 @@ mod tests {
}

#[test]
#[allow(deprecated)]
fn validate_unsigned_retracts_low_score() {
ExtBuilder::default().desired_targets(0).build_and_execute(|| {
roll_to_unsigned();
Expand Down Expand Up @@ -1233,6 +1238,7 @@ mod tests {
}

#[test]
#[allow(deprecated)]
fn validate_unsigned_retracts_incorrect_winner_count() {
ExtBuilder::default().desired_targets(1).build_and_execute(|| {
roll_to_unsigned();
Expand All @@ -1259,6 +1265,7 @@ mod tests {
}

#[test]
#[allow(deprecated)]
fn priority_is_set() {
ExtBuilder::default()
.miner_tx_priority(20)
Expand Down Expand Up @@ -1904,6 +1911,7 @@ mod tests {
}

#[test]
#[allow(deprecated)]
fn ocw_solution_must_have_correct_round() {
let (mut ext, pool) = ExtBuilder::default().build_offchainify(0);
ext.execute_with(|| {
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/examples/offchain-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ pub mod pallet {
NewPrice { price: u32, maybe_who: Option<T::AccountId> },
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
13 changes: 4 additions & 9 deletions substrate/frame/executive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@
//! # use sp_runtime::transaction_validity::{
//! # TransactionValidity, UnknownTransaction, TransactionSource,
//! # };
//! # use sp_runtime::traits::ValidateUnsigned;
//! # impl ValidateUnsigned for Runtime {
//! # type Call = ();
//! #
//! # fn validate_unsigned(_source: TransactionSource, _call: &Self::Call) -> TransactionValidity {
//! # UnknownTransaction::NoUnsignedValidator.into()
//! # }
//! # }
//! /// Executive: handles dispatch to the various modules.
//! pub type Executive = executive::Executive<Runtime, Block, Context, Runtime, AllPalletsWithSystem>;
//! ```
Expand Down Expand Up @@ -135,12 +127,15 @@ use sp_runtime::{
generic::Digest,
traits::{
self, Applyable, CheckEqual, Checkable, Dispatchable, Header, LazyBlock, NumberFor, One,
ValidateUnsigned, Zero,
Zero,
},
transaction_validity::{TransactionSource, TransactionValidity, TransactionValidityError},
ApplyExtrinsicResult, ExtrinsicInclusionMode,
};

#[allow(deprecated)]
use sp_runtime::traits::ValidateUnsigned;

#[cfg(feature = "try-runtime")]
use ::{
frame_support::{
Expand Down
2 changes: 2 additions & 0 deletions substrate/frame/executive/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ mod custom {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down Expand Up @@ -261,6 +262,7 @@ mod custom2 {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ pub mod pallet {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/grandpa/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ fn report_equivocation_invalid_equivocation_proof() {
}

#[test]
#[allow(deprecated)]
fn report_equivocation_validate_unsigned_prevents_duplicates() {
use sp_runtime::transaction_validity::{
InvalidTransaction, TransactionPriority, TransactionSource, TransactionValidity,
Expand Down
7 changes: 3 additions & 4 deletions substrate/frame/im-online/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
use frame_benchmarking::v2::*;
use frame_support::{traits::UnfilteredDispatchable, WeakBoundedVec};
use frame_system::RawOrigin;
use sp_runtime::{
traits::{ValidateUnsigned, Zero},
transaction_validity::TransactionSource,
};
use sp_runtime::{traits::Zero, transaction_validity::TransactionSource};

use crate::*;

Expand Down Expand Up @@ -83,6 +80,7 @@ mod benchmarks {

#[block]
{
#[allow(deprecated)]
Pallet::<T>::validate_unsigned(TransactionSource::InBlock, &call)
.map_err(<&str>::from)?;
}
Expand All @@ -100,6 +98,7 @@ mod benchmarks {

#[block]
{
#[allow(deprecated)]
Pallet::<T>::validate_unsigned(TransactionSource::InBlock, &call)
.map_err(<&str>::from)?;
<Call<T> as Decode>::decode(&mut &*call_enc)
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/im-online/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ pub mod pallet {
/// incorrect.
pub(crate) const INVALID_VALIDATORS_LEN: u8 = 10;

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/im-online/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ fn heartbeat(
};
let signature = id.sign(&heartbeat.encode()).unwrap();

#[allow(deprecated)]
ImOnline::pre_dispatch(&crate::Call::heartbeat {
heartbeat: heartbeat.clone(),
signature: signature.clone(),
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/mixnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ pub mod pallet {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/sassafras/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ pub mod pallet {
}
}

#[allow(deprecated)]
#[pallet::validate_unsigned]
impl<T: Config> ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
Expand Down
Loading
Loading