Commit graph

55 commits

Author SHA1 Message Date
Duncan Dean
70762f90ca
Deprecate AvailableBalances::balance_msat
The ChannelMonitor::get_claimable_balances method provides a more
straightforward approach to the balance of a channel, which satisfies
most use cases. The computation of AvailableBalances::balance_msat is
complex and originally had a different purpose that is not applicable
anymore. We deprecate AvailableBalances::balance_msat now and will remove
it in a following release.

Co-authored-by: Willem Van Lint <noreply@wvanlint.dev>
2024-08-20 17:08:34 +02:00
Jeffrey Czyz
075a2e36b9
Make PaymentFailureReason downgradable
The PaymentFailureReason variants for invoice request failures will
cause downgrades to break. Instead, use a new TLV for the reason and
continue to write the old TLV, only use None for the new reasons.
2024-08-14 10:55:59 -05:00
Jeffrey Czyz
f00b782a1c
Add pending changelog for Event::PaymentFailed 2024-08-14 10:55:59 -05:00
Jeffrey Czyz
825bda03c9
Add pending changelog for BOLT12 authentication 2024-07-22 11:38:39 -05:00
Matt Corallo
1d1f47c45a Add pending changelog entry for the previous commit 2024-07-17 15:02:13 +00:00
Valentine Wallace
18ebbf7244
Make blinded hop features optional per spec.
The spec states that if these features are missing, we MUST process the message
as if it were present and contained an empty array.
2024-03-18 17:07:27 -04:00
Valentine Wallace
ef02b9e6f9
Fix ser for PaymentRelay and PaymentConstraints.
Two fields were serialized as u32/u64 when the spec said *tu32/tu64*.
/facepalm.
2024-03-14 15:26:11 -04:00
Matt Corallo
d6c16aa1ae Add CHANGELOG entries for 0.0.119 2023-12-15 23:53:40 +00:00
Valentine Wallace
ecd8238592
Add release note for blinded HTLC serialization. 2023-12-12 18:38:59 -05:00
Valentine Wallace
633be238fd
Fix skimmed fee ser in Channel
Previously, if some holding cell HTLCs have skimmed fees present and some
don't, we would fail to deserialize a Channel. See added test coverage.
2023-12-04 16:41:37 -05:00
Valentine Wallace
e510e3c2d9
Add release note for blinded HTLC backwards compat. 2023-11-29 22:46:54 -05:00
Elias Rohrer
c8ff32197a
Return confirmation height via Confirm::get_relevant_txids
We previously included the block hash, but it's also useful to include
the height under which we expect the respective transaction to be
confirmed.
2023-11-23 09:30:56 +01:00
Matt Corallo
7a951b1bf7 Stop writing signer data as a part of channels
This breaks backwards compatibility with versions of LDK prior to
0.0.113 as they expect to always read signer data.

This also substantially reduces allocations during `ChannelManager`
serialization, as we currently don't pre-allocate the `Vec` that
the signer gets written in to. We could alternatively pre-allocate
that `Vec`, but we've been set up to skip the write entirely for a
while, and 0.0.113 was released nearly a year ago. Users
downgrading to LDK 0.0.112 and before at this point should not be
expected.
2023-11-09 22:28:08 +00:00
Matt Corallo
2587f70925 0.0.118 release notes 2023-10-23 23:41:11 +00:00
Matt Corallo
3133286c88 Add 0.0.117 release notes 2023-10-03 23:00:48 +00:00
Matt Corallo
c7c4226e99 Revert "Remove AvailableBalances::balance_msat"
While removing the `balance_msat` field absolutely makes sense -
it is, at best, confusing - we really need a solid replacement for
it before we can do so. While one such replacement is in progress,
it is not complete and we'd like to not block our current release
on its completion.

This reverts commit ef5be580f5.
2023-09-29 18:32:25 +00:00
Matt Corallo
47e1148283 Update remaining references to primary/secondary namespaces
Update various variables, error strings, and the pending changelog
entry to refer to new namespace terminology.
2023-09-28 18:35:38 +00:00
Dom Zippilli
0430d3379a Add MonitorUpdatingPersister
MonitorUpdatingPersister is an implementation of Persister that stores
ChannelMonitorUpdates separately from ChannelMonitors. Its RFC is
in #2545, at https://github.com/orgs/lightningdevkit/discussions/2545.

Co-Authored-By: Elias Rohrer <dev@tnull.de>
2023-09-26 16:30:07 -07:00
Valentine Wallace
070f7e0d5c
Support receiving to 1-hop blinded payment paths. 2023-09-12 18:11:59 -04:00
Antonio Yang
b1bedcfbec Rename SocketAddress from NetAddress 2023-09-08 20:42:06 +08:00
Matt Corallo
c60d3058af
Merge pull request #2371 from jkczyz/2023-06-offer-message-handling
BOLT 12 Invoice payments
2023-09-08 01:52:38 +00:00
Matt Corallo
2e113b549d
Merge pull request #2472 from tnull/2023-08-add-kvstore
Replace `KVStorePersister` with `KVStore`
2023-09-07 22:26:03 +00:00
Elias Rohrer
d1405f38bc
Add KVStore interface trait
We upstream the `KVStore` interface trait from LDK Node, which will
replace `KVStorePersister` in the coming commits.

Besides persistence, `KVStore` implementations will also offer to `list`
keys present in a given `namespace` and `read` the stored values.
2023-09-07 22:49:21 +02:00
Jeffrey Czyz
6d0c5f00ba
Add an InvoiceRequestFailed event
When an invoice is requested but either receives an error or never
receives a response, surface an event to indicate to the user that the
corresponding future payment has failed.
2023-09-07 11:08:53 -05:00
Elias Rohrer
61cf75265e
Have Route hold RouteParameters 2023-09-06 19:35:38 +02:00
optout
d5d336f215
Add ChannelId pending change note; formatting 2023-08-28 07:20:23 +02:00
Willem Van Lint
ef5be580f5 Remove AvailableBalances::balance_msat
The ChannelMonitor::get_claimable_balances method provides a more
straightforward approach to the balance of a channel, which satisfies
most use cases. The computation of AvailableBalances::balance_msat is
complex and originally had a different purpose that is not applicable
anymore.
2023-08-15 11:42:00 -07:00
Alec Chen
0a2dbdf247
Handle receiving custom HTLC TLVs
This completes basic receiver-side support for custom TLVs and adds
functional testing for sending and receiving.
2023-08-08 16:16:38 -05:00
Matt Corallo
b4a5de1d41 Add 0.0.116rc1 CHANGELOG entries (to be renamed 116 later) 2023-07-17 20:07:30 +00:00
Elias Rohrer
15b1c9b837
Merge pull request #2319 from valentinewallace/2023-05-forward-less-than-onion
Allow forwarding less than the amount in the onion
2023-06-21 09:25:07 +02:00
Valentine Wallace
27b99acd64
Add PaymentClaimable::counterparty_skimmed_fee_msat
See its docs
2023-06-20 17:57:38 -04:00
Valentine Wallace
52f290119d
Set extra skimmed fee on intercepted forward
Receivers need to use this value to verify incoming payments if
ChannelConfig::accept_underpaying_htlcs is set.
2023-06-20 17:57:38 -04:00
Matt Corallo
942d77699b Stop writing old user_payment_id field not read since 0.0.103
Since we're breaking downgrade compatibility to LDK version 0.0.103
and before, we might as well go ahead and remove other code we have
for compatibility.
2023-06-12 18:46:41 +00:00
Matt Corallo
6535627a3e Drop create_inbound_payment*_legacy breaking downgrade to 0.0.103
0.0.103 is now downright ancient, and certainly shouldn't exist in
production anywhere today. Thus, it seems fine to remove the
ability to create legacy stateful inbound payment entries.

Users downgrading to 0.0.103 will thus not be able to claim any
payments created on modern LDK, though we still retain the ability
to claim such payments at least for one more release.
2023-06-12 16:43:01 +00:00
valentinewallace
71af4a2d15
Merge pull request #2277 from valentinewallace/2023-05-fix-big-oms
Fix large onion message packet generation
2023-05-09 08:50:28 -04:00
Valentine Wallace
7f49f6bf4d
Move payee node id from top level PaymentParams to Payee::Clear
Since blinded payees don't have one
2023-05-08 18:01:41 -04:00
Valentine Wallace
f18661f6f6
Fix onion messages of size BIG_PACKET_HOP_DATA_LEN
This was previously broken and would result in an invalid HMAC error, because
we had a hardcoded assumption that OM hop data would always be of size 1300.
2023-05-08 15:02:42 -04:00
Matt Corallo
dafa095413 Add 0.0.115 CHANGELOG entries 2023-04-24 22:40:40 +00:00
Valentine Wallace
5c2cf77253
Update changelog for backwards compat 2023-04-21 15:35:08 -04:00
Matt Corallo
2f798f6cc0 Remove the PaymentSecret field from HTLCSource::OutboundRoute
Many of the fields in `HTLCSource::OutboundRoute` are used to
rebuild the pending-outbound-payment map on reload if the
`ChannelManager` was not serialized though `ChannelMonitor`(s)
were after an HTLC was sent. As of 0.0.114, however, such payments
are not retryable without allowing them to fail and doing a full,
fresh, send.

Thus, some of the fields can be safely removed - we only really
care about having enough information to provide the user a failure
event, not being able to retry.

Here we drop one such field - the `payment_secret`, making our
`ChannelMonitorUpdate`s another handful of bytes smaller.
2023-04-05 16:28:14 +00:00
Wilmer Paulino
9fe475057a
Add pending changelog noting possible backwards compat panic 2023-03-28 17:27:51 -07:00
Valentine Wallace
753e4ce3c3
Remove PaymentPathFailed::retry
We now support automatic retries in ChannelManager and no longer support manual
retries, so the field is useless.
2023-03-13 11:59:03 -04:00
Matt Corallo
e5c1a6d4dd Add release notes for 0.0.114 2023-03-04 00:06:46 +00:00
Valentine Wallace
1dcb3ecb6c
Change PaymentPathFailed's optional network update to a Failure enum
This let us capture the errors when we fail without committing to an HTLC vs
failing via update_fail.
2023-02-25 16:13:42 -05:00
Valentine Wallace
2037a241f4
Remove all_paths_failed from PaymentPathFailed
This field was previous useful in manual retries for users to know when all
paths of a payment have failed and it is safe to retry. Now that we support
automatic retries in ChannelManager and no longer support manual retries, the
field is no longer useful.

For backwards compat, we now always write false for this field. If we didn't do
this, previous versions would default this field's value to true, which can be
problematic because some clients have relied on the field to indicate when a
full payment retry is safe.
2023-02-24 14:21:08 -05:00
Duncan Dean
5b53670172
Add new payment type and metadata bytes
Adds two new payment `Method`s for identifying payments with custom
`min_final_cltv_expiry_delta` as payments with LDK or user payment
hashes.

The `min_final_cltv_expiry_delta` value is packed into the first 2
bytes of the expiry timestamp in the payment secret metadata.
2023-01-24 21:01:27 +02:00
Matt Corallo
7658f15371 Add release notes for 0.0.113
Fixes #1890
2022-12-15 22:15:55 +00:00
Matt Corallo
1969b48b7a Note that abandon_payment does not persist the state update in docs
If a user calls `abandon_payment`, then restarts without freshly
persisting the `ChannelManager`, the payment will still be pending
on restart. This was unclear from the docs (and the docs seemed to
imply otherwise). Because this doesn't materially impact the
usability of `abandon_payment` (users shouldn't be called
`retry_payment` on an abandoned one anyway), we simply document it.

Fixes #1804.
2022-12-12 19:59:19 +00:00
Elias Rohrer
c17e9fb1b3
Update docs and add pending changelog 2022-12-04 17:44:39 +01:00
Elias Rohrer
0edb0e2f84
Expose the channel via which we received a payment
We expose the `channel_id` and `user_channel_id` via which we received a
payment in the `PaymentReceived` event.
2022-11-29 18:49:49 +01:00