Skip to content

Fix transaction ETA calculation #3714

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

Merged
merged 3 commits into from
May 3, 2023
Merged

Fix transaction ETA calculation #3714

merged 3 commits into from
May 3, 2023

Conversation

mononaut
Copy link
Collaborator

@mononaut mononaut commented May 3, 2023

resolves #3695 and resolves #2871

The current ETA calculation chooses the last projected block in which the fee span includes the transaction's effective rate.

Because of the issues discussed in #3566, when the mempool is extremely large that means it almost always chooses the final "overflow" mempool block (since the very high number of transactions ensures the fee span is very wide):

Screenshot 2023-05-03 at 10 08 13 AM

This PR switches the ETA calculation to choose the first matching projected block, which should be correct for the majority of transactions.

However there are still a few edge cases from #3566 where this will underestimate the ETA, so we still need PR #3673 to completely fix the calculation.

Copy link
Member

@softsimon softsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this weird time calculation when tracking something in the 20 minutes block and a block gets mined moving this one to the next block.

Screenshot 2023-05-03 at 23 07 52

@mononaut
Copy link
Collaborator Author

mononaut commented May 3, 2023

Good catch.

Apparently we never updated the now variable to which we add the estimated delay, so when the block index changed the ETA would slip backwards (presumably the block got mined about 8 minutes after you loaded the tx page?).

I've just pushed a fix for that, and also backported a fix from #3673 for a subscription leak which could also cause some issues.

@softsimon softsimon self-requested a review May 3, 2023 20:16
Copy link
Member

@softsimon softsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ACK @ [9bd968f]

@softsimon softsimon merged commit a5b764f into master May 3, 2023
@softsimon softsimon deleted the mononaut/fix-tx-eta branch May 3, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transaction ETA shows the wrong value most of the time TX ETA is not updated in real time
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy