telosnetwork / telos-consensus-client

Consensus client for TelosEVM
Apache License 2.0
2 stars 0 forks source link

Address gas_limit checking #56

Closed poplexity closed 1 month ago

poplexity commented 2 months ago

On the EVM contract there is currently no check to ensure we do not accept a transaction who's gas limit is > the block's gas limit. We need to do 2 things, possibly 3:

  1. Add check to the EVM contract to prevent such transactions from being put into blocks
  2. Check that we don't already have any such transactions on chain (testnet & mainnet) via kibana or another approach
  3. If we find that we have larger transactions, we need to account for these by either a. Increasing global gas limit for blocks, so we can handle them b. Dynamically increase gas_limit in the block header if there is a trx which exceeds the limit. It looks like reth has a check that we don't increase to quickly (looks like previous_block.gas_limit / 1024 is the biggest increase allowed)
poplexity commented 2 months ago

Per @guilledk:

we have 4 transactions on mainnet acording to this rpc that go over the 0x7fffffff gas limit:

poplexity commented 1 month ago

We have implemented a fix, allowing block gas_limit to go up beyond the limit mentioned above, so we now do this dynamically.

Created https://github.com/telosnetwork/telos.evm/issues/178 to add a check in the contract to protect against this going forward.