diff --git a/prdoc/pr_10125.prdoc b/prdoc/pr_10125.prdoc new file mode 100644 index 0000000000000..bb4fefd7c63b6 --- /dev/null +++ b/prdoc/pr_10125.prdoc @@ -0,0 +1,12 @@ +title: 'revive/fix: Remove double tax on eth_call weight' +doc: +- audience: Node Dev + description: "This PR aligns the `eth_call` with `eth_instantiate_with_code` in\ + \ terms of weight.\n\n@pgherveou noticed that we are double taxing the `eth_call`\ + \ in terms of weight:\n- (I) we are adding the `#pallet::weight` on the encoded\ + \ tx length\n- (II) we are adding the same weight again via `.saturating_add(T::WeightInfo::on_finalize_block_per_tx(encoded_length))`\n\ + \nThis PR removes the weight from (II) and relies on the `#pallet::weight` entirely.\n\ + \ncc @pgherveou @lrubasze \U0001F64F" +crates: +- name: pallet-revive + bump: patch diff --git a/substrate/frame/revive/src/lib.rs b/substrate/frame/revive/src/lib.rs index fca8db4e3dbab..a735ce68cd711 100644 --- a/substrate/frame/revive/src/lib.rs +++ b/substrate/frame/revive/src/lib.rs @@ -1312,21 +1312,14 @@ pub mod pallet { } } - let encoded_length = transaction_encoded.len() as u32; - block_storage::process_transaction::( transaction_encoded, output.result.is_ok(), output.gas_consumed, ); - let result = dispatch_result( - output.result, - output.gas_consumed, - base_info - .call_weight - .saturating_add(T::WeightInfo::on_finalize_block_per_tx(encoded_length)), - ); + let result = + dispatch_result(output.result, output.gas_consumed, base_info.call_weight); T::FeeInfo::ensure_not_overdrawn(encoded_len, &info, result) }) }