-
Notifications
You must be signed in to change notification settings - Fork 268
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
gui: ensure inbound block relay peers have relevant services #201
Conversation
fd0f17d
to
89c20ee
Compare
{ | ||
switch (conn_type) { | ||
case ConnectionType::INBOUND: return relay_txes ? QObject::tr("Inbound Full Relay") : QObject::tr("Inbound Block Relay"); | ||
case ConnectionType::INBOUND: return !relay_txes && relevant_services ? QObject::tr("Inbound Block Relay") : QObject::tr("Inbound"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This heuristic seems to be working fine. At least I can't find a counter example right now that can be observed on today's network (Edit: counter example: #201 (comment)). Though, it still seems fragile to assume that the type of the inbound connection can be deduced based on fuzzy logic.
If it was fine to assume so, then BIP bitcoin/bips#1052 wouldn't be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If helpful, the logic is from https://github.com/bitcoin/bitcoin/blob/16b784d953365bb2d7ae65acd2b20a79ef8ba7b6/src/net.cpp#L872 in our inbound eviction protection logic, so that's why I was interested in seeing these peers. Otherwise we could just display all of them as inbound.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think plain "Inbound" makes most sense because it is neither possible to enumerate all inbound connection types, nor is it possible to determine them (if they were enumerable).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it seems we will need to deduce some types of connections from other properties, as currently done to obtain the inbound block relay peers for eviction protection. Take for instance this bitcoin/bitcoin#20726 (comment):
#19670 introduced a workaround to deduce inbound block-relay-only peers and protect them from eviction. After this PR, do you think we could revisit to make it more direct?
I think we would wait until this has been deployed for a while and then (potentially) change the eviction logic. Two things occur to me on this point:
- Older software will continue to use the old way of (not) communicating their intentions, via the fRelayTxes flag. So to accommodate older software we may not want to switch to keying off this p2p message for a little while at least.
- It seems most of the feedback has been to shy away from encoding overly broad semantics into a single p2p message; while I think that is fine it also means that from our peer's point of view, they will have to infer the connection "type" from the properties of the peer, rather than from the peer declaring its full intentions in a single message. I think for now we can treat "will never relay txes" as essentially synonymous with these block-relay connections, but perhaps in the future there will be some distinction, and all a peer can do is rely on some set of flags that it might use to preference some peers over others -- which might put us exactly back to where we are today, with us just keying off of whether fRelayTxes is false, anyway.
So while I'd like to see this type of peers easily, yes for now it may be more prudent to just use plain "Inbound" and display other properties useful for inferring the connection status, like fRelayTxes, separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even with BIP bitcoin/bips#1052 you couldn't enumerate all possible inbound connection types. This is simply impossible.
Using properties of the connection like service bits or relay flags (and maybe later a disabletx
message) or other statistics like last sent tx/block to aid eviction can be done without exactly enumerating the connection types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't disagree, though as a user I'd like to see this information...either directly as proposed here, or indirectly by manually looking at the inbound
+ relaytxes
+ services
/servicesnames
getpeerinfo boolean fields. Anyway, closing for now, replaced by #203.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Services and inbound status should be shown in the gui. I don't recall whether version.fRelay is shown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, inbound and services are. Proposing now to add frelaytxes and bip152 high bandwidth.
Sorry for being late... It's unfortunate that it is closed for the following reasons:
Concept ACK (and ready to test if it'll be reopened). Nevertheless, will review #203. |
@hebasto Thanks--I'm happy to re-open if desired. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 89c20ee, tested on Linux Mint 20.1 (Qt 5.12.8).
{ | ||
switch (conn_type) { | ||
case ConnectionType::INBOUND: return relay_txes ? QObject::tr("Inbound Full Relay") : QObject::tr("Inbound Block Relay"); | ||
case ConnectionType::INBOUND: return !relay_txes && relevant_services ? QObject::tr("Inbound Block Relay") : QObject::tr("Inbound"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pico-nit:
If helpful, the logic is from https://github.com/bitcoin/bitcoin/blob/16b784d953365bb2d7ae65acd2b20a79ef8ba7b6/src/net.cpp#L872 in our inbound eviction protection logic...
Maybe add a relevant comment here?
My point is that what is displayed in the gui is not the "untraceable subnetwork". Whether a node asked you to send txs has nothing to do of their behaviour to send you txs (or other peers they have sent a version.fRalay=false), so I think incorrectly classifying them as "block-relay-only" is confusing at best. It would be good to describe your use case, but if your use case is to determine the "untraceable subnetwork", this heuristic is neither accurate nor precise. https://en.wikipedia.org/wiki/Accuracy_and_precision Even when ignoring all different p2p clients on the network and only considering vanilla Bitcoin Core nodes (at the commit of this pull) wont give precise results for |
Thanks for the discussions @MarcoFalke and @hebasto. I agree this can be deferred for now and have aligned |
506e658 gui: display plain "Inbound" in peer details (Jon Atack) Pull request description: Alternative version to #201. ACKs for top commit: MarcoFalke: ACK 506e658 jonasschnelli: utACK 506e658 Tree-SHA512: 88d141b14684c1dcdff47f7ba241e5a7c42c14da3d9aaa89f1649235a64fd26bc5a6055707dc07992cd9d8c05d143754f6dd51ccee69fd4309336dd07c52e61c
Responding to #180 (comment), this ensures that inbound block relay peers have relevant services and returns all others as inbound.