-
Notifications
You must be signed in to change notification settings - Fork 265
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
Make htlc_maximum_msat
mandatory in channel updates
#2361
Conversation
@@ -100,38 +100,6 @@ class ChannelCodecsSpec extends AnyFunSuite { | |||
assert(data_new == data_new2) | |||
} | |||
|
|||
test("backward compatibility DATA_NORMAL_COMPAT_03_Codec (roundtrip)") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this to construct ChannelDisabled
error messages, which should really only use channelFlags
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
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.