You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We apply slightly different validation for zero-fee commitments:
- the commit feerate must be `0 sat/byte`
- the max number of accepted HTLCs must be at most 114
- `update_fee` cannot be used
We verify those requirements during channel creation and add tests
for normal channel operation.
require(maxAcceptedHtlcs <=Channel.MAX_ACCEPTED_HTLCS, s"channel.max-accepted-htlcs must be lower than ${Channel.MAX_ACCEPTED_HTLCS}")
364
+
require(maxAcceptedHtlcs <=Channel.maxAcceptedHtlcs(ChannelTypes.AnchorOutputsZeroFeeHtlcTx()), s"channel.max-accepted-htlcs must be lower than ${Channel.maxAcceptedHtlcs(ChannelTypes.AnchorOutputsZeroFeeHtlcTx())}")
if (nodeParams.onChainFeeConf.feerateToleranceFor(remoteNodeId).isProposedCommitFeerateTooHigh(localFeeratePerKw, open.commitmentFeerate)) returnLeft(FeerateTooDifferent(open.temporaryChannelId, localFeeratePerKw, open.commitmentFeerate))
@@ -218,7 +218,7 @@ object Helpers {
218
218
caseRight(channelType) => channelType
219
219
}
220
220
221
-
if (accept.maxAcceptedHtlcs >Channel.MAX_ACCEPTED_HTLCS)returnLeft(InvalidMaxAcceptedHtlcs(accept.temporaryChannelId, accept.maxAcceptedHtlcs, Channel.MAX_ACCEPTED_HTLCS))
221
+
if (accept.maxAcceptedHtlcs >Channel.maxAcceptedHtlcs(channelType))returnLeft(InvalidMaxAcceptedHtlcs(accept.temporaryChannelId, accept.maxAcceptedHtlcs, Channel.maxAcceptedHtlcs(channelType)))
222
222
223
223
if (accept.dustLimitSatoshis > nodeParams.channelConf.maxRemoteDustLimit) returnLeft(DustLimitTooLarge(open.temporaryChannelId, accept.dustLimitSatoshis, nodeParams.channelConf.maxRemoteDustLimit))
224
224
if (accept.dustLimitSatoshis <Channel.MIN_DUST_LIMIT) returnLeft(DustLimitTooSmall(accept.temporaryChannelId, accept.dustLimitSatoshis, Channel.MIN_DUST_LIMIT))
@@ -268,7 +268,7 @@ object Helpers {
268
268
// BOLT #2: The receiving node MUST fail the channel if: push_msat is greater than funding_satoshis * 1000.
269
269
if (accept.pushAmount > accept.fundingAmount) returnLeft(InvalidPushAmount(accept.temporaryChannelId, accept.pushAmount, accept.fundingAmount.toMilliSatoshi))
270
270
271
-
if (accept.maxAcceptedHtlcs >Channel.MAX_ACCEPTED_HTLCS)returnLeft(InvalidMaxAcceptedHtlcs(accept.temporaryChannelId, accept.maxAcceptedHtlcs, Channel.MAX_ACCEPTED_HTLCS))
271
+
if (accept.maxAcceptedHtlcs >Channel.maxAcceptedHtlcs(channelType))returnLeft(InvalidMaxAcceptedHtlcs(accept.temporaryChannelId, accept.maxAcceptedHtlcs, Channel.maxAcceptedHtlcs(channelType)))
272
272
273
273
if (accept.dustLimit <Channel.MIN_DUST_LIMIT) returnLeft(DustLimitTooSmall(accept.temporaryChannelId, accept.dustLimit, Channel.MIN_DUST_LIMIT))
274
274
if (accept.dustLimit > nodeParams.channelConf.maxRemoteDustLimit) returnLeft(DustLimitTooLarge(open.temporaryChannelId, accept.dustLimit, nodeParams.channelConf.maxRemoteDustLimit))
@@ -291,8 +291,12 @@ object Helpers {
291
291
* @paramremoteFeeratePerKw remote fee rate per kiloweight
292
292
* @return true if the remote fee rate is too small
// 0x00 was used for pre-anchor channels, which have been deprecated after eclair v0.13.1.
86
87
.typecase(0x00, fail[Transactions.CommitmentFormat](Err("some of your channels are not using anchor outputs: you must restart with your previous eclair version and close those channels before updating to this version of eclair (see the release notes for more details)")))
0 commit comments