Skip to content

Commit 8aa8a96

Browse files
authored
Merge pull request #124 from TheBlueMatt/main
Update to 0.0.113
2 parents 300b54d + fe11b81 commit 8aa8a96

File tree

1,141 files changed

+115812
-33696
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,141 files changed

+115812
-33696
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ jobs:
3939
# Note this is a different endpoint, as we need one non-upstream commit!
4040
git clone https://git.bitcoin.ninja/rust-lightning
4141
cd rust-lightning
42-
git checkout origin/2022-10-112-java-bindings
42+
git checkout origin/2022-12-0.0.113-java-bindings
4343
cd ..
4444
git clone https://github.com/lightningdevkit/ldk-c-bindings
4545
cd ldk-c-bindings
46-
git checkout 0.0.112
46+
git checkout 0.0.113
4747
- name: Rebuild C bindings without STD
4848
run: |
4949
cd ldk-c-bindings
50+
git config --global safe.directory "*"
5051
./genbindings.sh ../rust-lightning false
5152
- name: Build and Test TS Debug Bindings for Node
5253
run: |
@@ -66,7 +67,7 @@ jobs:
6667
export HOME=/root/ # Github actions is apparently broken
6768
export PATH=$(pwd)/$(echo node-*/bin):$PATH
6869
# npx playwright install-deps is broken so we do it manually, see https://github.com/microsoft/playwright/issues/11165
69-
apt-get install -y --no-install-recommends fonts-liberation libenchant-2-2 libicu71 libjpeg62-turbo libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1 xvfb fonts-noto-color-emoji fonts-unifont libfontconfig libfreetype6 xfonts-scalable fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf ffmpeg libcairo-gobject2 libdbus-glib-1-2 libfontconfig1 libgdk-pixbuf2.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libxcb-shm0 libxcursor1 libxi6 libxrender1 libxt6 gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good libepoxy0 libevdev2 libgl1 libgles2 libgstreamer-gl1.0-0 libgstreamer1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libnotify4 libopenjp2-7 libopus0 libpng16-16 libsecret-1-0 libsoup2.4-1 libwayland-client0 libwayland-egl1 libwayland-server0 libwebp7 libwebpdemux2 libwoff1 libxkbcommon0 libxml2 libxslt1.1
70+
apt-get install -y --no-install-recommends fonts-liberation libenchant-2-2 libicu72 libjpeg62-turbo libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1 xvfb fonts-noto-color-emoji fonts-unifont libfontconfig libfreetype6 xfonts-scalable fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf ffmpeg libcairo-gobject2 libdbus-glib-1-2 libfontconfig1 libgdk-pixbuf2.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libxcb-shm0 libxcursor1 libxi6 libxrender1 libxt6 gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good libepoxy0 libevdev2 libgl1 libgles2 libgstreamer-gl1.0-0 libgstreamer1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libnotify4 libopenjp2-7 libopus0 libpng16-16 libsecret-1-0 libsoup2.4-1 libwayland-client0 libwayland-egl1 libwayland-server0 libwebp7 libwebpdemux2 libwoff1 libxkbcommon0 libxml2 libxslt1.1
7071
mkdir -p $HOME/.cache/ms-playwright # `playwright install` is too dumb to create this for us
7172
chmod -R 777 $HOME/
7273
npm i -D playwright
@@ -75,6 +76,7 @@ jobs:
7576
run: |
7677
export HOME=/root/ # Github actions is apparently broken
7778
export PATH=$(pwd)/$(echo node-*/bin):$PATH
79+
git config --global safe.directory "*"
7880
./genbindings.sh ./ldk-c-bindings/ wasm true true
7981
cd ts
8082
rm liblightningjs.wasm && ln -s $(pwd)/../liblightningjs_debug.wasm ./liblightningjs.wasm
@@ -130,11 +132,11 @@ jobs:
130132
# Note this is a different endpoint, as we need one non-upstream commit!
131133
git clone https://git.bitcoin.ninja/rust-lightning
132134
cd rust-lightning
133-
git checkout origin/2022-10-112-java-bindings
135+
git checkout origin/2022-12-0.0.113-java-bindings
134136
cd ..
135137
git clone https://github.com/lightningdevkit/ldk-c-bindings
136138
cd ldk-c-bindings
137-
git checkout 0.0.112
139+
git checkout 0.0.113
138140
- name: Rebuild C bindings, and check the sample app builds + links
139141
run: |
140142
cd ldk-c-bindings
@@ -185,11 +187,11 @@ jobs:
185187
# Note this is a different endpoint, as we need one non-upstream commit!
186188
git clone https://git.bitcoin.ninja/rust-lightning
187189
cd rust-lightning
188-
git checkout origin/2022-10-112-java-bindings
190+
git checkout origin/2022-12-0.0.113-java-bindings
189191
cd ..
190192
git clone https://github.com/lightningdevkit/ldk-c-bindings
191193
cd ldk-c-bindings
192-
git checkout 0.0.112
194+
git checkout 0.0.113
193195
- name: Rebuild C bindings, and check the sample app builds + links
194196
run: |
195197
cd ldk-c-bindings
@@ -288,11 +290,11 @@ jobs:
288290
# Note this is a different endpoint, as we need one non-upstream commit!
289291
git clone https://git.bitcoin.ninja/rust-lightning
290292
cd rust-lightning
291-
git checkout origin/2022-10-112-java-bindings
293+
git checkout origin/2022-12-0.0.113-java-bindings
292294
cd ..
293295
git clone https://github.com/lightningdevkit/ldk-c-bindings
294296
cd ldk-c-bindings
295-
git checkout 0.0.112
297+
git checkout 0.0.113
296298
- name: Checkout Android AAR binaries and artifacts
297299
run: |
298300
# Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
@@ -345,20 +347,20 @@ jobs:
345347
steps:
346348
- name: Install other Rust platforms
347349
run: rustup target install aarch64-apple-darwin
350+
- name: Checkout source code
351+
uses: actions/checkout@v2
352+
with:
353+
fetch-depth: 0
348354
- name: Fetch upstream LLVM/clang snapshot
349355
run: |
350-
wget -O clang+llvm-14.0.5-x86_64-apple-darwin.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.5/clang+llvm-14.0.5-x86_64-apple-darwin.tar.xz
351-
if [ "$(shasum -a 256 clang+llvm-14.0.5-x86_64-apple-darwin.tar.xz | awk '{ print $1 }')" != "66cf1b8e00289a567b2f5f740f068b7682e27ccf048647b836d3624376a64705" ]; then
356+
wget -O clang+llvm-15.0.3-x86_64-apple-darwin.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.3/clang+llvm-15.0.3-x86_64-apple-darwin.tar.xz
357+
if [ "$(shasum -a 256 clang+llvm-15.0.3-x86_64-apple-darwin.tar.xz | awk '{ print $1 }')" != "ac668586b2b3d068f1e43520a3ef0b1592e5dc3eff1a4a4b772e29803b428a69" ]; then
352358
echo "Bad hash"
353359
exit 1
354360
fi
355361
- name: Unpack upstream LLVM+clang and use it by default
356362
run: |
357-
tar xvvf clang+llvm-14.0.5-x86_64-apple-darwin.tar.xz
358-
- name: Checkout source code
359-
uses: actions/checkout@v2
360-
with:
361-
fetch-depth: 0
363+
tar xvvf clang+llvm-15.0.3-x86_64-apple-darwin.tar.xz
362364
- name: Install cbindgen
363365
run: cargo install cbindgen
364366
- name: Checkout Rust-Lightning and LDK-C-Bindings git
@@ -368,14 +370,14 @@ jobs:
368370
# Note this is a different endpoint, as we need one non-upstream commit!
369371
git clone https://git.bitcoin.ninja/rust-lightning
370372
cd rust-lightning
371-
git checkout origin/2022-10-112-java-bindings
373+
git checkout origin/2022-12-0.0.113-java-bindings
372374
cd ..
373375
git clone https://github.com/lightningdevkit/ldk-c-bindings
374376
cd ldk-c-bindings
375-
git checkout 0.0.112
377+
git checkout 0.0.113
376378
- name: Rebuild C bindings with upstream clang, and check the sample app builds + links
377379
run: |
378-
export PATH=`pwd`/clang+llvm-14.0.5-x86_64-apple-darwin/bin:$PATH
380+
export PATH=`pwd`/clang+llvm-15.0.3-x86_64-apple-darwin/bin:$PATH
379381
cd ldk-c-bindings
380382
CC=clang ./genbindings.sh ../rust-lightning true
381383
- name: Fetch OpenJDK 18
@@ -414,7 +416,7 @@ jobs:
414416
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
415417
export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
416418
export PATH=$JAVA_HOME/bin:$PATH
417-
export PATH=`pwd`/clang+llvm-14.0.5-x86_64-apple-darwin/bin:$PATH
419+
export PATH=`pwd`/clang+llvm-15.0.3-x86_64-apple-darwin/bin:$PATH
418420
./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
419421
420422
if [ "${{ matrix.platform }}" = "macos-11" ]; then

c_sharp/libcode.version

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
global: CS_LDK_*;
3+
local: *;
4+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* An error when accessing the chain via [`Access`].
3+
*/
4+
public enum AccessError {
5+
/**
6+
* The requested chain is unknown.
7+
*/
8+
LDKAccessError_UnknownChain,
9+
/**
10+
* The requested transaction doesn't exist or hasn't confirmed.
11+
*/
12+
LDKAccessError_UnknownTx,
13+
}} } }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* An enum which can either contain a or not
3+
*/
4+
public enum COption_NoneZ {
5+
/**
6+
* When we're in this state, this COption_NoneZ contains a
7+
*/
8+
LDKCOption_NoneZ_Some,
9+
/**
10+
* When we're in this state, this COption_NoneZ contains nothing
11+
*/
12+
LDKCOption_NoneZ_None,
13+
}} } }
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* An enum representing the status of a channel monitor update persistence.
3+
*/
4+
public enum ChannelMonitorUpdateStatus {
5+
/**
6+
* The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
7+
* have been updated.
8+
*
9+
* This includes performing any `fsync()` calls required to ensure the update is guaranteed to
10+
* be available on restart even if the application crashes.
11+
*/
12+
LDKChannelMonitorUpdateStatus_Completed,
13+
/**
14+
* Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
15+
* our state failed, but is expected to succeed at some point in the future).
16+
*
17+
* Such a failure will \"freeze\" a channel, preventing us from revoking old states or
18+
* submitting new commitment transactions to the counterparty. Once the update(s) which failed
19+
* have been successfully applied, a [`MonitorEvent::Completed`] can be used to restore the
20+
* channel to an operational state.
21+
*
22+
* Note that a given [`ChannelManager`] will *never* re-generate a [`ChannelMonitorUpdate`].
23+
* If you return this error you must ensure that it is written to disk safely before writing
24+
* the latest [`ChannelManager`] state, or you should return [`PermanentFailure`] instead.
25+
*
26+
* Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
27+
* occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
28+
* attempting to claim it on this channel) and those updates must still be persisted.
29+
*
30+
* No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
31+
* until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
32+
* monitor update for the same channel.
33+
*
34+
* For deployments where a copy of ChannelMonitors and other local state are backed up in a
35+
* remote location (with local copies persisted immediately), it is anticipated that all
36+
* updates will return [`InProgress`] until the remote copies could be updated.
37+
*
38+
* [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
39+
* [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
40+
* [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
41+
*/
42+
LDKChannelMonitorUpdateStatus_InProgress,
43+
/**
44+
* Used to indicate no further channel monitor updates will be allowed (likely a disk failure
45+
* or a remote copy of this [`ChannelMonitor`] is no longer reachable and thus not updatable).
46+
*
47+
* When this is returned, [`ChannelManager`] will force-close the channel but *not* broadcast
48+
* our current commitment transaction. This avoids a dangerous case where a local disk failure
49+
* (e.g. the Linux-default remounting of the disk as read-only) causes [`PermanentFailure`]s
50+
* for all monitor updates. If we were to broadcast our latest commitment transaction and then
51+
* restart, we could end up reading a previous [`ChannelMonitor`] and [`ChannelManager`],
52+
* revoking our now-broadcasted state before seeing it confirm and losing all our funds.
53+
*
54+
* Note that this is somewhat of a tradeoff - if the disk is really gone and we may have lost
55+
* the data permanently, we really should broadcast immediately. If the data can be recovered
56+
* with manual intervention, we'd rather close the channel, rejecting future updates to it,
57+
* and broadcast the latest state only if we have HTLCs to claim which are timing out (which
58+
* we do as long as blocks are connected).
59+
*
60+
* In order to broadcast the latest local commitment transaction, you'll need to call
61+
* [`ChannelMonitor::get_latest_holder_commitment_txn`] and broadcast the resulting
62+
* transactions once you've safely ensured no further channel updates can be generated by your
63+
* [`ChannelManager`].
64+
*
65+
* Note that at least one final [`ChannelMonitorUpdate`] may still be provided, which must
66+
* still be processed by a running [`ChannelMonitor`]. This final update will mark the
67+
* [`ChannelMonitor`] as finalized, ensuring no further updates (e.g. revocation of the latest
68+
* commitment transaction) are allowed.
69+
*
70+
* Note that even if you return a [`PermanentFailure`] due to unavailability of secondary
71+
* [`ChannelMonitor`] copies, you should still make an attempt to store the update where
72+
* possible to ensure you can claim HTLC outputs on the latest commitment transaction
73+
* broadcasted later.
74+
*
75+
* In case of distributed watchtowers deployment, the new version must be written to disk, as
76+
* state may have been stored but rejected due to a block forcing a commitment broadcast. This
77+
* storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
78+
* lagging behind on block processing.
79+
*
80+
* [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
81+
* [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
82+
*/
83+
LDKChannelMonitorUpdateStatus_PermanentFailure,
84+
}} } }
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* An enum that represents the speed at which we want a transaction to confirm used for feerate
3+
* estimation.
4+
*/
5+
public enum ConfirmationTarget {
6+
/**
7+
* We are happy with this transaction confirming slowly when feerate drops some.
8+
*/
9+
LDKConfirmationTarget_Background,
10+
/**
11+
* We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
12+
*/
13+
LDKConfirmationTarget_Normal,
14+
/**
15+
* We'd like this transaction to confirm in the next few blocks.
16+
*/
17+
LDKConfirmationTarget_HighPriority,
18+
}} } }
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* Errors that may occur when constructing a new `RawInvoice` or `Invoice`
3+
*/
4+
public enum CreationError {
5+
/**
6+
* The supplied description string was longer than 639 __bytes__ (see [`Description::new(...)`](./struct.Description.html#method.new))
7+
*/
8+
LDKCreationError_DescriptionTooLong,
9+
/**
10+
* The specified route has too many hops and can't be encoded
11+
*/
12+
LDKCreationError_RouteTooLong,
13+
/**
14+
* The Unix timestamp of the supplied date is less than zero or greater than 35-bits
15+
*/
16+
LDKCreationError_TimestampOutOfBounds,
17+
/**
18+
* The supplied millisatoshi amount was greater than the total bitcoin supply.
19+
*/
20+
LDKCreationError_InvalidAmount,
21+
/**
22+
* Route hints were required for this invoice and were missing. Applies to
23+
* [phantom invoices].
24+
*
25+
* [phantom invoices]: crate::utils::create_phantom_invoice
26+
*/
27+
LDKCreationError_MissingRouteHints,
28+
}} } }
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* Enum representing the crypto currencies (or networks) supported by this library
3+
*/
4+
public enum Currency {
5+
/**
6+
* Bitcoin mainnet
7+
*/
8+
LDKCurrency_Bitcoin,
9+
/**
10+
* Bitcoin testnet
11+
*/
12+
LDKCurrency_BitcoinTestnet,
13+
/**
14+
* Bitcoin regtest
15+
*/
16+
LDKCurrency_Regtest,
17+
/**
18+
* Bitcoin simnet
19+
*/
20+
LDKCurrency_Simnet,
21+
/**
22+
* Bitcoin signet
23+
*/
24+
LDKCurrency_Signet,
25+
}} } }
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* Describes the type of HTLC claim as determined by analyzing the witness.
3+
*/
4+
public enum HTLCClaim {
5+
/**
6+
* Claims an offered output on a commitment transaction through the timeout path.
7+
*/
8+
LDKHTLCClaim_OfferedTimeout,
9+
/**
10+
* Claims an offered output on a commitment transaction through the success path.
11+
*/
12+
LDKHTLCClaim_OfferedPreimage,
13+
/**
14+
* Claims an accepted output on a commitment transaction through the timeout path.
15+
*/
16+
LDKHTLCClaim_AcceptedTimeout,
17+
/**
18+
* Claims an accepted output on a commitment transaction through the success path.
19+
*/
20+
LDKHTLCClaim_AcceptedPreimage,
21+
/**
22+
* Claims an offered/accepted output on a commitment transaction through the revocation path.
23+
*/
24+
LDKHTLCClaim_Revocation,
25+
}} } }
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace org { namespace ldk { namespace enums {/**
2+
* Represents an IO Error. Note that some information is lost in the conversion from Rust.
3+
*/
4+
public enum IOError {
5+
LDKIOError_NotFound,
6+
LDKIOError_PermissionDenied,
7+
LDKIOError_ConnectionRefused,
8+
LDKIOError_ConnectionReset,
9+
LDKIOError_ConnectionAborted,
10+
LDKIOError_NotConnected,
11+
LDKIOError_AddrInUse,
12+
LDKIOError_AddrNotAvailable,
13+
LDKIOError_BrokenPipe,
14+
LDKIOError_AlreadyExists,
15+
LDKIOError_WouldBlock,
16+
LDKIOError_InvalidInput,
17+
LDKIOError_InvalidData,
18+
LDKIOError_TimedOut,
19+
LDKIOError_WriteZero,
20+
LDKIOError_Interrupted,
21+
LDKIOError_Other,
22+
LDKIOError_UnexpectedEof,
23+
}} } }

0 commit comments

Comments
 (0)