chore(grpc): use EffectiveGasTip method to get the tip of a tx while streaming bids#48
Merged
bharath-123 merged 6 commits intomainfrom Mar 5, 2025
Merged
Conversation
joroshiba
reviewed
Mar 4, 2025
| effectiveTip := cmath.BigMin(pendingTx.GasTipCap(), new(big.Int).Sub(pendingTx.GasFeeCap(), optimisticBlock.BaseFee)) | ||
| effectiveTip, err := pendingTx.EffectiveGasTip(optimisticBlock.BaseFee) | ||
| if err != nil { | ||
| log.Warn("effective tip is too low", "effectiveTip", effectiveTip.String()) |
Member
There was a problem hiding this comment.
This might make sense as a debug or a metric counter + debug log. If people send low tips that's on them, but useful to know if it's happening a lot potentially.
Contributor
Author
There was a problem hiding this comment.
yeah good point, i ll add a metric. but ideally they shouldn't even arrive at this stage cause we are filtering txs which sends too low gas fee during tx submission.
joroshiba
approved these changes
Mar 4, 2025
Comment on lines
+78
to
+81
| if err != nil { | ||
| txsTipTooLow.Inc(1) | ||
| log.Debug("effective tip is too low", "effectiveTip", effectiveTip.String()) | ||
| // don't throw an error but we should avoid streaming this bid |
Member
There was a problem hiding this comment.
nit: put the comment above the check block
Suggested change
| if err != nil { | |
| txsTipTooLow.Inc(1) | |
| log.Debug("effective tip is too low", "effectiveTip", effectiveTip.String()) | |
| // don't throw an error but we should avoid streaming this bid | |
| // don't stream the bid if the tip is below minimum fee | |
| if err != nil { | |
| txsTipTooLow.Inc(1) | |
| log.Debug("effective tip is too low", "effectiveTip", effectiveTip.String()) |
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
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.
It is better to use the in-build
EffectiveGasTipmethod to calculate the tip of a given tx. If the gas fee tip is too low, then we don't stream the bid to the auctioneer.This has been tested by deploying auctioneer setup locally and sending txs against it.