Revert "FRAME: Create TransactionExtension as a replacement for SignedExtension (#2280)" (#3665)

This PR reverts #2280 which introduced `TransactionExtension` to replace
`SignedExtension`.

As a result of the discussion
[here](https://github.com/paritytech/polkadot-sdk/pull/3623#issuecomment-1986789700),
the changes will be reverted for now with plans to reintroduce the
concept in the future.

---------

Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
This commit is contained in:
georgepisaltu
2024-03-13 16:10:59 +02:00
committed by GitHub
parent 60ac5a723c
commit bbd51ce867
350 changed files with 15826 additions and 24304 deletions
@@ -30,7 +30,6 @@ use frame_support::{
StorageNoopGuard,
};
use frame_system::Event as SysEvent;
use sp_runtime::traits::DispatchTransaction;
const ID_1: LockIdentifier = *b"1 ";
const ID_2: LockIdentifier = *b"2 ";
@@ -241,17 +240,17 @@ fn lock_should_work_reserve() {
TokenError::Frozen
);
assert_noop!(Balances::reserve(&1, 1), Error::<Test>::LiquidityRestrictions,);
assert!(ChargeTransactionPayment::<Test>::validate_and_prepare(
assert!(<ChargeTransactionPayment<Test> as SignedExtension>::pre_dispatch(
ChargeTransactionPayment::from(1),
Some(1).into(),
&1,
CALL,
&info_from_weight(Weight::from_parts(1, 0)),
1,
)
.is_err());
assert!(ChargeTransactionPayment::<Test>::validate_and_prepare(
assert!(<ChargeTransactionPayment<Test> as SignedExtension>::pre_dispatch(
ChargeTransactionPayment::from(0),
Some(1).into(),
&1,
CALL,
&info_from_weight(Weight::from_parts(1, 0)),
1,
@@ -272,17 +271,17 @@ fn lock_should_work_tx_fee() {
TokenError::Frozen
);
assert_noop!(Balances::reserve(&1, 1), Error::<Test>::LiquidityRestrictions,);
assert!(ChargeTransactionPayment::<Test>::validate_and_prepare(
assert!(<ChargeTransactionPayment<Test> as SignedExtension>::pre_dispatch(
ChargeTransactionPayment::from(1),
Some(1).into(),
&1,
CALL,
&info_from_weight(Weight::from_parts(1, 0)),
1,
)
.is_err());
assert!(ChargeTransactionPayment::<Test>::validate_and_prepare(
assert!(<ChargeTransactionPayment<Test> as SignedExtension>::pre_dispatch(
ChargeTransactionPayment::from(0),
Some(1).into(),
&1,
CALL,
&info_from_weight(Weight::from_parts(1, 0)),
1,
+2 -2
View File
@@ -37,7 +37,7 @@ use scale_info::TypeInfo;
use sp_core::hexdisplay::HexDisplay;
use sp_io;
use sp_runtime::{
traits::{BadOrigin, Zero},
traits::{BadOrigin, SignedExtension, Zero},
ArithmeticError, BuildStorage, DispatchError, DispatchResult, FixedPointNumber, RuntimeDebug,
TokenError,
};
@@ -96,13 +96,13 @@ impl frame_system::Config for Test {
type AccountData = super::AccountData<u64>;
}
#[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig as pallet_transaction_payment::DefaultConfig)]
impl pallet_transaction_payment::Config for Test {
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = CurrencyAdapter<Pallet<Test>, ()>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = IdentityFee<u64>;
type LengthToFee = IdentityFee<u64>;
type FeeMultiplierUpdate = ();
}
pub(crate) type Balance = u64;
+48 -50
View File
@@ -17,28 +17,26 @@
//! Autogenerated weights for `pallet_balances`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-03-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-01-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-bn-ce5rx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
// Executed Command:
// ./target/production/substrate-node
// target/production/substrate-node
// benchmark
// pallet
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=pallet_balances
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./substrate/frame/balances/src/weights.rs
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_balances
// --chain=dev
// --header=./substrate/HEADER-APACHE2
// --output=./substrate/frame/balances/src/weights.rs
// --template=./substrate/.maintain/frame-weight-template.hbs
#![cfg_attr(rustfmt, rustfmt_skip)]
@@ -71,8 +69,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 46_407_000 picoseconds.
Weight::from_parts(47_561_000, 3593)
// Minimum execution time: 46_329_000 picoseconds.
Weight::from_parts(47_297_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -82,8 +80,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 36_574_000 picoseconds.
Weight::from_parts(37_682_000, 3593)
// Minimum execution time: 36_187_000 picoseconds.
Weight::from_parts(36_900_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -93,8 +91,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 13_990_000 picoseconds.
Weight::from_parts(14_568_000, 3593)
// Minimum execution time: 13_498_000 picoseconds.
Weight::from_parts(14_143_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -104,8 +102,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 19_594_000 picoseconds.
Weight::from_parts(20_148_000, 3593)
// Minimum execution time: 18_756_000 picoseconds.
Weight::from_parts(19_553_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -115,8 +113,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `6196`
// Minimum execution time: 47_945_000 picoseconds.
Weight::from_parts(49_363_000, 6196)
// Minimum execution time: 47_826_000 picoseconds.
Weight::from_parts(48_834_000, 6196)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
@@ -126,8 +124,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 45_205_000 picoseconds.
Weight::from_parts(45_952_000, 3593)
// Minimum execution time: 44_621_000 picoseconds.
Weight::from_parts(45_151_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -137,8 +135,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 16_593_000 picoseconds.
Weight::from_parts(17_123_000, 3593)
// Minimum execution time: 16_194_000 picoseconds.
Weight::from_parts(16_945_000, 3593)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -149,10 +147,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0 + u * (135 ±0)`
// Estimated: `990 + u * (2603 ±0)`
// Minimum execution time: 16_182_000 picoseconds.
Weight::from_parts(16_412_000, 990)
// Standard Error: 10_148
.saturating_add(Weight::from_parts(13_382_459, 0).saturating_mul(u.into()))
// Minimum execution time: 15_782_000 picoseconds.
Weight::from_parts(16_118_000, 990)
// Standard Error: 10_499
.saturating_add(Weight::from_parts(13_327_660, 0).saturating_mul(u.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into())))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into())))
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
@@ -161,8 +159,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_478_000 picoseconds.
Weight::from_parts(6_830_000, 0)
// Minimum execution time: 6_157_000 picoseconds.
Weight::from_parts(6_507_000, 0)
}
}
@@ -174,8 +172,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 46_407_000 picoseconds.
Weight::from_parts(47_561_000, 3593)
// Minimum execution time: 46_329_000 picoseconds.
Weight::from_parts(47_297_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -185,8 +183,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 36_574_000 picoseconds.
Weight::from_parts(37_682_000, 3593)
// Minimum execution time: 36_187_000 picoseconds.
Weight::from_parts(36_900_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -196,8 +194,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 13_990_000 picoseconds.
Weight::from_parts(14_568_000, 3593)
// Minimum execution time: 13_498_000 picoseconds.
Weight::from_parts(14_143_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -207,8 +205,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 19_594_000 picoseconds.
Weight::from_parts(20_148_000, 3593)
// Minimum execution time: 18_756_000 picoseconds.
Weight::from_parts(19_553_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -218,8 +216,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `6196`
// Minimum execution time: 47_945_000 picoseconds.
Weight::from_parts(49_363_000, 6196)
// Minimum execution time: 47_826_000 picoseconds.
Weight::from_parts(48_834_000, 6196)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
@@ -229,8 +227,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 45_205_000 picoseconds.
Weight::from_parts(45_952_000, 3593)
// Minimum execution time: 44_621_000 picoseconds.
Weight::from_parts(45_151_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -240,8 +238,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 16_593_000 picoseconds.
Weight::from_parts(17_123_000, 3593)
// Minimum execution time: 16_194_000 picoseconds.
Weight::from_parts(16_945_000, 3593)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
@@ -252,10 +250,10 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0 + u * (135 ±0)`
// Estimated: `990 + u * (2603 ±0)`
// Minimum execution time: 16_182_000 picoseconds.
Weight::from_parts(16_412_000, 990)
// Standard Error: 10_148
.saturating_add(Weight::from_parts(13_382_459, 0).saturating_mul(u.into()))
// Minimum execution time: 15_782_000 picoseconds.
Weight::from_parts(16_118_000, 990)
// Standard Error: 10_499
.saturating_add(Weight::from_parts(13_327_660, 0).saturating_mul(u.into()))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(u.into())))
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(u.into())))
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
@@ -264,7 +262,7 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_478_000 picoseconds.
Weight::from_parts(6_830_000, 0)
// Minimum execution time: 6_157_000 picoseconds.
Weight::from_parts(6_507_000, 0)
}
}