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

bol09: Specify behavior when a node specifies both optional and required features #1095

Merged

Conversation

vincenzopalazzo
Copy link
Contributor

While reviewing a patch on lnprototest, I encountered a scenario where the BOLT 9 specification needed to provide clear guidance.

As a result, this commit adds specific requirements to determine the appropriate behaviour when a node specifies both optional and required features.

Additionally, if this situation appears to be an
implementation bug, it will be taken care of accordingly.

Reported-by: lnprototest

Copy link
Contributor

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

09-features.md Outdated Show resolved Hide resolved
@ProofOfKeags
Copy link
Contributor

ACK 2e828eb

@vincenzopalazzo vincenzopalazzo force-pushed the macros/specify-multiple-fields branch 2 times, most recently from 1d52361 to da27563 Compare July 31, 2023 19:13
@vincenzopalazzo
Copy link
Contributor Author

Ok, I made the requested change and would love another review run.

In addition, I fold the sender requirements under a single list inside the commit 90af56b

If you disagree I can drop it!

Copy link
Contributor

@carlaKC carlaKC left a comment

Choose a reason for hiding this comment

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

Some small wording nits, otherwise LGTM

09-features.md Outdated Show resolved Hide resolved
09-features.md Outdated Show resolved Hide resolved
09-features.md Outdated Show resolved Hide resolved
09-features.md Outdated Show resolved Hide resolved
09-features.md Outdated
Comment on lines 73 to 74
* if both the optional and the mandatory feature its in a pair are set,
the feature should be treated as mandatory.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* if both the optional and the mandatory feature its in a pair are set,
the feature should be treated as mandatory.
* if both the optional and the mandatory feature its in a pair are set:
* the feature SHOULD be treated as mandatory
* the feature MUST NOT be treated as optional
* the receiving node MAY fail the feature negotiation

See this for rationale

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the receiving node MAY fail the feature negotiation

No, this is the point of my PR. It is ok to declare both fields and if they are, the node should take the mandatory. This suggestion does not convince me, I am sorry.

Copy link
Collaborator

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

LGTM once the typos/nits are fixed.

09-features.md Outdated Show resolved Hide resolved
@vincenzopalazzo vincenzopalazzo force-pushed the macros/specify-multiple-fields branch 2 times, most recently from 2a23ce5 to c8053c5 Compare August 14, 2023 20:02
…red features

While reviewing a patch on lnprototest, I encountered a scenario
where the BOLT 9 specification needed to provide clear guidance.

As a result, this commit adds specific requirements to
determine the appropriate behaviour when a node specifies
both optional and required features.

Additionally, if this situation appears to be an
implementation bug, it will be taken care of accordingly.

Reported-by: lnprototest
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Copy link
Collaborator

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

ACK ec59f7c

@vincenzopalazzo
Copy link
Contributor Author

OK, I fixup the change in the wrong commit so I had to squash the two commits in two! it should not be a big deal

Copy link
Collaborator

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🧩

@Roasbeef Roasbeef merged commit 8cb9b89 into lightning:master Aug 14, 2023
@vincenzopalazzo vincenzopalazzo deleted the macros/specify-multiple-fields branch August 14, 2023 20:18
@rustyrussell
Copy link
Collaborator

Ack ec59f7c

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.

7 participants