-
Notifications
You must be signed in to change notification settings - Fork 791
Mempool block sort bug #3566
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
Comments
I think those fee ranges are actually accurate, and the problem is that it's not always possible to know which block a transaction belongs to from its fee rate alone, because transaction selection also depends on size (and to some extent randomness). Consider an extreme example:
I'm not sure what the best solution is. We do have the actual positions of transactions in each projected block available in the backend, so perhaps we should just send that info over the websocket when you subscribe to an unconfirmed transaction? |
Ok. So that is also the cause of this thing when the fee range doesn't look sorted by fee and you get a sudden high fee data point like here? I just don't seem to understand why it's not sorted by sats/vB / effective fee and we see 16 - 17 and 16- 17 in 2 blocks instead of 17-17 and 16-16. I guess a lower fee rate transaction that is bigger, can be more profitable than a few smaller high fee txs? |
Never really worked in that code but I would have thought it was already the case. Are you saying the backend and the frontend have different code to compute the position in the mempool? |
I think the weird fee gradients are caused by something more complicated, but yes this probably contributes to it.
More that a few smaller low fee transactions are more profitable than nothing. Like in my example earlier, miners will try to fit as many large, high fee rate transactions as possible. But when they run out of space in a block for those large transactions, they'll fill up the rest with smaller lower rate transactions rather than leave any empty space. When that happens, the lowest fee rate in the first projected block can be less than the highest fee rate in the second projected block etc. |
Well, the backend doesn't explicitly compute mempool positions, but the result of the advanced gbt algorithm is an ordered list of transactions for each of the first 8 mempool blocks. We don't send those full lists of transactions to the frontend (it would be a lot of data), so instead we estimate mempool positions there by searching for the first mempool block feeRange interval that spans the transaction's effective fee rate: mempool/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts Lines 318 to 346 in 83c0347
When we used the old |
Uh oh!
There was an error while loading. Please reload this page.
I click on a TX in block 3, but it shows tracking in block 2.
Inspecting the Websocket response, it looks like the order of the feeRanges is not correct.
Screen.Recording.2023-03-25.at.00.14.17.mov
The text was updated successfully, but these errors were encountered: