This repository was archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 682
fix: store transactions with the correct effectiveGasPrice
#4112
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jeffsmale90
approved these changes
Jan 5, 2023
davidmurdoch
suggested changes
Jan 5, 2023
davidmurdoch
suggested changes
Jan 5, 2023
src/chains/ethereum/transaction/src/eip1559-fee-market-transaction.ts
Outdated
Show resolved
Hide resolved
davidmurdoch
suggested changes
Jan 6, 2023
jeffsmale90
approved these changes
Jan 8, 2023
davidmurdoch
approved these changes
Jan 9, 2023
Contributor
davidmurdoch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a measurable performance improvement when fetching receipts since we don't query the db for the block anymore.
3772419 to
0429712
Compare
|
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Previously we were returning the wrong
gasPricewhen a transaction was fetched viaeth_getTransactionByHash. This was happening because when we saved the transaction to the chain, we didn't update the transaction'seffectiveGasPricefield based off of thebaseFeePerGasof the block that the transaction was mined onto in some cases.However, the
effectiveGasPricereturned on a receipt was correct because when the receipt was fetched, we would calculate theeffectiveGasPriceon 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
effectiveGasPriceon the receipt, and presets the transaction'seffectiveGasPricebased off of the next block'sbaseFeePerGaswhen the transaction is added to the pool. As block's are mined, the miner updates all pending transaction'seffectiveGasPricebased off of the next block'sbaseFeePerGas.Fixes #4094.