Skip to content

Kernel/EVM: gas price should be of tx, not block

Emma Turner requested to merge emturner@eth-block-rm-gas-price into master

Context

Depends on !11508 (merged)

The gas price used to charge the sender of a transaction was block_constants.gas_price, which was always initialised to U256::one. Therefore, users were always charged 1 wei/gas - which is well under the intended base_fee_per_gas = 21000.

We remove block_constants.gas_price, and instead thread through transaction.gas_price(..) which is the effective_gas_fee as per EIP-1559.

Manually testing the MR

Observe the following, with/without this patch (NB you will require !11508 (merged))

dune exec tezt/tests/main.exe -- --file evm_rollup.ml --title 'Alpha: Check L2 transfers are applied (proxy)' --verbose
  • Without this patch, you will see 0x1 in the transaction receipt for effectiveGasPrice.
  • With this patch, you will see the correct value of 0x3b9aca00 (this is 1Gwei, the default gas price set by eth-cli).

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Emma Turner

Merge request reports