Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
63a2e4b
Make credit available to pallets
athei Sep 18, 2025
bb42047
Add NoDrop
athei Sep 19, 2025
dc41453
Update substrate/frame/transaction-payment/src/payment.rs
athei Sep 22, 2025
bf636fe
Call drop impl when deleting TxPaymentCredit
athei Sep 23, 2025
6156ddd
Improved docs of `withdraw_txfee`
athei Sep 23, 2025
4d3a1f9
Rework gas mapping
athei Sep 8, 2025
d013df2
Fix RPC build
athei Sep 23, 2025
eb91545
Move to FungibleAdapter in kitechensink runtime
athei Sep 23, 2025
315d179
Fix typo in docs
athei Sep 23, 2025
29f7a17
Unify `unadjusted_tx_fee` and `tx_fee`
athei Sep 23, 2025
8f3cecb
Fix the weight derivation
athei Sep 23, 2025
e37cc15
Fix evm_block_gas_limit
athei Sep 24, 2025
a7f65c0
Make extrinsic cap configurable
athei Sep 24, 2025
8ec4aa1
Fix docs
athei Sep 24, 2025
c04e4a5
Take ed from storage deposit hold
athei Sep 25, 2025
ff50a8c
Increase the minimum fee multiplier of the kitchensink runtime
athei Sep 25, 2025
181e573
Fix XCM tests
athei Sep 25, 2025
ed85905
Skip ed transfer when transfers are skipped
athei Sep 25, 2025
2d04dcd
Don't collect from hold during dry run
athei Sep 25, 2025
1ab4393
Fix node cli tests
athei Sep 25, 2025
74c03d6
Fix kitchensink tests after fungible adapter change
athei Sep 25, 2025
66b4249
Remove stale check
athei Sep 25, 2025
a50f0da
Add transaction extension that sets origin
athei Sep 26, 2025
be4ee93
Update EVM test suite
athei Sep 26, 2025
9a59281
Fix rust doc
athei Sep 26, 2025
21da596
Decode the weight from the eth transaction when dry running
athei Sep 29, 2025
eb09623
Fail dry run if transaction consumes to much weight
athei Sep 30, 2025
6d6cc47
Merge branch 'master' into at/gas_mapping2
athei Sep 30, 2025
d7353ce
Fixup asset precompile tests
athei Sep 30, 2025
4125ccd
Remove trait bounds from call
athei Sep 30, 2025
c0c6cf0
Make sure we don't consume too much deposit
athei Sep 30, 2025
3afa072
Remove more bounds
athei Oct 1, 2025
574c214
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Oct 1, 2025
f8b6027
Merge branch 'master' into at/gas_mapping2
athei Oct 1, 2025
486518d
fix: snowbridge test
franciscoaguirre Oct 1, 2025
aa31098
Merge branch 'master' into at/gas_mapping2
athei Oct 2, 2025
ac04073
Roll back edition change
athei Oct 2, 2025
20b9c2d
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Oct 2, 2025
453b36e
Update substrate/frame/revive/src/lib.rs
athei Oct 2, 2025
e59817f
Update substrate/frame/revive/src/evm/fees.rs
athei Oct 2, 2025
f07e335
Update substrate/frame/revive/src/evm/fees.rs
athei Oct 2, 2025
9247704
Remove no longer needed #[allow(deprecated)]
athei Oct 2, 2025
0dafa86
Clean up doc strings
athei Oct 2, 2025
8959cda
Update substrate/frame/revive/src/evm/call.rs
athei Oct 2, 2025
8135e4e
Add docstrings
athei Oct 2, 2025
06ba792
Rename impl_runtime_apis_plus_revive
athei Oct 2, 2025
486f175
Make Stack::effective_gas_price return U256
athei Oct 2, 2025
6d39a08
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Oct 2, 2025
b597ee4
Update prdoc
athei Oct 2, 2025
c998c98
Refund to the tx credit
athei Oct 2, 2025
1385c11
Code deposit refunds should not go to the tx credit
athei Oct 2, 2025
5e15c8c
Record charges for code uploads in the storage meter
athei Oct 2, 2025
9d8b9a5
Fix overdrawn logic
athei Oct 2, 2025
2cd0fde
Update dry-run behaviour
pgherveou Oct 2, 2025
5e24e5e
Changed error messages
athei Oct 2, 2025
9e6ba87
Fixes + evm test suite
pgherveou Oct 2, 2025
3dd1a65
use release for tests
pgherveou Oct 2, 2025
5326b90
nit rm space
pgherveou Oct 2, 2025
12234d5
fix links
pgherveou Oct 2, 2025
f3c3e43
Comment out matter-labs tests
pgherveou Oct 2, 2025
6a82667
Add compile time check for P > 0 and Q > 0
athei Oct 3, 2025
1c33b08
Merge branch 'master' into at/gas_mapping2
athei Oct 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ use sp_runtime::{
generic, impl_opaque_keys,
traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, ConvertInto, Saturating, Verify},
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult, Perbill, Permill, RuntimeDebug,
ApplyExtrinsicResult, FixedU128, Perbill, Permill, RuntimeDebug,
};
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use testnet_parachains_constants::westend::{
consensus::*, currency::*, fee::WeightToFee, snowbridge::EthereumNetwork, time::*,
consensus::*, currency::*, snowbridge::EthereumNetwork, time::*,
};
use westend_runtime_constants::time::DAYS as RC_DAYS;
use xcm_config::{
Expand Down Expand Up @@ -248,6 +248,18 @@ parameter_types! {
pub const TransactionByteFee: Balance = MILLICENTS;
}

/// `pallet_revive` requires this specific `WeightToFee` implementation.
///
/// This is needed because we make certain assumptions about how weight
/// is mapped to fees. Enforced at compile time.
type WeightToFee = pallet_revive::evm::fees::BlockRatioFee<
// p
CENTS,
// q
{ 100 * ExtrinsicBaseWeight::get().ref_time() as u128 },
Runtime,
>;

impl pallet_transaction_payment::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction =
Expand Down Expand Up @@ -1160,6 +1172,7 @@ parameter_types! {
pub const DepositPerItem: Balance = deposit(1, 0);
pub const DepositPerByte: Balance = deposit(0, 1);
pub CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(30);
pub const MaxEthExtrinsicWeight: FixedU128 = FixedU128::from_rational(1,2);
}

impl pallet_revive::Config for Runtime {
Expand All @@ -1169,7 +1182,6 @@ impl pallet_revive::Config for Runtime {
type RuntimeCall = RuntimeCall;
type DepositPerItem = DepositPerItem;
type DepositPerByte = DepositPerByte;
type WeightPrice = pallet_transaction_payment::Pallet<Self>;
type WeightInfo = pallet_revive::weights::SubstrateWeight<Self>;
type Precompiles = (
ERC20<Self, InlineIdConfig<0x120>, TrustBackedAssetsInstance>,
Expand All @@ -1190,8 +1202,9 @@ impl pallet_revive::Config for Runtime {
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type ChainId = ConstU64<420_420_421>;
type NativeToEthRatio = ConstU32<1_000_000>; // 10^(18 - 12) Eth is 10^18, Native is 10^12.
type EthGasEncoder = ();
type FindAuthor = <Runtime as pallet_authorship::Config>::FindAuthor;
type FeeInfo = pallet_revive::evm::fees::Info<Address, Signature, EthExtraImpl>;
type MaxEthExtrinsicWeight = MaxEthExtrinsicWeight;
}

parameter_types! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ use frame_support::{
use hex_literal::hex;
use pallet_revive::{
test_utils::builder::{BareInstantiateBuilder, Contract},
Code, DepositLimit,
Code,
};
use pallet_revive_fixtures::compile_module;
use pallet_uniques::{asset_ops::Item, asset_strategies::Attribute};
Expand Down Expand Up @@ -1689,7 +1689,7 @@ fn withdraw_and_deposit_erc20s() {
let constructor_data = sol_data::Uint::<256>::abi_encode(&initial_amount_u256);
let Contract { addr: erc20_address, .. } = bare_instantiate(&sender, code)
.gas_limit(Weight::from_parts(2_000_000_000, 200_000))
.storage_deposit_limit(DepositLimit::Balance(Balance::MAX))
.storage_deposit_limit(Balance::MAX)
.data(constructor_data)
.build_and_unwrap_contract();

Expand Down Expand Up @@ -1802,7 +1802,7 @@ fn smart_contract_not_erc20_will_error() {

let Contract { addr: non_erc20_address, .. } = bare_instantiate(&sender, code)
.gas_limit(Weight::from_parts(2_000_000_000, 200_000))
.storage_deposit_limit(DepositLimit::Balance(Balance::MAX))
.storage_deposit_limit(Balance::MAX)
.build_and_unwrap_contract();

let wnd_amount_for_fees = 1_000_000_000_000u128;
Expand Down Expand Up @@ -1860,7 +1860,7 @@ fn smart_contract_does_not_return_bool_fails() {

let Contract { addr: non_erc20_address, .. } = bare_instantiate(&sender, code)
.gas_limit(Weight::from_parts(2_000_000_000, 200_000))
.storage_deposit_limit(DepositLimit::Balance(Balance::MAX))
.storage_deposit_limit(Balance::MAX)
.data(constructor_data)
.build_and_unwrap_contract();

Expand Down Expand Up @@ -1916,7 +1916,7 @@ fn expensive_erc20_runs_out_of_gas() {
let constructor_data = sol_data::Uint::<256>::abi_encode(&initial_amount_u256);
let Contract { addr: non_erc20_address, .. } = bare_instantiate(&sender, code)
.gas_limit(Weight::from_parts(2_000_000_000, 200_000))
.storage_deposit_limit(DepositLimit::Balance(Balance::MAX))
.storage_deposit_limit(Balance::MAX)
.data(constructor_data)
.build_and_unwrap_contract();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use pallet_revive::{
primitives::{Address, U256 as EU256},
sol_types::SolCall,
},
AddressMapper, ContractResult, DepositLimit, MomentOf,
AddressMapper, ContractResult, ExecConfig, MomentOf,
};
use sp_core::{Get, H160, H256, U256};
use sp_runtime::Weight;
Expand Down Expand Up @@ -126,8 +126,9 @@ where
asset_id,
U256::zero(),
gas_limit,
DepositLimit::Balance(StorageDepositLimit::get()),
StorageDepositLimit::get(),
data,
ExecConfig::new_substrate_tx(),
);
// We need to return this surplus for the executor to allow refunding it.
let surplus = gas_limit.saturating_sub(gas_consumed);
Expand Down Expand Up @@ -184,8 +185,9 @@ where
asset_id,
U256::zero(),
gas_limit,
DepositLimit::Balance(StorageDepositLimit::get()),
StorageDepositLimit::get(),
data,
ExecConfig::new_substrate_tx(),
);
// We need to return this surplus for the executor to allow refunding it.
let surplus = gas_limit.saturating_sub(gas_consumed);
Expand Down
17 changes: 11 additions & 6 deletions cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ use sp_runtime::{
generic, impl_opaque_keys,
traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT},
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult,
ApplyExtrinsicResult, FixedU128,
};
pub use sp_runtime::{traits::ConvertInto, MultiAddress, Perbill, Permill};
#[cfg(feature = "std")]
Expand Down Expand Up @@ -441,7 +441,7 @@ parameter_types! {
impl pallet_transaction_payment::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter<Balances, ()>;
type WeightToFee = WeightToFee;
type WeightToFee = pallet_revive::evm::fees::BlockRatioFee<1, 1, Self>;
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
type OperationalFeeMultiplier = ConstU8<5>;
Expand Down Expand Up @@ -806,6 +806,7 @@ parameter_types! {
pub const DepositPerItem: Balance = 0;
pub const DepositPerByte: Balance = 0;
pub CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(30);
pub const MaxEthExtrinsicWeight: FixedU128 = FixedU128::from_rational(1,2);
}

impl pallet_revive::Config for Runtime {
Expand All @@ -815,7 +816,6 @@ impl pallet_revive::Config for Runtime {
type RuntimeCall = RuntimeCall;
type DepositPerItem = DepositPerItem;
type DepositPerByte = DepositPerByte;
type WeightPrice = pallet_transaction_payment::Pallet<Self>;
type WeightInfo = pallet_revive::weights::SubstrateWeight<Self>;
type Precompiles = ();
type AddressMapper = pallet_revive::AccountId32Mapper<Self>;
Expand All @@ -829,8 +829,9 @@ impl pallet_revive::Config for Runtime {
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type ChainId = ConstU64<420_420_999>;
type NativeToEthRatio = ConstU32<1_000_000>; // 10^(18 - 12) Eth is 10^18, Native is 10^12.
type EthGasEncoder = ();
type FindAuthor = <Runtime as pallet_authorship::Config>::FindAuthor;
type FeeInfo = pallet_revive::evm::fees::Info<Address, Signature, EthExtraImpl>;
type MaxEthExtrinsicWeight = MaxEthExtrinsicWeight;
}

impl pallet_sudo::Config for Runtime {
Expand Down Expand Up @@ -906,7 +907,11 @@ mod benches {
);
}

impl_runtime_apis! {
pallet_revive::impl_runtime_apis_plus_revive!(
Runtime,
Executive,
EthExtraImpl,

impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
fn slot_duration() -> sp_consensus_aura::SlotDuration {
sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION)
Expand Down Expand Up @@ -1211,7 +1216,7 @@ impl_runtime_apis! {
ConsensusHook::can_build_upon(included_hash, slot)
}
}
}
);

cumulus_pallet_parachain_system::register_validate_block! {
Runtime = Runtime,
Expand Down
Loading
Loading