Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpcdaemon: post EIP1559 balance check done on max_fee_per_gas and max_blob_per_gas #2063

Merged
merged 12 commits into from
Jun 14, 2024

Conversation

lupin012
Copy link
Contributor

@lupin012 lupin012 commented Jun 2, 2024

Internally we always manage transactions using post EIP-1559 attributes i.e. base_fee_per_gas, max_fee_per_gas, max_priority_fee_per_gas, converting back and forth to/from pre EIP-1559 gas_price. Specifically:

  • when a transaction is decoded from storage, it is adapted to post EIP-1559 format (even if the transaction is pre EIP-1559)
  • when a client issues any JSON RPC call API (e.g. eth_call), the Call parameters are converted to post EIP-1559 format here
  • rpc::EVMExecutor relies only on post EIP-1559 Transaction::effective_gas_price to calculate the gas price and this works both pre and post EIP-1559
  • in order to check if the sender balance is sufficient, we now use max_fee_per_gas (before we used the effective gas price)

@lupin012 lupin012 force-pushed the align_effective_gas_calc_to_erigon branch from 2272c8b to 0b2a9c1 Compare June 2, 2024 09:48
@lupin012 lupin012 changed the title rpcdaemon: add check and modify effective_gas calc rpcdaemon: add check on call according erigon Jun 9, 2024
@lupin012 lupin012 force-pushed the align_effective_gas_calc_to_erigon branch from fb9263e to edaf3d4 Compare June 12, 2024 18:05
@lupin012 lupin012 force-pushed the align_effective_gas_calc_to_erigon branch from 6247988 to 060a135 Compare June 13, 2024 08:09
@lupin012 lupin012 force-pushed the align_effective_gas_calc_to_erigon branch from 85cd2de to 52d8c7b Compare June 13, 2024 20:54
@lupin012 lupin012 changed the title rpcdaemon: add check on call according erigon rpcdaemon: check on available balance on POSI EIP1559 should be done on max_fee_per_gas and max_blob_per_gas Jun 13, 2024
@lupin012 lupin012 changed the title rpcdaemon: check on available balance on POSI EIP1559 should be done on max_fee_per_gas and max_blob_per_gas rpcdaemon: post EIP1559 check on balance should be done on max_fee_per_gas and max_blob_per_gas Jun 13, 2024
@lupin012 lupin012 requested a review from canepat June 13, 2024 21:10
@lupin012 lupin012 marked this pull request as ready for review June 13, 2024 21:11
@canepat canepat added the maintenance Some maintenance work (fix, refactor, rename, test...) label Jun 14, 2024
@canepat canepat changed the title rpcdaemon: post EIP1559 check on balance should be done on max_fee_per_gas and max_blob_per_gas rpcdaemon: post EIP1559 balance check done on max_fee_per_gas and max_blob_per_gas Jun 14, 2024
@canepat canepat merged commit f93fec4 into master Jun 14, 2024
4 checks passed
@canepat canepat deleted the align_effective_gas_calc_to_erigon branch June 14, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Some maintenance work (fix, refactor, rename, test...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants