-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
transaction underpriced #24079
Comments
Thanks for creating a new issue. I think the behavior of geth is kind of correct here. Your tx data with maxFeePerGas specifies that you want to pay a maximum of 75 wei per gas for this transaction. However, when the baseFee is 80, it will cost at least 80 wei/gas, so the transaction is underpriced. The solution is sending with higher maxFeePerGas. |
I also just got bit by this, I think.
@fjl: to be clear, does your response mean that the threshold for getting into the pool should be the same as the threshold for getting into the next block? Or, said differently, in order to have a transaction admitted into the pool, a user must price the transaction to be mined quickly, regardless of how quickly they need the transaction to be mined? |
May be we can add new configuration parameters?
|
In my opinion this is a bug in geth 1.10.13. The txpool should not only include transaction that are currently profitable to mine, but also transactions that may be profitable to mine 5 seconds into the future. However the current code will reject transactions that pay 800 Gwei if the base fee is currently 805 Gwei and the txpool only contains transaction below 300 Gwei. To fix this, revert to the old code and use the maximum priority fee instead of the current priority fee. The code already makes sure that it only includes the most profitable transactions and will evict the transactions that pay the lowest overall fee. The new code will evict any new transactions below the current base fee, but keep transactions in the mempool that pay far less. To see this in an image, visit https://mempool.jhoenicke.de/#ETH,2w,count,30 Edit: I should add that my node has a huge number of slot settings. With the default 4k the node would evict low fee transactions as soon as the pool reaches 4k transactions. The difference between old and new code is then that the old code would keep the 4k most paying transactions, while the new code would stop accepting new transactions long before it reaches the limit and keep most of the old low fee transactions. |
Thanks a lot for your input. @jhoenicke your graph is very helpful. |
This is a bug. It should be possible for a user to choose a gas fee as low as they want. User should be able to wait patiently for network to be less congested and accept a low "bid." Auto rejecting low fee transactions is harmful to the network in long term. |
Rejecting transactions with an error because
|
Also, I think there's an off-by-one error? focusing on the change here: #23855 if !local && tx.EffectiveGasTipIntCmp(pool.gasPrice, pendingBaseFee) < 0 {
return ErrUnderpriced
} I'm not really familar with this code, so it's entirely possible I missed something (I know I got it wrong the first time, this was from my second attempt at unpacking these lines). This simple-looking check is actually packing a lot of logic into it that takes a bit to unwind, so I do so below, focusing on the
Thus for most geth installs we have: pool.gasPrice := 1
pendingBaseFee := pool.priced.urgent.baseFee And now if we focus on this part: tx.EffectiveGasTipIntCmp(1, pendingBaseFee) < 0 We can "simplify" it to the code below, based on the logic inside tx.EffectiveGasTipValue(pendingBaseFee).Cmp(1)
tx.EffectiveGasTipValue = min(tx.GasTipCap(), tx.GasFeeCap() - pendingBaseFee) For legacy TXs, GasTipCap and GasFeeCap are both tx.GasPrice. tx.EffectiveGasTipValue = min(tx.GasPrice, tx.GasPrice - pendingBaseFee) Now we can plug min(tx.GasPrice, tx.GasPrice - pendingBaseFee).Cmp(1) < 0
min(tx.GasPrice, tx.GasPrice - pendingBaseFee) < 1
(tx.GasPrice - pendingBaseFee) < 1 Won't this lead to txs where |
Yes, but that is intentional. The comparison is |
I found that I cannot send tx today.
For example:
current tx pool:
baseFee == 80
send tx config:
maxFeePerGas == 75 maxPriorityFeePerGas == 1
The text was updated successfully, but these errors were encountered: