You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We seem to have forgotten a lot of fee-currency conversions in EffectiveGasTip based calculations for fee-currency denominated transactions.
For most of the affected code, the tx.EffectiveGasTip(), tx.EffectiveGasTipCmp(),tx.EffectiveGasTipValue() methods are called to do some calculation (e.g. moving average) without considering wether the transaction is denominated in Celo or fee-currency.
tx.EffectiveGasTip()
A lot of calls to the tx.EffectiveGasTip() are affected, which are used e.g. here:
This function however does not seem (yet) to be used in the op-geth codebase.
Severity
So far there seems to be no usage of those methods in EVM / state-transition related code, and the externally exposed affected surface consists of mostly convenience methods:
FeeHistory will return incorrect gas price history
SuggestGasTipCap will return incorrect gas-tip suggestions
For all calls to the aforementioned effective-gas-tip related methods, the passed in base-fee has to first be converted
to the transactions fee-currency when that transaction is a CIP-64 transaction.
When methods accumulate values between CIP-64 and Ethereum transactions, the accumulation has to be done in the same denomination.
The text was updated successfully, but these errors were encountered:
Issue
We seem to have forgotten a lot of fee-currency conversions in
EffectiveGasTip
based calculations for fee-currency denominated transactions.For most of the affected code, the
tx.EffectiveGasTip()
,tx.EffectiveGasTipCmp()
,tx.EffectiveGasTipValue()
methods are called to do some calculation (e.g. moving average) without considering wether the transaction is denominated in Celo or fee-currency.tx.EffectiveGasTip()
A lot of calls to the
tx.EffectiveGasTip()
are affected, which are used e.g. here:op-geth/miner/worker.go
Line 582 in a59c67f
op-geth/graphql/graphql.go
Line 371 in a59c67f
op-geth/eth/gasprice/gasprice.go
Line 259 in a59c67f
tx.EffectiveGasTipValue()
There is one usage of this method which is affected:
op-geth/eth/gasprice/optimism-gasprice.go
Lines 87 to 89 in a59c67f
tx.EffectiveGasTipCmp()
The entire function
tx.EffectiveGasTipCmp()
is compromised, whenever fee-currency and native transactions are compared:op-geth/core/types/transaction.go
Lines 463 to 468 in a59c67f
This function however does not seem (yet) to be used in the op-geth codebase.
Severity
So far there seems to be no usage of those methods in EVM / state-transition related code, and the externally exposed affected surface consists of mostly convenience methods:
FeeHistory
will return incorrect gas price historySuggestGasTipCap
will return incorrect gas-tip suggestionsop-geth/eth/api_backend.go
Lines 390 to 396 in a59c67f
Solution
For all calls to the aforementioned effective-gas-tip related methods, the passed in base-fee has to first be converted
to the transactions fee-currency when that transaction is a CIP-64 transaction.
When methods accumulate values between CIP-64 and Ethereum transactions, the accumulation has to be done in the same denomination.
The text was updated successfully, but these errors were encountered: