ldk-java
2 years agoTry new paths for Android NDK library search v0.0.101.2
Matt Corallo [Tue, 28 Sep 2021 01:29:18 +0000 (01:29 +0000)]
Try new paths for Android NDK library search

I'm not sure where these paths came from to begin with, but [1]
seems to indicate they're wrong, so let's try new ones.

[1] https://developer.android.com/ndk/guides/abis#sa

2 years agoDrop accidentally checked-in class file and update .gitignore
Matt Corallo [Tue, 28 Sep 2021 01:24:42 +0000 (01:24 +0000)]
Drop accidentally checked-in class file and update .gitignore

2 years agoUpdate auto-generated bindings
Matt Corallo [Tue, 28 Sep 2021 01:23:02 +0000 (01:23 +0000)]
Update auto-generated bindings

2 years agoSkip object reference adding when cloning within the FFI on to-Rust object passing
Matt Corallo [Tue, 28 Sep 2021 01:19:22 +0000 (01:19 +0000)]
Skip object reference adding when cloning within the FFI on to-Rust object passing

2 years agoCorrect and use ChannelManagerConstructor in HumanObjectPeerTest
Matt Corallo [Mon, 27 Sep 2021 23:31:55 +0000 (23:31 +0000)]
Correct and use ChannelManagerConstructor in HumanObjectPeerTest

When ChannelManagerConstructor support was added, the test loop
bounds were never updated to actually test it. This corrects that
(and a few regressions that snuck in over time).

Memory leaks during tests are now:
    249 allocations remained for 1146062 bytes.

2 years agoExpand HumanObjectPeerTest to cover get_claimable_balances
Matt Corallo [Mon, 27 Sep 2021 00:34:32 +0000 (00:34 +0000)]
Expand HumanObjectPeerTest to cover get_claimable_balances

Memory leaks during tests are unchanged

2 years agoUpdate auto-generated bindings
Matt Corallo [Mon, 27 Sep 2021 00:20:44 +0000 (00:20 +0000)]
Update auto-generated bindings

Memory leaks during tests are now:
    193 allocations remained for 1136846 bytes.

2 years agoUpdate batteries to new Tuple-mapping API
Matt Corallo [Mon, 27 Sep 2021 00:10:49 +0000 (00:10 +0000)]
Update batteries to new Tuple-mapping API

2 years agoUpdate tests to new Tuple mapping API
Matt Corallo [Mon, 27 Sep 2021 00:10:31 +0000 (00:10 +0000)]
Update tests to new Tuple mapping API

2 years agoRedo tuple mapping to be explicit and not generic
Matt Corallo [Mon, 27 Sep 2021 00:05:18 +0000 (00:05 +0000)]
Redo tuple mapping to be explicit and not generic

This was suggested by Galder as more Java-y, but also fixes
a number of memory leaks by avoiding the complexity of
always holding references and letting the common code do
more work.

2 years agoFix exception catch in native library load failure to catch NPE
Matt Corallo [Sun, 26 Sep 2021 17:12:02 +0000 (17:12 +0000)]
Fix exception catch in native library load failure to catch NPE

2 years agoUse current HEAD for version in CI instead of previous commit
Matt Corallo [Sun, 26 Sep 2021 04:55:28 +0000 (04:55 +0000)]
Use current HEAD for version in CI instead of previous commit

2 years agoMove version information out of git into new files
Matt Corallo [Sun, 26 Sep 2021 04:53:04 +0000 (04:53 +0000)]
Move version information out of git into new files

2 years agoMerge pull request #45 from TheBlueMatt/main
Matt Corallo [Sat, 25 Sep 2021 22:48:11 +0000 (22:48 +0000)]
Merge pull request #45 from TheBlueMatt/main

Various fixes + cut 0.0.101

2 years agoUpdate auto-generated bindings to 0.0.101
Matt Corallo [Fri, 24 Sep 2021 03:14:18 +0000 (03:14 +0000)]
Update auto-generated bindings to 0.0.101

2 years agoFix CI failures due to faketime breaking PKI time checks
Matt Corallo [Sat, 25 Sep 2021 05:29:10 +0000 (05:29 +0000)]
Fix CI failures due to faketime breaking PKI time checks

2 years agoUpdate CI branch refernces to 0.0.101
Matt Corallo [Fri, 24 Sep 2021 22:25:28 +0000 (22:25 +0000)]
Update CI branch refernces to 0.0.101

2 years agoSpecify maven plugin versions to avoid inconsistent jars
Matt Corallo [Sat, 25 Sep 2021 06:32:07 +0000 (06:32 +0000)]
Specify maven plugin versions to avoid inconsistent jars

2 years agoExpand test coverage in HumanObjectPeerTest to hit new API features
Matt Corallo [Fri, 24 Sep 2021 19:02:14 +0000 (19:02 +0000)]
Expand test coverage in HumanObjectPeerTest to hit new API features

Leak count is now:
    507 allocations remained for 1163454 bytes.

2 years agoUpdate batteries and tests to latest upstream API
Matt Corallo [Fri, 24 Sep 2021 17:53:23 +0000 (17:53 +0000)]
Update batteries and tests to latest upstream API

With the upstream v0.0.101, memory leaks during tests are now:
    411 allocations remained for 1156930 bytes.

2 years agoDrop reallocarray wrapper, enforcing that we don't need it
Matt Corallo [Fri, 24 Sep 2021 22:01:34 +0000 (22:01 +0000)]
Drop reallocarray wrapper, enforcing that we don't need it

2 years agoSwap java locks to pthread to avoid relying on newer GLIBC versions
Matt Corallo [Fri, 24 Sep 2021 21:59:30 +0000 (21:59 +0000)]
Swap java locks to pthread to avoid relying on newer GLIBC versions

2 years agoAdd a build mode for "release optimizations with leaks checks", handle a jar in CI
Matt Corallo [Fri, 24 Sep 2021 21:41:08 +0000 (21:41 +0000)]
Add a build mode for "release optimizations with leaks checks", handle a jar in CI

2 years agoImplement partial clones when passing complex enums containing traits
Matt Corallo [Fri, 24 Sep 2021 17:44:45 +0000 (17:44 +0000)]
Implement partial clones when passing complex enums containing traits

2 years agoAdd missing clone when passing a complex enum to Java
Matt Corallo [Fri, 24 Sep 2021 17:44:24 +0000 (17:44 +0000)]
Add missing clone when passing a complex enum to Java

2 years agoExpand the criteria for cloning when passing to Rust
Matt Corallo [Fri, 24 Sep 2021 17:36:56 +0000 (17:36 +0000)]
Expand the criteria for cloning when passing to Rust

If a method takes an object by ownership, we always need to clone.

2 years agoRemap non-clonable move-passed optional fn args into Option<&Type>
Matt Corallo [Fri, 24 Sep 2021 02:05:03 +0000 (02:05 +0000)]
Remap non-clonable move-passed optional fn args into Option<&Type>

This may break in the future, so we print a huge warning.

2 years agoFix calling Java/TS methods that return strings
Matt Corallo [Thu, 23 Sep 2021 22:41:47 +0000 (22:41 +0000)]
Fix calling Java/TS methods that return strings

2 years agoFix conflicting overuse of "ret" as a variable name
Matt Corallo [Thu, 23 Sep 2021 22:40:47 +0000 (22:40 +0000)]
Fix conflicting overuse of "ret" as a variable name

2 years agoPrint error information when we fail to load LDK native library
Matt Corallo [Mon, 20 Sep 2021 17:34:42 +0000 (17:34 +0000)]
Print error information when we fail to load LDK native library

2 years agoCorrectly handle reference tracking for array elements, construct multi-dimentional...
Matt Corallo [Sat, 4 Sep 2021 22:07:12 +0000 (22:07 +0000)]
Correctly handle reference tracking for array elements, construct multi-dimentional arrays

2 years agoRename ChannelManagerConstructor.ChannelManagerPersister to EventHandler
Matt Corallo [Sat, 4 Sep 2021 20:39:32 +0000 (20:39 +0000)]
Rename ChannelManagerConstructor.ChannelManagerPersister to EventHandler

ChannelManagerPersister is a bit of a misnomer for the struct which
now handles events as well. Thus, we rename it to focus on the
event-handling function here.

2 years agoDrop dup PeerManager tiemr_tick_occurred calls from NioPeerHandler
Matt Corallo [Sat, 4 Sep 2021 19:46:46 +0000 (19:46 +0000)]
Drop dup PeerManager tiemr_tick_occurred calls from NioPeerHandler

We call PeerManager's timer_tick_occurred in the
lightning-background-processor crate, initialized from the
ChannelManagerConstructor. Prior to the use of the
lightning-background-processor we'd needed to call PeerManager's
timer_tick_occurred from NioPeerHandler, but we never dropped it
after the switch. Thus, every ~30 seconds we'll call
PeerManager::timer_tick_occurred twice in a row, disconnecting all
of our peers.

2 years agoMerge pull request #42 from TheBlueMatt/main
Matt Corallo [Wed, 25 Aug 2021 22:42:56 +0000 (22:42 +0000)]
Merge pull request #42 from TheBlueMatt/main

Cut 0.0.100.2 which should be uploadable to Maven Central

2 years agoBump version to 0.0.100.2
Matt Corallo [Wed, 25 Aug 2021 03:39:51 +0000 (03:39 +0000)]
Bump version to 0.0.100.2

2 years agoSkip javadoc generation on OSX since its broken v0.0.100.2
Matt Corallo [Wed, 25 Aug 2021 06:05:00 +0000 (06:05 +0000)]
Skip javadoc generation on OSX since its broken

2 years agoUpdate pom.xml to comply with Maven Central requirements
Matt Corallo [Wed, 25 Aug 2021 00:23:17 +0000 (00:23 +0000)]
Update pom.xml to comply with Maven Central requirements

2 years agoMerge pull request #40 from TheBlueMatt/main
Matt Corallo [Sun, 22 Aug 2021 04:53:16 +0000 (04:53 +0000)]
Merge pull request #40 from TheBlueMatt/main

v0.0.100.1

2 years agoUpdate autogenerated bindings to new version
Matt Corallo [Fri, 20 Aug 2021 20:38:36 +0000 (20:38 +0000)]
Update autogenerated bindings to new version

2 years agoTest use of IgnoringMessageHandler with ChannelManagerConstructor
Matt Corallo [Wed, 18 Aug 2021 22:45:34 +0000 (22:45 +0000)]
Test use of IgnoringMessageHandler with ChannelManagerConstructor

2 years agoMerge pull request #39 from TheBlueMatt/main
Matt Corallo [Wed, 18 Aug 2021 04:50:17 +0000 (04:50 +0000)]
Merge pull request #39 from TheBlueMatt/main

v0.0.100.0

2 years agoUpdate auto-generated files
Matt Corallo [Tue, 17 Aug 2021 22:31:53 +0000 (22:31 +0000)]
Update auto-generated files

2 years agoSwitch to the 0.0.100 branch on ldk-c-bindings v0.0.100.0
Matt Corallo [Wed, 18 Aug 2021 00:18:27 +0000 (00:18 +0000)]
Switch to the 0.0.100 branch on ldk-c-bindings

2 years agoUpdate tests to latest upstream master
Matt Corallo [Fri, 6 Aug 2021 19:09:10 +0000 (19:09 +0000)]
Update tests to latest upstream master

2 years agoCorrect Rust -> Java method call semantics to avoid double-conversion
Matt Corallo [Tue, 17 Aug 2021 22:18:46 +0000 (22:18 +0000)]
Correct Rust -> Java method call semantics to avoid double-conversion

2 years agoFix cloning trait structs via native clone method
Matt Corallo [Tue, 17 Aug 2021 22:15:55 +0000 (22:15 +0000)]
Fix cloning trait structs via native clone method

When cloning a trait struct, we need to reference the
already-converted-to-struct value, not the original, integer,
value.

2 years agoMerge pull request #33 from TheBlueMatt/main
Matt Corallo [Mon, 9 Aug 2021 15:34:19 +0000 (15:34 +0000)]
Merge pull request #33 from TheBlueMatt/main

Expose supertrait implemetations to the Java API

2 years agoUpdate auto-generated bindings to latest upstream
Matt Corallo [Sat, 7 Aug 2021 22:34:45 +0000 (22:34 +0000)]
Update auto-generated bindings to latest upstream

Note that the inclusion of enum constructor functions fixes #30.

2 years agoDrop fail-fast in CI to run jobs even after another fails v0.0.99.2
Matt Corallo [Mon, 9 Aug 2021 14:34:55 +0000 (14:34 +0000)]
Drop fail-fast in CI to run jobs even after another fails

2 years agoMove release jar comparisons to run before functional tests in CI
Matt Corallo [Mon, 9 Aug 2021 04:58:52 +0000 (04:58 +0000)]
Move release jar comparisons to run before functional tests in CI

2 years agoAutomatically run diffoscope on changed compressed files in CI
Matt Corallo [Sun, 8 Aug 2021 23:24:48 +0000 (23:24 +0000)]
Automatically run diffoscope on changed compressed files in CI

2 years agoUse the 0.0.99 branch of ldk-c-bindings in CI
Matt Corallo [Sat, 7 Aug 2021 22:03:13 +0000 (22:03 +0000)]
Use the 0.0.99 branch of ldk-c-bindings in CI

2 years agoUse explicit paths for function arguments in Java
Matt Corallo [Sat, 7 Aug 2021 22:24:22 +0000 (22:24 +0000)]
Use explicit paths for function arguments in Java

When we have an enum with a variant named the same as a struct we
need to specify a full concrete path when referring to it. The
simplest approach is to just use full concrete paths for all
function arguments, which we do here.

2 years agoAdd an accessor to UInt5 to get the value and correct conversion
Matt Corallo [Sat, 7 Aug 2021 17:57:02 +0000 (17:57 +0000)]
Add an accessor to UInt5 to get the value and correct conversion

2 years agoTest function returning Option::None returns null to Java
Matt Corallo [Fri, 6 Aug 2021 18:52:57 +0000 (18:52 +0000)]
Test function returning Option::None returns null to Java

2 years agoUse new TxOut constructor in tests
Matt Corallo [Fri, 6 Aug 2021 18:48:17 +0000 (18:48 +0000)]
Use new TxOut constructor in tests

2 years agoAdd constructors and expose fields in TxOut
Matt Corallo [Fri, 6 Aug 2021 18:46:48 +0000 (18:46 +0000)]
Add constructors and expose fields in TxOut

Fixes #34.

2 years agoAdd a simple wrapper for `disconnect_by_node_id` in `NioPeerHandler`
Matt Corallo [Fri, 6 Aug 2021 17:40:09 +0000 (17:40 +0000)]
Add a simple wrapper for `disconnect_by_node_id` in `NioPeerHandler`

Fixes #36.

2 years agoAdd docs for and mark nullable complex enum fields
Matt Corallo [Fri, 6 Aug 2021 17:10:51 +0000 (17:10 +0000)]
Add docs for and mark nullable complex enum fields

2 years agoCorrectly handle passing a null to Rust for an array
Matt Corallo [Fri, 6 Aug 2021 17:10:19 +0000 (17:10 +0000)]
Correctly handle passing a null to Rust for an array

2 years agoMark function arguments and return values Nullable if relevant
Matt Corallo [Fri, 6 Aug 2021 17:09:55 +0000 (17:09 +0000)]
Mark function arguments and return values Nullable if relevant

Fixes #35.

2 years agoCorrectly handle null pointers returned from Rust representing None
Matt Corallo [Thu, 5 Aug 2021 03:18:28 +0000 (03:18 +0000)]
Correctly handle null pointers returned from Rust representing None

Fixes the SEGFAULT in #35.

2 years agoUse findbugs for Nullable annotations instead of jetbrains
Matt Corallo [Thu, 5 Aug 2021 03:17:43 +0000 (03:17 +0000)]
Use findbugs for Nullable annotations instead of jetbrains

2 years agoUse a full Sign wrapper again in HumanObjectPeerTest
Matt Corallo [Sun, 18 Jul 2021 02:25:28 +0000 (02:25 +0000)]
Use a full Sign wrapper again in HumanObjectPeerTest

With the new upstream clone API and this, memory leaks during tests are
now:
  418 allocations remained for 1160528 bytes.

2 years agoExpose supertrait implemetations to the Java API
Matt Corallo [Sun, 18 Jul 2021 02:24:52 +0000 (02:24 +0000)]
Expose supertrait implemetations to the Java API

2 years agoSupport new cloned upstream API instead of clone
Matt Corallo [Sun, 18 Jul 2021 02:24:07 +0000 (02:24 +0000)]
Support new cloned upstream API instead of clone

2 years agoFree constructed LDK strings when relevant.
Matt Corallo [Sun, 18 Jul 2021 02:24:24 +0000 (02:24 +0000)]
Free constructed LDK strings when relevant.

With LDK C Bindings v0.0.99.2, this reduces memory leaks during tests from:
  538 allocations remained for 1188720 bytes.
to
  358 allocations remained for 1141342 bytes.

2 years agoDeliver messages in PeerTest more robustly
Matt Corallo [Sun, 18 Jul 2021 02:48:47 +0000 (02:48 +0000)]
Deliver messages in PeerTest more robustly

2 years agoMerge pull request #31 from TheBlueMatt/main
Matt Corallo [Wed, 14 Jul 2021 03:24:57 +0000 (03:24 +0000)]
Merge pull request #31 from TheBlueMatt/main

Build deterministic Android AARs, Test built OSX bins

2 years agoUpdate auto-generated bindings to 0.0.99.1
Matt Corallo [Sun, 11 Jul 2021 19:30:18 +0000 (19:30 +0000)]
Update auto-generated bindings to 0.0.99.1

2 years agoAdd script to build deterministic android aar v0.0.99.1
Matt Corallo [Wed, 14 Jul 2021 00:54:10 +0000 (00:54 +0000)]
Add script to build deterministic android aar

2 years agoEnable macos-11 in CI
Matt Corallo [Wed, 14 Jul 2021 00:02:33 +0000 (00:02 +0000)]
Enable macos-11 in CI

2 years agoDon't explicitly override __cxa_thread_atexit_impl, rely on LLVM to optimize it out
Matt Corallo [Tue, 13 Jul 2021 21:00:31 +0000 (21:00 +0000)]
Don't explicitly override __cxa_thread_atexit_impl, rely on LLVM to optimize it out

2 years agoMerge pull request #29 from TheBlueMatt/main
Matt Corallo [Sat, 10 Jul 2021 02:19:04 +0000 (02:19 +0000)]
Merge pull request #29 from TheBlueMatt/main

Update to LDK 0.0.99

2 years agoUpdate auto-generated bindings to LDK v0.0.99
Matt Corallo [Sat, 10 Jul 2021 00:17:29 +0000 (00:17 +0000)]
Update auto-generated bindings to LDK v0.0.99

2 years agoDrop disconnect_socket blocking in NioPeerHandler for 0.0.99 v0.0.99.0
Matt Corallo [Fri, 9 Jul 2021 16:24:34 +0000 (16:24 +0000)]
Drop disconnect_socket blocking in NioPeerHandler for 0.0.99

0.0.99 no longer requires that we block disconnect_socket and
simplifes our side of the SocketDescriptor interface substantially,
which we implement here.

2 years agoMerge pull request #28 from TheBlueMatt/main
Matt Corallo [Thu, 1 Jul 2021 22:41:22 +0000 (22:41 +0000)]
Merge pull request #28 from TheBlueMatt/main

Provide Better Diagnostics when a Java method called from Rust panics

2 years agoUpdate auto-generated bindings with new error messages and version
Matt Corallo [Thu, 1 Jul 2021 21:25:04 +0000 (21:25 +0000)]
Update auto-generated bindings with new error messages and version

2 years agoTest that channel_manager_bytes is not null when persisting v0.0.98.5
Matt Corallo [Thu, 1 Jul 2021 21:16:08 +0000 (21:16 +0000)]
Test that channel_manager_bytes is not null when persisting

We had an apparently-spurious report that this was the case, though
it doesn't seem to be.

2 years agoSpecify the method which threw an exception when aborting
Matt Corallo [Thu, 1 Jul 2021 21:15:07 +0000 (21:15 +0000)]
Specify the method which threw an exception when aborting

2 years agoMerge pull request #25 from TheBlueMatt/main
Matt Corallo [Thu, 24 Jun 2021 23:23:31 +0000 (23:23 +0000)]
Merge pull request #25 from TheBlueMatt/main

Fix glibc compat tweaks, make jars deterministic

2 years agoBump auto-generated bindings version to 0.0.98.4
Matt Corallo [Wed, 23 Jun 2021 14:58:49 +0000 (14:58 +0000)]
Bump auto-generated bindings version to 0.0.98.4

2 years agoDrop binaries from the repo, they are now at https://git.bitcoin.ninja/index.cgi...
Matt Corallo [Wed, 23 Jun 2021 14:47:18 +0000 (14:47 +0000)]
Drop binaries from the repo, they are now at https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=summary

2 years agoRedo the glibc compatibility issues workaround, see comment for details
Matt Corallo [Thu, 24 Jun 2021 06:16:02 +0000 (06:16 +0000)]
Redo the glibc compatibility issues workaround, see comment for details

2 years agoDeterministically build the jars and check in CI, from a new repo
Matt Corallo [Wed, 23 Jun 2021 14:42:00 +0000 (14:42 +0000)]
Deterministically build the jars and check in CI, from a new repo

2 years agoAdd a utility script to make release jars deterministic
Matt Corallo [Thu, 24 Jun 2021 22:52:18 +0000 (22:52 +0000)]
Add a utility script to make release jars deterministic

2 years agoSet a library suffix for all platforms, useful for android builds
Matt Corallo [Wed, 23 Jun 2021 14:41:29 +0000 (14:41 +0000)]
Set a library suffix for all platforms, useful for android builds

2 years agoMerge pull request #24 from TheBlueMatt/main
Matt Corallo [Wed, 23 Jun 2021 00:42:04 +0000 (00:42 +0000)]
Merge pull request #24 from TheBlueMatt/main

Support glibc 2.17 and make exception failures explicit

2 years agoUpdate auto-generated bindings
Matt Corallo [Wed, 23 Jun 2021 00:19:33 +0000 (00:19 +0000)]
Update auto-generated bindings

2 years agoHandle Java exceptions thrown in calls from C, printing and aborting v0.0.98.3
Matt Corallo [Tue, 22 Jun 2021 21:55:12 +0000 (21:55 +0000)]
Handle Java exceptions thrown in calls from C, printing and aborting

Closes #23.

2 years agoSupport glibc versions prior to 2.18 for linux builds
Matt Corallo [Tue, 22 Jun 2021 21:47:35 +0000 (21:47 +0000)]
Support glibc versions prior to 2.18 for linux builds

2 years agoMerge pull request #22 from TheBlueMatt/main
Matt Corallo [Wed, 16 Jun 2021 19:26:37 +0000 (19:26 +0000)]
Merge pull request #22 from TheBlueMatt/main

Support building on OSX

2 years agoRe-generate auto-generated bindings + add Mac OS generated bindings
Matt Corallo [Tue, 15 Jun 2021 23:18:12 +0000 (23:18 +0000)]
Re-generate auto-generated bindings + add Mac OS generated bindings

2 years agoDrop the liblightningjni link, creating it in CI instead v0.0.98.2
Matt Corallo [Tue, 15 Jun 2021 23:17:53 +0000 (23:17 +0000)]
Drop the liblightningjni link, creating it in CI instead

2 years agoAdd a CI run on OSX
Matt Corallo [Tue, 15 Jun 2021 19:55:19 +0000 (19:55 +0000)]
Add a CI run on OSX

2 years agoBuild a test jar which we can run to test the built jar is runnable
Matt Corallo [Tue, 15 Jun 2021 22:02:19 +0000 (22:02 +0000)]
Build a test jar which we can run to test the built jar is runnable

2 years agoInclude native libraries in jar by shifting folder structure
Matt Corallo [Tue, 15 Jun 2021 21:07:25 +0000 (21:07 +0000)]
Include native libraries in jar by shifting folder structure

2 years agoDrop most instances of Thread.sleep in HumanObjectPeerTest
Matt Corallo [Wed, 16 Jun 2021 01:57:45 +0000 (01:57 +0000)]
Drop most instances of Thread.sleep in HumanObjectPeerTest

2 years agoDo not rely on assertions being enabled in ChannelManagerConstructor
Matt Corallo [Wed, 16 Jun 2021 00:14:30 +0000 (00:14 +0000)]
Do not rely on assertions being enabled in ChannelManagerConstructor

2 years agoUpdate README with notes about OSX addrsan
Matt [Mon, 14 Jun 2021 22:30:43 +0000 (18:30 -0400)]
Update README with notes about OSX addrsan