diff --git a/pallets/xvm/src/lib.rs b/pallets/xvm/src/lib.rs index f0acfa99b6..7ebc6acbdc 100644 --- a/pallets/xvm/src/lib.rs +++ b/pallets/xvm/src/lib.rs @@ -150,13 +150,6 @@ impl Pallet { used_weight: WeightInfoOf::::evm_call_overheads(), })?; - if skip_execution { - return Ok(CallInfo { - output: vec![], - used_weight: WeightInfoOf::::evm_call_overheads(), - }); - } - let value = U256::zero(); // With overheads, less weight is available. let weight_limit = context @@ -164,6 +157,13 @@ impl Pallet { .saturating_sub(WeightInfoOf::::evm_call_overheads()); let gas_limit = U256::from(T::GasWeightMapping::weight_to_gas(weight_limit)); + if skip_execution { + return Ok(CallInfo { + output: vec![], + used_weight: WeightInfoOf::::evm_call_overheads(), + }); + } + let transact_result = T::EthereumTransact::xvm_transact( T::AccountMapping::into_h160(source), CheckedEthereumTx { diff --git a/precompiles/xvm/src/lib.rs b/precompiles/xvm/src/lib.rs index 2a18b07887..78772c5244 100644 --- a/precompiles/xvm/src/lib.rs +++ b/precompiles/xvm/src/lib.rs @@ -99,6 +99,8 @@ where Err(f) => f.used_weight, }; handle.record_cost(R::GasWeightMapping::weight_to_gas(used_weight))?; + handle + .record_external_cost(Some(used_weight.ref_time()), Some(used_weight.proof_size()))?; match call_result { Ok(success) => {