diff --git a/CHANGELOG.md b/CHANGELOG.md index ce75d12a8..668c8fde2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.7.0-rc.36 (Synonym Fork) +# 0.7.0-rc.37 (Synonym Fork) ## Bug Fixes @@ -59,11 +59,11 @@ ## Synonym Fork Additions - Added pre-flight probe correlation: `Event::ProbeSuccessful` and `Event::ProbeFailed` (from LDK - probe lifecycle), plus `ProbeHandle` (`payment_id`, synthetic `payment_hash`) returned by - `Bolt11Payment::send_probes`, `send_probes_using_amount`, and `SpontaneousPayment::send_probes` - (one handle per probe path). Match handles to events by `payment_id` (and optionally - `payment_hash`); these are not the BOLT11 invoice payment hash. UniFFI: `dictionary ProbeHandle` - in `ldk_node.udl`. + probe lifecycle), plus `ProbeHandle` (`payment_id`, synthetic `payment_hash`) values returned + for probes actually dispatched by `Bolt11Payment::send_probes`, `send_probes_using_amount`, and + `SpontaneousPayment::send_probes` (some route paths may be skipped before dispatch). Match + handles to events by `payment_id` (and optionally `payment_hash`); these are not the BOLT11 + invoice payment hash. UniFFI: `dictionary ProbeHandle` in `ldk_node.udl`. - Added `connection_timeout_secs` field to `ElectrumSyncConfig` (default: 10 s). This bounds Electrum socket operations for both the BDK on-chain and LDK tx-sync clients, preventing Tokio's blocking thread pool from being exhausted by threads stuck on dead sockets under total packet diff --git a/Cargo.toml b/Cargo.toml index fc45137fe..5a44e37e9 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ exclude = ["bindings/uniffi-bindgen"] [package] name = "ldk-node" -version = "0.7.0-rc.36" +version = "0.7.0-rc.37" authors = ["Elias Rohrer "] homepage = "https://lightningdevkit.org/" license = "MIT OR Apache-2.0" diff --git a/Package.swift b/Package.swift index 3cc7a6aff..569d04f12 100644 --- a/Package.swift +++ b/Package.swift @@ -3,8 +3,8 @@ import PackageDescription -let tag = "v0.7.0-rc.36" -let checksum = "e46e7c75c03831175b437fe032cef1cd43ba5c171871f82c4337a4bd5da62f5f" +let tag = "v0.7.0-rc.37" +let checksum = "31ca289fb94221bf1a0077532a868d1e19912f19760735697023066b1160eea7" let url = "https://github.com/synonymdev/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip" let package = Package( diff --git a/bindings/kotlin/ldk-node-android/gradle.properties b/bindings/kotlin/ldk-node-android/gradle.properties index 6b8e6a518..8bcf01514 100644 --- a/bindings/kotlin/ldk-node-android/gradle.properties +++ b/bindings/kotlin/ldk-node-android/gradle.properties @@ -3,4 +3,4 @@ android.useAndroidX=true android.enableJetifier=true kotlin.code.style=official group=com.synonym -version=0.7.0-rc.36 +version=0.7.0-rc.37 diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so index b0e81ee48..03f45ecdf 100755 Binary files a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so and b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so differ diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so index ceebbd517..3b31e07fe 100755 Binary files a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so and b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so differ diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so index b9dead6ee..c37f4acc1 100755 Binary files a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so and b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so differ diff --git a/bindings/kotlin/ldk-node-jvm/gradle.properties b/bindings/kotlin/ldk-node-jvm/gradle.properties index e63300c91..a6c95664e 100644 --- a/bindings/kotlin/ldk-node-jvm/gradle.properties +++ b/bindings/kotlin/ldk-node-jvm/gradle.properties @@ -1,4 +1,4 @@ org.gradle.jvmargs=-Xmx1536m kotlin.code.style=official group=com.synonym -version=0.7.0-rc.36 +version=0.7.0-rc.37 diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib index 596e0c6d5..5d0ae096c 100644 Binary files a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib and b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib differ diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib index 7ad1fd9de..86bc05d56 100644 Binary files a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib and b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib differ diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml index 9e72b7a6c..2918dabb5 100644 --- a/bindings/python/pyproject.toml +++ b/bindings/python/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ldk_node" -version = "0.7.0-rc.36" +version = "0.7.0-rc.37" authors = [ { name="Elias Rohrer", email="dev@tnull.de" }, ] diff --git a/src/event.rs b/src/event.rs index f33da9559..940a2f029 100644 --- a/src/event.rs +++ b/src/event.rs @@ -2619,17 +2619,35 @@ mod tests { #[tokio::test] async fn probe_events_persistence_roundtrip() { + let events = [ + Event::ProbeSuccessful { + payment_id: PaymentId([1u8; 32]), + payment_hash: PaymentHash([2u8; 32]), + }, + Event::ProbeFailed { + payment_id: PaymentId([3u8; 32]), + payment_hash: PaymentHash([4u8; 32]), + short_channel_id: Some(42), + }, + Event::ProbeFailed { + payment_id: PaymentId([5u8; 32]), + payment_hash: PaymentHash([6u8; 32]), + short_channel_id: None, + }, + ]; + + for expected_event in events { + assert_probe_event_persistence_roundtrip(expected_event).await; + } + } + + async fn assert_probe_event_persistence_roundtrip(expected_event: Event) { let store: Arc = Arc::new(InMemoryStore::new()); let logger = Arc::new(TestLogger::new()); let event_queue = Arc::new(EventQueue::new(Arc::clone(&store), Arc::clone(&logger))); assert_eq!(event_queue.next_event(), None); - let payment_hash = PaymentHash([7u8; 32]); - let payment_id = PaymentId(payment_hash.0); - let expected_event = - Event::ProbeFailed { payment_id, payment_hash, short_channel_id: Some(42) }; - event_queue.add_event(expected_event.clone()).await.unwrap(); // Check we get the expected event and that it is returned until handled. diff --git a/src/payment/bolt11.rs b/src/payment/bolt11.rs index eb79439c0..4c96c485f 100644 --- a/src/payment/bolt11.rs +++ b/src/payment/bolt11.rs @@ -836,8 +836,10 @@ impl Bolt11Payment { /// If `route_parameters` are provided they will override the default as well as the /// node-wide parameters configured via [`Config::route_parameters`] on a per-field basis. /// - /// Returns one [`ProbeHandle`] per probe path. Use [`ProbeHandle::payment_id`] (and/or - /// [`ProbeHandle::payment_hash`]) to match [`crate::Event::ProbeSuccessful`] / + /// Returns one [`ProbeHandle`] per probe that LDK actually sends. LDK may skip route + /// paths before dispatch, for example if the path is too short to probe or would breach + /// [`Config::probing_liquidity_limit_multiplier`]. Use [`ProbeHandle::payment_id`] + /// (and/or [`ProbeHandle::payment_hash`]) to match [`crate::Event::ProbeSuccessful`] / /// [`crate::Event::ProbeFailed`]. These values are **not** the invoice payment hash. pub fn send_probes( &self, invoice: &Bolt11Invoice, route_parameters: Option, diff --git a/src/payment/spontaneous.rs b/src/payment/spontaneous.rs index 251d57970..a1a5f7438 100644 --- a/src/payment/spontaneous.rs +++ b/src/payment/spontaneous.rs @@ -195,7 +195,7 @@ impl SpontaneousPayment { /// See [`Bolt11Payment::send_probes`] for semantics and how returned [`ProbeHandle`] values /// correlate with [`crate::Event::ProbeSuccessful`] / [`crate::Event::ProbeFailed`]. /// - /// [`Bolt11Payment::send_probes`]: crate::payment::Bolt11Payment + /// [`Bolt11Payment::send_probes`]: crate::payment::Bolt11Payment::send_probes pub fn send_probes( &self, amount_msat: u64, node_id: PublicKey, ) -> Result, Error> {