feat: add configurable route hints to BOLT11 receive APIs - #2
Conversation
2a5154f to
62fd214
Compare
62fd214 to
ffce1d0
Compare
kaloudis
left a comment
There was a problem hiding this comment.
Reviewed the branch at e70a3c6. The core mechanics check out: claimability parameters (payment secret registration, MIN_FINAL_CLTV_EXPIRY_DELTA, currency, MPP feature, signature recovery) match what ChannelManager expects per the pinned rust-lightning, cargo check passes with and without --all-features, and uniffi bindgen generates valid Python/Kotlin/Swift bindings including the None variant.
Five inline comments below. Minor notes not worth separate threads:
- The PR description is stale: it still says unusable channels are skipped, but e70a3c6 made them fail fast.
- Custom-hint validation runs after
create_inbound_payment*. No state leaks (inbound payments are stateless), but validating the hints first is the cleaner fail-fast order and skips pointless key derivation on the error path. sha256::Hash::from_slice(&payment_hash.0)on a fixed[u8; 32]can never fail —sha256::Hash::from_byte_array(payment_hash.0)removes the dead error branch.- The
*_for_hashreceive variants got no route-hints counterpart even thoughreceive_innernow supports the combination — worth deciding whether that asymmetry is intentional before this API ships.
|
Three items before merge:
|
1416591 to
206155e
Compare
Pulls in ZeusLN/ldk-node#3: DualStore push-safety gate (prevents a fresh local store from overwriting an existing VSS backup) and restore-mode VSS error propagation (a failed VSS fetch now fails the build instead of silently producing a fresh node with no channels). Also includes the additive BOLT11 route-hints receive APIs from ZeusLN/ldk-node#2; the uniffi interface change is purely additive and the uniffi version is unchanged, so the vendored bindings remain compatible without regeneration.
Pulls in ZeusLN/ldk-node#3: DualStore push-safety gate (prevents a fresh local store from overwriting an existing VSS backup) and restore-mode VSS error propagation (a failed VSS fetch now fails the build instead of silently producing a fresh node with no channels). Also includes the additive BOLT11 route-hints receive APIs from ZeusLN/ldk-node#2; the uniffi interface change is purely additive and the uniffi version is unchanged, so the vendored bindings remain compatible without regeneration.
Pulls in ZeusLN/ldk-node#3: DualStore push-safety gate (prevents a fresh local store from overwriting an existing VSS backup) and restore-mode VSS error propagation (a failed VSS fetch now fails the build instead of silently producing a fresh node with no channels). Also includes the additive BOLT11 route-hints receive APIs from ZeusLN/ldk-node#2; the uniffi interface change is purely additive and the uniffi version is unchanged, so the vendored bindings remain compatible without regeneration.
Pulls in ZeusLN/ldk-node#3: DualStore push-safety gate (prevents a fresh local store from overwriting an existing VSS backup) and restore-mode VSS error propagation (a failed VSS fetch now fails the build instead of silently producing a fresh node with no channels). Also includes the additive BOLT11 route-hints receive APIs from ZeusLN/ldk-node#2; the uniffi interface change is purely additive and the uniffi version is unchanged, so the vendored bindings remain compatible without regeneration.
Summary
RouteHints(None/Automatic/Custom { user_channel_ids }) for BOLT11 invoice creation (replaces the earlierRouteHintsMode+ optional IDs shape)receive_with_route_hints,receive_variable_amount_with_route_hints, and the matching*_for_hash_with_route_hintsvariants (Rust + UniFFI)receive*APIs stay onAutomaticChannelManager::create_bolt11_invoiceviaroute_hints_override(pinned ZeusLN/rust-lightning)Customtakes up to 3UserChannelIds and builds hints from ready channels that have an inbound SCID and forwarding info. Invalid or unusable channel IDs fail immediately withInvalidChannelId(they are not skipped).