Skip to content

Commit ad5d519

Browse files
committed
Merge branch 'main' into fix/channel-monitor-migration
# Conflicts: # CHANGELOG.md # Package.swift # bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so # bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so # bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so # bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib # bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib
2 parents dc087fb + d1d6fff commit ad5d519

19 files changed

Lines changed: 562 additions & 450 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
with a newer `update_id` before writing, preventing stale migration data from overwriting
3535
current state on repeated migrations or restarts. Errors reading or deserializing existing
3636
monitors now fail-closed (abort migration) to avoid silent data loss.
37+
- Added `connection_timeout_secs` field to `ElectrumSyncConfig` (default: 10 s). This bounds
38+
Electrum socket operations for both the BDK on-chain and LDK tx-sync clients, preventing Tokio's
39+
blocking thread pool from being exhausted by threads stuck on dead sockets under total packet
40+
loss (e.g. a captive portal on iOS). Set to `0` to disable; values above 255 are capped to
41+
255 and a warning is logged.
42+
**Breaking change:** existing struct-literal construction of `ElectrumSyncConfig` must add the
43+
new field or switch to `ElectrumSyncConfig { .., ..Default::default() }`.
44+
3745
- Added `OnchainPayment::calculate_send_all_fee()` to preview the fee for a drain / send-all
3846
transaction before broadcasting (fee-calculation counterpart of `send_all_to_address`)
3947
- Added runtime APIs for dynamic address type management:

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import PackageDescription
55

66
let tag = "v0.7.0-rc.33"
7-
let checksum = "235e276d2a39ed41abb4034b027f72bf876b65eb40a2a584cc1d06208ad7a58a"
7+
let checksum = "82e318ac605e04d87f1aa24c920c06627346d9500c6395db45cb23f159e200f0"
88
let url = "https://github.com/synonymdev/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip"
99

1010
let package = Package(

bindgen.sh

100644100755
File mode changed.
Binary file not shown.
Binary file not shown.
Binary file not shown.

bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.android.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9459,15 +9459,18 @@ object FfiConverterTypeElectrumSyncConfig: FfiConverterRustBuffer<ElectrumSyncCo
94599459
override fun read(buf: ByteBuffer): ElectrumSyncConfig {
94609460
return ElectrumSyncConfig(
94619461
FfiConverterOptionalTypeBackgroundSyncConfig.read(buf),
9462+
FfiConverterULong.read(buf),
94629463
)
94639464
}
94649465

94659466
override fun allocationSize(value: ElectrumSyncConfig) = (
9466-
FfiConverterOptionalTypeBackgroundSyncConfig.allocationSize(value.`backgroundSyncConfig`)
9467+
FfiConverterOptionalTypeBackgroundSyncConfig.allocationSize(value.`backgroundSyncConfig`) +
9468+
FfiConverterULong.allocationSize(value.`connectionTimeoutSecs`)
94679469
)
94689470

94699471
override fun write(value: ElectrumSyncConfig, buf: ByteBuffer) {
94709472
FfiConverterOptionalTypeBackgroundSyncConfig.write(value.`backgroundSyncConfig`, buf)
9473+
FfiConverterULong.write(value.`connectionTimeoutSecs`, buf)
94719474
}
94729475
}
94739476

bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,8 @@ data class CustomTlvRecord (
868868

869869
@kotlinx.serialization.Serializable
870870
data class ElectrumSyncConfig (
871-
val `backgroundSyncConfig`: BackgroundSyncConfig?
871+
val `backgroundSyncConfig`: BackgroundSyncConfig?,
872+
val `connectionTimeoutSecs`: kotlin.ULong
872873
) {
873874
companion object
874875
}

bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,8 @@ data class CustomTlvRecord (
868868

869869
@kotlinx.serialization.Serializable
870870
data class ElectrumSyncConfig (
871-
val `backgroundSyncConfig`: BackgroundSyncConfig?
871+
val `backgroundSyncConfig`: BackgroundSyncConfig?,
872+
val `connectionTimeoutSecs`: kotlin.ULong
872873
) {
873874
companion object
874875
}

bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.jvm.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9448,15 +9448,18 @@ object FfiConverterTypeElectrumSyncConfig: FfiConverterRustBuffer<ElectrumSyncCo
94489448
override fun read(buf: ByteBuffer): ElectrumSyncConfig {
94499449
return ElectrumSyncConfig(
94509450
FfiConverterOptionalTypeBackgroundSyncConfig.read(buf),
9451+
FfiConverterULong.read(buf),
94519452
)
94529453
}
94539454

94549455
override fun allocationSize(value: ElectrumSyncConfig) = (
9455-
FfiConverterOptionalTypeBackgroundSyncConfig.allocationSize(value.`backgroundSyncConfig`)
9456+
FfiConverterOptionalTypeBackgroundSyncConfig.allocationSize(value.`backgroundSyncConfig`) +
9457+
FfiConverterULong.allocationSize(value.`connectionTimeoutSecs`)
94569458
)
94579459

94589460
override fun write(value: ElectrumSyncConfig, buf: ByteBuffer) {
94599461
FfiConverterOptionalTypeBackgroundSyncConfig.write(value.`backgroundSyncConfig`, buf)
9462+
FfiConverterULong.write(value.`connectionTimeoutSecs`, buf)
94609463
}
94619464
}
94629465

0 commit comments

Comments
 (0)