Skip to content
Open
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
9 changes: 9 additions & 0 deletions prdoc/pr_10693.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: refund deposit_eth_extrinsic_revert_event on the base_weight
doc:
- audience: Runtime Dev
description: |-
When an eth transaction succeed we refund the pre-charged revert_event.
The refund should be done on the base weight and not the weight_consumed, as the latest could be lower than the cost of the revert_event
crates:
- name: pallet-revive
bump: patch
6 changes: 2 additions & 4 deletions substrate/frame/revive/src/evm/block_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl EthereumCallResult {
pub(crate) fn new<T: Config>(
signer: AccountIdOf<T>,
mut output: ContractResult<ExecReturnValue, BalanceOf<T>>,
base_call_weight: Weight,
mut base_call_weight: Weight,
encoded_len: u32,
info: &DispatchInfo,
effective_gas_price: U256,
Expand All @@ -85,9 +85,7 @@ impl EthereumCallResult {

// Refund pre-charged revert event weight if the call succeeds.
if output.result.is_ok() {
output
.weight_consumed
.saturating_reduce(T::WeightInfo::deposit_eth_extrinsic_revert_event())
base_call_weight.saturating_reduce(T::WeightInfo::deposit_eth_extrinsic_revert_event())
}

let result = dispatch_result(output.result, output.weight_consumed, base_call_weight);
Expand Down
Loading