Commit graph

69 commits

Author SHA1 Message Date
Matt Corallo
42cc4e7f4c
Merge pull request #3486 from TheBlueMatt/2024-12-async-sign
Remove the async_signing cfg flag
2024-12-17 19:41:50 +00:00
Matt Corallo
6ad40f996a
Merge pull request #3436 from tnull/2024-12-add-lightning-liquidity-crate
Add `lightning-liquidity` crate to the workspace
2024-12-17 02:02:55 +00:00
Matt Corallo
47ca19d39e Remove the async_signing cfg flag
Now that the core features required for `async_signing` are in
place, we can go ahead and expose it publicly (rather than behind a
a `cfg`-flag). We still don't have full async support for
`get_per_commitment_point`, but only one case in channel
reconnection remains. The overall logic may still have some
hiccups, but its been in use in production at a major LDK user for
some time now. Thus, it doesn't really make sense to hide behind a
`cfg`-flag, even if the feature is only 99% complete. Further, the
new paths exposed are very restricted to signing operations that
run async, so the risk for existing users should be incredibly low.
2024-12-16 00:39:39 +00:00
Arik Sosman
a97e2b88be
Pin rustls on MSRV 2024-12-12 00:32:43 -08:00
Elias Rohrer
b8b807124f
Add lightning-liquidity crate to the workspace
We upstream the `lightning-liquidity` into the `rust-lightning`
workspace.

Files are copied over as per commit c80eb75f5a31bea5c2b73e41c50ca382ec0020f8.
2024-12-11 17:01:03 +01:00
Matt Corallo
1386bef048
Merge pull request #3431 from tnull/2024-11-drop-logging-features
Drop log-limiting features
2024-12-03 17:54:20 +00:00
Elias Rohrer
f6af8e346e
Drop log-limiting features
Previously, LDK offered two ways to limit log outputs:
filtering during runtime client-side by matching on any given `Record`'s `Level` value,
as well as at compile time through the `max_level_*` feature flags.

It turns out the latter approach was always broken when used outside of
the `lightning` crate. Here, we therefore simply drop the feature-based
filtering.
2024-12-03 17:26:49 +01:00
Elias Rohrer
d80d1dd1ff
Fix indexmap pin as 2.7.0 was just released
I heard you like pins, so I pinned you pin so you can pin while you pin.
2024-12-02 16:20:06 +01:00
Duncan Dean
7e23afc9a8
Remove dual_funding cfg attributes
We'll only gate public API related to contributing toward an inbound or opening
a dual funded channel.
2024-11-18 15:18:39 +02:00
Matt Corallo
8e941426cf Add a lightning-dns-resolver crate which answers bLIP 32 queries
When a lightning node wishes to send payments to a BIP 353 human
readable name (using BOLT 12), it first has to resolve that name to
a DNS TXT record. bLIP 32 defines a way to do so over onion
messages, and this completes our implementation thereof by adding
the server side.

It operates by simply accepting new messages and spawning tokio
tasks to do DNS lookups using the `dnsse_prover` crate. It also
contains full end-to-end tests of the BIP 353 -> BOLT 12 -> payment
logic using the new server code to do the resolution.

Note that because we now have a workspace crate which sets the
"lightning/dnssec" feature in its `dev-dependencies`, a naive
`cargo test` will test the "dnssec" feature.
2024-11-12 15:53:35 +00:00
Elias Rohrer
e12ee9d120
Pin indexmap back to account for hashbrown MSRV bump
`indexmap` 2.6.0 upgraded to `hashbrown` 0.15, which unfortunately
bumped their MSRV to rustc 1.65 with the 0.15.1 release. So we pin
`indexmap` to 2.5.0 to fix our MSRV CI.
2024-11-07 14:35:12 +01:00
Elias Rohrer
8a8e0f7c8a
f Move pin to right place 2024-11-04 18:10:20 +01:00
Elias Rohrer
038b2812f9
Pin idna_adapter to fix MSRV 2024-11-04 16:06:41 +01:00
Matt Corallo
81923c7340
Merge pull request #3330 from tnull/2024-09-add-macros-crate
Add `lightning-macros` crate and drop `bdk_macros` dependency
2024-10-17 15:34:18 +00:00
Elias Rohrer
0aed2b9c44
Add lightning-macros crate
Previously, we used the `bdk_macros` dependency for some simple proc
macros in `lightning-transaction-sync`. However, post-1.0 BDK doesn't
further maintain this crate and will at some point probably yank it
together with the old `bdk` crate that was split up.

Here, we create a new crate for utility proc macros and ~~steal~~ add
what we currently use (slightly modified for the latest `syn` version's
API though). In the future we may want to expand this crate, e.g., for
some `maybe_async` macros in the context of an `async KVStore`
implementation.
2024-10-17 16:26:41 +02:00
Matt Corallo
9335c9bbf7 Add the core functionality required to resolve Human Readable Names
This adds a new utility struct, `OMNameResolver`, which implements
the core functionality required to resolve Human Readable Names,
namely generating `DNSSECQuery` onion messages, tracking the state
of requests, and ultimately receiving and verifying `DNSSECProof`
onion messages.

It tracks pending requests with a `PaymentId`, allowing for easy
integration into `ChannelManager` in a coming commit - mapping
received proofs to `PaymentId`s which we can then complete by
handing them `Offer`s to pay.

It does not, directly, implement `DNSResolverMessageHandler`, but
an implementation of `DNSResolverMessageHandler` becomes trivial
with `OMNameResolver` handling the inbound messages and creating
the messages to send.
2024-09-30 18:04:01 +00:00
Elias Rohrer
545b037827
Drop no-std feature
We drop the `lightning/no-std` feature and just take
`hashbrown`,`possiblyrandom` and `libm` as required dependencies.
2024-09-18 09:07:58 +02:00
Elias Rohrer
a06e7b9133
Check workspace members with default features individually in CI
Previously, we would only check the workspace as a whole. This however
would mean that we would check/test crates with `lightning`'s default
features enabled, allowing failures-to-build under the crates own
default features to slip through, if they didn't explicitly enable
`lightning/std`, for example.

Here, we extend the CI to check the workspace as a whole but then run
checks, tests, and doc generation on the workspace members individually,
asserting that all of them build even when not built as part of the same
workspace as `lightning`.
2024-09-18 09:07:58 +02:00
Matt Corallo
868a5956a4 Fix MSRV test of lightning-transaction-sync with esplora-async
`lightning-transaction-sync`'s `esplora-async` dependency
indirectly depends on `tokio-util`, which, like tokio, recently
bumped its MSRV.

Here we update `ci/ci-tests.sh` to pin `tokio-util` to make MSRV
builds pass.
2024-09-08 21:21:35 +00:00
Matt Corallo
feffaf8bbc Return owned Strings for onion message message types
Returning a reference from a trait method is relatively difficult
to map in bindings and is currently handled by storing the object
in the trait instance, returning a reference to the local field.

This is fine when the object we're returning only needs to live as
long as the trait, but when it needs to be `'static` (as is the
case for onion message `msg_type`s), there's not really a good way
to map them at all.

Instead, here, condition on `#[cfg(c_bindings)]` we return a fully
owned `String`. This is obviously relatively less effecient, but
the extra allocation and `memcpy` isn't the end of the world,
especially given it should be released relatively quickly.

Note that this breaks doctests in with `c_bindings`.
2024-08-27 00:05:12 +00:00
Matt Corallo
3fe4ef9640 Drop the _test_vectors feature in favor of a cfg flag
This exists just for tests, so there's no reason for it to be
publicly visible.
2024-08-19 15:09:40 +00:00
Matt Corallo
e212d74298 Somewhat clean up ci-tests.sh and sort by RUSTFLAGS 2024-08-19 15:09:40 +00:00
Matt Corallo
51f5bc881f Drop the no-std feature from lightning-rapid-gossip-sync
Now that we don't have to have everything in our entire ecosystem
use the same `std`/`no-std` feature combinations we should start by
untangling our own features a bit.

This takes another step by removing the `no-std` feature entirely
from the `lightning-rapid-gossip-sync` crate and removing all
feature implications on dependencies from the remaining `std`
feature.
2024-08-19 15:09:40 +00:00
Matt Corallo
31a9cd2d3d Drop the no-std feature from lightning-invoice
Now that we don't have to have everything in our entire ecosystem
use the same `std`/`no-std` feature combinations we should start by
untangling our own features a bit.

This takes another step by removing the `no-std` feature entirely
from the `lightning-invoice` crate and removing all feature
implications on dependencies from the remaining `std` feature.
2024-08-19 15:09:40 +00:00
Matt Corallo
5e37074246 Drop the no-std feature from BP and drop feature implications
Now that we don't have to have everything in our entire ecosystem
use the same `std`/`no-std` feature combinations we should start by
untangling our own features a bit.

This takes the first step by removing the `no-std` feature entirely
from the `lightning-background-processor` crate and removing most
feature implications on dependencies from the remaining `std`
feature.

It also addresses a CI oversight where we were not testing
`lightning-background-processor` without the `std` feature in CI at
all.
2024-08-19 15:09:40 +00:00
Matt Corallo
9ca38c59f4 Ensure we always pass a path for in-workspace dependencies
In order to ensure our crates depend on the workspace copies of
each other in test builds we need to override the crates.io
dependency with a local `path`.

We can do this in one of two ways - either specify the `path` in
the dependency listing in each crate's `Cargo.toml` or use the
workspace `Cargo.toml` to `patch` all dependencies. The first is
tedious while the second lets us have it all in one place. However,
the second option does break `cargo *` in individual crate
directories (forcing the use of `cargo -p crate *` instead) and
makes it rather difficult to depend on local versions of workspace
crates.

Thus, here we drop the `patch.crates-io` from our top-level
`Cargo.toml` entirely.

Still, we do update the `ci/ci-tests.sh` script here to use
`cargo -p crate` instead of switching to each crate's directory as
it allows `cargo` to use a shared `target` and may speed up tests.
2024-08-19 15:09:38 +00:00
Elias Rohrer
43bc78ce3d
Disallow skipping tx-sync tests in CI
Previously, we'd always skip tx-sync tests if the
`BITCOIND_EXE`/`ELECTRS_EXE` environment variables would be unset. While
this is especially fine for local testing, we still want to enforce
tests failing if somehow the `bitcoind`/`electrs` downloading or caching
in CI stops working. Here, we therefore add a `CI_ENV` variable that
indicates we're indeed running in CI, and only skip if it's unset.
2024-08-16 17:41:16 +02:00
Elias Rohrer
4320f483f2
Enable caching for bitcoind/electrs in CI 2024-08-13 15:02:46 +02:00
Elias Rohrer
3e1c9e7059
Drop electrsd autodownload feature for good
... which requires a bunch of unnecessary dev dependencies, e.g., `zip`.

Instead we lean on the `download_bitcoind_electrs.sh` script also for
local testing.
2024-08-13 08:50:29 +02:00
Elias Rohrer
5f15d6f051
Move CI downloading bitcoind/electrsd to dedicated shell script
... allowing it to be sourced locally before running
`lightning-transaction-sync` tests.
2024-08-13 08:50:29 +02:00
Elias Rohrer
3566b98b75
Pin tokio in CI to fix MSRV
The recently released `tokio` 1.39 bumped their MSRV to rustc 1.70.
Here, we pin the `tokio` version to 1.38 for users that require to
maintain our MSRV of rustc 1.63.
2024-08-01 16:20:20 -05:00
Valentine Wallace
5c7af8c6d3
Cfg-gate async payments module and public enum variants. 2024-06-20 14:24:09 -04:00
optout
8c334cb579
Add splicing feature flag (also triggers dual_funding) 2024-04-18 08:40:34 +02:00
Matt Corallo
9571988d21 Avoid new "out of disk space" issues in CI
Our 1.63 build on Ubuntu has been failing for quite some time
because it runs out of disk space trying to build tests in the last
cfg-flag steps. Thus, we add a few new `cargo clean`s here to fix
it.
2024-03-12 15:20:52 +00:00
Duncan Dean
47f7dfe9ee
Test builds with #[cfg(dual_funding)] enabled 2024-02-20 09:15:11 +02:00
Elias Rohrer
7299fe62c3
Drop reqwest pin
.. since a version with fixed MSRV was released by now.
2024-02-12 10:42:10 +01:00
Elias Rohrer
9ac42ed394
Move lightning-transaction-sync to main workspace
.. so it's actually included in the audit.
2024-02-12 10:42:09 +01:00
Elias Rohrer
8471644a2d
Deny warnings in CI
Since we recently got rid of our last build/test/doc warnings, we now
deny warnings via `-D warnings` in CI, enforcing no new ones are
introduced.
2023-12-18 08:53:27 +01:00
Matt Corallo
2aecfa45ba Fix dev MSRV build of lightning-transaction-sync
...due to a transitive dependency of the `bitcoind` crate.
2023-12-15 22:39:57 +00:00
Matt Corallo
a866ba7ee3 cfg-gate async signing logic
We are intending to release without having completed our async
signing logic, which sadly means we need to cfg-gate it to ensure
we restore the previous state of panicking on signer errors, rather
than putting us in a stuck state with no way to recover.

Here we add a new `async_signing` cfg flag and use it to gate all
the new logic from #2558 effectively reverting commits
1da29290e7 through
014a336e59.
2023-12-13 22:58:34 +00:00
Elias Rohrer
f368facac0
Manually download bitcoind/electrs for CI tests
Previously, we used the auto-download feature of the
`electrsd`/`bitcoind` crates. While convenient, they unnecessarily
introduced a lot of dependecies (`zip`, `zstd`, `time`, etc.) to our
test environment which needed pinning for the MSRV of 1.63.

Here, we introduce a new `no_download` config flag to the
`lightning-transaction-sync` crate allowing us to disable this
auto-download feature in CI, where we now opt to download the
corresponding binaries manually. We keep the default-auto-download as a
convenience feature for running tests locally though.
2023-12-08 14:40:15 +01:00
Elias Rohrer
ddf2509227
Bump MSRV to rustc 1.63.0 and edition to 2021
.. which is a reasonable common ground, also supported by Debian stable.
2023-12-08 14:03:45 +01:00
Elias Rohrer
28c14cd884
Add Electrum integration test 2023-11-23 09:30:58 +01:00
Matt Corallo
35eb38df14 Fix CI on rustc 1.50 and below
rustc doesn't allow `--features` with `-p`, so we simply skip the
steps that rely on it.
2023-10-23 19:50:12 +00:00
Matt Corallo
bbb8facbe6 Fix (and test) the c_bindings build flag
Rather than only building with the `c_bindings` flag in certain
crates, we go ahead and test all crates with the flag in CI here.
2023-10-21 14:30:21 +00:00
Matt Corallo
d186c683b9 Reduce disk usage in CI
Recently github appears to have reduced the available free disk
space in actions runs, causing CI to fail with out of space errors.
Here we simply run `cargo clean` a few times in CI to reduce our
disk usage somewhat.
2023-10-14 18:41:34 +00:00
Matt Corallo
e1707baf15 Replace cargo build calls in CI with cargo check
We're not actually using the build output, so there's no reason to
do a build vs just running check.
2023-09-17 00:57:00 +00:00
Matt Corallo
b78f93694f Move coverage generation to llvm-cov in the hopes its more stable 2023-09-17 00:56:56 +00:00
Matt Corallo
a13dd715f2 Correct syn pinning on cargo 1.48
Sadly the pinning introduced in 050f5a9029
was brittle in the face of any further syn updates, and has already
broken.

Here we fix it by looking up the actual version of syn to pin.

Note that this dependency is somewhat nonsense as its actually only
a `criterion` dependency, pulled in even though we haven't set the
bench flag (as we aren't yet using `resolver = 2`).
2023-09-16 16:54:17 +00:00
Matt Corallo
ba12a86393 Pin memchr in our release dependency list due to core2 using it
We're working with rust-bitcoin to remove the `core2` dependency
at https://github.com/rust-bitcoin/rust-bitcoin/pull/2066 but until
that lands and we can upgrade rust-bitcoin we're stuck with it. In
the mean time, we should still pass our MSRV tests.
2023-09-15 17:07:17 +00:00