Commit graph

5948 commits

Author SHA1 Message Date
Valentine Wallace
02a6d895a5
Receive payment onions as new InboundPayload instead of OnionHopData
To support route blinding, we want to split OnionHopData into two separate
structs, one for inbound onions and one for outbound onions. This is because
blinded payloads change the fields present in the onion hop data struct based
on whether we're sending vs receiving (outbound onions include encrypted blobs,
inbound onions can decrypt those blobs and contain the decrypted fields
themselves).

In upcoming commits, we'll add variants for blinded payloads to the new
InboundPayload enum.
2023-08-02 12:54:34 -07:00
Valentine Wallace
0c37488ff4
Remove outdated documentation of a panic 2023-08-02 12:54:34 -07:00
Valentine Wallace
9473f1cb5f
Remove indentation in payment receive util
This also set us up for supporting receiving blinded onion payloads.
2023-08-02 12:54:31 -07:00
valentinewallace
6f58072585
Merge pull request #2366 from valentinewallace/2023-05-blinded-pathfinding-fuzz
Blinded pathfinding fuzzing
2023-07-31 15:27:47 -07:00
Matt Corallo
0607ed766a
Merge pull request #2460 from TheBlueMatt/2023-07-claimable-clarify
Rename `Balance::claimable_amount_satoshis` to have a unique name
2023-07-31 17:47:33 +00:00
Matt Corallo
3c525ef694
Merge pull request #2463 from TheBlueMatt/2023-07-no-rustdoc-unicode
Drop unicode in documentation
2023-07-31 17:47:19 +00:00
Matt Corallo
56fba35422
Merge pull request #2465 from alecchendev/2023-07-flip-keysend-feature-bit
Flip keysend feature bit on
2023-07-31 17:46:57 +00:00
valentinewallace
390d49c596
Merge pull request #2454 from optout21/unused-use
(Minor) Remove an unused import (ChannelSigner)
2023-07-31 10:35:15 -07:00
Elias Rohrer
7768b73251
Merge pull request #2459 from valentinewallace/2023-07-reconnect-peers-test-util
Struct-ify `reconnect_nodes` test util args
2023-07-31 15:25:05 +02:00
Alec Chen
7ee90a5dc6 Flip keysend feature bit in node features 2023-07-30 21:18:43 -05:00
Matt Corallo
28f303c193 Drop unicode in documentation
Javadocs refuse unicode and as our rustdocs get copied over to Java
bindings (and thus get run through javadocs) we can't have unicode
in our rustdocs.
2023-07-30 17:12:08 +00:00
Matt Corallo
830220393f Drop claimable from Balance::claimable_amount_satoshis fields
In Java/TypeScript, we map enums as a base class and each variant
as a class which extends the base. In Java/TypeScript, functions
and fields share the same namespace, which means we cannot have
functions on an enum which have the same name as any fields in any
enum variants.

`Balance`'s `claimable_amount_satoshis` method aliases with fields
in each variant, and thus ultimately doesn't compile in TypeScript.

Because `Balance::claimable_amount_satoshis` has the same name as
the fields, it's also a bit confusing, as it doesn't return the
field for each variant, but sometimes returns zero if we're not
sure we can claim the balance.

Instead, we rename the fields in each enum variant to simply
`amount_satoshis`, to avoid implying that we can definitely claim
the balance.
2023-07-30 02:24:16 +00:00
Jeffrey Czyz
4bb4a970e8
Make offers::merkle::SignError visible 2023-07-28 14:21:19 -05:00
Jeffrey Czyz
9c708df2ff
Tidy up bitcoin::secp256k1 imports 2023-07-28 14:21:19 -05:00
Matt Corallo
8164cb9307 Accept RPC responses with a null result
This is actually a valid response in some cases, at least for the
`gettxout` command, where `null` is returned if no corresponding
UTXO was found, but the command otherwise succeeded.
2023-07-28 19:01:34 +00:00
Valentine Wallace
ece4db67fe
Struct-ify reconnect_nodes test util args
Makes it easier to add new arguments without a ton of resulting test changes.
Useful for route blinding testing because we need to check for malformed HTLCs,
which is not currently supported by reconnect_nodes. It also makes it easier to
tell what is being checked in relevant tests.
2023-07-27 16:00:28 -07:00
Valentine Wallace
49f4d5f8f4
Add onion message test vectors
Also re-alphabetize the imports in the onion message functional tests.

Co-authored-by: Carla Kirk-Cohen <kirkcohenc@gmail.com>
2023-07-27 11:55:47 -07:00
valentinewallace
5cddf5e06a
Merge pull request #2104 from douglaz/docs_fixes_channel
Docs improvements for channel
2023-07-26 14:52:15 -07:00
optout
1babca4e2c
Remove an unused use (ChannelSigner) 2023-07-26 21:47:40 +02:00
Valentine Wallace
a35b92c8c8
Fuzz test blinded payment pathfinding 2023-07-25 16:32:33 -07:00
Valentine Wallace
9bf4b6ed90
Router fuzz: macroize first/last hops construction and pathfinding call
For reuse in fuzzing blinded payment pathfinding, and to ensure fuzz input
values are fetched in the same order in both match arms.
2023-07-25 16:32:30 -07:00
Allan Douglas R. de Oliveira
a15d0b5c2e Docs improvements for channel 2023-07-25 22:52:21 +00:00
valentinewallace
685f266655
Merge pull request #2446 from TheBlueMatt/2023-07-ci-more-test
Run all tests first before testing more esoteric flags in CI
2023-07-25 11:07:41 -07:00
valentinewallace
c6c684be30
Merge pull request #2448 from TheBlueMatt/2023-07-cm-clone
Impl clone for ChannelMonitor
2023-07-25 10:46:48 -07:00
Matt Corallo
c383f06538
Merge pull request #2370 from valentinewallace/2023-06-send-along-path-args
Update `send_payment_along_path` to take its args as struct
2023-07-24 22:43:58 +00:00
benthecarman
d026259d3e Impl clone for ChannelMonitor
This gives people more freedom with the channel monitors. For Mutiny
this would be nice for us to be able to create copies of them and pass
aorund in memory without having to serialize until we actually want to.

Originally by benthecarman <benthecarman@live.com>
Small bugfix from Matt Corallo <git@bluematt.me>
2023-07-24 22:36:03 +00:00
Matt Corallo
aa3c78658e Run all tests first before testing more esoteric flags in CI
This should at least marginally more aggressively target things
which are more likely to have changed in CI, making `ci-tests.sh`
more useful as a "default" script for developers to run locally.
2023-07-24 22:04:10 +00:00
Matt Corallo
e13ff10c63
Merge pull request #2431 from arik-so/2023-07-public-excess-data 2023-07-24 03:52:27 +00:00
Elias Rohrer
78f59a5345
Merge pull request #2444 from szabgab/https
http => https
2023-07-23 19:28:17 +02:00
Gabor Szabo
1da6fc2ded http => https 2023-07-23 08:58:41 +03:00
Matt Corallo
4938be6ad7
Merge pull request #2427 from TheBlueMatt/2023-07-cut-116
Release 0.0.116
2023-07-21 23:15:05 +00:00
Matt Corallo
983f2c1870 Bump crate versions to 0.0.116 release 2023-07-21 20:42:13 +00:00
Matt Corallo
e9e806bc41 Add a warning on anchors and update 116 changelog for release 2023-07-21 20:42:13 +00:00
Matt Corallo
ae33b093b8 Add lightning-background-processor no-std feature
While this is generally uneccessary as users set the `no-std` or
`std` features on the `lightning` crate directly, having this
allows `lightning-background-processor` to be built by itself
without extra dep lines. Specifically, the bindings are moving to
using the `-Z avoid-dev-deps` option, which now causes
`lightning-background-processor` to fail to build directly.
2023-07-21 20:33:13 +00:00
Jeffrey Czyz
0fadb54d7f
Merge pull request #2436 from tnull/2023-07-improve-router-logging
Improve router logging and update documentation
2023-07-21 15:25:57 -05:00
Matt Corallo
d7e3320c03
Merge pull request #2439 from tnull/2023-05-fix-0conf-sigs-racing-confirms
Avoid panic when 0conf channel's ann. sigs race on-chain confirmation
2023-07-21 19:37:28 +00:00
Elias Rohrer
1db53a9d73
Improve logging for ignored candiate hops
Previously, we barely gave any hints why we excluded certain hops during
pathfinding. Here, we introduce more verbose logging by a) accounting
how much candidates we ignored for which reasons and b) logging any
first/last/blinded hops we end up ignoring.

Fixes #1646.
2023-07-21 20:28:47 +02:00
Elias Rohrer
543c5bfe13
Update outdated router.rs docs
As `RouteParameters` are not included anymore in
`Event::PaymentPathFailed` since 0.0.115, and we don't give value/payee
as immediate arguments to `find_route` anymore.
2023-07-21 20:28:47 +02:00
Matt Corallo
a61746246c
Merge pull request #2434 from TheBlueMatt/2023-07-116-bindings-part-2
0.0.116 Bindings Changes
2023-07-21 16:39:19 +00:00
Elias Rohrer
adcac97ebc
Avoid unwraping in get_announcement_sigs
While this is currently not reachable, it's still cleaner to
avoid the `unwrap` and return `None` if `short_channel_id` hasn't been
set yet.
2023-07-21 09:54:28 +02:00
Elias Rohrer
82fdf0f62d
Avoid panic when 0conf channel's ann. sigs race on-chain confirmation
A channel's `short_channel_id` is currently only set when the funding
transaction is confirmed via `transactions_confirmed`, which might be
well after the channel initally becomes usable, e.g., in the 0conf case.

Previously we would panic due to a reachable `unwrap` when receiving a
counterparty's `announcement_signatures` message for a 0conf channel
pending confirmation on-chain.

Here we fix this bug by avoiding unsafe `unwrap`s and just erroring out
and ignoring the announcement_signatures message if the `short_channel_id`
hasn't been set yet.
2023-07-21 09:54:28 +02:00
Matt Corallo
27bf1d053d Add relevant derives for BigSize as its a simple integer 2023-07-20 21:43:52 +00:00
Matt Corallo
8cffeb6dba Add relevant trait derives for bump_transaction structs
Notably including `Hash`/`Eq`/`Ord` for structs which may be used
in maps.
2023-07-20 21:43:52 +00:00
Matt Corallo
5f120b1b65 Make OffersMessage and offers errors Cloneable 2023-07-20 21:43:52 +00:00
Matt Corallo
8c61d9d0dc Make requires_unknown_bits_from param type bindings compatible
While bindings should probably be able to figure out that this is
the same type as `Self`, for now we simply swap the type to make
the bindings generator have an easier go of it.
2023-07-20 21:43:52 +00:00
Matt Corallo
9f9ed591a5 Mark the Duration serialization implementation no-bindings-export
The bindings are being updated to consider all traits even if the
trait itself is no-export, which causes issues generating code
around the `Duration` impl here.
2023-07-20 21:43:52 +00:00
Matt Corallo
6d62d5d021 No-export un-exportable types in BOLT12 module
We missed one method that now cannot be bindings exported - the
`payment_paths` method, as it returns a slice of objects, which
cannot be supported in bindings.
2023-07-20 21:43:52 +00:00
Matt Corallo
a8acbe710e No-export APeerManager in bindings
`APeerManager` will simply be mapped as `PeerManager` in bindings,
as structs are all concretized into a single form.
2023-07-20 21:43:52 +00:00
Matt Corallo
97a6246b6f Move ClaimId to [u8; 32] in bindings.
This matches what we've done for other `[u8; 32]` newtypes.
2023-07-20 21:43:52 +00:00
Matt Corallo
0b9c5204af Tweak PSBT signing for bindings compatibility
In bindings we can't practically pass a mutable PSBT, and instead
need to pass an owned transaction and have the sign method return a
signed copy. We do this here for all build modes as its not a
material API change for Rust users.
2023-07-20 21:43:52 +00:00