You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix `gas_used` calculation introduced in #9418 to use the actual gas
instead of just `ref_time`.
With these changes we now guarantee that `tx_cost = effective_gas_price
* gas`.
Note that since we compute gas as `fee / gas_price`, this can lead to
rounding errors when the chain uses `SlowAdjustingFeeUpdate` (i.e. the
fee is not a multiple of the gas price).
The changes in this PR ensure the fee still matches by burning the
rounding remainder.
This PR also fixes how the actual fee is computed and introduces a new
`compute_actual_fee` in `Config::FeeInfo`.
The previous fee calculation was skipping the `extension_weight` in the
fee calculation.
The updated tests ensure that the tx cost reported in the receipt
matches the fees deducted from the user account:
https://github.com/paritytech/evm-test-suite/blob/460b2c9aa3a3019d3508bb5a34a2498ea86035ff/src/gas.test.ts?plain=1#L31-L61
---------
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fix `gas_used` calculation introduced in #9418 to use the actual gas instead of just `ref_time`.
6
+
7
+
With these changes we now guarantee that `tx_cost = effective_gas_price * gas`.
8
+
Note that since we compute gas as `fee / gas_price`, this can lead to rounding errors when the chain uses `SlowAdjustingFeeUpdate` (i.e. the fee is not a multiple of the gas price).
9
+
The changes in this PR ensure the fee still matches by burning the rounding remainder.
10
+
11
+
This PR also fixes how the actual fee is computed and introduces a new `compute_actual_fee` in `Config::FeeInfo`.
12
+
The previous fee calculation was skipping the `extension_weight` in the fee calculation.
13
+
14
+
The updated tests ensure that the tx cost reported in the receipt matches the fees deducted from the user account:
0 commit comments