diff --git a/prdoc/pr_9679.prdoc b/prdoc/pr_9679.prdoc new file mode 100644 index 0000000000000..ebc4b71882551 --- /dev/null +++ b/prdoc/pr_9679.prdoc @@ -0,0 +1,10 @@ +title: '[pallet-revive] fix GAS_PRICE' +doc: +- audience: Runtime Dev + description: |- + Currently submitting a transaction to the dev-node or kitchensink will trigger an error when you try to submit a transaction trough cast (or anything using alloy) as the block gas limit on these runtime is greater than u64::max. + + This bumps the GAS_PRICE to fix this issue, this will eventually be superseeded by the new gas model +crates: +- name: pallet-revive + bump: patch diff --git a/substrate/frame/revive/src/evm/runtime.rs b/substrate/frame/revive/src/evm/runtime.rs index f75c1f599e0d1..b443dd07d89f6 100644 --- a/substrate/frame/revive/src/evm/runtime.rs +++ b/substrate/frame/revive/src/evm/runtime.rs @@ -56,7 +56,7 @@ type CallOf = ::RuntimeCall; /// - Not too high, ensuring the gas value is large enough (at least 7 digits) to encode the /// ref_time, proof_size, and deposit into the less significant (6 lower) digits of the gas value. /// - Not too low, enabling users to adjust the gas price to define a tip. -pub(crate) const GAS_PRICE: u64 = 1_000u64; +pub(crate) const GAS_PRICE: u64 = 1_000_000u64; /// Wraps [`generic::UncheckedExtrinsic`] to support checking unsigned /// [`crate::Call::eth_transact`] extrinsic. @@ -511,6 +511,7 @@ mod test { Weight::MAX, |eth_call, dispatch_call| { let mut info = dispatch_call.get_dispatch_info(); + info.extension_weight = Extra::get_eth_extension(0, 0u32.into()).weight(&dispatch_call); let uxt: Ex = @@ -699,7 +700,7 @@ mod test { ( "Eth fees too low", Box::new(|tx| { - tx.gas_price = Some(tx.gas_price.unwrap() / 2); + tx.gas_price = Some(100u64.into()); }), InvalidTransaction::Payment, ), @@ -723,7 +724,8 @@ mod test { #[test] fn check_transaction_tip() { let (code, _) = compile_module("dummy").unwrap(); - let data = vec![]; + // create some dummy data to increase the gas fee + let data = vec![42u8; crate::limits::CALLDATA_BYTES as usize]; let (_, extra, tx) = UncheckedExtrinsicBuilder::instantiate_with(code.clone(), data.clone()) .mutate_estimate_and_check(Box::new(|tx| { @@ -733,6 +735,7 @@ mod test { .unwrap(); let diff = tx.gas_price.unwrap() - U256::from(GAS_PRICE); let expected_tip = crate::Pallet::::evm_gas_to_fee(tx.gas.unwrap(), diff).unwrap(); + assert_eq!(extra.1.tip(), expected_tip); }