-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: aggregator 2x bump in mainnet #1551
Merged
JuArce
merged 7 commits into
testnet
from
1540-hotfixaggregator-aggregator-is-bumping-to-much-in-mainnet
Dec 4, 2024
Merged
fix: aggregator 2x bump in mainnet #1551
JuArce
merged 7 commits into
testnet
from
1540-hotfixaggregator-aggregator-is-bumping-to-much-in-mainnet
Dec 4, 2024
Conversation
This file contains 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
Oppen
reviewed
Dec 2, 2024
Oppen
approved these changes
Dec 2, 2024
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.
LGTM
uri-99
approved these changes
Dec 2, 2024
JulianVentura
approved these changes
Dec 3, 2024
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.
LGTM
…ng-to-much-in-mainnet
JuArce
approved these changes
Dec 4, 2024
…ng-to-much-in-mainnet
PatStiles
pushed a commit
that referenced
this pull request
Dec 6, 2024
Co-authored-by: Julian Arce <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
TL;DR
This issue arises because of the mixed use of dynamic transactions and legacy transactions between the simulation and the actual transaction. We fixed it by avoiding the usage of
simulation.GasPrice
aspreviousGasPrice
in the first iteration as it returns thebaseFee
* 2 (doubling the gas price).Detailed explanation
In the simulation, the
sendResponseTransaction
was executed without a specifiedtx.GasPrice()
. This made sense, as simulations do not require actual gas pricing. When nogasPrice
is provided, the library treats the transaction as dynamic.In a dynamic transaction, the library sets:
priorityFee
= suggestPriorityFee()maxFee
= 2 × BaseFeeThis approach is standard practice, as setting
maxFee = 2 × baseFee
ensures the transaction remains valid for approximately six blocks.On the first iteration, we were setting
PreviousGasPrice
to the value ofsimulation.GasPrice()
. However, for dynamic transactions, calling GasPrice() returns themaxFee
. In subsequent steps, the code calculates the new transaction’s gas price as the maximum ofcalculatedGasPrice
andpreviousGasPrice
.Since
previousGasPrice
was erroneously set tomaxFee
(2 × BaseFee
), the resulting gas price was being doubled.Why This Didn’t Appear Earlier
The issue went unnoticed in Holesky due to its extremely low base gas cost—four orders of magnitude smaller than typical gas prices. Under such conditions, the 2 × BaseFee did not significantly interfere with calculatedGasPrice.
Type of change
Please delete options that are not relevant.
Checklist
testnet
, everything else tostaging