Skip to content

Commit 4ada34b

Browse files
CheckOnlySudoAccount: Provide some tags (#7838)
Close: #7816 --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 007565a commit 4ada34b

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

cumulus/parachains/runtimes/glutton/glutton-westend/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ pub type TxExtension = (
299299
frame_system::CheckTxVersion<Runtime>,
300300
frame_system::CheckGenesis<Runtime>,
301301
frame_system::CheckEra<Runtime>,
302-
frame_system::CheckNonce<Runtime>,
303302
frame_system::CheckWeight<Runtime>,
304303
frame_system::WeightReclaim<Runtime>,
305304
);

prdoc/pr_7838.prdoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: '`CheckOnlySudoAccount`: Provide some tags'
2+
doc:
3+
- audience: Runtime User
4+
description: Let `CheckOnlySudoAccount` provide some tags to make the tx pool happy.
5+
crates:
6+
- name: pallet-sudo
7+
bump: patch

substrate/frame/sudo/src/extension.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
// limitations under the License.
1717

1818
use crate::{Config, Key};
19+
use alloc::vec;
1920
use codec::{Decode, DecodeWithMemTracking, Encode};
2021
use core::{fmt, marker::PhantomData};
2122
use frame_support::{dispatch::DispatchInfo, ensure, pallet_prelude::TransactionSource};
2223
use scale_info::TypeInfo;
2324
use sp_runtime::{
2425
impl_tx_ext_default,
25-
traits::{AsSystemOriginSigner, DispatchInfoOf, Dispatchable, TransactionExtension},
26+
traits::{AsSystemOriginSigner, DispatchInfoOf, Dispatchable, Hash, TransactionExtension},
2627
transaction_validity::{
2728
InvalidTransaction, TransactionPriority, TransactionValidityError, UnknownTransaction,
2829
ValidTransaction,
@@ -31,7 +32,7 @@ use sp_runtime::{
3132

3233
/// Ensure that signed transactions are only valid if they are signed by sudo account.
3334
///
34-
/// In the initial phase of a chain without any tokens you can not prevent accounts from sending
35+
/// In the initial phase of a chain without any tokens you cannot prevent accounts from sending
3536
/// transactions.
3637
/// These transactions would enter the transaction pool as the succeed the validation, but would
3738
/// fail on applying them as they are not allowed/disabled/whatever. This would be some huge dos
@@ -89,7 +90,7 @@ where
8990
fn validate(
9091
&self,
9192
origin: <<T as frame_system::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin,
92-
_call: &<T as frame_system::Config>::RuntimeCall,
93+
call: &<T as frame_system::Config>::RuntimeCall,
9394
info: &DispatchInfoOf<<T as frame_system::Config>::RuntimeCall>,
9495
_len: usize,
9596
_self_implicit: Self::Implicit,
@@ -110,6 +111,7 @@ where
110111
Ok((
111112
ValidTransaction {
112113
priority: info.total_weight().ref_time() as TransactionPriority,
114+
provides: vec![(who, T::Hashing::hash_of(call)).encode()],
113115
..Default::default()
114116
},
115117
(),

0 commit comments

Comments
 (0)