-
Notifications
You must be signed in to change notification settings - Fork 683
In Geth chain-mode, logic to accept/reject transactions based on gas price/limit should match Geth #2176
Comments
To paraphrase @MicaiahReid: "The best course of action is to add our check in the transaction-pool.ts prepareTransaction function to validate that a transaction's maxFeePerGas >= baseFeePerGas, and we'll do the rest in #2831" For reference, the same behaviour is described in Geth here: https://github.com/ethereum/go-ethereum/blob/06540146524222f648d8b19c5bcb00a8fd3dd339/core/state_transition.go#L235 |
As per comment from the geth team here: ethereum/go-ethereum#24661 (comment), and @MicaiahReid 's (excellent) summary here: #2840 (review), Geth's behaviour is:
(Quoting @MicaiahReid) const block = new RuntimeBlock(
Quantity.from((parentHeader.number.toBigInt() || 0n) + 1n),
parentHeader.parentHash,
parentHeader.miner,
tx.gas.toBuffer(),
parentHeader.gasUsed.toBuffer(),
parentHeader.timestamp,
options.miner.difficulty,
parentHeader.totalDifficulty,
0n // no baseFeePerGas for estimates
); So rather than this current change, we may just want to pass in the next block's baseFeePerGas rather than 0n. |
If a transaction gets into the miner's
runTx
function, and it fails in the VM, thatcatch
block should probably add the transaction back into the pool.Check against geth if:
{"from" : "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1", "gas": "0x5b8d80", "maxFeePerGas": "0x1" }
(too lowmaxFeePerGas
) immediately returns an error like thisVM Exception while processing transaction: Transaction's maxFeePerGas (1) is less than the block's baseFeePerGas
, and iftxpool_content
The text was updated successfully, but these errors were encountered: