Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions prdoc/pr_9679.prdoc
Original file line number Diff line number Diff line change
@@ -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
9 changes: 6 additions & 3 deletions substrate/frame/revive/src/evm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type CallOf<T> = <T as frame_system::Config>::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.
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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,
),
Expand All @@ -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| {
Expand All @@ -733,6 +735,7 @@ mod test {
.unwrap();
let diff = tx.gas_price.unwrap() - U256::from(GAS_PRICE);
let expected_tip = crate::Pallet::<Test>::evm_gas_to_fee(tx.gas.unwrap(), diff).unwrap();

assert_eq!(extra.1.tip(), expected_tip);
}

Expand Down
Loading