Commit graph

6639 commits

Author SHA1 Message Date
Orbital
06f9dd7e83
export send_onion_message_using_path for testing 2024-02-01 20:22:53 -06:00
Matt Corallo
5592378de2
Merge pull request #2834 from TheBlueMatt/2024-01-cut-120
Cut 0.0.120
2024-01-17 23:02:24 +00:00
Matt Corallo
37017ec39f Bump crate versions to 0.0.120/invoice 0.28 2024-01-17 21:34:29 +00:00
Matt Corallo
947850b1de Add CHANGELOG entry for 0.0.120 2024-01-17 21:34:29 +00:00
Matt Corallo
871db638f2
Merge pull request #2818 from valentinewallace/2024-01-blinded-path-retries
Avoid retrying over previously failed blinded paths
2024-01-17 21:21:36 +00:00
valentinewallace
a1759582ad
Merge pull request #2828 from TheBlueMatt/2024-01-crypto-module
Move cryptographic algorithms and utilities to a new `crypto` mod
2024-01-17 12:53:02 -05:00
Valentine Wallace
5c87f40f6b
Test that we won't retry over previously failed blinded paths. 2024-01-17 10:55:41 -05:00
Valentine Wallace
8fcfaeb8d5
Test util: separate out code to construct a blinded path. 2024-01-17 10:55:41 -05:00
Valentine Wallace
32ab7a9e4d
Avoid building routes over previously failed blinded payment paths. 2024-01-17 10:55:39 -05:00
Valentine Wallace
23ef2535d0
Store previously failed blinded paths on outbound payment failure.
Useful so we don't retry over these paths.
2024-01-17 10:44:38 -05:00
Valentine Wallace
5c5d691425
Persist previously failed blinded paths in RouteParameters.
Useful so we don't retry over these paths.
2024-01-17 10:44:33 -05:00
Valentine Wallace
75a1c47b19
Add failed_within_blinded_path to DecodedOnionFailure.
Will be used to ensure correctness when we store previously failed blinded
paths to avoid retrying over them.
2024-01-17 10:44:33 -05:00
Valentine Wallace
ae1288d8cc
Add failed_within_blinded_path to onion util internal struct.
Will be used to ensure correctness when we store previously failed blinded
paths to avoid retrying over them.
2024-01-17 10:44:33 -05:00
Matt Corallo
fbeb7ac9e1
Merge pull request #2831 from jkczyz/2024-01-fix-cltv-expiry-delta
Use consistent `cltv_expiry_delta` in `ForwardTlvs`
2024-01-17 00:47:48 +00:00
Matt Corallo
a97f945607
Merge pull request #2832 from p2pderivatives/fix-ln-net-tokio-dropping-messages
Fix lightning-net-tokio sometimes dropping messages
2024-01-17 00:37:09 +00:00
Matt Corallo
53f2e2e882
Merge pull request #2812 from valentinewallace/2023-12-blinded-forwarding
Complete route blinding support
2024-01-17 00:28:30 +00:00
Tibo-lg
4cd0e6a391 Fix lightning-net-tokio sometimes dropping messages 2024-01-17 09:24:49 +09:00
Jeffrey Czyz
8053aa3df4
Use consistent cltv_expiry_delta in ForwardTlvs
When converting from CounterpartyForwardingInfo to PaymentRelay, the
cltv_expiry_delta is copied. Then, when forming a blinded payment path,
the value is mutated so that esoteric values don't reveal information
about the path. However, the value was only used in computing
PaymentConstraints and wasn't actually updated in PaymentRelay. Move the
logic for modifying the cltv_expiry_delta to the conversion code to
avoid this inconsistency.
2024-01-16 16:59:27 -06:00
Valentine Wallace
aae39b4090
Advertise route blinding feature as supported.
Now that we fully support forwarding blinded payments, we should advertise
support so nodes on the network can include us in their blinded paths.
2024-01-16 17:46:41 -05:00
Valentine Wallace
027aef2b64
Fix sender double-including shadow offset in CLTV expiry height.
The excess delta is included in the final RouteHop::cltv_expiry_delta, so by
adding it explicitly to cur_cltv we were erroneously including it twice in the
total cltv expiry.

This could've add up to an extra MAX_SHADOW_CLTV_DELTA_OFFSET (432) blocks to
the total cltv expiry.
2024-01-16 17:46:41 -05:00
Valentine Wallace
6e6bd44138
Rename test var to be more descriptive. 2024-01-16 17:46:41 -05:00
Valentine Wallace
a76bb51a3a
Complete remaining TODOs for failing blinded non-intro forwards. 2024-01-16 17:46:41 -05:00
Valentine Wallace
c37d10944e
Add failure mode info to BlindedForward struct.
See added docs.
2024-01-16 17:46:39 -05:00
Matt Corallo
4a0abd52e7 Move cryptographic algorithms and utilities to a new crypto mod
As we'd generally like the `lightning` crate to, over time, have
more modules rather than being very monolithic, we should move the
cryptographic things into their own module, which we do here.

We also take this opportunity to move stream adapters into their
own module and make clear that the ChaChaPoly `decrypt` method is
variable time.
2024-01-16 20:07:08 +00:00
Elias Rohrer
ea5de93dd9
Merge pull request #2824 from shuoer86/main
Fix typos
2024-01-15 10:38:03 +01:00
shuoer86
fff6616b7c
Fix typo lightning/src/util/wakers.rs 2024-01-12 20:46:47 +08:00
shuoer86
9c22a48a49
Fix typo lightning/src/routing/router.rs 2024-01-12 20:46:40 +08:00
shuoer86
896477d33d
Fix typo lightning/src/ln/peer_handler.rs 2024-01-12 20:46:33 +08:00
shuoer86
8cd48060d7
Fix typo lightning-invoice/src/ser.rs 2024-01-12 20:46:26 +08:00
shuoer86
9c5edad51b
Fix typo CONTRIBUTING.md 2024-01-12 20:46:16 +08:00
Matt Corallo
4b70921c95
Merge pull request #2800 from optout21/channel-close-add-funding
Add channel funding txo to Channel Event::ChannelClosed
2024-01-11 19:35:26 +00:00
Elias Rohrer
cd5f09b8e3
Merge pull request #2822 from TheBlueMatt/2024-01-pm-dyn-ref
Drop `PeerManager` type bound on `UtxoLookup` entirely
2024-01-11 18:41:01 +01:00
Valentine Wallace
f09ac1931f
Make BlindedFailure enum pub.
Necessary to include it in the public PendingHTLCInfo struct in the next commit.
2024-01-11 11:36:28 -05:00
Valentine Wallace
8ad292eea6
Test successful payment to 3-hop blinded path. 2024-01-11 11:36:28 -05:00
Valentine Wallace
f1e4645edf
Fix final blinded hop CLTV expiry on send.
Previously, we were setting the final blinded hop's CLTV expiry height to
best_block_height + total_blinded_path_cltv_delta + shadow_cltv_offset. This is
incorrect, it should instead be set to best_block_height + shadow_cltv_offset
only -- it doesn't make sense to include the delta for the other blinded hops
in the final hop's expiry.

The reason this too-high final cltv value didn't cause test failures previously
is because of a 2nd bug that is fixed in an upcoming commit where the sender
adds the shadow offset twice to the total path CLTV expiry. This 2nd offset
meant that intermediate nodes had some buffer CLTV to subtract their delta from
while still (usually) have enough leftover to meet the expiry in the final hop's
onion.
2024-01-11 11:36:08 -05:00
Valentine Wallace
4a0170a941
Support forwarding blinded HTLCs as non-intro node.
Error handling will be completed in upcoming commit(s).
2024-01-11 11:33:33 -05:00
valentinewallace
62d52c6020
Merge pull request #2801 from valentinewallace/2023-12-rb-groundwork-followups
#2128 follow-ups
2024-01-11 11:30:46 -05:00
valentinewallace
3eec5d3c17
Merge pull request #2820 from TheBlueMatt/2024-01-fuzz-ooo-monitor-updates
Test individual monitor update compl in chanmon_consistency fuzzer
2024-01-11 11:22:34 -05:00
valentinewallace
9d803a92bd
Merge pull request #2821 from TheBlueMatt/2024-01-om-direct-export
Expose `onion_message` items directly rather than via re-exports
2024-01-11 09:52:00 -05:00
optout
efaba118da
Add channel funding txo to Channel Event::ChannelClosed 2024-01-11 09:15:53 +01:00
Matt Corallo
db81c650ba
Merge pull request #2791 from valentinewallace/2023-12-multihop-recv-followups
Follow-ups to #2688
2024-01-11 00:04:39 +00:00
Matt Corallo
ab66143cb6 Expose onion_message items directly rather than via re-exports
When we originally added the `onion_message` module, there weren't
a lot of public items in it, and it didn't make a lot of sense to
export the whole sub-module structure publicly. So, instead, we
exported the public items via re-exports directly in the
`onion_message` top-level module. However, as time went on, more
and more things entered the module, which left the top-level module
rather cluttered.

Worse, in 0.0.119, we exposed
`onion_message::messenger::SendSuccess` via the return type of
`send_message`, but forgot to re-export the enum itself, making
it impossible to actually use from external code.

Here we address both issues and simply replace the re-export with
the underlying sub-module structure.
2024-01-10 23:50:34 +00:00
Matt Corallo
ccf710d860
Merge pull request #2809 from TheBlueMatt/2023-12-closing-event-cleanup-fixes
Clean Up Funding Error Handling and shutdown
2024-01-10 22:37:07 +00:00
Matt Corallo
370339919d Drop PeerManager type bound on UtxoLookup entirely
In 67659677d4 we relaxed the bounds
set on `UtxoLookup` to enable those using `RoutingMessageHandler`
other than `P2PGossipSync` to use `UtxoLookup`. Sadly, because this
requires having a concrete `PeerManager` type which does *not* use
`UtxoLookup` in the `RoutingMessageHandler` type, this broke users
who were directly using `P2PGossipSync`.

We could split `UtxoLookup` into two, with different bounds, for
the two use-cases, but instead here we simply switch to storing a
reference to the `PeerManager` via a `dyn Fn` which allows us to
wake the `PeerManager` when we need to.

Fixes #2813
2024-01-10 22:33:43 +00:00
Valentine Wallace
3ec4d52277
Rename parameter from err_packet to err_contents.
This name is more accurate since the method has been generalized to support
malformed HTLCs.
2024-01-10 11:23:44 -05:00
Valentine Wallace
c1fbb90847
Remove outdated comment. 2024-01-10 11:23:44 -05:00
Valentine Wallace
95b3ef4910
Normalize order of (sha256_of_onion, failure_code) in trait.
This helps avoid destructuring the tuple.
2024-01-10 11:23:44 -05:00
Valentine Wallace
04e70bad0a
DRY malformed HTLC handling during htlc batch processing. 2024-01-10 11:23:44 -05:00
Valentine Wallace
5c880a0549
Fix logger usage during batched htlc processing of malforms.
Introduced due to a rebase error.
2024-01-10 11:23:44 -05:00
Valentine Wallace
d0d1634d95
Clean up code DRY'd in previous commit. 2024-01-10 11:19:09 -05:00