ethereum-optimism / op-geth

GNU Lesser General Public License v3.0
254 stars 652 forks source link

fix(list-totalcost): Add `l1Cost` instead of transaction `cost` #324

Open kustrun opened 1 month ago

kustrun commented 1 month ago

Description

Previously, l.totalcost was calculated incorrectly. The transaction cost was added twice, and the l1Cost was left out.

This PR fixes the sum calculation so that it is correctly calculated as tx.Cost() + l1Cost.

iavl commented 4 weeks ago

does it require a hard fork ?

kustrun commented 4 weeks ago

No, I don't believe so. It only affects wheter a transaction enters a mempool or not.

Since l1 fees < l2 fees it could happen that some transactions were rejected from entering the mempool. If a user then tops up the account balance, the transaction goes through. This is the worst case I could think of.

kustrun commented 2 weeks ago

@tynes When you have a moment, could you please review this PR? I believe it's affecting the UX, as some of the transactions could be falsely rejected when entering the mempool.