Upfront shutdown script#1286
Closed
t-bast wants to merge 3 commits into
Closed
Conversation
Add to features list. Activate optional bit by default.
Encode/decode upfront_shutdown_script in open_channel and accept_channel messages. Decode both old and new format, always encode with the new one.
Codecov Report
@@ Coverage Diff @@
## master #1286 +/- ##
==========================================
+ Coverage 77.16% 77.45% +0.28%
==========================================
Files 143 144 +1
Lines 9942 10059 +117
Branches 394 420 +26
==========================================
+ Hits 7672 7791 +119
+ Misses 2270 2268 -2
|
sstone
reviewed
Jan 23, 2020
| ("yourLastPerCommitmentSecret" | optional(bitsRemaining, privateKey)) :: | ||
| ("myCurrentPerCommitmentPoint" | optional(bitsRemaining, publicKey))).as[ChannelReestablish] | ||
|
|
||
| // Legacy nodes are supposed to encode an upfront_shutdown_script only if both sides advertised support for option_upfront_shutdown_script. |
Member
There was a problem hiding this comment.
I think that a node may include an optional shutdown script even if its peer does not support it:
- if both nodes advertised the
option_upfront_shutdown_scriptfeature:- MUST include either a valid
shutdown_scriptpubkeyas required byshutdown>scriptpubkey, or a zero-lengthshutdown_scriptpubkey.- otherwise:
- MAY include a
shutdown_scriptpubkey.
Member
|
I think there is something missing: if both peers support |
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.
Extending all messages with a TLV stream (spec PR here) requires making currently optional data to become mandatory.
We don't support
upfront_shutdown_scriptyet which is going to be a problem if we want to extendopen_channelandaccept_channelwith additional TLVs (which we already do for Phoenix).This PR implements partial support for
upfront_shutdown_script: we allow our peers to use that feature, but there's no hooks to use it ourselves. If our users want us to add support for specifying anupfront_shutdown_script, we can add it later.