Remove OptionalField and make DataLossProtect fields mandatory#2253
Merged
TheBlueMatt merged 3 commits intolightningdevkit:mainfrom May 2, 2023
Merged
Remove OptionalField and make DataLossProtect fields mandatory#2253TheBlueMatt merged 3 commits intolightningdevkit:mainfrom
OptionalField and make DataLossProtect fields mandatory#2253TheBlueMatt merged 3 commits intolightningdevkit:mainfrom
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.
TheBlueMatt
reviewed
May 1, 2023
Contributor
Author
|
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. |
Collaborator
|
We need to update the channelmanager feature set to set |
wpaulino
approved these changes
May 2, 2023
TheBlueMatt
approved these changes
May 2, 2023
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As per lightning/bolts@6656b70, we do three main things here:
Make
DataLossProtectfields required and move them directly intoChannelReestablish.These fields have been made mandatory regardless of whether
option_dataloss_protectoroption_remote_keyfeature bits are set.Move
shutdown_scriptpubkeyinto TLV stream.We can move the
shutdown_scriptpubkeyfield into the TLV streams ofOpenChannelandAcceptChannelwithout affecting the resulting encoding as per the BOLT commit linked above.Remove
OptionalFieldentirely as it is obsolete.Blocks #1794