Skip to content

Commit 981ca67

Browse files
committed
Increase maximum number of accepted HTLCs to 18
#800 included a lot of improvements on our data structure and removed data that was either redondant or could be re-computed. This means that serialised channel states are smaller, and we can increase the number of pending HTLCs to 18 and stay below the 65 Kb size limit for LN messages. Note that this applies to new channels only: existing ones will still use the previous value of 12 pending HTLCs.
1 parent bb72a06 commit 981ca67

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

modules/core/src/commonMain/kotlin/fr/acinq/lightning/NodeParams.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ data class NodeParams(
223223
feerateTolerance = FeerateTolerance(ratioLow = 0.01, ratioHigh = 100.0)
224224
),
225225
maxHtlcValueInFlightMsat = 20_000_000_000L,
226-
maxAcceptedHtlcs = 12,
226+
maxAcceptedHtlcs = 18,
227227
expiryDeltaBlocks = CltvExpiryDelta(144),
228228
// We use a long expiry delta here for a few reasons:
229229
// - we want to ensure we're able to get HTLC-success txs confirmed if our peer ignores our preimage

modules/core/src/commonTest/kotlin/fr/acinq/lightning/serialization/channel/StateSerializationTestsCommon.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import fr.acinq.lightning.channel.LNChannel
77
import fr.acinq.lightning.channel.SpliceStatus
88
import fr.acinq.lightning.channel.TestsHelper
99
import fr.acinq.lightning.channel.TestsHelper.crossSign
10+
import fr.acinq.lightning.channel.states.ChannelState
1011
import fr.acinq.lightning.channel.states.Negotiating
1112
import fr.acinq.lightning.channel.states.Normal
1213
import fr.acinq.lightning.channel.states.PersistedChannelState
1314
import fr.acinq.lightning.channel.states.SpliceTestsCommon
15+
import fr.acinq.lightning.json.JsonSerializers
1416
import fr.acinq.lightning.serialization.channel.Encryption.from
1517
import fr.acinq.lightning.serialization.channel.Encryption.fromEncryptedPeerStorage
1618
import fr.acinq.lightning.tests.utils.LightningTestSuite
@@ -91,8 +93,8 @@ class StateSerializationTestsCommon : LightningTestSuite() {
9193
.maxOf { it.size }
9294
}
9395

94-
// with 12 incoming payments and 12 outgoing payments, our encrypted backup stays below the 65k limit for peer storage
95-
assertTrue(peerStorageSize(12, 12) <= 65_000)
96+
// with 18 incoming payments and 18 outgoing payments, our encrypted backup stays below the 65k limit for peer storage
97+
assertTrue(peerStorageSize(18, 18) <= 65_000)
9698
}
9799

98100
@Test

0 commit comments

Comments
 (0)