Commit graph

6763 commits

Author SHA1 Message Date
Matt Corallo
5f404b9d0a Give Futures for a FutureState an idx and track StdWaker idxn
When an `std::future::Future` is `poll()`ed, we're only supposed to
use the latest `Waker` provided. However, we currently push an
`StdWaker` onto our callback list every time `poll` is called,
waking every `Waker` but also using more and more memory until the
`Future` itself is woken.

Here we take a step towards fixing this by giving each `Future` a
unique index and storing which `Future` an `StdWaker` came from in
the callback list. This sets us up to deduplicate `StdWaker`s by
`Future`s in the next commit.
2024-02-15 21:52:06 +00:00
Matt Corallo
2c987209f9 Split lists of Waker and directly-registered Future callbacks
In the next commit we'll fix a memory leak due to keeping too many
`std::task::Waker` callbacks in `FutureState` from redundant `poll`
calls, but first we need to split handling of `StdWaker`-based
future wake callbacks from normal ones, which we do here.
2024-02-15 21:52:06 +00:00
Matt Corallo
73da722d18
Merge pull request #2861 from tnull/2024-01-introduce-cargo-audit
Introduce CI workflow running `cargo audit`
2024-02-13 21:35:51 +00:00
Matt Corallo
f98a652f11
Merge pull request #2816 from wpaulino/retryable-holder-sigs
Allow holder commitment and HTLC signature requests to fail
2024-02-13 21:22:55 +00:00
Elias Rohrer
0995de7fa8
Merge pull request #2892 from TheBlueMatt/2024-02-destination-eq
Add further standard derives to various onion message structs
2024-02-13 09:21:04 +01:00
Elias Rohrer
fd705c7919
Introduce CI workflow running cargo audit
In order to continuously monitor our dependencies for security
vulnerabilities, we introduce a new CI job that will use `cargo audit`
to check for any known vulnerabilities.

This job is run on a daily schedule. For each new advisory, a new issue
will be created.
2024-02-13 09:16:57 +01:00
Matt Corallo
6f02025246 Add further standard derives to various onion message structs 2024-02-12 23:54:14 +00:00
Elias Rohrer
0c2a715c01
Merge pull request #2888 from TheBlueMatt/2024-02-destination-eq
Implement `Debug`/`PartialEq`/`Eq` for `Destination`
2024-02-12 13:29:15 +01: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
a386ba5314
Disable lightning-transaction-sync integration tests on Windows
.. as the `electrsd` crate doesn't support it.

While we previously did so in our CI script, we now also `cfg`-gate the
tests and dependencies for easier handling.
2024-02-12 10:42:07 +01:00
Matt Corallo
71c0d56415 Implement Debug/PartialEq/Eq for Destination 2024-02-10 02:27:59 +00:00
Matt Corallo
d70124cec4
Merge pull request #2850 from TheBlueMatt/2024-01-fuzz-gossip 2024-02-09 00:49:33 +00:00
Matt Corallo
81cc0d3d6c
Merge pull request #2886 from TheBlueMatt/2024-02-actually-fix-build
Fix silent merge conflict introduced in d3ddf15 @TheBlueMatt
2024-02-09 00:08:28 +00:00
Matt Corallo
ee34bcf2d6 Replace spaces with tabs in msgs.rs 2024-02-08 23:05:08 +00:00
Matt Corallo
5faca20934 Fix silent merge conflict introduced in d3ddf15357 2024-02-08 23:05:08 +00:00
Matt Corallo
aaacaf45e3
Merge pull request #2885 from benthecarman/tiny-opt
Worlds smallest optimization
2024-02-08 22:55:53 +00:00
benthecarman
0769b22f5c
Worlds smallest optimization
Preallocate for 8 items in the vec. I chose this value for

1. features
2. description
3. payment hash
4. expire time
5. min_final_cltv
6. payment secret
7. route hint
8. for the memes
2024-02-08 22:40:48 +00:00
Matt Corallo
c93b59e13d
Merge pull request #2871 from dunxen/2024-02-msgcommonfields
Combine common fields for OpenChannel and AcceptChannel V1 & V2
2024-02-08 21:50:27 +00:00
Wilmer Paulino
e38dccaef4
Allow holder commitment and HTLC signature requests to fail
As part of the ongoing async signer work, our holder signatures must
also be capable of being obtained asynchronously. We expose a new
`ChannelMonitor::signer_unblocked` method to retry pending onchain
claims by re-signing and rebroadcasting transactions. Unfortunately, we
cannot retry said claims without them being registered first, so if
we're not able to obtain the signature synchronously, we must return the
transaction as unsigned and ensure it is not broadcast.
2024-02-07 15:44:23 -08:00
Wilmer Paulino
043ab75bb4
Introduce FeerateStrategy enum for onchain claims
This refactors the existing `force_feerate_bump` flag into an enum as we
plan to introduce a new flag/enum variant in a future commit.
2024-02-07 15:42:28 -08:00
Wilmer Paulino
71b4bd0811
Rework get_latest_holder_commitment_txn to broadcast for users
This method is meant to be used as a last resort when a user is forced
to broadcast the current state, even if it is stale, in an attempt to
claim their funds in the channel. Previously, we'd return the commitment
and HTLC transactions such that they broadcast them themselves. Doing so
required a different code path, one which was not tested, to obtain
these transactions than our usual path when force closing. It's not
worth maintaining both, and it's much simpler for us to broadcast
instead.
2024-02-07 15:42:26 -08:00
Matt Corallo
e0323ec049
Merge pull request #2856 from valentinewallace/2024-01-blinded-payinfo-min-final-cltv
Route blinding: add `min_final_cltv_delta` to aggregated CLTV delta
2024-02-07 22:12:59 +00:00
Valentine Wallace
fff1aa7cb0
Add min_final_cltv_delta to aggregated CLTV delta.
The spec was previously missing this requirement.
2024-02-07 12:02:26 -05:00
Valentine Wallace
fa44185ba8
Parameterize BlindedPath::new_for_payment by min final CLTV delta.
Currently we are not including this value in the aggregated CLTV delta, which
is wrong.
2024-02-07 12:02:24 -05:00
Matt Corallo
7aa06d25f2 [fuzz] Add fst coverage for ChannelManager::update_channel_config 2024-02-07 02:32:52 +00:00
Matt Corallo
e63fc65ce0 [fuzz] Add a second full_stack_target seed test for gossip 2024-02-07 02:32:52 +00:00
Matt Corallo
207fbb0296 [fuzz] De-dup hex in test_no_existing_test_breakage
This will make test_no_existing_test_breakage marginally easier to
update.
2024-02-07 02:32:52 +00:00
Matt Corallo
a4cacee4b1 [fuzz] Add additional method calls in full_stack_target
The whole point of full_stack_target is to just expose our entire
API to the fuzzer and see what happens. Sadly, we're really only
exposing a small subset of our API. This improves that by exposing
a handful of other assorted methods from ChannelManager and
PeerManager.
2024-02-07 02:32:52 +00:00
Matt Corallo
a17df4f8eb [fuzz] Use batch funding in full_stack_target
To potentially get more test coverage
2024-02-07 02:32:52 +00:00
Matt Corallo
a9d73c2889
Merge pull request #2873 from tnull/2024-02-expose-channel-details-in-bte
Expose `channel_id` / `counterparty_node_id` in `BumpTransaction` event
2024-02-07 00:57:01 +00:00
Matt Corallo
36429e8245
Merge pull request #2878 from TheBlueMatt/2024-02-fix-build
Small comment tweaks
2024-02-07 00:28:50 +00:00
Elias Rohrer
5b5c87464a
Expose channel_id / counterparty_node_id in BumpTransaction event
A client node might choose not to handle `Event::BumptTransaction`
events and leave bumping / Anchor output spending to a trusted
counterparty.

However, `Event::BumptTransaction` currently doesn't offer any clear
indication what channel and/or counterparty it is referring to. In order
to allow filtering these events, we here expose the `channel_id` and
`counterparty_node_id` fields.
2024-02-06 21:02:33 +01:00
Matt Corallo
d1c2e143fe Note when new HTLC state can be None 2024-02-06 18:53:56 +00:00
Matt Corallo
8296515871 Fix comment spelling 2024-02-06 18:53:04 +00:00
Matt Corallo
4a7ba675d4
Merge pull request #2442 from wvanlint/list_pending_htlcs
Include pending HTLC's in ChannelDetails
2024-02-06 18:45:36 +00:00
Elias Rohrer
a0917e50e8
Merge pull request #2876 from TheBlueMatt/2024-02-2863-doc-nits
Minor doc nits on the new coop close reason variants
2024-02-06 11:44:32 +01:00
Willem Van Lint
67e788eaa7 Include pending HTLCs in ChannelDetails
This exposes details around pending HTLCs in ChannelDetails.  The state
of the HTLC in the state machine is also included, so it can be
determined which protocol message the HTLC is waiting for to advance.
2024-02-05 17:35:54 -08:00
Matt Corallo
a3c4fe97df [fuzz] Fix misc warnings in full_stack_target 2024-02-05 23:54:06 +00:00
Matt Corallo
d1bb0cba07 [fuzz] Reduce size of payments_sent in full_stack_target
Slightly reducing the amount of data we read to do things.
2024-02-05 23:54:06 +00:00
Matt Corallo
e64342afab
Merge pull request #2810 from TheBlueMatt/2023-12-arbitrary-fuzz-config
Update `full_stack_target` to take an arbitrary config object
2024-02-05 23:53:06 +00:00
Matt Corallo
e594021052
Merge pull request #2847 from TheBlueMatt/2024-01-bindings-upstream
Misc Tweaks for bindings
2024-02-05 23:49:19 +00:00
Matt Corallo
bad2efb73c Minor doc nits on the new coop close reason variants 2024-02-05 23:47:36 +00:00
Matt Corallo
8d9d099bf8
Merge pull request #2725 from shaavan/issue2096
Ensure successful message propagation in case of disconnection mid-handshake
2024-02-05 23:44:36 +00:00
Matt Corallo
f70c113fd8
Merge pull request #2863 from benthecarman/breakup-coop-close
Breakup CooperativeClosure into Local/Remote initiated
2024-02-05 23:43:26 +00:00
Matt Corallo
ce2907f226
Merge pull request #2872 from tnull/2024-02-add-features-to-channel-pending
Expose `channel_type` in `Event::ChannelPending`
2024-02-05 19:58:51 +00:00
Elias Rohrer
2e61d92044
Expose channel_type in Event::ChannelPending
It is useful to immediately know what kind of channel is being opened,
and not having to wait until `ChannelReady`.
2024-02-05 14:32:33 +01:00
benthecarman
efcb5d9d0f
Rename old CooperativeClosure to LegacyCooperativeClosure 2024-02-04 16:33:28 +00:00
benthecarman
58f7942e11
Breakup CooperativeClosure into Local/Remote initiated 2024-02-04 16:33:27 +00:00
Matt Corallo
7377cc99c7 [fuzz] Fix slice copy in peer_crypt_target
This has apparently been broken for quite some time...I guess
`peer_crypt_target` doesn't get much CPU anymore.
2024-02-02 18:05:09 +00:00