Skip to content

Commit 01d69f9

Browse files
authored
Merge pull request #177 from TheBlueMatt/0.1
[0.1] Update to LDK 0.1.8
2 parents 4411b11 + 75b0e22 commit 01d69f9

File tree

8 files changed

+101
-20
lines changed

8 files changed

+101
-20
lines changed

.github/workflows/build.yml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,20 @@ jobs:
4141
git clone https://github.com/lightningdevkit/rust-lightning
4242
cd rust-lightning
4343
git checkout origin/0.1-bindings
44+
cargo update -p syn --precise "2.0.106" --verbose
45+
cargo update -p quote --precise "1.0.41" --verbose
4446
cd ..
4547
git clone https://github.com/lightningdevkit/ldk-c-bindings
4648
cd ldk-c-bindings
4749
git checkout 0.1
50+
cd lightning-c-bindings
51+
cargo update -p syn --precise "2.0.106" --verbose
52+
cargo update -p quote --precise "1.0.41" --verbose
53+
- name: Pin proc-macro and quote to meet MSRV
54+
run: |
55+
cd ldk-c-bindings/c-bindings-gen
56+
cargo update -p quote --precise "1.0.30" --verbose
57+
cargo update -p proc-macro2 --precise "1.0.65" --verbose
4858
- name: Rebuild C bindings without STD
4959
run: |
5060
cd ldk-c-bindings
@@ -137,10 +147,20 @@ jobs:
137147
git clone https://github.com/lightningdevkit/rust-lightning
138148
cd rust-lightning
139149
git checkout origin/0.1-bindings
150+
cargo update -p syn --precise "2.0.106" --verbose
151+
cargo update -p quote --precise "1.0.41" --verbose
140152
cd ..
141153
git clone https://github.com/lightningdevkit/ldk-c-bindings
142154
cd ldk-c-bindings
143155
git checkout 0.1
156+
cd lightning-c-bindings
157+
cargo update -p syn --precise "2.0.106" --verbose
158+
cargo update -p quote --precise "1.0.41" --verbose
159+
- name: Pin proc-macro and quote to meet MSRV
160+
run: |
161+
cd ldk-c-bindings/c-bindings-gen
162+
cargo update -p quote --precise "1.0.30" --verbose
163+
cargo update -p proc-macro2 --precise "1.0.65" --verbose
144164
- name: Rebuild C bindings with STD
145165
run: |
146166
cd ldk-c-bindings
@@ -182,10 +202,15 @@ jobs:
182202
git clone https://github.com/lightningdevkit/rust-lightning
183203
cd rust-lightning
184204
git checkout origin/0.1-bindings
205+
cargo update -p syn --precise "2.0.106" --verbose
206+
cargo update -p quote --precise "1.0.41" --verbose
185207
cd ..
186208
git clone https://github.com/lightningdevkit/ldk-c-bindings
187209
cd ldk-c-bindings
188210
git checkout 0.1
211+
cd lightning-c-bindings
212+
cargo update -p syn --precise "2.0.106" --verbose
213+
cargo update -p quote --precise "1.0.41" --verbose
189214
- name: Fetch MacOS SDK
190215
run: |
191216
curl -o Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz
@@ -233,7 +258,10 @@ jobs:
233258
cd ldk-c-bindings
234259
git clean -f -x -d
235260
git reset --hard
236-
cd ..
261+
cd lightning-c-bindings
262+
cargo update -p syn --precise "2.0.106" --verbose
263+
cargo update -p quote --precise "1.0.41" --verbose
264+
cd ../..
237265
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
238266
export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64"
239267
export PATH="$PATH:$ANDROID_TOOLCHAIN/bin"
@@ -363,10 +391,15 @@ jobs:
363391
git clone https://github.com/lightningdevkit/rust-lightning
364392
cd rust-lightning
365393
git checkout origin/0.1-bindings
394+
cargo update -p syn --precise "2.0.106" --verbose
395+
cargo update -p quote --precise "1.0.41" --verbose
366396
cd ..
367397
git clone https://github.com/lightningdevkit/ldk-c-bindings
368398
cd ldk-c-bindings
369399
git checkout 0.1
400+
cd lightning-c-bindings
401+
cargo update -p syn --precise "2.0.106" --verbose
402+
cargo update -p quote --precise "1.0.41" --verbose
370403
- name: Pin proc-macro and quote to meet MSRV
371404
run: |
372405
cd ldk-c-bindings/c-bindings-gen
@@ -424,10 +457,15 @@ jobs:
424457
git clone https://github.com/lightningdevkit/rust-lightning
425458
cd rust-lightning
426459
git checkout origin/0.1-bindings
460+
cargo update -p syn --precise "2.0.106" --verbose
461+
cargo update -p quote --precise "1.0.41" --verbose
427462
cd ..
428463
git clone https://github.com/lightningdevkit/ldk-c-bindings
429464
cd ldk-c-bindings
430465
git checkout 0.1
466+
cd lightning-c-bindings
467+
cargo update -p syn --precise "2.0.106" --verbose
468+
cargo update -p quote --precise "1.0.41" --verbose
431469
- name: Pin proc-macro and quote to meet MSRV
432470
run: |
433471
cd ldk-c-bindings/c-bindings-gen
@@ -551,10 +589,20 @@ jobs:
551589
git clone https://github.com/lightningdevkit/rust-lightning
552590
cd rust-lightning
553591
git checkout origin/0.1-bindings
592+
cargo update -p syn --precise "2.0.106" --verbose
593+
cargo update -p quote --precise "1.0.41" --verbose
554594
cd ..
555595
git clone https://github.com/lightningdevkit/ldk-c-bindings
556596
cd ldk-c-bindings
557597
git checkout 0.1
598+
cd lightning-c-bindings
599+
cargo update -p syn --precise "2.0.106" --verbose
600+
cargo update -p quote --precise "1.0.41" --verbose
601+
- name: Pin proc-macro and quote to meet MSRV
602+
run: |
603+
cd ldk-c-bindings/c-bindings-gen
604+
cargo update -p quote --precise "1.0.30" --verbose
605+
cargo update -p proc-macro2 --precise "1.0.65" --verbose
558606
- name: Fetch MacOS SDK
559607
run: |
560608
curl -o Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz
@@ -683,10 +731,15 @@ jobs:
683731
git clone https://github.com/lightningdevkit/rust-lightning
684732
cd rust-lightning
685733
git checkout origin/0.1-bindings
734+
cargo update -p syn --precise "2.0.106" --verbose
735+
cargo update -p quote --precise "1.0.41" --verbose
686736
cd ..
687737
git clone https://github.com/lightningdevkit/ldk-c-bindings
688738
cd ldk-c-bindings
689739
git checkout 0.1
740+
cd lightning-c-bindings
741+
cargo update -p syn --precise "2.0.106" --verbose
742+
cargo update -p quote --precise "1.0.41" --verbose
690743
- name: Checkout Android AAR binaries and artifacts
691744
run: |
692745
# Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:

c_sharp/src/org/ldk/structs/ChannelManager.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ namespace org { namespace ldk { namespace structs {
723723
* [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future
724724
* [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync
725725
* [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync
726-
* [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor
726+
* [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor
727727
* [`list_channels`]: Self::list_channels
728728
* [`list_usable_channels`]: Self::list_usable_channels
729729
* [`create_channel`]: Self::create_channel
@@ -1014,7 +1014,7 @@ public org.ldk.structs.Result_NoneAPIErrorZ close_channel(org.ldk.structs.Channe
10141014
*
10151015
* The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
10161016
* Will fail if a shutdown script has already been set for this channel by
1017-
* ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
1017+
* [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
10181018
* also be compatible with our and the counterparty's features.
10191019
*
10201020
* May generate a [`SendShutdown`] message event on success, which should be relayed.
@@ -1026,6 +1026,7 @@ public org.ldk.structs.Result_NoneAPIErrorZ close_channel(org.ldk.structs.Channe
10261026
*
10271027
* [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
10281028
* [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
1029+
* [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]: crate::util::config::ChannelHandshakeConfig::commit_upfront_shutdown_pubkey
10291030
* [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
10301031
*
10311032
* Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
@@ -2011,7 +2012,7 @@ public org.ldk.structs.Result_Bolt12InvoiceBolt12SemanticErrorZ request_refund_p
20112012

20122013
/**
20132014
* Pays for an [`Offer`] looked up using [BIP 353] Human Readable Names resolved by the DNS
2014-
* resolver(s) at `dns_resolvers` which resolve names according to bLIP 32.
2015+
* resolver(s) at `dns_resolvers` which resolve names according to [bLIP 32].
20152016
*
20162017
* If the wallet supports paying on-chain schemes, you should instead use
20172018
* [`OMNameResolver::resolve_name`] and [`OMNameResolver::handle_dnssec_proof_for_uri`] (by
@@ -2029,27 +2030,33 @@ public org.ldk.structs.Result_Bolt12InvoiceBolt12SemanticErrorZ request_refund_p
20292030
*
20302031
* To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
20312032
* invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
2032-
* payment will fail with an [`Event::InvoiceRequestFailed`].
2033+
* payment will fail with an [`PaymentFailureReason::UserAbandoned`] or
2034+
* [`PaymentFailureReason::InvoiceRequestExpired`], respectively.
20332035
*
20342036
* # Privacy
20352037
*
20362038
* For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
2037-
* to construct a [`BlindedPath`] for the reply path. For further privacy implications, see the
2039+
* to construct a [`BlindedMessagePath`] for the reply path. For further privacy implications, see the
20382040
* docs of the parameterized [`Router`], which implements [`MessageRouter`].
20392041
*
20402042
* # Limitations
20412043
*
20422044
* Requires a direct connection to the given [`Destination`] as well as an introduction node in
2043-
* [`Offer::paths`] or to [`Offer::signing_pubkey`], if empty. A similar restriction applies to
2045+
* [`Offer::paths`] or to [`Offer::issuer_signing_pubkey`], if empty. A similar restriction applies to
20442046
* the responding [`Bolt12Invoice::payment_paths`].
20452047
*
20462048
* # Errors
20472049
*
20482050
* Errors if:
20492051
* - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
20502052
*
2053+
* [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
2054+
* [bLIP 32]: https://github.com/lightning/blips/blob/master/blip-0032.md
20512055
* [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
20522056
* [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
2057+
* [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
2058+
* [`PaymentFailureReason::UserAbandoned`]: crate::events::PaymentFailureReason::UserAbandoned
2059+
* [`PaymentFailureReason::InvoiceRequestRejected`]: crate::events::PaymentFailureReason::InvoiceRequestRejected
20532060
*/
20542061
public org.ldk.structs.Result_NoneNoneZ pay_for_offer_from_human_readable_name(org.ldk.structs.HumanReadableName name, long amount_msats, byte[] payment_id, org.ldk.structs.Retry retry_strategy, org.ldk.structs.Option_u64Z max_total_routing_fee_msat, Destination[] dns_resolvers) {
20552062
long ret = bindings.ChannelManager_pay_for_offer_from_human_readable_name(this.ptr, name.ptr, amount_msats, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), retry_strategy.ptr, max_total_routing_fee_msat.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(dns_resolvers, dns_resolvers_conv_13 => dns_resolvers_conv_13.ptr)));

c_sharp/src/org/ldk/structs/PeerManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ public org.ldk.structs.Result_boolPeerHandleErrorZ read_event(org.ldk.structs.So
233233
* [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
234234
* [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
235235
* [`send_data`]: SocketDescriptor::send_data
236+
* [`lightning-net-tokio`]: https://docs.rs/lightning-net-tokio/latest/lightning_net_tokio
237+
* [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor
236238
*/
237239
public void process_events() {
238240
bindings.PeerManager_process_events(this.ptr);

src/main/java/org/ldk/structs/ChannelManager.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@
725725
* [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future
726726
* [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync
727727
* [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync
728-
* [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor
728+
* [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor
729729
* [`list_channels`]: Self::list_channels
730730
* [`list_usable_channels`]: Self::list_usable_channels
731731
* [`create_channel`]: Self::create_channel
@@ -1011,7 +1011,7 @@ public Result_NoneAPIErrorZ close_channel(org.ldk.structs.ChannelId channel_id,
10111011
*
10121012
* The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
10131013
* Will fail if a shutdown script has already been set for this channel by
1014-
* ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
1014+
* [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
10151015
* also be compatible with our and the counterparty's features.
10161016
*
10171017
* May generate a [`SendShutdown`] message event on success, which should be relayed.
@@ -1023,6 +1023,7 @@ public Result_NoneAPIErrorZ close_channel(org.ldk.structs.ChannelId channel_id,
10231023
*
10241024
* [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
10251025
* [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
1026+
* [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]: crate::util::config::ChannelHandshakeConfig::commit_upfront_shutdown_pubkey
10261027
* [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
10271028
*
10281029
* Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
@@ -2006,7 +2007,7 @@ public Result_Bolt12InvoiceBolt12SemanticErrorZ request_refund_payment(org.ldk.s
20062007

20072008
/**
20082009
* Pays for an [`Offer`] looked up using [BIP 353] Human Readable Names resolved by the DNS
2009-
* resolver(s) at `dns_resolvers` which resolve names according to bLIP 32.
2010+
* resolver(s) at `dns_resolvers` which resolve names according to [bLIP 32].
20102011
*
20112012
* If the wallet supports paying on-chain schemes, you should instead use
20122013
* [`OMNameResolver::resolve_name`] and [`OMNameResolver::handle_dnssec_proof_for_uri`] (by
@@ -2024,27 +2025,33 @@ public Result_Bolt12InvoiceBolt12SemanticErrorZ request_refund_payment(org.ldk.s
20242025
*
20252026
* To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
20262027
* invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
2027-
* payment will fail with an [`Event::InvoiceRequestFailed`].
2028+
* payment will fail with an [`PaymentFailureReason::UserAbandoned`] or
2029+
* [`PaymentFailureReason::InvoiceRequestExpired`], respectively.
20282030
*
20292031
* # Privacy
20302032
*
20312033
* For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
2032-
* to construct a [`BlindedPath`] for the reply path. For further privacy implications, see the
2034+
* to construct a [`BlindedMessagePath`] for the reply path. For further privacy implications, see the
20332035
* docs of the parameterized [`Router`], which implements [`MessageRouter`].
20342036
*
20352037
* # Limitations
20362038
*
20372039
* Requires a direct connection to the given [`Destination`] as well as an introduction node in
2038-
* [`Offer::paths`] or to [`Offer::signing_pubkey`], if empty. A similar restriction applies to
2040+
* [`Offer::paths`] or to [`Offer::issuer_signing_pubkey`], if empty. A similar restriction applies to
20392041
* the responding [`Bolt12Invoice::payment_paths`].
20402042
*
20412043
* # Errors
20422044
*
20432045
* Errors if:
20442046
* - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
20452047
*
2048+
* [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki
2049+
* [bLIP 32]: https://github.com/lightning/blips/blob/master/blip-0032.md
20462050
* [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
20472051
* [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
2052+
* [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
2053+
* [`PaymentFailureReason::UserAbandoned`]: crate::events::PaymentFailureReason::UserAbandoned
2054+
* [`PaymentFailureReason::InvoiceRequestRejected`]: crate::events::PaymentFailureReason::InvoiceRequestRejected
20482055
*/
20492056
public Result_NoneNoneZ pay_for_offer_from_human_readable_name(org.ldk.structs.HumanReadableName name, long amount_msats, byte[] payment_id, org.ldk.structs.Retry retry_strategy, org.ldk.structs.Option_u64Z max_total_routing_fee_msat, Destination[] dns_resolvers) {
20502057
long ret = bindings.ChannelManager_pay_for_offer_from_human_readable_name(this.ptr, name.ptr, amount_msats, InternalUtils.check_arr_len(payment_id, 32), retry_strategy.ptr, max_total_routing_fee_msat.ptr, dns_resolvers != null ? Arrays.stream(dns_resolvers).mapToLong(dns_resolvers_conv_13 -> dns_resolvers_conv_13.ptr).toArray() : null);

src/main/java/org/ldk/structs/Event.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ private DiscardFunding(long ptr, bindings.LDKEvent.DiscardFunding obj) {
14381438
* To accept the request (and in the case of a dual-funded channel, not contribute funds),
14391439
* call [`ChannelManager::accept_inbound_channel`].
14401440
* To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`].
1441-
* Note that a ['ChannelClosed`] event will _not_ be triggered if the channel is rejected.
1441+
* Note that a [`ChannelClosed`] event will _not_ be triggered if the channel is rejected.
14421442
*
14431443
* The event is only triggered when a new open channel request is received and the
14441444
* [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
@@ -1448,6 +1448,7 @@ private DiscardFunding(long ptr, bindings.LDKEvent.DiscardFunding obj) {
14481448
* returning `Err(ReplayEvent ())`) and won't be persisted across restarts.
14491449
*
14501450
* [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1451+
* [`ChannelClosed`]: Event::ChannelClosed
14511452
* [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
14521453
* [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14531454
*/

src/main/java/org/ldk/structs/PeerManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ public Result_boolPeerHandleErrorZ read_event(org.ldk.structs.SocketDescriptor p
237237
* [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
238238
* [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
239239
* [`send_data`]: SocketDescriptor::send_data
240+
* [`lightning-net-tokio`]: https://docs.rs/lightning-net-tokio/latest/lightning_net_tokio
241+
* [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor
240242
*/
241243
public void process_events() {
242244
bindings.PeerManager_process_events(this.ptr);

0 commit comments

Comments
 (0)