-
Notifications
You must be signed in to change notification settings - Fork 368
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
Remove OptionalField
and make DataLossProtect
fields mandatory
#2253
Remove OptionalField
and make DataLossProtect
fields mandatory
#2253
Conversation
The fields provided by `DataLossProtect` have been mandatory since lightning/bolts@6656b70, regardless of whether `option_dataloss_protect` or `option_remote_key` feature bits are set. We move the fields out of `DataLossProtect` to make encoding definitions more succinct with `impl_writeable_msg!` and to reduce boilerplate. This paves the way for completely removing `OptionalField` in subsequent commits.
Oops. Broke taproot cfgs along the way. Will fix. |
As pointed out in lightning/bolts@6656b70, we can move the `shutdown_scriptpubkey` field into the TLV streams of `OpenChannel` and `AcceptChannel` without affecting the resulting encoding. We use `WithoutLength` encoding here to ensure that we do not encode a length prefix along with `Script` as is normally the case.
64aa89c
to
20cd856
Compare
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #2253 +/- ##
==========================================
+ Coverage 91.59% 92.05% +0.45%
==========================================
Files 104 104
Lines 51976 55468 +3492
Branches 51976 55468 +3492
==========================================
+ Hits 47609 51062 +3453
- Misses 4367 4406 +39
☔ View full report in Codecov by Sentry. |
We need to update the channelmanager feature set to set |
As per lightning/bolts@6656b70, we do three main things here:
Make
DataLossProtect
fields required and move them directly intoChannelReestablish
.These fields have been made mandatory regardless of whether
option_dataloss_protect
oroption_remote_key
feature bits are set.Move
shutdown_scriptpubkey
into TLV stream.We can move the
shutdown_scriptpubkey
field into the TLV streams ofOpenChannel
andAcceptChannel
without affecting the resulting encoding as per the BOLT commit linked above.Remove
OptionalField
entirely as it is obsolete.Blocks #1794