Make htlc_maximum_msat mandatory in channel updates#2361
Merged
Conversation
t-bast
commented
Aug 3, 2022
| assert(data_new == data_new2) | ||
| } | ||
|
|
||
| test("backward compatibility DATA_NORMAL_COMPAT_03_Codec (roundtrip)") { |
Member
Author
There was a problem hiding this comment.
I tried fixing this test, but it's a real pain because it uses one of our oldest codecs that has been updated years ago. I think we can safely drop it.
ec83a24 to
654d9f7
Compare
The specification is removing support for old channel updates that didn't include an `htlc_maximum_msat` (lightning/bolts#996). Every implementation has been generating updates containing this field for years, so we can safely reject updates that don't contain it.
654d9f7 to
a95058f
Compare
Codecov Report
@@ Coverage Diff @@
## master #2361 +/- ##
==========================================
+ Coverage 84.71% 84.74% +0.02%
==========================================
Files 194 194
Lines 14671 14667 -4
Branches 604 597 -7
==========================================
+ Hits 12428 12429 +1
+ Misses 2243 2238 -5
|
pm47
reviewed
Aug 8, 2022
eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/LightningMessageCodecs.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/LightningMessageCodecs.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/LightningMessageCodecs.scala
Show resolved
Hide resolved
| tlvStream: TlvStream[ChannelUpdateTlv] = TlvStream.empty) extends RoutingMessage with AnnouncementMessage with HasTimestamp with HasChainHash { | ||
|
|
||
| def messageFlags: Byte = if (htlcMaximumMsat.isDefined) 1 else 0 | ||
| def messageFlags: Byte = 1 |
Member
There was a problem hiding this comment.
We need this to construct ChannelDisabled error messages, which should really only use channelFlags.
Member
Author
pm47
approved these changes
Aug 8, 2022
t-bast
added a commit
that referenced
this pull request
Aug 11, 2022
Following #2361, we reject channel updates that don't contain the `htlc_maximum_msat` field. However, the network DB may contain such channel updates, that we need to remove when starting up.
t-bast
added a commit
that referenced
this pull request
Aug 11, 2022
Following #2361, we reject channel updates that don't contain the `htlc_maximum_msat` field. However, the network DB may contain such channel updates, that we need to remove when starting up.
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.
The specification is removing support for old channel updates that didn't include an
htlc_maximum_msat(lightning/bolts#996).Every implementation has been generating updates containing this field for years, so we can safely reject updates that don't contain it.