Skip to content

RBF Timelines #2847

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 18 commits into from
May 3, 2023
Merged

RBF Timelines #2847

merged 18 commits into from
May 3, 2023

Conversation

mononaut
Copy link
Collaborator

@mononaut mononaut commented Dec 14, 2022

This PR attempts to better visualize RBF events.

It adds a new section to the transaction page (where relevant), showing a timeline of replacements:

RBF Transaction Page

Each 'node' on the timeline is a different version of the transaction, with the one currently being viewed circled in purple. Clicking on a node navigates to that tx version.

If a version has been mined, the corresponding node is circled in green.

The timeline scrolls horizontally to fit longer sequences of replacements, and updates via websocket as subsequent replacements come in.

The PR also adds a new page listing (up to 25 sets of) the latest RBF events, using the same timeline components:

RBF List

The listing updates in real time via websocket, and includes a toggle to switch between all RBF events and only Full RBF replacements if the instance is running Full RBF.

The page isn't linked anywhere on the main site yet. Perhaps we could add a mini widget version to one of the dashboards?

Limitations

Multi-replacements

Technically, a single transaction can replace multiple others by fee, which would turn our linear timeline into more like a tree structure. In practice, that doesn't seem to happen very often, if ever.

This implementation breaks any trees into separate linear leaf-to-root timelines, and only shows one such timeline on each transaction page.

(edit) The PR now supports arbitrary trees of replacements, e.g:

Screenshot 2022-12-16 at 4 56 58 PM

Pagination

Grouping replacements into timelines makes sorting by recency unstable, so pagination is difficult.

Todo

  • Support for multi-replacement trees
  • Tooltips
  • Save RBF cache to disk to preserve across restarts

Extensions for future PRs

  • Link to /rbf page
  • Pagination / infinite scroll
  • Reverse timeline direction for RTL locales

@cla-bot cla-bot bot added the cla-signed label Dec 14, 2022
@0xB10C
Copy link
Collaborator

0xB10C commented Dec 15, 2022

This is cool - thanks for working on this!

Multi-replacements
Technically, a single transaction can replace multiple others by fee, which would turn our linear timeline into more like a tree structure. In practice, that doesn't seem to happen very often, if ever.

I disagree with this. Looking at the RBF data I've collected over the past years it's quite common that e.g. two or even multiple (like 20+ transactions) transactions are merged into one. Happy to extract some statistics on this if you're interested. IMO a tree like structure is the way to go here.

Pagination
Grouping replacements into timelines makes sorting by recency unstable, so pagination is difficult.

Right. Might make sense have two ways to sort here:

  • by most recent replacement (unstable pagination)
  • by time the first version of this replacement sequence was seen (stable pagination)

@mononaut
Copy link
Collaborator Author

Thanks for the feedback!

I disagree with this. Looking at the RBF data I've collected over the past years it's quite common that e.g. two or even multiple (like 20+ transactions) transactions are merged into one. Happy to extract some statistics on this if you're interested. IMO a tree like structure is the way to go here.

Admittedly this was based on only a very unscientific survey of the last few days. I'd love to see some proper statistics, if it's not too much of a hassle to extract.

@mononaut mononaut marked this pull request as draft December 15, 2022 17:38
@0xB10C
Copy link
Collaborator

0xB10C commented Dec 16, 2022

This are stats based on the replacements my Bitcoin Core node has seen between 2022-04-01 and 2022-11-01. There were a total of 1344596 replacements during these 7 months. My intuition with "quite common" in #2847 (comment) might have been biased a bit as I've spent the most time looking at the more interesting multi-replacements. You'll be fine in >98% of the cases with a simple timeline.

number of tx replaced by a replacement count share
1 1324815 98.52%
2 12174 0.9054%
3 6726 0.5002%
4 586 0.0435%
5 130 0.0096%
6 58 0.0043%
7 20 0.0014%
8 18 0.0013%
9 12 0.0008%
10 8
11 2
12 4
13 4
14 1
15 3
16 4
19 2
21 2
22 1
23 2
24 1
25 10
26 3
29 1
31 1
32 1
39 1
41 1
43 1
54 1
93 1
94 1
97 1

@mononaut
Copy link
Collaborator Author

awesome, thank you!

@mononaut mononaut force-pushed the mononaut/rbf-timeline branch from 3b0dcd4 to cf6c07f Compare January 6, 2023 16:11
@mononaut mononaut force-pushed the mononaut/rbf-timeline branch from cf6c07f to b0e7147 Compare January 18, 2023 01:29
@mononaut mononaut force-pushed the mononaut/rbf-timeline branch from b0e7147 to a7f123c Compare March 4, 2023 09:22
@mononaut
Copy link
Collaborator Author

mononaut commented Mar 4, 2023

Rebased on master, fixed some bugs, and removed dependency on PR #2845.

@mononaut mononaut marked this pull request as ready for review March 4, 2023 09:25
@softsimon softsimon self-requested a review March 4, 2023 09:46
@softsimon
Copy link
Member

softsimon commented Mar 5, 2023

Suggestions

  • Store and restore RBF history in JSON disk cache
  • Change the tooltip to typical dual column design
  • Display the time stamps like "5 minutes" without the "After" between replacements
  • Change "Replacements" title to "RBF History" (?)
  • If you open a transaction with many RBF history points, the current TX point is hidden in view, so always scroll the RBF timeline so the current TX bullet is in view.

Screenshot 2023-03-05 at 13 50 19

Bugs:

  • When new replacement arrives and clicking on the link, the timeline graph highlight doesn't always update.

It looks like the E2E "shows RBF transactions properly" fail and needs to be updated

@mononaut mononaut force-pushed the mononaut/rbf-timeline branch 3 times, most recently from 771a19d to 078a5e7 Compare March 6, 2023 03:40
@mononaut
Copy link
Collaborator Author

mononaut commented Mar 6, 2023

Implemented

  • Store and restore RBF history in JSON disk cache
  • Change the tooltip to typical dual column design
  • Display the time stamps like "5 minutes" without the "After" between replacements
  • Change "Replacements" title to "RBF History" (?)
  • If you open a transaction with many RBF history points, the current TX point is hidden in view, so always scroll the RBF timeline so the current TX bullet is in view.

Fixed:

  • When new replacement arrives and clicking on the link, the timeline graph highlight doesn't always update.
  • It looks like the E2E "shows RBF transactions properly" fail and needs to be updated

@softsimon softsimon added this to the v2.6.0 milestone Mar 6, 2023
@softsimon
Copy link
Member

@mononaut please rebase on master

@mononaut mononaut force-pushed the mononaut/rbf-timeline branch from 0a0ea16 to aef9070 Compare March 29, 2023 20:48
@mononaut
Copy link
Collaborator Author

Rebased on master, made compatible with recent disk cache changes, and added some other minor frontend improvements.

@softsimon
Copy link
Member

softsimon commented Mar 30, 2023

Getting a couple of frontend errors when clicking around between RBF transactions. Just opening a transaction that has been deleted and replaced it seems.

Screenshot 2023-03-30 at 11 18 28

@mononaut mononaut force-pushed the mononaut/rbf-timeline branch from aef9070 to b4a6a36 Compare April 4, 2023 22:12
@softsimon softsimon self-requested a review April 11, 2023 06:59
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 @ [c9ed2e1]

@mononaut mononaut force-pushed the mononaut/rbf-timeline branch from c9ed2e1 to b325f8c Compare May 3, 2023 19:17
@mononaut
Copy link
Collaborator Author

mononaut commented May 3, 2023

rebased on current master [8db7326]

@softsimon softsimon self-requested a review May 3, 2023 19:33
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 @ [b325f8c]

@softsimon softsimon merged commit 12ae940 into master May 3, 2023
@softsimon softsimon deleted the mononaut/rbf-timeline branch May 3, 2023 19:48
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.

3 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