Skip to content

ADR 30 : New handshake for the bolt protocol#1243

Merged
MaxAake merged 23 commits into5.0from
handshake-improvement
Feb 3, 2025
Merged

ADR 30 : New handshake for the bolt protocol#1243
MaxAake merged 23 commits into5.0from
handshake-improvement

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