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

debugwindow: update session ID tooltip #788

Merged
merged 1 commit into from
May 11, 2024

Conversation

MarnixCroes
Copy link
Contributor

@MarnixCroes MarnixCroes commented Jan 17, 2024

When you have a v2 connection, there is always a session ID.

the if any is a leftover from #754, where the session ID property initially would always be displayed (transport v1 and v2).
So the session ID could be empty when you have a v1 connection.

As now the Session ID property only is displayed for v2 connection, there will always be a session ID.

master

sessionIDifany

PR

sessionID

Session ID not shown when transport v1

transportv1

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 17, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK kristapsk, vostrnad, jarolrod, pablomartin4btc, hebasto
Concept ACK BrandonOdiwuor, hernanmarino

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@hebasto hebasto changed the title gui: debugwindow: update session ID tooltip debugwindow: update session ID tooltip Jan 17, 2024
Copy link
Contributor

@pablomartin4btc pablomartin4btc 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

nit: @MarnixCroes, maybe you can add the screenshot for transport v1 and session ID is empty/ not shown, if possible, even this PR doesn't affect that logic.

@MarnixCroes
Copy link
Contributor Author

Concept ACK

nit: @MarnixCroes, maybe you can add the screenshot for transport v1 and session ID is empty/ not shown, if possible, even this PR doesn't affect that logic.

done

Copy link
Contributor

@kristapsk kristapsk left a comment

Choose a reason for hiding this comment

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

ACK 3bf00e1

Copy link
Contributor

@BrandonOdiwuor BrandonOdiwuor 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

@DrahtBot DrahtBot requested review from pablomartin4btc and removed request for pablomartin4btc January 31, 2024 07:41
@vostrnad
Copy link

vostrnad commented Feb 3, 2024

ACK 3bf00e1

@DrahtBot DrahtBot requested review from pablomartin4btc and BrandonOdiwuor and removed request for pablomartin4btc February 3, 2024 07:45
Copy link
Contributor

@hernanmarino hernanmarino 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

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.

ACK 3bf00e1

@hebasto
Copy link
Member

hebasto commented Feb 7, 2024

When you have a v2 connection, there is always a session ID.

What if the connection type is still DETECTING?

The code reference:

/** Transport layer version */
enum class TransportProtocolType : uint8_t {
DETECTING, //!< Peer could be v1 or v2
V1, //!< Unencrypted, plaintext protocol
V2, //!< BIP324 protocol
};

@MarnixCroes
Copy link
Contributor Author

When you have a v2 connection, there is always a session ID.

What if the connection type is still DETECTING?

The code reference:

/** Transport layer version */
enum class TransportProtocolType : uint8_t {
DETECTING, //!< Peer could be v1 or v2
V1, //!< Unencrypted, plaintext protocol
V2, //!< BIP324 protocol
};

then there is no session ID property
as it is not a v2 peer (yet), right

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

tACK 3bf00e1

Tested on Ubuntu 22.04 using signet (./src/qt/bitcoin-qt -signet) otherwise I couldn't find v2 peers on testnet.
  • v2 transport with Session ID field displayed:

image

  • v1 transport without it:

image

@hebasto this PR only updates peerSessionIdLabel tooltip; this widget and the "Session ID" one, right below on the ui form, won't be shown on "DETECTING" TransportProtocolType enum:

gui/src/qt/rpcconsole.cpp

Lines 1208 to 1215 in d04324a

if (stats->nodeStats.m_transport_type == TransportProtocolType::V2) {
ui->peerSessionIdLabel->setVisible(true);
ui->peerSessionId->setVisible(true);
ui->peerSessionId->setText(QString::fromStdString(stats->nodeStats.m_session_id));
} else {
ui->peerSessionIdLabel->setVisible(false);
ui->peerSessionId->setVisible(false);
}

@pablomartin4btc
Copy link
Contributor

nit: you could expand a bit on the details of the reason of the removal of "if any" from the label in the commit body (i.e. as it's only shown in v2 transport which will always have a session id).

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK 3bf00e1.

@hebasto hebasto merged commit 182983c into bitcoin-core:master May 11, 2024
16 checks passed
Copy link

@gatleas17 gatleas17 left a comment

Choose a reason for hiding this comment

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

Help!

@MarnixCroes MarnixCroes deleted the session-id-tooltip branch May 13, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants