Skip to content
Closed
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
12 changes: 12 additions & 0 deletions prdoc/pr_10125.prdoc
Original file line number Diff line number Diff line change
@@ -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
11 changes: 2 additions & 9 deletions substrate/frame/revive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,21 +1312,14 @@ pub mod pallet {
}
}

let encoded_length = transaction_encoded.len() as u32;

block_storage::process_transaction::<T>(
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)
})
}
Expand Down
Loading