Closed MicaiahReid closed 1 year ago
Congrats, your important contribution to this open-source project has earned you a GitPOAP!
GitPOAP: 2023 Ganache Contributor:
Head to gitpoap.io & connect your GitHub account to mint!
Learn more about GitPOAPs here.
Previously we were returning the wrong
gasPrice
when a transaction was fetched viaeth_getTransactionByHash
. This was happening because when we saved the transaction to the chain, we didn't update the transaction'seffectiveGasPrice
field based off of thebaseFeePerGas
of the block that the transaction was mined onto in some cases.However, the
effectiveGasPrice
returned on a receipt was correct because when the receipt was fetched, we would calculate theeffectiveGasPrice
on the fly just to correct what we return to the user, rather than directly using what the database returned.This change removes the on-the-fly calculation of the
effectiveGasPrice
on the receipt, and presets the transaction'seffectiveGasPrice
based off of the next block'sbaseFeePerGas
when the transaction is added to the pool. As block's are mined, the miner updates all pending transaction'seffectiveGasPrice
based off of the next block'sbaseFeePerGas
.Fixes #4094.