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

ADR 30 : New handshake for the bolt protocol #1243

Merged
merged 23 commits into from
Feb 3, 2025
Merged

Conversation

MaxAake
Copy link
Contributor

@MaxAake MaxAake commented Dec 19, 2024

Implements the handshake v2 protocol, allowing for more granular selection of bolt protocol versions.

@MaxAake MaxAake marked this pull request as ready for review January 7, 2025 15:11

let major
let minor
versions.sort((a, b) => Number(b.major + '.' + b.minor) - Number(a.major + '.' + a.minor))
Copy link
Contributor

Choose a reason for hiding this comment

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

It may not be an issue, but have you checked this covers trailing zeros in the conversation?

So Number(major + '.' + minor) converts versions into floats (5.7 becomes 5.7 but 4.10 might not behave as expected?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch that I really should have realized myself! Thank you!

versions.sort((a, b) => Number(b.major + '.' + b.minor) - Number(a.major + '.' + a.minor))
for (let i = 0; i < versions.length; i++) {
const version = versions[i]
if (AVAILABLE_BOLT_PROTOCOLS.includes(Number(version.major + '.' + version.minor))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If no version matches, major and minor will be undefined, does this lead to any unexpected errors?

Copy link
Contributor

@StephenCathcart StephenCathcart left a comment

Choose a reason for hiding this comment

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

Nice job 👍

@MaxAake MaxAake merged commit 2031e43 into 5.0 Feb 3, 2025
37 checks passed
@MaxAake MaxAake deleted the handshake-improvement branch February 3, 2025 10:29
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.

2 participants