erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.12k stars 1.11k forks source link

Transaction with higher gas limit than block gas limit is flagged as "queued" #9851

Open jcchevalier-ledger opened 6 months ago

jcchevalier-ledger commented 6 months ago

System information

Erigon version: erigon version 2.58.1

OS & Version: Linux

Erigon Command (with flags/config): /app/erigon --chain=sepolia --snapshots=true --torrent.port=<####> --torrent.download.rate=100mb --http --http.addr=<####> --http.port=<####> --http.vhosts=<####> --http.api=eth,net,debug,trace,txpool,erigon,web3 --metrics.addr=<####> --metrics.port=<####> --datadir=/some/dir --db.size.limit=8TB --authrpc.jwtsecret=/some/file --nat=<####> --port=<####>

Consensus Layer: Prysm

Chain/Network: Ethereum Sepolia

Expected behaviour

The transaction must be rejected by the node with the error {"code":-32000,"message":"exceeds block gas limit"}}

Actual behaviour

Transaction is accepted and flagged as "queued"

Steps to reproduce the behaviour

Create a dummy transaction with a gas limit > 30_000_000

somnathb1 commented 6 months ago

Why?

jcchevalier-ledger commented 3 weeks ago

I just remember I created this issue 😅. A transaction with a gas limit higher than block gas cap cannot be mined since it can use more gas than available in one block. Geth handles this by refusing this transaction (with the error msg {"code":-32000,"message":"exceeds block gas limit"}), and I think it's safer and less confusing than accepting it, bcs the transaction will stay stuck anyway.