From dccf002ccd7e39cb4c43c0ac939ad6a089ed61c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 7 Mar 2025 00:27:38 +0100 Subject: [PATCH 1/6] `CheckOnlySudoAccount`: Provide some tags --- substrate/frame/sudo/src/extension.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/substrate/frame/sudo/src/extension.rs b/substrate/frame/sudo/src/extension.rs index dbd127a2e5422..d17ab06b4f06a 100644 --- a/substrate/frame/sudo/src/extension.rs +++ b/substrate/frame/sudo/src/extension.rs @@ -31,7 +31,7 @@ use sp_runtime::{ /// Ensure that signed transactions are only valid if they are signed by sudo account. /// -/// In the initial phase of a chain without any tokens you can not prevent accounts from sending +/// In the initial phase of a chain without any tokens you cannot prevent accounts from sending /// transactions. /// These transactions would enter the transaction pool as the succeed the validation, but would /// fail on applying them as they are not allowed/disabled/whatever. This would be some huge dos @@ -89,7 +89,7 @@ where fn validate( &self, origin: <::RuntimeCall as Dispatchable>::RuntimeOrigin, - _call: &::RuntimeCall, + call: &::RuntimeCall, info: &DispatchInfoOf<::RuntimeCall>, _len: usize, _self_implicit: Self::Implicit, @@ -110,6 +110,7 @@ where Ok(( ValidTransaction { priority: info.total_weight().ref_time() as TransactionPriority, + provides: vec![(who, call).encode()], ..Default::default() }, (), From 1904e0bacd6573d531dd43ba391feb7e361843c6 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 6 Mar 2025 23:32:10 +0000 Subject: [PATCH 2/6] Update from github-actions[bot] running command 'prdoc --audience runtime_user --bump patch' --- prdoc/pr_7838.prdoc | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 prdoc/pr_7838.prdoc diff --git a/prdoc/pr_7838.prdoc b/prdoc/pr_7838.prdoc new file mode 100644 index 0000000000000..1046fdc59a8cb --- /dev/null +++ b/prdoc/pr_7838.prdoc @@ -0,0 +1,7 @@ +title: '`CheckOnlySudoAccount`: Provide some tags' +doc: +- audience: Runtime User + description: 'Close: https://github.com/paritytech/polkadot-sdk/issues/7816' +crates: +- name: pallet-sudo + bump: patch From 4d63c367b13d44232fe28b6760c1bb93db63ab94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 7 Mar 2025 00:37:02 +0100 Subject: [PATCH 3/6] Update pr_7838.prdoc --- prdoc/pr_7838.prdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prdoc/pr_7838.prdoc b/prdoc/pr_7838.prdoc index 1046fdc59a8cb..eece94f8fa7e5 100644 --- a/prdoc/pr_7838.prdoc +++ b/prdoc/pr_7838.prdoc @@ -1,7 +1,7 @@ title: '`CheckOnlySudoAccount`: Provide some tags' doc: - audience: Runtime User - description: 'Close: https://github.com/paritytech/polkadot-sdk/issues/7816' + description: Let `CheckOnlySudoAccount` provide some tags to make the tx pool happy. crates: - name: pallet-sudo bump: patch From 8688eb2d79acc6d0f71c37b674f60d69f37b8983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 7 Mar 2025 00:57:53 +0100 Subject: [PATCH 4/6] vec --- substrate/frame/sudo/src/extension.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/substrate/frame/sudo/src/extension.rs b/substrate/frame/sudo/src/extension.rs index d17ab06b4f06a..476475c572f0e 100644 --- a/substrate/frame/sudo/src/extension.rs +++ b/substrate/frame/sudo/src/extension.rs @@ -16,6 +16,7 @@ // limitations under the License. use crate::{Config, Key}; +use alloc::vec; use codec::{Decode, DecodeWithMemTracking, Encode}; use core::{fmt, marker::PhantomData}; use frame_support::{dispatch::DispatchInfo, ensure, pallet_prelude::TransactionSource}; From 58de5fcef1a3b4db3de94f878894271953d71891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 7 Mar 2025 19:45:11 +0100 Subject: [PATCH 5/6] Review comments --- substrate/frame/sudo/src/extension.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/substrate/frame/sudo/src/extension.rs b/substrate/frame/sudo/src/extension.rs index 476475c572f0e..a2e2fdf706e8f 100644 --- a/substrate/frame/sudo/src/extension.rs +++ b/substrate/frame/sudo/src/extension.rs @@ -23,7 +23,7 @@ use frame_support::{dispatch::DispatchInfo, ensure, pallet_prelude::TransactionS use scale_info::TypeInfo; use sp_runtime::{ impl_tx_ext_default, - traits::{AsSystemOriginSigner, DispatchInfoOf, Dispatchable, TransactionExtension}, + traits::{AsSystemOriginSigner, DispatchInfoOf, Dispatchable, Hash, TransactionExtension}, transaction_validity::{ InvalidTransaction, TransactionPriority, TransactionValidityError, UnknownTransaction, ValidTransaction, @@ -111,7 +111,7 @@ where Ok(( ValidTransaction { priority: info.total_weight().ref_time() as TransactionPriority, - provides: vec![(who, call).encode()], + provides: vec![(who, T::Hashing::hash_of(call)).encode()], ..Default::default() }, (), From 91fecc8365a07ed51af7fbadaa45f7a528d33430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 7 Mar 2025 19:51:14 +0100 Subject: [PATCH 6/6] Remove `CheckNonce` --- cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs b/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs index 9e73a8c5f93d9..08f87a67c8a66 100644 --- a/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs @@ -299,7 +299,6 @@ pub type TxExtension = ( frame_system::CheckTxVersion, frame_system::CheckGenesis, frame_system::CheckEra, - frame_system::CheckNonce, frame_system::CheckWeight, frame_system::WeightReclaim, );