-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
New txpool policy doesn't really fill the txpool #23986
Comments
I would suggest to have two criteria for txpool admission: (1) the maximum priority fee should be greater than the gas price set in the config (1 Gwei is the default, but miners can choose a higher or lower value) and (2) the maximum total gas price should be greater than a dynamically chosen price to keep number of queued transactions to the target size. This would roughly give the pre eip-1559 behaviour except that miners ignore eip-1559 transaction that pay them too little priority fee. It would ensure that the miners always have the transactions in the pool that are most likely to be mined by them in the future. |
From my observations this is how it used to work before the change. However having this parameter on 1 Gwei caused the txpool to be flooded with many (non useful) low gas legacy transactions (which is why the change was made). I believe that the ideal purpose of the Therefore I believe that the next best option would be to test the |
The effective gas price level should only be chosen dynamically. If you set it to something like 65, it would work fine at the moment but it wouldn't have enqueued any transaction in September and it would have enqueued 30k transactions in April. You don't want users to continuously reconfigure their nodes. So choosing it automatically such that the number of queued transactions hits the desired size is probably best and this is how geth worked pre-1559. In June when the base fee was 4 Gwei [edit: base fee didn't exists in June, but it would have been 4 Gwei] it would be stupid for a miner to not accept a 24 Gwei transaction. Currently even accepting all 50 Gwei transactions would just bloat your txpool. The problem with just looking at the priority fee (as the current implementation does) is that it changes faster than the transaction pool. So during a nft sale you may have a base fee peak of 1000 Gwei but only 50 transaction in total above 500 Gwei. So why shouldn't you accept a transaction that pays over 500 Gwei? It's very likely to be the most profitable transaction in the next few minutes. It's current priority fee is -500 though so using the current priority fee as a metric would not work. If geth was consistent and removed all tx that it wouldn't accept into the pool, then it would currently clear the txpool completely whenever a block that is not 200% full is produced. So my suggestion is to use a dynamic max gas price limit that keeps the pool to the desired size (e.g. 4000 tx), and use user set pricelimit with the priority fee only to discard transactions that don't pay the desired priority fee for the miner. |
BTW the difference between "BaseFee + MaxPriorityFee" and "Max Total Fee" is at most five minutes :) After five minutes the transaction is either mined, or the base fee has grown by so much that "Max Total Fee" is reached. |
I think the old logic before #23855 does exactly what I want. Reject transaction with too little tip cap and of the remaining keep the tx with the largest max fee cap (urgent/floating list). I really don't understand what the problem was the pull request was about to solve but for me it changed it from working to broken. The new implementation will still store the low fee transactions in the txpool, but will not include new higher paying transactions that were sent after the base fee increased. |
The problem I had after the EIP-1559 change was that my node running with the following settings This is what I wanted to be solved. Unless I am doing something wrong or am missing something. |
@Kzenox7 You can reduce the number of global slots. 10k should be more than enough for most application; default value is 4k. With the old code it will then do what you want, namely only retain the 10k transactions with the highest max fee cap. I use 150k just to get most of the pending transactions so I know roughly how many low fee transactions exists. But 150k will give you also the 4 Gwei transactions. |
@jhoenicke I think my point about the My original issue remains (pre & post geth 1.10.13) but then again I'm not an expert and I'm not sure if I'm viewing the |
#24080 fixes my issue |
@jhoenicke or @Kzenox7 I'm new to running my own node and have been using the
If I have understood things correct my node should not accept txs with less then 50 gwei because I set my price limit to do that. But when I check pending txs a lot of txs with less 20 gwei are included and they are never processed. Any tips on preventing them joining my tx pool? Also one thing I find frustrating is the lack of clear guides out there on what units the different flags the config file uses. For example is the Lifetime in seconds, ms, microseconds etc. It's been a ton of experimentation to figure this all out. |
@fomotrader: I think the price limit is in wei, not in Gwei, so if you only want to propagate super-high-priority transactions with 50 Gwei priority fee, you should set the price limit to 50000000000. If you also want to accept normally priced transactions, you should not set it below 1 Gwei, though. There is no option to restrict the max fee, as it doesn't make sense. Why don't you want to allow 10 Gwei transactions if the base fee goes below 10 Gwei? Or do you want to change the configuration of your node every week to adapt to the base fee? |
@jhoenicke for some reason I missed this notification 😄 So in essence I noticed my mempool is filled with many txs that are underpriced and over a year old. I do on chain analytics on the txs in the mempool and seeing txs like this. https://etherscan.io/address/0x77d2b562d34fc4609df2b2ded37bbe3f707dca23 If you decode the input data you'll see the deadline is I don't want my mempool to have txs that are super high priority only. But I want my it to have transactions that are no older then 24 hours since first seen. Another way to phrase this would be, I want my mempool to have txs that are likely to be included in a block within 24 hours. This mainly started happening after EIP-1599, do you have any thoughts on this. My initial thought was to check the type of tx and do some kind of gwei check. But the more I think about it the more that seems wrong as that value can't be dynamic and will have to be changing semi regularly. |
I'm running txpool statistics to see at which fee-level transactions are processed over time, see https://jochen-hoenicke.de/queue/#ETH,24h,count. For this I run with
--txpool.globalslots=150000
to ensure I see most of the pending transactions.I recently updated to geth 1.10.13 and you can see that almost no transactions are added to the txpool since then. If I understand the new logic correctly, it will never add any transaction that pays less than the base fee. This may be not intended as it means that when the base fee drops, miners do not already have the low fee transactions in their pool but now have to wait for them to be resent over the network. Also it is a bit inconsistent, since the low fee transactions are not purged when the base fee rises but no new transactions are added below the base fee even if they pay more than the transactions already in the pool.
IMHO for txpool admission it may make more sense to use the maximum fee instead of the current effective fee, since this doesn't change over time. This is also what I use in my txpool graphs.
The text was updated successfully, but these errors were encountered: