Skip to content

Commit 7811d21

Browse files
authored
Merge pull request #139 from TheBlueMatt/main
LDK 0.0.117
2 parents 3e33cfd + c1d2857 commit 7811d21

File tree

1,259 files changed

+307438
-212238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,259 files changed

+307438
-212238
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ jobs:
3838
git config --global user.email "[email protected]"
3939
git config --global user.name "LDK CI"
4040
# Note this is a different endpoint, as we need one non-upstream commit!
41-
git clone https://git.bitcoin.ninja/rust-lightning
41+
git clone https://github.com/lightningdevkit/rust-lightning
4242
cd rust-lightning
43-
git checkout origin/2023-07-0.0.116-java-bindings
43+
git checkout origin/0.0.117-bindings
4444
cd ..
4545
git clone https://github.com/lightningdevkit/ldk-c-bindings
4646
cd ldk-c-bindings
47-
git checkout 0.0.116
47+
git checkout 0.0.117
48+
cd lightning-c-bindings
49+
cargo update -p memchr --precise "2.5.0" --verbose
4850
- name: Rebuild C bindings without STD
4951
run: |
5052
cd ldk-c-bindings
@@ -132,13 +134,15 @@ jobs:
132134
git config --global user.email "[email protected]"
133135
git config --global user.name "LDK CI"
134136
# Note this is a different endpoint, as we need one non-upstream commit!
135-
git clone https://git.bitcoin.ninja/rust-lightning
137+
git clone https://github.com/lightningdevkit/rust-lightning
136138
cd rust-lightning
137-
git checkout origin/2023-07-0.0.116-java-bindings
139+
git checkout origin/0.0.117-bindings
138140
cd ..
139141
git clone https://github.com/lightningdevkit/ldk-c-bindings
140142
cd ldk-c-bindings
141-
git checkout 0.0.116
143+
git checkout 0.0.117
144+
cd lightning-c-bindings
145+
cargo update -p memchr --precise "2.5.0" --verbose
142146
- name: Pin proc-macro and quote to meet MSRV
143147
run: |
144148
cd ldk-c-bindings/c-bindings-gen
@@ -193,13 +197,15 @@ jobs:
193197
git config --global user.email "[email protected]"
194198
git config --global user.name "LDK CI"
195199
# Note this is a different endpoint, as we need one non-upstream commit!
196-
git clone https://git.bitcoin.ninja/rust-lightning
200+
git clone https://github.com/lightningdevkit/rust-lightning
197201
cd rust-lightning
198-
git checkout origin/2023-07-0.0.116-java-bindings
202+
git checkout origin/0.0.117-bindings
199203
cd ..
200204
git clone https://github.com/lightningdevkit/ldk-c-bindings
201205
cd ldk-c-bindings
202-
git checkout 0.0.116
206+
git checkout 0.0.117
207+
cd lightning-c-bindings
208+
cargo update -p memchr --precise "2.5.0" --verbose
203209
- name: Pin proc-macro and quote to meet MSRV
204210
run: |
205211
cd ldk-c-bindings/c-bindings-gen
@@ -308,13 +314,13 @@ jobs:
308314
git config --global user.email "[email protected]"
309315
git config --global user.name "LDK CI"
310316
# Note this is a different endpoint, as we need one non-upstream commit!
311-
git clone https://git.bitcoin.ninja/rust-lightning
317+
git clone https://github.com/lightningdevkit/rust-lightning
312318
cd rust-lightning
313-
git checkout origin/2023-07-0.0.116-java-bindings
319+
git checkout origin/0.0.117-bindings
314320
cd ..
315321
git clone https://github.com/lightningdevkit/ldk-c-bindings
316322
cd ldk-c-bindings
317-
git checkout 0.0.116
323+
git checkout 0.0.117
318324
- name: Fetch MacOS SDK
319325
run: |
320326
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
@@ -445,13 +451,15 @@ jobs:
445451
git config --global user.email "[email protected]"
446452
git config --global user.name "LDK CI"
447453
# Note this is a different endpoint, as we need one non-upstream commit!
448-
git clone https://git.bitcoin.ninja/rust-lightning
454+
git clone https://github.com/lightningdevkit/rust-lightning
449455
cd rust-lightning
450-
git checkout origin/2023-07-0.0.116-java-bindings
456+
git checkout origin/0.0.117-bindings
451457
cd ..
452458
git clone https://github.com/lightningdevkit/ldk-c-bindings
453459
cd ldk-c-bindings
454-
git checkout 0.0.116
460+
git checkout 0.0.117
461+
cd lightning-c-bindings
462+
cargo update -p memchr --precise "2.5.0" --verbose
455463
- name: Checkout Android AAR binaries and artifacts
456464
run: |
457465
# Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
@@ -518,13 +526,15 @@ jobs:
518526
git config --global user.email "[email protected]"
519527
git config --global user.name "LDK CI"
520528
# Note this is a different endpoint, as we need one non-upstream commit!
521-
git clone https://git.bitcoin.ninja/rust-lightning
529+
git clone https://github.com/rghtningdevkit/ust-lightning
522530
cd rust-lightning
523-
git checkout origin/2023-07-0.0.116-java-bindings
531+
git checkout origin/0.0.117-bindings
524532
cd ..
525533
git clone https://github.com/lightningdevkit/ldk-c-bindings
526534
cd ldk-c-bindings
527-
git checkout 0.0.116
535+
git checkout 0.0.117
536+
cd lightning-c-bindings
537+
cargo update -p memchr --precise "2.5.0" --verbose
528538
- name: Rebuild C bindings and check the sample app builds + links
529539
run: |
530540
cd ldk-c-bindings

README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,13 @@ Status
4141

4242
## Java
4343

44-
While the underlying library and C bindings are relatively mature, the Java bindings should be
45-
considered beta quality and some issues may still appear. Specifically, because the Java bindings
46-
map between two very different memory models - Rust's strict ownership model and Java's reference
47-
cloning and garbage collection - a lot of work occurs in the background to keep the Java GC
48-
informed of Rust ownership semantics.
49-
50-
The debug-mode build includes memory leak tracking and will print all loose objects when the
51-
program exists, though without calls to `System.gc(); System.runFinalization();` immediately before
52-
exit there will likely be many false positives. While it will require some complicated usage, there
53-
are likely some use-after-free or unkonwn-free bugs remaining. The debug-mode build links LLVM
54-
address sanitizer and will print diagnostic information in case of such issues.
44+
The Java bindings are relatively mature, and should be considered safe for production use. Still,
45+
as they have relatively few users, unexpected issues remain possible, and bug reports are welcome.
5546

5647
## TypeScript
5748

58-
The TypeScript bindings are functionally complete, but should be considered early alpha quality.
59-
Some functions may error spuriously due to oversights or missing implementations.
49+
The TypeScript bindings are functionally complete, but should be considered beta quality. As there
50+
are relatively few users, unexpected issues remain likely, and bug reports are welcome.
6051

6152
The TypeScript bindings require modern web standards, including support for `FinalizationRegistry`
6253
and `WeakRef` (Chrome 84, Firefox 79, Safari 14.1/iOS 14.5 and Node 14.6) and WASM BigInt support
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
namespace org { namespace ldk { namespace enums {/**
2-
* Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
3-
* requirements sections in BOLT #11
2+
* Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
3+
* the requirements sections in BOLT #11
44
*/
5-
public enum SemanticError {
5+
public enum Bolt11SemanticError {
66
/**
77
* The invoice is missing the mandatory payment hash
88
*/
9-
LDKSemanticError_NoPaymentHash,
9+
LDKBolt11SemanticError_NoPaymentHash,
1010
/**
1111
* The invoice has multiple payment hashes which isn't allowed
1212
*/
13-
LDKSemanticError_MultiplePaymentHashes,
13+
LDKBolt11SemanticError_MultiplePaymentHashes,
1414
/**
1515
* No description or description hash are part of the invoice
1616
*/
17-
LDKSemanticError_NoDescription,
17+
LDKBolt11SemanticError_NoDescription,
1818
/**
1919
* The invoice contains multiple descriptions and/or description hashes which isn't allowed
2020
*/
21-
LDKSemanticError_MultipleDescriptions,
21+
LDKBolt11SemanticError_MultipleDescriptions,
2222
/**
2323
* The invoice is missing the mandatory payment secret, which all modern lightning nodes
2424
* should provide.
2525
*/
26-
LDKSemanticError_NoPaymentSecret,
26+
LDKBolt11SemanticError_NoPaymentSecret,
2727
/**
2828
* The invoice contains multiple payment secrets
2929
*/
30-
LDKSemanticError_MultiplePaymentSecrets,
30+
LDKBolt11SemanticError_MultiplePaymentSecrets,
3131
/**
3232
* The invoice's features are invalid
3333
*/
34-
LDKSemanticError_InvalidFeatures,
34+
LDKBolt11SemanticError_InvalidFeatures,
3535
/**
3636
* The recovery id doesn't fit the signature/pub key
3737
*/
38-
LDKSemanticError_InvalidRecoveryId,
38+
LDKBolt11SemanticError_InvalidRecoveryId,
3939
/**
4040
* The invoice's signature is invalid
4141
*/
42-
LDKSemanticError_InvalidSignature,
42+
LDKBolt11SemanticError_InvalidSignature,
4343
/**
4444
* The invoice's amount was not a whole number of millisatoshis
4545
*/
46-
LDKSemanticError_ImpreciseAmount,
46+
LDKBolt11SemanticError_ImpreciseAmount,
4747
}} } }
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* Error when interpreting a TLV stream as a specific type.
3+
*/
4+
public enum Bolt12SemanticError {
5+
/**
6+
* The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
7+
*/
8+
LDKBolt12SemanticError_AlreadyExpired,
9+
/**
10+
* The provided chain hash does not correspond to a supported chain.
11+
*/
12+
LDKBolt12SemanticError_UnsupportedChain,
13+
/**
14+
* A chain was provided but was not expected.
15+
*/
16+
LDKBolt12SemanticError_UnexpectedChain,
17+
/**
18+
* An amount was expected but was missing.
19+
*/
20+
LDKBolt12SemanticError_MissingAmount,
21+
/**
22+
* The amount exceeded the total bitcoin supply.
23+
*/
24+
LDKBolt12SemanticError_InvalidAmount,
25+
/**
26+
* An amount was provided but was not sufficient in value.
27+
*/
28+
LDKBolt12SemanticError_InsufficientAmount,
29+
/**
30+
* An amount was provided but was not expected.
31+
*/
32+
LDKBolt12SemanticError_UnexpectedAmount,
33+
/**
34+
* A currency was provided that is not supported.
35+
*/
36+
LDKBolt12SemanticError_UnsupportedCurrency,
37+
/**
38+
* A feature was required but is unknown.
39+
*/
40+
LDKBolt12SemanticError_UnknownRequiredFeatures,
41+
/**
42+
* Features were provided but were not expected.
43+
*/
44+
LDKBolt12SemanticError_UnexpectedFeatures,
45+
/**
46+
* A required description was not provided.
47+
*/
48+
LDKBolt12SemanticError_MissingDescription,
49+
/**
50+
* A signing pubkey was not provided.
51+
*/
52+
LDKBolt12SemanticError_MissingSigningPubkey,
53+
/**
54+
* A signing pubkey was provided but a different one was expected.
55+
*/
56+
LDKBolt12SemanticError_InvalidSigningPubkey,
57+
/**
58+
* A signing pubkey was provided but was not expected.
59+
*/
60+
LDKBolt12SemanticError_UnexpectedSigningPubkey,
61+
/**
62+
* A quantity was expected but was missing.
63+
*/
64+
LDKBolt12SemanticError_MissingQuantity,
65+
/**
66+
* An unsupported quantity was provided.
67+
*/
68+
LDKBolt12SemanticError_InvalidQuantity,
69+
/**
70+
* A quantity or quantity bounds was provided but was not expected.
71+
*/
72+
LDKBolt12SemanticError_UnexpectedQuantity,
73+
/**
74+
* Metadata could not be used to verify the offers message.
75+
*/
76+
LDKBolt12SemanticError_InvalidMetadata,
77+
/**
78+
* Metadata was provided but was not expected.
79+
*/
80+
LDKBolt12SemanticError_UnexpectedMetadata,
81+
/**
82+
* Payer metadata was expected but was missing.
83+
*/
84+
LDKBolt12SemanticError_MissingPayerMetadata,
85+
/**
86+
* A payer id was expected but was missing.
87+
*/
88+
LDKBolt12SemanticError_MissingPayerId,
89+
/**
90+
* Blinded paths were expected but were missing.
91+
*/
92+
LDKBolt12SemanticError_MissingPaths,
93+
/**
94+
* The blinded payinfo given does not match the number of blinded path hops.
95+
*/
96+
LDKBolt12SemanticError_InvalidPayInfo,
97+
/**
98+
* An invoice creation time was expected but was missing.
99+
*/
100+
LDKBolt12SemanticError_MissingCreationTime,
101+
/**
102+
* An invoice payment hash was expected but was missing.
103+
*/
104+
LDKBolt12SemanticError_MissingPaymentHash,
105+
/**
106+
* A signature was expected but was missing.
107+
*/
108+
LDKBolt12SemanticError_MissingSignature,
109+
}} } }
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* Further information on the details of the channel shutdown.
3+
* Upon channels being forced closed (i.e. commitment transaction confirmation detected
4+
* by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
5+
* the channel will be removed shortly.
6+
* Also note, that in normal operation, peers could disconnect at any of these states
7+
* and require peer re-connection before making progress onto other states
8+
*/
9+
public enum ChannelShutdownState {
10+
/**
11+
* Channel has not sent or received a shutdown message.
12+
*/
13+
LDKChannelShutdownState_NotShuttingDown,
14+
/**
15+
* Local node has sent a shutdown message for this channel.
16+
*/
17+
LDKChannelShutdownState_ShutdownInitiated,
18+
/**
19+
* Shutdown message exchanges have concluded and the channels are in the midst of
20+
* resolving all existing open HTLCs before closing can continue.
21+
*/
22+
LDKChannelShutdownState_ResolvingHTLCs,
23+
/**
24+
* All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
25+
*/
26+
LDKChannelShutdownState_NegotiatingClosingFee,
27+
/**
28+
* We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
29+
* to drop the channel.
30+
*/
31+
LDKChannelShutdownState_ShutdownComplete,
32+
}} } }
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
namespace org { namespace ldk { namespace enums {/**
2-
* An enum that represents the speed at which we want a transaction to confirm used for feerate
2+
* An enum that represents the priority at which we want a transaction to confirm used for feerate
33
* estimation.
44
*/
55
public enum ConfirmationTarget {
66
/**
7-
* We are happy with this transaction confirming slowly when feerate drops some.
7+
* We'd like a transaction to confirm in the future, but don't want to commit most of the fees
8+
* required to do so yet. The remaining fees will come via a Child-Pays-For-Parent (CPFP) fee
9+
* bump of the transaction.
10+
*
11+
* The feerate returned should be the absolute minimum feerate required to enter most node
12+
* mempools across the network. Note that if you are not able to obtain this feerate estimate,
13+
* you should likely use the furthest-out estimate allowed by your fee estimator.
14+
*/
15+
LDKConfirmationTarget_MempoolMinimum,
16+
/**
17+
* We are happy with a transaction confirming slowly, at least within a day or so worth of
18+
* blocks.
819
*/
920
LDKConfirmationTarget_Background,
1021
/**
11-
* We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
22+
* We'd like a transaction to confirm without major delayed, i.e., within the next 12-24 blocks.
1223
*/
1324
LDKConfirmationTarget_Normal,
1425
/**
15-
* We'd like this transaction to confirm in the next few blocks.
26+
* We'd like a transaction to confirm in the next few blocks.
1627
*/
1728
LDKConfirmationTarget_HighPriority,
1829
}} } }

c_sharp/src/org/ldk/enums/CreationError.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
namespace org { namespace ldk { namespace enums {/**
2-
* Errors that may occur when constructing a new `RawInvoice` or `Invoice`
2+
* Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
33
*/
44
public enum CreationError {
55
/**
6-
* The supplied description string was longer than 639 __bytes__ (see [`Description::new(...)`](./struct.Description.html#method.new))
6+
* The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
77
*/
88
LDKCreationError_DescriptionTooLong,
99
/**
@@ -25,4 +25,10 @@ public enum CreationError {
2525
* [phantom invoices]: crate::utils::create_phantom_invoice
2626
*/
2727
LDKCreationError_MissingRouteHints,
28+
/**
29+
* The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
30+
*
31+
* [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
32+
*/
33+
LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
2834
}} } }

0 commit comments

Comments
 (0)