diff --git a/Cargo.lock b/Cargo.lock
index 31badd989fe1a..a5f741627f533 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1239,7 +1239,7 @@ dependencies = [
"fixed-hash",
"impl-rlp",
"impl-serde 0.3.0",
- "tiny-keccak 2.0.2",
+ "tiny-keccak 2.0.1",
]
[[package]]
@@ -1974,7 +1974,7 @@ dependencies = [
"indexmap",
"log",
"slab",
- "tokio 0.2.16",
+ "tokio 0.2.13",
"tokio-util",
]
@@ -2186,7 +2186,7 @@ dependencies = [
"net2",
"pin-project",
"time",
- "tokio 0.2.16",
+ "tokio 0.2.13",
"tower-service",
"want 0.3.0",
]
@@ -2204,7 +2204,7 @@ dependencies = [
"log",
"rustls 0.17.0",
"rustls-native-certs",
- "tokio 0.2.16",
+ "tokio 0.2.13",
"tokio-rustls",
"webpki",
]
@@ -4873,9 +4873,9 @@ dependencies = [
[[package]]
name = "paste"
-version = "0.1.10"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab4fb1930692d1b6a9cfabdde3d06ea0a7d186518e2f4d67660d8970e2fa647a"
+checksum = "092d791bf7847f70bbd49085489fba25fc2c193571752bff9e36e74e72403932"
dependencies = [
"paste-impl",
"proc-macro-hack",
@@ -4883,9 +4883,9 @@ dependencies = [
[[package]]
name = "paste-impl"
-version = "0.1.10"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a62486e111e571b1e93b710b61e8f493c0013be39629b714cb166bdb06aa5a8a"
+checksum = "406c23fb4c45cc6f68a9bbabb8ec7bd6f8cfcbd17e9e8f72c2460282f8325729"
dependencies = [
"proc-macro-hack",
"proc-macro2",
@@ -5229,9 +5229,9 @@ dependencies = [
[[package]]
name = "quicksink"
-version = "0.1.2"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858"
+checksum = "a8461ef7445f61fd72d8dcd0629ce724b9131b3c2eb36e83a5d3d4161c127530"
dependencies = [
"futures-core",
"futures-sink",
@@ -5895,7 +5895,7 @@ dependencies = [
"substrate-prometheus-endpoint",
"tempfile",
"time",
- "tokio 0.2.16",
+ "tokio 0.2.13",
]
[[package]]
@@ -6153,7 +6153,7 @@ dependencies = [
"substrate-test-runtime-client",
"substrate-test-runtime-transaction-pool",
"tempfile",
- "tokio 0.2.16",
+ "tokio 0.2.13",
]
[[package]]
@@ -6335,7 +6335,7 @@ dependencies = [
"substrate-prometheus-endpoint",
"substrate-test-runtime-client",
"tempfile",
- "tokio 0.2.16",
+ "tokio 0.2.13",
]
[[package]]
@@ -6500,7 +6500,7 @@ dependencies = [
"sp-utils",
"substrate-test-runtime-client",
"threadpool",
- "tokio 0.2.16",
+ "tokio 0.2.13",
]
[[package]]
@@ -6918,18 +6918,18 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0"
[[package]]
name = "serde"
-version = "1.0.106"
+version = "1.0.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399"
+checksum = "e707fbbf255b8fc8c3b99abb91e7257a622caeb20a9818cbadbeeede4e0932ff"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.106"
+version = "1.0.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c"
+checksum = "ac5d00fc561ba2724df6758a17de23df5914f20e41cb00f94d5b7ae42fffaff8"
dependencies = [
"proc-macro2",
"quote 1.0.3",
@@ -6938,9 +6938,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.51"
+version = "1.0.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da07b57ee2623368351e9a0488bb0b261322a15a6e0ae53e243cbdc0f4208da9"
+checksum = "78a7a12c167809363ec3bd7329fc0a3369056996de43c4b37ef3cd54a6ce4867"
dependencies = [
"itoa",
"ryu",
@@ -7389,7 +7389,7 @@ dependencies = [
"sp-storage",
"substrate-bip39",
"tiny-bip39",
- "tiny-keccak 2.0.2",
+ "tiny-keccak 2.0.1",
"twox-hash",
"wasmi",
"zeroize",
@@ -7961,7 +7961,7 @@ dependencies = [
"sc-rpc-api",
"serde",
"sp-storage",
- "tokio 0.2.16",
+ "tokio 0.2.13",
]
[[package]]
@@ -7997,7 +7997,7 @@ dependencies = [
"hyper 0.13.4",
"log",
"prometheus",
- "tokio 0.2.16",
+ "tokio 0.2.13",
]
[[package]]
@@ -8399,9 +8399,9 @@ dependencies = [
[[package]]
name = "tiny-keccak"
-version = "2.0.2"
+version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237"
+checksum = "2953ca5148619bc99695c1274cb54c5275bbb913c6adad87e72eaf8db9787f69"
dependencies = [
"crunchy",
]
@@ -8442,9 +8442,9 @@ dependencies = [
[[package]]
name = "tokio"
-version = "0.2.16"
+version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee5a0dd887e37d37390c13ff8ac830f992307fe30a1fff0ab8427af67211ba28"
+checksum = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616"
dependencies = [
"bytes 0.5.4",
"fnv",
@@ -8576,7 +8576,7 @@ checksum = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a"
dependencies = [
"futures-core",
"rustls 0.17.0",
- "tokio 0.2.16",
+ "tokio 0.2.13",
"webpki",
]
@@ -8688,7 +8688,7 @@ dependencies = [
"futures-sink",
"log",
"pin-project-lite",
- "tokio 0.2.16",
+ "tokio 0.2.13",
]
[[package]]
@@ -9225,18 +9225,18 @@ dependencies = [
[[package]]
name = "wast"
-version = "13.0.0"
+version = "12.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b20abd8b4a26f7e0d4dd5e357e90a3d555ec190e94472c9b2b27c5b9777f9ae"
+checksum = "0615ba420811bcda39cf80e8a1bd75997aec09222bda35165920a07ef15cc695"
dependencies = [
"leb128",
]
[[package]]
name = "wat"
-version = "1.0.14"
+version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51a615830ee3e7200b505c441fec09aac2f114deae69df52f215cb828ba112c4"
+checksum = "095f615fbfcae695e3a4cea7d9f02f70561c81274c0142f45a12bf1e154d08bd"
dependencies = [
"wast",
]
diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs
index 94f033fd8f58e..7693f5f0c8065 100644
--- a/bin/node-template/runtime/src/lib.rs
+++ b/bin/node-template/runtime/src/lib.rs
@@ -269,7 +269,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic
;
/// Executive: handles dispatch to the various modules.
-pub type Executive = frame_executive::Executive, Runtime, AllModules>;
+pub type Executive = frame_executive::Executive, AllModules>;
impl_runtime_apis! {
impl sp_api::Core for Runtime {
diff --git a/bin/node/cli/src/factory_impl.rs b/bin/node/cli/src/factory_impl.rs
index 1d1eabe29cbfb..178035f5debd7 100644
--- a/bin/node/cli/src/factory_impl.rs
+++ b/bin/node/cli/src/factory_impl.rs
@@ -56,6 +56,7 @@ impl FactoryState {
frame_system::CheckEra::from(Era::mortal(256, phase)),
frame_system::CheckNonce::from(index),
frame_system::CheckWeight::new(),
+ frame_system::ValidateUnsigned::new(),
pallet_transaction_payment::ChargeTransactionPayment::from(0),
Default::default(),
)
@@ -122,7 +123,7 @@ impl RuntimeAdapter for FactoryState {
(*amount).into()
)
)
- }, key, (version, genesis_hash.clone(), prior_block_hash.clone(), (), (), (), ()))
+ }, key, (version, genesis_hash.clone(), prior_block_hash.clone(), (), (), (), (), ()))
}
fn inherent_extrinsics(&self) -> InherentData {
diff --git a/bin/node/cli/src/service.rs b/bin/node/cli/src/service.rs
index 257068cf144ac..1ed3e8447adf7 100644
--- a/bin/node/cli/src/service.rs
+++ b/bin/node/cli/src/service.rs
@@ -608,6 +608,7 @@ mod tests {
let check_era = frame_system::CheckEra::from(Era::Immortal);
let check_nonce = frame_system::CheckNonce::from(index);
let check_weight = frame_system::CheckWeight::new();
+ let check_unsigned = frame_system::ValidateUnsigned::new();
let payment = pallet_transaction_payment::ChargeTransactionPayment::from(0);
let extra = (
check_version,
@@ -615,13 +616,14 @@ mod tests {
check_era,
check_nonce,
check_weight,
+ check_unsigned,
payment,
Default::default(),
);
let raw_payload = SignedPayload::from_raw(
function,
extra,
- (version, genesis_hash, genesis_hash, (), (), (), ())
+ (version, genesis_hash, genesis_hash, (), (), (), (), ())
);
let signature = raw_payload.using_encoded(|payload| {
signer.sign(payload)
diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs
index 54e236db96e96..8e04960442518 100644
--- a/bin/node/runtime/src/lib.rs
+++ b/bin/node/runtime/src/lib.rs
@@ -105,6 +105,7 @@ impl frame_system::offchain::CreateTransaction for
frame_system::CheckEra::::from(generic::Era::mortal(period, current_block)),
frame_system::CheckNonce::::from(index),
frame_system::CheckWeight::::new(),
+ frame_system::ValidateUnsigned::::new(),
pallet_transaction_payment::ChargeTransactionPayment::::from(tip),
Default::default(),
);
@@ -127,8 +128,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
- spec_version: 240,
- impl_version: 1,
+ spec_version: 241,
+ impl_version: 0,
apis: RUNTIME_API_VERSIONS,
};
@@ -708,6 +709,7 @@ pub type SignedExtra = (
frame_system::CheckEra,
frame_system::CheckNonce,
frame_system::CheckWeight,
+ frame_system::ValidateUnsigned,
pallet_transaction_payment::ChargeTransactionPayment,
pallet_contracts::CheckBlockGasLimit,
);
@@ -718,7 +720,7 @@ pub type SignedPayload = generic::SignedPayload;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic;
/// Executive: handles dispatch to the various modules.
-pub type Executive = frame_executive::Executive, Runtime, AllModules>;
+pub type Executive = frame_executive::Executive, AllModules>;
impl_runtime_apis! {
impl sp_api::Core for Runtime {
diff --git a/bin/node/testing/src/keyring.rs b/bin/node/testing/src/keyring.rs
index 6b0d06875d692..93490e48c92d0 100644
--- a/bin/node/testing/src/keyring.rs
+++ b/bin/node/testing/src/keyring.rs
@@ -73,6 +73,7 @@ pub fn signed_extra(nonce: Index, extra_fee: Balance) -> SignedExtra {
frame_system::CheckEra::from(Era::mortal(256, 0)),
frame_system::CheckNonce::from(nonce),
frame_system::CheckWeight::new(),
+ frame_system::ValidateUnsigned::new(),
pallet_transaction_payment::ChargeTransactionPayment::from(extra_fee),
Default::default(),
)
diff --git a/bin/utils/subkey/src/main.rs b/bin/utils/subkey/src/main.rs
index 08a46f1190ac2..dff63f94eec9a 100644
--- a/bin/utils/subkey/src/main.rs
+++ b/bin/utils/subkey/src/main.rs
@@ -688,6 +688,7 @@ fn create_extrinsic(
frame_system::CheckEra::::from(Era::Immortal),
frame_system::CheckNonce::::from(i),
frame_system::CheckWeight::::new(),
+ frame_system::ValidateUnsigned::::new(),
pallet_transaction_payment::ChargeTransactionPayment::::from(f),
Default::default(),
)
@@ -703,6 +704,7 @@ fn create_extrinsic(
(),
(),
(),
+ (),
),
);
let signature = raw_payload.using_encoded(|payload| signer.sign(payload)).into_runtime();
diff --git a/frame/contracts/src/lib.rs b/frame/contracts/src/lib.rs
index 10938bb7debc1..98b9083a3d656 100644
--- a/frame/contracts/src/lib.rs
+++ b/frame/contracts/src/lib.rs
@@ -119,6 +119,7 @@ use sp_runtime::{
},
transaction_validity::{
ValidTransaction, InvalidTransaction, TransactionValidity, TransactionValidityError,
+ TransactionSource,
},
RuntimeDebug,
};
@@ -1100,6 +1101,7 @@ impl SignedExtension for CheckBlockGasLimit {
fn validate(
&self,
_: &Self::AccountId,
+ _: TransactionSource,
call: &Self::Call,
_: &DispatchInfoOf,
_: usize,
diff --git a/frame/contracts/src/tests.rs b/frame/contracts/src/tests.rs
index 1a5aa08454d14..09b686dae6f12 100644
--- a/frame/contracts/src/tests.rs
+++ b/frame/contracts/src/tests.rs
@@ -28,9 +28,10 @@ use assert_matches::assert_matches;
use hex_literal::*;
use codec::{Decode, Encode, KeyedVec};
use sp_runtime::{
- Perbill, BuildStorage, transaction_validity::{InvalidTransaction, ValidTransaction},
- traits::{BlakeTwo256, Hash, IdentityLookup, SignedExtension},
+ Perbill, BuildStorage,
testing::{Digest, DigestItem, Header, UintAuthorityId, H256},
+ traits::{BlakeTwo256, Hash, IdentityLookup, SignedExtension},
+ transaction_validity::{InvalidTransaction, ValidTransaction, TransactionSource},
};
use frame_support::{
assert_ok, assert_err, impl_outer_dispatch, impl_outer_event, impl_outer_origin, parameter_types,
@@ -1632,16 +1633,21 @@ fn cannot_self_destruct_in_constructor() {
#[test]
fn check_block_gas_limit_works() {
ExtBuilder::default().block_gas_limit(50).build().execute_with(|| {
+ let source = TransactionSource::External;
let info = DispatchInfo { weight: 100, class: DispatchClass::Normal, pays_fee: true };
let check = CheckBlockGasLimit::(Default::default());
let call: Call = crate::Call::put_code(1000, vec![]).into();
assert_eq!(
- check.validate(&0, &call, &info, 0), InvalidTransaction::ExhaustsResources.into(),
+ check.validate(&0, source, &call, &info, 0),
+ InvalidTransaction::ExhaustsResources.into(),
);
let call: Call = crate::Call::update_schedule(Default::default()).into();
- assert_eq!(check.validate(&0, &call, &info, 0), Ok(Default::default()));
+ assert_eq!(
+ check.validate(&0, source, &call, &info, 0),
+ Ok(Default::default())
+ );
});
}
diff --git a/frame/example/src/lib.rs b/frame/example/src/lib.rs
index 13985671c2e79..54dde4ba97ad8 100644
--- a/frame/example/src/lib.rs
+++ b/frame/example/src/lib.rs
@@ -269,6 +269,7 @@ use sp_runtime::{
},
transaction_validity::{
ValidTransaction, TransactionValidityError, InvalidTransaction, TransactionValidity,
+ TransactionSource,
},
};
@@ -627,6 +628,7 @@ impl SignedExtension for WatchDummy {
fn validate(
&self,
_who: &Self::AccountId,
+ _source: TransactionSource,
call: &Self::Call,
_info: &DispatchInfoOf,
len: usize,
@@ -826,16 +828,17 @@ mod tests {
fn signed_ext_watch_dummy_works() {
new_test_ext().execute_with(|| {
let call = >::set_dummy(10);
+ let source = TransactionSource::External;
let info = DispatchInfo::default();
assert_eq!(
- WatchDummy::(PhantomData).validate(&1, &call, &info, 150)
+ WatchDummy::(PhantomData).validate(&1, source, &call, &info, 150)
.unwrap()
.priority,
Bounded::max_value(),
);
assert_eq!(
- WatchDummy::(PhantomData).validate(&1, &call, &info, 250),
+ WatchDummy::(PhantomData).validate(&1, source, &call, &info, 250),
InvalidTransaction::ExhaustsResources.into(),
);
})
diff --git a/frame/executive/src/lib.rs b/frame/executive/src/lib.rs
index 20c79fe4a5cac..3322882f24d67 100644
--- a/frame/executive/src/lib.rs
+++ b/frame/executive/src/lib.rs
@@ -59,19 +59,8 @@
//! # pub type Balances = u64;
//! # pub type AllModules = u64;
//! # pub enum Runtime {};
-//! # 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;
+//! pub type Executive = executive::Executive;
//! ```
#![cfg_attr(not(feature = "std"), no_std)]
@@ -84,7 +73,7 @@ use frame_support::{
use sp_runtime::{
generic::Digest, ApplyExtrinsicResult,
traits::{
- self, Header, Zero, One, Checkable, Applyable, CheckEqual, ValidateUnsigned, NumberFor,
+ self, Header, Zero, One, Checkable, Applyable, CheckEqual, NumberFor,
Block as BlockT, Dispatchable, Saturating,
},
transaction_validity::{TransactionValidity, TransactionSource},
@@ -102,21 +91,20 @@ pub type CheckedOf = >::Checked;
pub type CallOf = as Applyable>::Call;
pub type OriginOf = as Dispatchable>::Origin;
-pub struct Executive(
- PhantomData<(System, Block, Context, UnsignedValidator, AllModules)>
+pub struct Executive(
+ PhantomData<(System, Block, Context, AllModules)>
);
impl<
System: frame_system::Trait,
Block: traits::Block,
Context: Default,
- UnsignedValidator,
AllModules:
OnRuntimeUpgrade +
OnInitialize +
OnFinalize +
- OffchainWorker,
-> ExecuteBlock for Executive
+ OffchainWorker +
+> ExecuteBlock for Executive
where
Block::Extrinsic: Checkable + Codec,
CheckedOf:
@@ -124,10 +112,9 @@ where
GetDispatchInfo,
CallOf: Dispatchable,
OriginOf: From