Skip to content

Commit

Permalink
Merge pull request #2833 from subspace/evm-domain-gas-estimate-fix
Browse files Browse the repository at this point in the history
Fix evm gas estimate bug
  • Loading branch information
dastansam authored Jun 11, 2024
2 parents e6039f5 + fb893a9 commit c4c1a63
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions domains/runtime/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,9 +1311,25 @@ impl_runtime_apis! {

let is_transactional = false;
let validate = true;
let weight_limit = None;
let proof_size_base_cost = None;
let evm_config = config.as_ref().unwrap_or(<Runtime as pallet_evm::Config>::config());

let gas_limit = gas_limit.min(u64::MAX.into());

let transaction_data = TransactionData::new(
pallet_ethereum::TransactionAction::Call(to),
data.clone(),
nonce.unwrap_or_default(),
gas_limit,
None,
max_fee_per_gas,
max_priority_fee_per_gas,
value,
Some(<Runtime as pallet_evm::Config>::ChainId::get()),
access_list.clone().unwrap_or_default(),
);

let (weight_limit, proof_size_base_cost) = pallet_ethereum::Pallet::<Runtime>::transaction_weight(&transaction_data);

<Runtime as pallet_evm::Config>::Runner::call(
from,
to,
Expand Down

0 comments on commit c4c1a63

Please sign in to comment.