Skip to content
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

WIP qt: mempool stats chart #320

Conversation

RandyMcMillan
Copy link
Contributor

@RandyMcMillan RandyMcMillan commented May 6, 2021

add graphical mempool display to Node window

@RandyMcMillan
Copy link
Contributor Author

RandyMcMillan commented May 6, 2021

There is a lot if interest in #108
This is a rebase of original PR - it has grown stale.


@RandyMcMillan RandyMcMillan mentioned this pull request May 6, 2021
4 tasks
@Sjors
Copy link
Member

Sjors commented May 6, 2021

Thanks for picking this up. Looks like it broke a few CI instances, probably because of the compiler warnings (that are treated as errors).

@RandyMcMillan RandyMcMillan force-pushed the mempool_graph_rebase branch 11 times, most recently from e5b3ab8 to 1baeb53 Compare May 7, 2021 19:51
Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

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

Concept ACK

I don't know if @jonasschnelli has completely given up on his original PR yet.

This is still very much a work in progress. So, it should be labeled as such and made into a draft.

When you push changes, it would be nice if you could write a small post explaining what has changed between updates. This makes it easier for people to follow along.

static const int GRAPH_PADDING_TOP_LABEL = 10;
static const int GRAPH_PADDING_BOTTOM = 50;

void ClickableTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
Copy link
Member

Choose a reason for hiding this comment

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

Clicking on the text item next to the RECT still reliably causes a segmentation fault

0   org.qt-project.QtCore         	0x0000000103eb5bf9 0x103c9f000 + 2190329
1   bitcoin-qt                    	0x00000001029ad160 ClickableRectItem::objectClicked(QGraphicsItem*) + 64 (moc_mempoolstats.cpp:247)
2   org.qt-project.QtCore         	0x0000000103eb6042 0x103c9f000 + 2191426
3   bitcoin-qt                    	0x00000001029acea0 ClickableTextItem::objectClicked(QGraphicsItem*) + 64 (moc_mempoolstats.cpp:134)

@RandyMcMillan RandyMcMillan changed the title qt: mempool stats chart WIP qt: mempool stats chart May 8, 2021
@RandyMcMillan RandyMcMillan marked this pull request as draft May 8, 2021 19:11
@hebasto hebasto added the Feature label May 9, 2021
@rebroad
Copy link
Contributor

rebroad commented May 12, 2021

Has anyone worked out how to make the Y axis show memory usage rather than tx count? (ideally in a way that it shows a flat line once we reach the maxmempool).

@Sjors
Copy link
Member

Sjors commented May 13, 2021

I would prefer MB over count too if it's not too difficult. I might take a look a later to see how...

Can you split this PR a bit? E.g. one commit for the src/interfaces changes, one for mempoolstats.cpp (which probably should mostly be moved out of the GUI code), one for the UI change, etc.

Also for a followup: little dots to indicate your wallet unconfirmed transactions :-)

@RandyMcMillan RandyMcMillan force-pushed the mempool_graph_rebase branch from 1baeb53 to daeadd2 Compare May 14, 2021 19:53
@ghost
Copy link

ghost commented May 15, 2021

Concept ACK

Has anyone worked out how to make the Y axis show memory usage rather than tx count? (ideally in a way that it shows a flat line once we reach the maxmempool).

There should be a way to select Tx count or vSize

Not sure if others will agree with it or maybe we can do this in follow up PRs, I created a rough design of mempool tab:

image

Left: History for mempool over a time period. User can select the time frame.

Right: Current fee rate distribution in mempool. I have used image from https://btc.bitaps.com (An option to switch between Tx count and vSize can be added)

User can enter a transaction id in the text edit widget to see where it is in the mempool (similar to https://mempool.observer):

Can be highlighted in the 'fee distribution' graph with dotted lines. I have used dotted lines and "glasses" sticker:

image

Co-authored-by: Jonas Schnelli <[email protected]>
Co-authored-by: @RandyMcMillan <[email protected]>
@RandyMcMillan RandyMcMillan force-pushed the mempool_graph_rebase branch from daeadd2 to b6d0a95 Compare May 16, 2021 01:27
@0xB10C
Copy link
Contributor

0xB10C commented May 21, 2021

I agree that insights into a nodes mempool are really interesting and useful. I too understand that users want to use their own full node and not rely on external services. However, I'm not sure if the Bitcoin Core GUI is the right place for it.

From my experience, different types of users want different stats, charts, chart axis and so forth... I think having good interfaces to access this data and then visualizing it, for example, on a web page, scales way better and requires much less maintenance on the Bitcoin Core side. I'm leaning towards a Concept NACK for now.

Disclaimer: I run such a site visualizing the mempool of my node, but I don't think this influences my reasoning here. I have no incentive to NACK here. I don't make money off site visitors. The hosting is payed by myself and donations (sometimes listed as sponsors) and I'm not compensated for my time maintaining it.

@hebasto
Copy link
Member

hebasto commented May 21, 2021

@0xB10C

I agree that insights into a nodes mempool are really interesting and useful. I too understand that users want to use their own full node and not rely on external services. However, I'm not sure if the Bitcoin Core GUI is the right place for it.

From my experience, different types of users want different stats, charts, chart axis and so forth... I think having good interfaces to access this data and then visualizing it, for example, on a web page, scales way better and requires much less maintenance on the Bitcoin Core side. I'm leaning towards a Concept NACK for now.

Disclaimer: I run such a site visualizing the mempool of my node, but I don't think this influences my reasoning here. I have no incentive to NACK here. I don't make money off site visitors. The hosting is payed by myself and donations (sometimes listed as sponsors) and I'm not compensated for my time maintaining it.

Could we limit this feature to some set of data (texts, tables, charts) that just could give to a pro-user useful info to manually set a feerate for his transaction?

@Rspigler
Copy link
Contributor

I am a strong Concept ACK for @prayank23 's design. Improving Core's GUI and widening the user base is important.

@Sjors
Copy link
Member

Sjors commented May 22, 2021

Personally I'm happy to review and test this, and it's something I would use. Mempool weather is something I check before and during every transaction. Although websites can indeed iterate faster, it's nice to have it in the node. The Hoenicke design that this is based on hasn't changed in many years, so I'm also not terribly worried about maintenance.

And if we correctly split the data collection (node & rpc: seperate PR) from the visualisation (gui), then there may be other use cases too.

@Rspigler
Copy link
Contributor

Rspigler commented Jun 9, 2021

😞 Reason for close? Mark up for grabs?

@ghost
Copy link

ghost commented Jun 17, 2021

@0xB10C

However, I'm not sure if the Bitcoin Core GUI is the right place for it.

Mempool related charts and options are a basic thing which should have been there in Bitcoin Core GUI few years back. Sad that we won't see it in v22.0 but still not too late to start working on it for future release.

From my experience, different types of users want different stats, charts, chart axis and so forth.

Agree. But that is true for lot of things in Bitcoin Core GUI. We should add atleast basic things that everyone finds useful.

I think having good interfaces to access this data and then visualizing it, for example, on a web page, scales way better and requires much less maintenance on the Bitcoin Core side.

Yes, website works better for charts. However, both can be used. One or two basic charts and options in Core GUI and other detailed mempool stats on different websites.

Is https://mempool.observer open source? Can users run it locally and use their own node? That would be helpful

@Rspigler
Copy link
Contributor

users want to use their own full node and not rely on external services

This.

@rebroad
Copy link
Contributor

rebroad commented Jun 26, 2021

I would prefer MB over count too if it's not too difficult. I might take a look a later to see how...

Can you split this PR a bit? E.g. one commit for the src/interfaces changes, one for mempoolstats.cpp (which probably should mostly be moved out of the GUI code), one for the UI change, etc.

Also for a followup: little dots to indicate your wallet unconfirmed transactions :-)

I've managed to do this... but I cheated a little bit as there is memory used in addition to the TXs that fluctuates over time, so if you want a nice flat line when your node starts pruning TXs from the mempool, then you won't get that unless you cheat :) (which I have). I will upload my patches soon.

@kristapsk
Copy link
Contributor

Concept ACK

However, I'm not sure if the Bitcoin Core GUI is the right place for it.

Mempool related charts and options are a basic thing which should have been there in Bitcoin Core GUI few years back. Sad that we won't see it in v22.0 but still not too late to start working on it for future release.

I agree with @prayank23 here, if you use Bitcoin Core as a wallet (and I don't see a reason running GUI if you don't), this is probably the most important metric to decide what transaction fee to use for transaction.

@promag
Copy link
Contributor

promag commented Jul 13, 2021

Concept ACK.

@0xB10C I think some basic mempool viz is reasonable. Will review.

@0xB10C
Copy link
Contributor

0xB10C commented Jul 13, 2021

Thanks everybody for the feedback and discussion. I've reconsidered my position on this. I agree that some basic mempool weather in the GUI makes sense.

@Rspigler
Copy link
Contributor

People who have (Concept) ACKd this should look at #108

@ghost
Copy link

ghost commented Aug 30, 2021

@RandyMcMillan Do you want to reopen this? I can work on it if you have bandwidth issues

@ghost
Copy link

ghost commented Sep 3, 2021

Why do I see a different chart and nothing on right with Detail Stub written?

Screenshot

image

  1. If I stretch that part to right, this is how it looks:
Screenshot

image

Same thing on Ubuntu and Windows.

  1. Chart in [Qt] Add interactive mempool graph bitcoin/bitcoin#8550 looks better IMO:
Screenshot

image

  1. Or maybe we can just draw a simple bar chart with Add feerate histogram to getmempoolinfo bitcoin/bitcoin#21422 and https://doc.qt.io/qt-5/qtcharts-barchart-example.html

I had used the results of getmempoolinfo to create a similar chart using Python Flask: bitcoin/bitcoin#21422 (comment)

Screenshot

image

So which chart would look better and everyone agrees to add in Node window?

  1. WIP: mempool stats chart #108
  2. [Qt] Add interactive mempool graph bitcoin/bitcoin#8550
  3. Add feerate histogram to getmempoolinfo bitcoin/bitcoin#21422 and https://doc.qt.io/qt-5/qtcharts-barchart-example.html

@RandyMcMillan
Copy link
Contributor Author

RandyMcMillan commented Nov 10, 2021

@bitcoin-core bitcoin-core locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants