From 2e54fc9d10de2981c1c07136b4f59f9f4b5fe82d Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Sat, 15 Jul 2023 02:51:05 +0200 Subject: [PATCH] bol09: Specify behavior when a node specifies both optional and required 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 --- 09-features.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/09-features.md b/09-features.md index ba0a0c5bf..95c5187f2 100644 --- a/09-features.md +++ b/09-features.md @@ -62,6 +62,8 @@ The origin node: * If it requires a feature above, MUST set the corresponding even feature bit in all feature fields indicated by the Context column, unless indicated that it must set the odd feature bit instead. + * If a feature is specified both as an optional feature and as a + required feature in the header, the more restrictive option MUST be chosen. * MUST NOT set feature bits it does not support. * MUST NOT set feature bits in fields not specified by the table above. * MUST set all transitive feature dependencies.