Skip to content

Commit 3d523ef

Browse files
authored
Merge pull request #180 from TheBlueMatt/0.1
[0.1] Update to LDK 0.1.8
2 parents 4411b11 + fb231a4 commit 3d523ef

File tree

8 files changed

+111
-21
lines changed

8 files changed

+111
-21
lines changed

.github/workflows/build.yml

Lines changed: 64 additions & 2 deletions
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
@@ -172,7 +192,11 @@ jobs:
172192
fetch-depth: 0
173193
- name: Install cbindgen
174194
run: |
175-
cargo install cbindgen
195+
git clone https://github.com/eqrion/cbindgen
196+
cd cbindgen/
197+
git checkout v0.20.0
198+
cargo update -p indexmap --precise "1.6.2" --verbose
199+
cargo install --locked --path .
176200
- name: Checkout Rust-Lightning and LDK-C-Bindings git
177201
run: |
178202
git config --global safe.directory '*'
@@ -182,10 +206,15 @@ jobs:
182206
git clone https://github.com/lightningdevkit/rust-lightning
183207
cd rust-lightning
184208
git checkout origin/0.1-bindings
209+
cargo update -p syn --precise "2.0.106" --verbose
210+
cargo update -p quote --precise "1.0.41" --verbose
185211
cd ..
186212
git clone https://github.com/lightningdevkit/ldk-c-bindings
187213
cd ldk-c-bindings
188214
git checkout 0.1
215+
cd lightning-c-bindings
216+
cargo update -p syn --precise "2.0.106" --verbose
217+
cargo update -p quote --precise "1.0.41" --verbose
189218
- name: Fetch MacOS SDK
190219
run: |
191220
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 +262,10 @@ jobs:
233262
cd ldk-c-bindings
234263
git clean -f -x -d
235264
git reset --hard
236-
cd ..
265+
cd lightning-c-bindings
266+
cargo update -p syn --precise "2.0.106" --verbose
267+
cargo update -p quote --precise "1.0.41" --verbose
268+
cd ../..
237269
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
238270
export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64"
239271
export PATH="$PATH:$ANDROID_TOOLCHAIN/bin"
@@ -363,10 +395,15 @@ jobs:
363395
git clone https://github.com/lightningdevkit/rust-lightning
364396
cd rust-lightning
365397
git checkout origin/0.1-bindings
398+
cargo update -p syn --precise "2.0.106" --verbose
399+
cargo update -p quote --precise "1.0.41" --verbose
366400
cd ..
367401
git clone https://github.com/lightningdevkit/ldk-c-bindings
368402
cd ldk-c-bindings
369403
git checkout 0.1
404+
cd lightning-c-bindings
405+
cargo update -p syn --precise "2.0.106" --verbose
406+
cargo update -p quote --precise "1.0.41" --verbose
370407
- name: Pin proc-macro and quote to meet MSRV
371408
run: |
372409
cd ldk-c-bindings/c-bindings-gen
@@ -424,10 +461,15 @@ jobs:
424461
git clone https://github.com/lightningdevkit/rust-lightning
425462
cd rust-lightning
426463
git checkout origin/0.1-bindings
464+
cargo update -p syn --precise "2.0.106" --verbose
465+
cargo update -p quote --precise "1.0.41" --verbose
427466
cd ..
428467
git clone https://github.com/lightningdevkit/ldk-c-bindings
429468
cd ldk-c-bindings
430469
git checkout 0.1
470+
cd lightning-c-bindings
471+
cargo update -p syn --precise "2.0.106" --verbose
472+
cargo update -p quote --precise "1.0.41" --verbose
431473
- name: Pin proc-macro and quote to meet MSRV
432474
run: |
433475
cd ldk-c-bindings/c-bindings-gen
@@ -551,10 +593,20 @@ jobs:
551593
git clone https://github.com/lightningdevkit/rust-lightning
552594
cd rust-lightning
553595
git checkout origin/0.1-bindings
596+
cargo update -p syn --precise "2.0.106" --verbose
597+
cargo update -p quote --precise "1.0.41" --verbose
554598
cd ..
555599
git clone https://github.com/lightningdevkit/ldk-c-bindings
556600
cd ldk-c-bindings
557601
git checkout 0.1
602+
cd lightning-c-bindings
603+
cargo update -p syn --precise "2.0.106" --verbose
604+
cargo update -p quote --precise "1.0.41" --verbose
605+
- name: Pin proc-macro and quote to meet MSRV
606+
run: |
607+
cd ldk-c-bindings/c-bindings-gen
608+
cargo update -p quote --precise "1.0.30" --verbose
609+
cargo update -p proc-macro2 --precise "1.0.65" --verbose
558610
- name: Fetch MacOS SDK
559611
run: |
560612
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 +735,20 @@ jobs:
683735
git clone https://github.com/lightningdevkit/rust-lightning
684736
cd rust-lightning
685737
git checkout origin/0.1-bindings
738+
cargo update -p syn --precise "2.0.106" --verbose
739+
cargo update -p quote --precise "1.0.41" --verbose
686740
cd ..
687741
git clone https://github.com/lightningdevkit/ldk-c-bindings
688742
cd ldk-c-bindings
689743
git checkout 0.1
744+
cd lightning-c-bindings
745+
cargo update -p syn --precise "2.0.106" --verbose
746+
cargo update -p quote --precise "1.0.41" --verbose
747+
- name: Pin proc-macro and quote to meet MSRV
748+
run: |
749+
cd ldk-c-bindings/c-bindings-gen
750+
cargo update -p quote --precise "1.0.30" --verbose
751+
cargo update -p proc-macro2 --precise "1.0.65" --verbose
690752
- name: Checkout Android AAR binaries and artifacts
691753
run: |
692754
# 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)