[Miscellaneous] Optimism / OP Stack based blockchain might have been not applying L1 Fee Scalar properly in transcation fee calculations #46
-
Issue DescriptionWhat is the problemWhile I have been looking into random transactions on Optimism Mainnet Explorer, it appeared to me that the transaction fees charged as displayed on the explorer have not taken into account of the Per below screenshot of an example transaction, the transaction fee is found to be calculated as:
However, based on Optimism's official help book and the block explorer, the transaction should be:
Therefore, the next step is to identify whether this issue is blockchain explorer's frontend display problem, which could be just a mis-configured formula, or if this is an backend/chain configuration issue where the I took a lazy but easy to verify approach here by looking at the pre-transaction and post-transaction account balance state on Tenderly, by simulating two transactions of 1 wei from zero address sent to the user who originated the transaction above, with one simulation before and one siulation after the actual balance change, in order to see the account balance state before and after the actual transaction originated by the user. The first simulation was done at block 111710718, or one block before the transaction: The second simulation was done at block 111710720, or one block after the transaction While the user has sent out the transaction with 0.0005 ETH, as shown below: Therefore by negating the 0.0005 ETH spent as transaction value, the rest of the balance change should belong to gas payments, which is a formula of:
This shows to have an exact match to the gas fee charged as displayed on the block explorer, therefore indicating the Tracing on the transaction illustarted above, user has also shown no additional value in or out from block 111710718 to 111710720, ruling out the possibility that the user might have been credited/debited balances from his account state. Steps to reproduceProblematic calculations could be found by looking into any transactions on OP Mainnet Explorer or Base Explorer NotesThank you Optimism team and contributors from Discord for encouraging me to share this issue here on Github. Additional InformationThe same issue is also found on transactions took place on Base, which lead to the potential of any OP Stack chains could also be affected. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
Hey @jonathanykh, thank you again for flagging this. I've raised it internally and we'll get some more eyes on it. Your math seems to check out. I'll see what other folks say. |
Beta Was this translation helpful? Give feedback.
-
I believe Etherscan is applying the L1 fee scalar to the L1 gas used. Note that the "L1 Gas Used by Txn" is not an integer but there's no such thing as decimal gas. If you request the transaction receipt from an actual node it gives:
That |
Beta Was this translation helpful? Give feedback.
-
@jonathanykh Etherscan just implemented a fix for this! Thank you for attention to detail and improving our ecosystem. |
Beta Was this translation helpful? Give feedback.
I believe Etherscan is applying the L1 fee scalar to the L1 gas used. Note that the "L1 Gas Used by Txn" is not an integer but there's no such thing as decimal gas. If you request the transaction receipt from an actual node it gives: