diff --git a/ecosystem-modules/stable-asset b/ecosystem-modules/stable-asset index db439920e4..adce350fab 160000 --- a/ecosystem-modules/stable-asset +++ b/ecosystem-modules/stable-asset @@ -1 +1 @@ -Subproject commit db439920e46f47c835b1327087cdcf97daee980b +Subproject commit adce350fab53d7ca7deba3c98deb4ef397527406 diff --git a/evm-tests b/evm-tests index bbd02c03df..5ccdf60e13 160000 --- a/evm-tests +++ b/evm-tests @@ -1 +1 @@ -Subproject commit bbd02c03df29601d800b44e369beb0d516080808 +Subproject commit 5ccdf60e13a221dc59041e028064c75ba42dc99f diff --git a/modules/transaction-payment/src/lib.rs b/modules/transaction-payment/src/lib.rs index b209d77b04..094d890143 100644 --- a/modules/transaction-payment/src/lib.rs +++ b/modules/transaction-payment/src/lib.rs @@ -961,7 +961,8 @@ where // pre check before set OverrideChargeFeeMethod ensure!( fee_swap_path.len() <= T::TradingPathLimit::get() as usize - && fee_swap_path.len() > 1 && fee_swap_path.first() != Some(&T::NativeCurrencyId::get()) + && fee_swap_path.len() > 1 + && fee_swap_path.first() != Some(&T::NativeCurrencyId::get()) && fee_swap_path.last() == Some(&T::NativeCurrencyId::get()), Error::::InvalidSwapPath ); diff --git a/node/service/src/chain_spec/mandala.rs b/node/service/src/chain_spec/mandala.rs index 8b32649a5f..6ace1add30 100644 --- a/node/service/src/chain_spec/mandala.rs +++ b/node/service/src/chain_spec/mandala.rs @@ -400,11 +400,11 @@ fn testnet_genesis( collaterals_params: vec![ ( DOT, - Some(FixedU128::zero()), // interest rate per sec for this collateral + Some(FixedU128::zero()), // interest rate per sec for this collateral Some(FixedU128::saturating_from_rational(150, 100)), // liquidation ratio - Some(FixedU128::saturating_from_rational(10, 100)), // liquidation penalty rate + Some(FixedU128::saturating_from_rational(10, 100)), // liquidation penalty rate Some(FixedU128::saturating_from_rational(150, 100)), // required liquidation ratio - 10_000_000 * dollar(AUSD), // maximum debit value in aUSD (cap) + 10_000_000 * dollar(AUSD), // maximum debit value in aUSD (cap) ), ( LDOT, @@ -576,11 +576,11 @@ fn mandala_genesis( collaterals_params: vec![ ( DOT, - Some(FixedU128::zero()), // interest rate per sec for this collateral + Some(FixedU128::zero()), // interest rate per sec for this collateral Some(FixedU128::saturating_from_rational(105, 100)), // liquidation ratio - Some(FixedU128::saturating_from_rational(3, 100)), // liquidation penalty rate + Some(FixedU128::saturating_from_rational(3, 100)), // liquidation penalty rate Some(FixedU128::saturating_from_rational(110, 100)), // required liquidation ratio - 10_000_000 * dollar(AUSD), // maximum debit value in aUSD (cap) + 10_000_000 * dollar(AUSD), // maximum debit value in aUSD (cap) ), ( LDOT, diff --git a/runtime/acala/Cargo.toml b/runtime/acala/Cargo.toml index 801da328fe..deb2a93a8f 100644 --- a/runtime/acala/Cargo.toml +++ b/runtime/acala/Cargo.toml @@ -415,4 +415,4 @@ no-metadata-docs = ["frame-support/no-metadata-docs"] # more types in the metadata. full-metadata-docs = ["frame-support/full-metadata-docs"] -tracing = ["module-evm/tracing", "module-evm-rpc-runtime-api/tracing"] +tracing = ["module-evm/tracing", "module-evm-rpc-runtime-api/tracing", "runtime-common/tracing"] diff --git a/runtime/acala/src/lib.rs b/runtime/acala/src/lib.rs index 145c9788e1..532dbda5c1 100644 --- a/runtime/acala/src/lib.rs +++ b/runtime/acala/src/lib.rs @@ -2535,7 +2535,11 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig valid_until, }) => { if System::block_number() > valid_until { - return Err(InvalidTransaction::Stale); + if cfg!(feature = "tracing") { + // skip check when enable tracing feature + } else { + return Err(InvalidTransaction::Stale); + } } let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone(); @@ -2580,7 +2584,11 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig decode_gas_price(gas_price, gas_limit, TxFeePerGasV2::get()).ok_or(InvalidTransaction::Stale)?; if System::block_number() > valid_until { - return Err(InvalidTransaction::Stale); + if cfg!(feature = "tracing") { + // skip check when enable tracing feature + } else { + return Err(InvalidTransaction::Stale); + } } let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone(); diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index c0c5fe923a..719f4eb157 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -179,3 +179,4 @@ wasm-bench = [ runtime-benchmarks = [ "orml-oracle/runtime-benchmarks" ] +tracing = [] diff --git a/runtime/common/src/check_nonce.rs b/runtime/common/src/check_nonce.rs index 9e3b4d922c..b2cd9accee 100644 --- a/runtime/common/src/check_nonce.rs +++ b/runtime/common/src/check_nonce.rs @@ -120,7 +120,10 @@ where let evm_nonce = module_evm::Accounts::::get(address) .map(|x| x.nonce) .unwrap_or_default(); - if self.nonce != evm_nonce { + + if cfg!(feature = "tracing") { + // skip check when enable tracing feature + } else if self.nonce != evm_nonce { return Err(if self.nonce < evm_nonce { InvalidTransaction::Stale } else { @@ -155,7 +158,10 @@ where let evm_nonce = module_evm::Accounts::::get(address) .map(|x| x.nonce) .unwrap_or_default(); - if self.nonce < evm_nonce { + + if cfg!(feature = "tracing") { + // skip check when enable tracing feature + } else if self.nonce < evm_nonce { return InvalidTransaction::Stale.into(); } diff --git a/runtime/integration-tests/src/evm.rs b/runtime/integration-tests/src/evm.rs index de3426f19f..cc009ea8d6 100644 --- a/runtime/integration-tests/src/evm.rs +++ b/runtime/integration-tests/src/evm.rs @@ -816,7 +816,8 @@ fn transaction_payment_module_works_with_evm_contract() { let dollar = dollar(NATIVE_CURRENCY); let alice_evm_account = MockAddressMapping::get_account_id(&alice_evm_addr()); let ed = NativeTokenExistentialDeposit::get(); // 100_000_000_000 - // new account + + // new account let empty_account = AccountId::new([1u8; 32]); let empty_address = H160::from_slice(&[1u8; 20]); let empty_address_account = MockAddressMapping::get_account_id(&empty_address); diff --git a/runtime/karura/Cargo.toml b/runtime/karura/Cargo.toml index 7d11c175ce..4c26403e31 100644 --- a/runtime/karura/Cargo.toml +++ b/runtime/karura/Cargo.toml @@ -423,4 +423,4 @@ no-metadata-docs = ["frame-support/no-metadata-docs"] # more types in the metadata. full-metadata-docs = ["frame-support/full-metadata-docs"] -tracing = ["module-evm/tracing", "module-evm-rpc-runtime-api/tracing"] +tracing = ["module-evm/tracing", "module-evm-rpc-runtime-api/tracing", "runtime-common/tracing"] diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index 3b1ca0b5ef..73f9b852f5 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -2561,7 +2561,11 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig valid_until, }) => { if System::block_number() > valid_until { - return Err(InvalidTransaction::Stale); + if cfg!(feature = "tracing") { + // skip check when enable tracing feature + } else { + return Err(InvalidTransaction::Stale); + } } let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone(); @@ -2606,7 +2610,11 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig decode_gas_price(gas_price, gas_limit, TxFeePerGasV2::get()).ok_or(InvalidTransaction::Stale)?; if System::block_number() > valid_until { - return Err(InvalidTransaction::Stale); + if cfg!(feature = "tracing") { + // skip check when enable tracing feature + } else { + return Err(InvalidTransaction::Stale); + } } let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone(); diff --git a/runtime/mandala/Cargo.toml b/runtime/mandala/Cargo.toml index 2034b973e7..776918b1f4 100644 --- a/runtime/mandala/Cargo.toml +++ b/runtime/mandala/Cargo.toml @@ -447,4 +447,4 @@ no-metadata-docs = ["frame-support/no-metadata-docs"] # more types in the metadata. full-metadata-docs = ["frame-support/full-metadata-docs"] -tracing = ["module-evm/tracing", "module-evm-rpc-runtime-api/tracing"] +tracing = ["module-evm/tracing", "module-evm-rpc-runtime-api/tracing", "runtime-common/tracing"] diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index ef30dd6d41..a3d3089f34 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -1920,7 +1920,11 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig valid_until, }) => { if System::block_number() > valid_until { - return Err(InvalidTransaction::Stale); + if cfg!(feature = "tracing") { + // skip check when enable tracing feature + } else { + return Err(InvalidTransaction::Stale); + } } let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone(); @@ -1965,7 +1969,11 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig decode_gas_price(gas_price, gas_limit, TxFeePerGasV2::get()).ok_or(InvalidTransaction::Stale)?; if System::block_number() > valid_until { - return Err(InvalidTransaction::Stale); + if cfg!(feature = "tracing") { + // skip check when enable tracing feature + } else { + return Err(InvalidTransaction::Stale); + } } let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone();