Kernel/EVM: flat fee is charged on every transaction
Context
Charge a flat fee to every transaction. For further context, see !11512 (merged).
Depends on !11572 (merged), !11604 (merged)
Manually testing the MR
run dune exec etherlink/tezt/tests/main.exe -- --file evm_rollup.ml --title 'Alpha: Check L2 transfers are applied (proxy)' --verbose before and after applying this patch.
Observe the change in gas used: (see the transaction receipt). You can see 123001 gas is used, which is correct given the 1Gwei gas fee passed by eth-cli:
(before)
[13:30:14.705] [eth#7] {
[13:30:14.705] [eth#7] "blockHash": "0x2e7a6add236909365b675ef7607aff5cd842dede2f3be09d9237576c1900699c",
[13:30:14.705] [eth#7] "blockNumber": 3,
[13:30:14.705] [eth#7] "from": "0x6ce4d79d4E77402e1ef3417Fdda433aA744C6e1c",
[13:30:14.705] [eth#7] "gas": 21000,
[13:30:14.705] [eth#7] "gasPrice": "1000000000",
[13:30:14.705] [eth#7] "hash": "0x613f60d1013e2c2b75b4e54228b4fe020c74f359d6fce5660a01b78119868b3a",
[13:30:14.705] [eth#7] "input": "0x",
[13:30:14.705] [eth#7] "nonce": 0,
[13:30:14.705] [eth#7] "to": "0xB53dc01974176E5dFf2298C5a94343c2585E3c54",
[13:30:14.705] [eth#7] "transactionIndex": 0,
[13:30:14.705] [eth#7] "value": "9998000000000000000000",
[13:30:14.705] [eth#7] "v": "0x960a",
[13:30:14.705] [eth#7] "r": "0x6e379419076f238cd61358ad1b5f080a0acfbdf66ebd3a746568f629426909b6",
[13:30:14.705] [eth#7] "s": "0x6a4fcd2180cf51848e2615792d03667ab56c7bf54be96eaf7748084bcb5cbe32",
[13:30:14.705] [eth#7] "receipt": {
[13:30:14.705] [eth#7] "transactionHash": "0x613f60d1013e2c2b75b4e54228b4fe020c74f359d6fce5660a01b78119868b3a",
[13:30:14.705] [eth#7] "transactionIndex": 0,
[13:30:14.705] [eth#7] "blockHash": "0x2e7a6add236909365b675ef7607aff5cd842dede2f3be09d9237576c1900699c",
[13:30:14.705] [eth#7] "blockNumber": 3,
[13:30:14.705] [eth#7] "from": "0x6ce4d79d4e77402e1ef3417fdda433aa744c6e1c",
[13:30:14.705] [eth#7] "to": "0xb53dc01974176e5dff2298c5a94343c2585e3c54",
[13:30:14.705] [eth#7] "cumulativeGasUsed": 21000,
[13:30:14.705] [eth#7] "effectiveGasPrice": "0x3b9aca00",
[13:30:14.705] [eth#7] "gasUsed": 21000,
[13:30:14.705] [eth#7] "logs": [],
[13:30:14.705] [eth#7] "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
[13:30:14.705] [eth#7] "type": "0x0",
[13:30:14.705] [eth#7] "status": true,
[13:30:14.705] [eth#7] "contractAddress": null
[13:30:14.705] [eth#7] }
[13:30:14.705] [eth#7] }
(after)
[12:04:24.451] [npx#7] {
[12:04:24.451] [npx#7] "blockHash": "0xb290dfbacc7c8538106e0ecb5b6e015a8583c661c888b30d713f4aa7f4db7ece",
[12:04:24.451] [npx#7] "blockNumber": 3,
[12:04:24.451] [npx#7] "from": "0x6ce4d79d4E77402e1ef3417Fdda433aA744C6e1c",
[12:04:24.451] [npx#7] "gas": 123001,
[12:04:24.451] [npx#7] "gasPrice": "1000000000",
[12:04:24.451] [npx#7] "hash": "0xed3f112ddb9c9adcffbebe094c3f0e515b98f74f794f7f80663a2c3b20ab9d8f",
[12:04:24.451] [npx#7] "input": "0x",
[12:04:24.451] [npx#7] "nonce": 0,
[12:04:24.451] [npx#7] "to": "0xB53dc01974176E5dFf2298C5a94343c2585E3c54",
[12:04:24.451] [npx#7] "transactionIndex": 0,
[12:04:24.451] [npx#7] "value": "9998000000000000000000",
[12:04:24.451] [npx#7] "v": "0x950a",
[12:04:24.451] [npx#7] "r": "0x65e11181d186428dab962e22b584a36bbba246b41c69189aec0b3478cbadec3a",
[12:04:24.451] [npx#7] "s": "0x56669beb8761b78df6ee0df710d3f8cee9593f3d2871e4ffa189787c50e0ba7d",
[12:04:24.451] [npx#7] "receipt": {
[12:04:24.451] [npx#7] "transactionHash": "0xed3f112ddb9c9adcffbebe094c3f0e515b98f74f794f7f80663a2c3b20ab9d8f",
[12:04:24.451] [npx#7] "transactionIndex": 0,
[12:04:24.451] [npx#7] "blockHash": "0xb290dfbacc7c8538106e0ecb5b6e015a8583c661c888b30d713f4aa7f4db7ece",
[12:04:24.451] [npx#7] "blockNumber": 3,
[12:04:24.451] [npx#7] "from": "0x6ce4d79d4e77402e1ef3417fdda433aa744c6e1c",
[12:04:24.451] [npx#7] "to": "0xb53dc01974176e5dff2298c5a94343c2585e3c54",
[12:04:24.451] [npx#7] "cumulativeGasUsed": 123001,
[12:04:24.451] [npx#7] "effectiveGasPrice": "0x3b9aca00",
[12:04:24.451] [npx#7] "gasUsed": 123001,
[12:04:24.451] [npx#7] "logs": [],
[12:04:24.451] [npx#7] "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
[12:04:24.451] [npx#7] "type": "0x0",
[12:04:24.451] [npx#7] "status": true,
[12:04:24.451] [npx#7] "contractAddress": null
[12:04:24.451] [npx#7] }
[12:04:24.451] [npx#7] }
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.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Emma Turner