Rebase bugfix PRs, prepare for minor release#6026
Merged
guggero merged 7 commits intolightningnetwork:masterfrom Nov 24, 2021
Merged
Rebase bugfix PRs, prepare for minor release#6026guggero merged 7 commits intolightningnetwork:masterfrom
guggero merged 7 commits intolightningnetwork:masterfrom
Conversation
…d be This fixes an issue where if one tries to unset a feature like anchors, and other feature depend on it, then `lnd` fails to start as it realizes that its dependnacy set is inconsistent. Fixes lightningnetwork#6002
In this commit, we fix a bug that would cause newly updated nodes to be unable to start up, if they have an older channel that was closed before we started to store all the historical state for each channel. The issue is that we started to write the complete state to disk, but newer channels don't have it, so when we try to supplement the resolvers, we run into this error. Ultimately, we only need this new supplemented information for script enforcement channels. Ideally we would instead check the channel type there instead, but it doesn't appear to be available in this context as is, without further changes. Fixes lightningnetwork#6001.
d4f76c1 to
0bf1e14
Compare
This was referenced Nov 24, 2021
0bf1e14 to
f5f9099
Compare
yyforyongyu
reviewed
Nov 24, 2021
yyforyongyu
approved these changes
Nov 24, 2021
Roasbeef
requested changes
Nov 24, 2021
Member
|
Patch to resolve the comment I made above: diff --git a/funding/commitment_type_negotiation.go b/funding/commitment_type_negotiation.go
index e2a9095a7..eb201e5b1 100644
--- a/funding/commitment_type_negotiation.go
+++ b/funding/commitment_type_negotiation.go
@@ -36,25 +36,6 @@ func negotiateCommitmentType(channelType *lnwire.ChannelType,
*channelType, local, remote,
)
}
-
- // If they don't know explicit negotiation, let's fall back to
- // implicit negotiation if they just signal one of the known
- // default types.
- channelFeatures := lnwire.RawFeatureVector(*channelType)
- staticRemoteKeyOnly := channelFeatures.OnlyContains(
- lnwire.StaticRemoteKeyRequired,
- )
- anchorOnly := channelFeatures.OnlyContains(
- lnwire.AnchorsZeroFeeHtlcTxRequired,
- )
-
- // It's one of the default types.
- if staticRemoteKeyOnly || anchorOnly {
- return implicitNegotiateCommitmentType(local, remote), nil
- }
-
- // Something's weird, let's not accept this channel.
- return 0, errUnsupportedExplicitNegotiation
}
return implicitNegotiateCommitmentType(local, remote), nil
diff --git a/funding/commitment_type_negotiation_test.go b/funding/commitment_type_negotiation_test.go
index c9ac25a7a..4da88f2a9 100644
--- a/funding/commitment_type_negotiation_test.go
+++ b/funding/commitment_type_negotiation_test.go
@@ -36,7 +36,8 @@ func TestCommitmentTypeNegotiation(t *testing.T) {
lnwire.StaticRemoteKeyOptional,
lnwire.AnchorsZeroFeeHtlcTxOptional,
),
- expectsErr: errUnsupportedExplicitNegotiation,
+ expectsRes: lnwallet.CommitmentTypeAnchorsZeroFeeHtlcTx,
+ expectsErr: nil,
},
{
name: "explicit missing remote commitment feature",
@@ -181,8 +182,8 @@ func TestCommitmentTypeNegotiation(t *testing.T) {
return
}
- require.Equal(t, testCase.expectsRes, localType)
- require.Equal(t, testCase.expectsRes, remoteType)
+ require.Equal(t, testCase.expectsRes, localType, testCase.name)
+ require.Equal(t, testCase.expectsRes, remoteType, testCase.name)
})
if !ok {
return |
f5f9099 to
0a749cf
Compare
Collaborator
Author
|
Thanks! Applied the patch, going to test again vs. |
0a749cf to
ee015a1
Compare
Crypt-iQ
approved these changes
Nov 24, 2021
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.
Replaces #6007.
Replaces #6003.
Fixes #6001.
Fixes #6002.
Fixes #5890.
Addresses an issue with explicit channel type negotiation that caused incompatibilities when opening channels with the latest versions of c-lightning and eclair (#5890).