taikoxyz / taiko-geth

An L2 execution engine implementation for the Taiko protocol. 🚚
https://geth.taiko.xyz
GNU Lesser General Public License v3.0
214 stars 147 forks source link

fix(taiko_worker): fix a `maxBytesPerTxList` check issue #282

Closed davidtaikocha closed 4 months ago

davidtaikocha commented 4 months ago

Also, think there may be an some double counting in your taiko_worker.go code when calculating if the total tx len is within the maxBytesPerTxList limit.

this check: https://github.com/taikoxyz/taiko-geth/blob/30a615b4c3aafd0d395309035d58b86ff53c8eb0/miner/taiko_worker.go#L330 appends the current tx length before calling encodeAndComporeessTxList However, if the transaction was successful it should have already been added to env.txs here: https://github.com/taikoxyz/taiko-geth/blob/30a615b4c3aafd0d395309035d58b86ff53c8eb0/miner/worker.go#L764

You will also run this check even if the tx failed and wasn't added to the tx list, which seems unecassary.

To fix I think you just need to move the maxBytesPerTxList check before committing the tx. Happy to PR this in if I haven't missed anything.