-
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -766,10 +766,10 @@ QString NetworkToQString(Network net) | |
assert(false); | ||
} | ||
|
||
QString ConnectionTypeToQString(ConnectionType conn_type, bool relay_txes) | ||
QString ConnectionTypeToQString(ConnectionType conn_type, bool relay_txes, bool relevant_services) | ||
{ | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. pico-nit:
Maybe add a relevant comment here? |
||
case ConnectionType::OUTBOUND_FULL_RELAY: return QObject::tr("Outbound Full Relay"); | ||
case ConnectionType::BLOCK_RELAY: return QObject::tr("Outbound Block Relay"); | ||
case ConnectionType::MANUAL: return QObject::tr("Outbound Manual"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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):
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.