Commit Graph

128 Commits

Author SHA1 Message Date
Vincenzo Palazzo
f939d6a5ac
ci: fixing the coverage report
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-11-05 16:03:08 +01:00
Arik Sosman
3d50b1d83b
Skip MSRV on Windows in CI 2024-10-22 13:09:24 -07:00
Arik Sosman
46c2c815bf
Create script file for easy local linting 2024-10-08 14:00:43 -07:00
Duncan Dean
c0d84e85c7
Add an explicit_type TLV syntax for avoiding certain cases of type inference
This new syntax is used to fix "dependency on fallback of ! -> ()".
This avoids cases where code compiles with a fallback of the
never type leading to the unit type. The behaviour in Rust edition 2024
would make this a compile error.

See: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/builtin/static.DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK.html#
2024-10-02 13:08:04 +02:00
Arik Sosman
d340ac3b39
Suppress linter warnings
Allow `map_err` and `dependency_on_unit_never_type_fallback` pending
a future MSRV increase.
2024-09-24 13:40:40 +09: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
Mirebella
0d71a5f9c2 Fix CI linting error 2024-08-28 09:53:51 +02:00
Mirebella
6ff1978eba Add clippy ignore rules for all errors and warnings 2024-08-28 09:47:40 +02: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
f316a3fef9
Upgrade all github actions to v4 variants 2024-08-13 08:50:30 +02:00
Elias Rohrer
a5aef14391
Have shellcheck check all scripts in contrib 2024-08-13 08:50:30 +02:00
Elias Rohrer
e99ff4520e
Have shellcheck check all scripts in ci 2024-08-13 08:50:30 +02:00
Duncan Dean
99aa6e27f6
Use native check-cfg lint in cargo beta
This uses the newly introduced conditional configuration checks that are
now configurable withint Cargo (beta).

This allows us to get rid of our custom python script that checks for
expected features and cfgs.

This does introduce a warning regarding the unknown lint in Cargo
versions prior to the current beta, but since these are not rustc errors,
they won't break any builds with the "-D warnings" RUSTFLAG.

Moving to this lint actually exposed the "strict" feature not being
present in the lightning-invoice crate, as our python script didnt
correctly parse the cfg_attr where it appeared.
2024-07-12 11:48:15 +02:00
Duncan Dean
b1d7829565
Skip incremental-mutants job for main
There is no diff when running against main, so we skip incremental-mutants.
Before this commit, we'd get `Error: Failed to parse diff: Line 1: Error while parsing:`
as the diff file was empty.
2024-07-04 15:48:08 +02:00
Duncan Dean
c42699d1af
Introduce basic incremental mutation testing
We introduce a CI job for mutation testing of PR diffs using cargo-mutants.
Missed cases do not trigger a fail of this job yet as we just introduce it
now for visibility. We may start enforcing stricter rules at a later stage.
2024-06-30 17:25:56 +02:00
Matt Corallo
050e7ebaa3 Use a real (probing-generated) scorer in benchmarks
Until now, our routing benchmarks used a synthetic scorer,
generated by scoring random paths to build up some history. This is
pretty far removed from real-world routing conditions, as
alternative paths generally have no scoring information and even
the paths we do take have only one or two past scoring results.

Instead, we fetch a static serialized scorer, generated using
minutely probes. This means future changes to the scorer's data may
be harder to benchmark, but makes for substantially more realistic
benchmarks for changes which don't impact the serialized state.
2024-06-12 19:35:06 +00:00
Jiri Jakes
a8bd4c097f
Upgrade rust-bitcoin to 0.31 2024-05-30 18:35:29 +08:00
Matt Corallo
d14ea82b5d Move existing BOLT11 fuzz test to the fuzz crate 2024-05-08 19:36:15 +00:00
Matt Corallo
c4a2f1bb21
Merge pull request #2877 from tnull/2024-02-start-rustfmt-journey
`rustfmt`: Add CI scripts and format `onion_utils.rs`
2024-02-22 19:30:17 +00:00
Matt Corallo
3096061bef Drop ahash dependency in favor of core's SipHasher
https://github.com/tkaitchuck/aHash/pull/196 bumped the MSRV of
`ahash` in a patch release, which makes it rather difficult for us
to have it as a dependency.

Further, it seems that `ahash` hasn't been particularly robust in
the past, notably
https://github.com/tkaitchuck/aHash/issues/163 and
https://github.com/tkaitchuck/aHash/issues/166.

Luckily, `core` provides `SipHasher` even on no-std (sadly its
SipHash-2-4 unlike the SipHash-1-3 used by the `DefaultHasher` in
`std`). Thus, we drop the `ahash` dependency entirely here and
simply wrap `SipHasher` for our `no-std` HashMaps.
2024-02-16 20:34:41 +00:00
Elias Rohrer
d5344dc178
Add rustfmt to CI, ignore all files
We add the previously discussed `rustfmt.toml` and enforce it in CI for
any files that are not contained in an exclusion list.

To start, we add all current Rust files to this exclusion list. This
means that formatter rules will be enforced for any newly introduced
files, and we'll then start going through the codebase file-by-file,
removing them from the list as we go.
2024-02-14 09:08:33 +01:00
Matt Corallo
dedc8306f6 Bump hashbrown dependency to 0.13
While this isn't expected to materially improve performance, it
does get us ahash 0.8, which allows us to reduce fuzzing
randomness, making our fuzzers much happier.

Sadly, by default `ahash` no longer tries to autodetect a
randomness source, so we cannot simply rely on `hashbrown` to do
randomization for us, but rather have to also explicitly depend on
`ahash`.
2024-02-02 18:05:08 +00:00
Matt Corallo
76ed917ddc Update fuzz CI job to use our MSRV rather than 1.58 2024-02-02 18:04:51 +00: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
Wilmer Paulino
a1c92820b0
Merge pull request #2782 from TheBlueMatt/2023-12-check-cfg-tags
Add CI test that `#[cfg]` tags are from a defined set
2023-12-11 11:04:18 -08:00
Matt Corallo
75c0e06ce1 Add CI test that #[cfg] tags are from a defined set
Rust is fairly relaxed in checking the validity of arguments
passed to #[cfg]. While it should probably be more strict when
checking features, it cannot be strict when checking loose cfg
tags, because those can be anything and are simply passed to rustc
via unconstrained arguments.

Thus, we do it for rustc manually, but scanning all our source and
checking that all our cfg tags match a known cfg tag.

Fixes #2184
2023-12-08 23:07:14 +00: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
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
b78f93694f Move coverage generation to llvm-cov in the hopes its more stable 2023-09-17 00:56:56 +00:00
Jeffrey Czyz
1227dfc1ee
Use rustc stable for check_commits
Otherwise, the compiler will panic when using 1.57 for upcoming commits.
2023-07-14 15:02:29 -05:00
Elias Rohrer
98bef2aa4b
Update Github Actions to remove deprecated actions 2023-07-06 14:30:31 +02:00
Wilmer Paulino
82b646c548
Remove anchors config flag
Now that all of the core functionality for anchor outputs has landed,
we're ready to remove the config flag that was temporarily hiding it
from our API.
2023-06-23 13:32:08 -07:00
Matt Corallo
1701b02124 Replace std's unmaintained bench with criterion
Rather than using the std benchmark framework (which isn't
maintained and is unlikely to get any further maintenance), we swap
for criterion, which at least gets us a variable number of test
runs so our benchmarks don't take forever.

We also fix the RGS benchmark to pass now that the file in use is
stale compared to today's date.
2023-05-11 06:11:49 +00:00
Wilmer Paulino
d63006dcc0
Cancel in-progress jobs on updated push
At times, PRs can go through multiple pushes in a short amount of time,
spawning a workflow run for each. Most of the time, there's no need to
let the previous jobs running if the code itself has changed (e.g., via
a force push), and we'd benefit from having those slots be used by other
PRs/branches instead.
2023-04-17 11:32:53 -07:00
Wilmer Paulino
f471a1b9da
Ignore workflow runs on master branch
This master branch is just an alias to the main branch for legacy
reasons, so there's no need to run workflows on both branches.
2023-04-17 11:30:30 -07:00
Arik Sosman
bc97b82de4
Add Taproot CI test. 2023-04-03 13:17:12 -07:00
Wilmer Paulino
881656ba9e
Test anchors build in CI 2023-03-20 16:46:38 -07:00
Matt Corallo
6558b510cf Replace the bulk of CI with a (much simpler) bash script 2023-03-16 19:15:06 +00:00
Matt Corallo
4e32de71df Remove build-features CI flag now that its always true 2023-03-15 18:18:08 +00:00
Matt Corallo
263173f06c Remove build-no-std CI flag now that its always true 2023-03-15 18:17:02 +00:00
Matt Corallo
fb4f34cb2c Remove build-net-tokio flag in CI since its now always true 2023-03-15 18:16:01 +00:00
Matt Corallo
11a0d266c5 Bump MSRV to 1.48
1.48.0 was released at the end of 2020, nearly 2.5 years ago. It
has been the rustc available on Debian stable since bullseye,
released in 2021. supporting Debian oldstable for more than a year
seems more than sufficient time to give Debian folks to upgrade,
and bullseye is set to become `oldstable` later this year with the
release of `bookworm`, likely this summer.

This also allows us to clean up our MSRV substantially, having a
single MSRV across our crates rather than a number of separate
ones. Sadly, windows already requires 1.49.
2023-03-15 18:11:43 +00:00
Elias Rohrer
73306a3503
Pin tokio to 1.26 on windows to fix CI 2023-03-12 14:12:21 +01:00
Elias Rohrer
7a30f3e118
Support HTTPS Esplora endpoints via new feature
To support HTTPS endpoints, the async HTTP library `reqwest` needs one of
the `-tls` features enabled. While the users could specify this in their
own cargo dependencies, we here provide a new `esplora-async-https`
feature for conveinience.
2023-03-08 19:25:23 +01:00
Matt Corallo
1a18b881bb Do not auto-select the lightning std feature from tx-sync crate
We have some downstream folks who are using LDK in wasm compiled
via the normal rust wasm path. To ensure nothing breaks they want
to use `no-std` on the lightning crate, disabling time calls as
those panic. However, the HTTP logic in
`lightning-transaction-sync` gets automatically stubbed out by the
HTTP client crates when targeting wasm via `wasm_bindgen`, so it
works fine despite the std restrictions.

In order to make both work, `lightning-transaction-sync` can remain
`std`, but needs to not automatically enable the `std` flag on the
`lightning` crate, ie by setting `default-features = false`. We do
so here.
2023-03-03 19:26:14 +00:00
Matt Corallo
22662efbc4 Export RUST_BACKTRACE=1 in --feature backtrace CI test
as this test often fails on windows which is hard to debug locally
for most contributors.
2023-02-28 01:06:35 +00:00
Matt Corallo
64a7567928 Move lightning-transaction-sync out of the main workspace
Because `lightning-transaction-sync` does not have an MSRV (and
because its dev-dependencies are huge), we can't build it by
default when devs run `cargo test`, so it is moved out of the
top-level workspace.
2023-02-27 19:01:29 +00:00
Matt Corallo
0fc5a3ae0f Remove the lightning-transaction-sync MSRV
Apparently it has dependencies that don't track an MSRV at all, so
we can't practically enforce one in CI.
2023-02-27 18:28:40 +00:00
Jeffrey Czyz
9876a08aab
Add CI testing for lightning-custom-message crate 2023-02-14 18:20:56 -06:00