Closed joostjager closed 1 year ago
With his change we'll only check that the length is above some minimum.
Is that independent to the spec change proposed here: https://github.com/lightning/bolts/pull/1021 ? As that's only about what the sender should do. (so we can't enforce that the read error is exactly 1024 bytes)
It is independent. We should already have allowed variable length failure messages.
Wondering now, should the minimum check be removed too? If we'd receive a shorter failure message today, wouldn't we want to locate the error source and parse the message?
On the other hand, failure messages shorter than 256 bytes may complicate the implementation in lnd: https://github.com/lightningnetwork/lnd/pull/6913#discussion_r995654979
Wondering now, should the minimum check be removed too? If we'd receive a shorter failure message today, wouldn't we want to locate the error source and parse the message?
I would say we should keep it for now. It would be valuable to check what other implementations are doing; if they all send (at least) 256 bytes, we could make this required in the spec.
The spec does not dictate but only recommends a length of 256 bytes. Future tlv extensions may push the failure message length over this limit. With this change, receivers can ignore the lengthier extensions without handling it as an unreadable failure.