Commit graph

16296 commits

Author SHA1 Message Date
Carla Kirk-Cohen
7e4f3d3b1d
htlcswitch: reject HTLCs that use use as introduction if disabled
Reject any HTLCs that use us as an introduction point in a blinded
route if we have disabled route blinding. We have to do this after
we've processed the payload, because we only know we're an introduction
point once we've processed the payload itself.
2024-04-03 09:19:39 -04:00
Carla Kirk-Cohen
6d41037628
htlcswitch: set forwarding information from encrypted data
If we received a payload with a encrypted data point set, our forwarding
information should be set from the information in our encrypted blob.
This behavior is the same for introduction and relying nodes in a
blinded route.
2024-04-03 08:52:26 -04:00
Carla Kirk-Cohen
2029a06918
multi: return parsed types from payload
To separate blinded route parsing from payload parsing, we need to
return the parsed types map so that we can properly validate blinded
data payloads against what we saw in the onion.
2024-04-03 08:52:25 -04:00
Carla Kirk-Cohen
1e6fae37f7
htlcswitch: add blinding point to sphinx iterator for decoding 2024-04-03 08:52:25 -04:00
Carla Kirk-Cohen
da76d05fa5
htlcswitch: add NextBlinding to ForwardingInfo and set in UpdateAddHtlc
When we have a HTLC that is part of a blinded route, we need to include
the next ephemeral blinding point in UpdateAddHtlc for the next hop. The
way that we handle the addition of this key is the same for introduction
nodes and relaying nodes within the route.
2024-04-03 08:38:24 -04:00
Carla Kirk-Cohen
ca6d414308
multi: validate contents in blinded data against payload 2024-04-03 08:38:23 -04:00
Carla Kirk-Cohen
03f6c5cd0a
htlcswitch: add blinding kit to handle encrypted data in blinded routes
This commit introduces a blinding kits which abstracts over the
operations required to decrypt, deserialize and reconstruct forwarding
data from an encrypted blob of data included for nodes in blinded
routes.
2024-04-03 08:38:22 -04:00
Carla Kirk-Cohen
040fcb0f92
multi: add option to disable route blinding, rejecting at link
Add an option to disable route blinding, failing back any HTLC with
a blinding point set when we haven't got the feature enabled.

Note that this commit only handles the case where we're chosen as the
relaying node (where the blinding point is in update_add_htlc), we'll
add handling for the introduction node case once we get to handling of
blinded payloads).
2024-04-03 08:35:41 -04:00
Carla Kirk-Cohen
019b8fa8aa
hop: add function for calculating forwarding amount
Co-authored-by: Calvin Zachman <calvin.zachman@protonmail.com>
2024-04-02 15:44:06 -04:00
Carla Kirk-Cohen
7fd9c2a7f8
multi: use some record for payment descriptor blinding point 2024-04-02 15:44:05 -04:00
Oliver Gugger
b1175514f9
Merge pull request #8515 from mohamedawnallah/add-coin-selection-strategy-on-chain-rpc
coin select: add coin selection strategy option to all on-chain RPCs
2024-04-02 11:20:08 +00:00
Oliver Gugger
b331e73b67
Merge pull request #8609 from ziggie1984/master
lnd: fix sweepall argument call.
2024-04-02 11:04:37 +00:00
András Bánki-Horváth
16c8339034
Merge pull request #8595 from bhandras/sqldb-invoices-reset-on-retry
sqldb: reset out of scope containers on potential ExecTx retry
2024-04-02 09:43:59 +02:00
ziggie
b019657d19
docs: add release-notes. 2024-04-01 20:05:28 +01:00
ziggie
eba4911599
lnd: fix sweepall argument call.
maxFeeRate and feePerKw were switched in CraftSweepAllTx.
2024-04-01 20:00:54 +01:00
Mohamed Awnallah
31526a0191
docs: update the release-notes-0.18.0 2024-04-01 19:08:24 +02:00
Mohamed Awnallah
1a2d50d385
multi: add coin selection strategy option to all on-chain rpcs
In this commit, we add the coin selection strategy option to the following
on-chain RPCs `fundpsbt`, `batchopenchannel`, `estimatefee`, `sendcoins`,
`sendmany`, and `sendoutputs`.
2024-04-01 19:08:22 +02:00
Mohamed Awnallah
a0b0e7aa62
lncli: add coin selection strategy option to on-chain rpc commands
In this commit we add coin selection strategy option to the
following on-chain rpc commands `fundpsbt`, `fundtemplatepsbt`,
`batchopenchannel`, `estimatefee`, `sendcoins`, and `sendmany`.
2024-04-01 19:08:19 +02:00
Mohamed Awnallah
7c2c0dcf98
lnrpc+lnd+config: add coin selection strategy to all on-chain rpcs
In this commit, we add the coin selection strategy option
to all on-chain RPCs `FundPsbt`, `BatchOpenChannel`, `EstimateFee`,
`SendMany`, `SendCoins`, `SendOutputs`.
2024-04-01 19:08:01 +02:00
Olaoluwa Osuntokun
5599b3c9e2
Merge pull request #6934 from bottlepay/inbound-fees-send-support
routing: inbound fees send support
2024-03-31 10:54:09 -07:00
Joost Jager
0bae781785 routing: add inbound fee support to pathfinding
Add sender-side support for inbound fees in pathfinding
and route building.
2024-03-31 18:12:28 +02:00
Joost Jager
d97e7d30fb channeldb/test: refactor TestGraphCacheForEachNodeChannel 2024-03-31 18:12:28 +02:00
Joost Jager
9d4251c18d routing/test: test local unified edge 2024-03-31 18:12:28 +02:00
Joost Jager
e0a080454a routing: track unifiedPolicyEdge
Preparation so that we can have the inbound fee available
in addition to the outgoing policy.
2024-03-31 18:12:28 +02:00
Olaoluwa Osuntokun
a6d4bb5c89
Merge pull request #6703 from bottlepay/inbound-fees
htlcswitch: add inbound routing fees receive support
2024-03-31 08:43:09 -07:00
Joost Jager
ba21ca7609 itest: multi-hop payment test with negative inbound fee
Ensure that negative fees are backwards compatible.
2024-03-31 16:49:19 +02:00
Joost Jager
763787e08c routing+lnrpc: add inbound fee policy update 2024-03-31 16:49:19 +02:00
Joost Jager
e8c97deaef htlcswitch: add receiver-side inbound fee support 2024-03-31 16:49:19 +02:00
Joost Jager
3e6adbf1c0 lnwire+channeldb: parse inbound fees
In this commit, the tlv extension of a channel update message is parsed.
If an inbound fee schedule is encountered, it is reported in the
graph rpc calls.
2024-03-31 16:33:26 +02:00
Olaoluwa Osuntokun
1d61de28c0
Merge pull request #8159 from carlaKC/7298-1-forwardblindedroutes
[1/3]: Preparatory work for Forwarding Blinded Routes
2024-03-28 15:13:05 -07:00
Olaoluwa Osuntokun
41cdb0fce5
Merge pull request #8599 from yyforyongyu/update-fn
gomod: bump `fn` version to v1.0.5
2024-03-28 14:28:21 -07:00
yyforyongyu
252b909867
gomod: bump fn version to v1.0.5 2024-03-28 23:52:31 +08:00
Andras Banki-Horvath
a1a7982646
sqldb: reset out of scope containers on potential ExecTx retry
As SQL serializaton errors can lead to transaction retries we need to
ensure that we reset any out of scope containers where we accumulate
results. Otherwise partial data from a previously executed transacton
retry may be returned along with the latest result.
2024-03-27 17:59:54 +01:00
Carla Kirk-Cohen
2130022e20
docs: release notes for blinded routes prep work 2024-03-27 09:39:03 -04:00
Carla Kirk-Cohen
d67f65212b
routing: fix comment on blinded path cltv delta 2024-03-27 09:39:02 -04:00
Carla Kirk-Cohen
421433039b
lnrpc: rename proportional fee rate on lnrpc
This field is incorrectly suffixed as "msat", when it is actually
interpreted as the proportional fee rate. This is the value that we
should be using because the sender will calculate proportional fees
accordingly. This is a breaking change to the RPC, but on an
experimental and unreleased API.
2024-03-27 09:39:01 -04:00
Carla Kirk-Cohen
0aeb7c4ba2
multi/refactor: clarify blinded payment fee rate field name 2024-03-27 09:39:00 -04:00
Carla Kirk-Cohen
4a93f4d8d3
multi: pass blinding point through to reconstruction 2024-03-27 09:38:59 -04:00
Carla Kirk-Cohen
7265e4c9b0
htlcswitch: add incoming amount and to decode hop iterator request
When we have payments inside of a blinded route, we need to know
the incoming amount to be able to back-calculate the amount that
we need to forward using the forwarding parameters provided in the
blinded route encrypted data. This commit adds the payment amount
to our DecodeHopIteratorRequest so that it can be threaded down to
payment forwarding information creation in later commits.
2024-03-27 09:38:58 -04:00
Carla Kirk-Cohen
7bf1daaade
htlcswitch: add blinding point to decode hop iterator request 2024-03-27 09:38:57 -04:00
Carla Kirk-Cohen
f090a64142
multi: add blinding point to payment descriptor and persist
This commit adds an optional blinding point to payment descriptors and
persists them in our HTLC's extra data. A get/set pattern is used to
populate the ExtraData on our disk representation of the HTLC so that
callers do not need to worry about the underlying storage detail.
2024-03-27 09:38:56 -04:00
Carla Kirk-Cohen
7596e764ac
channeldb: include extra data in htlc clone function 2024-03-27 09:38:55 -04:00
Carla Kirk-Cohen
e4f90ec593
lnwire: add blinding point to update_add_htlc TLVs
Add blinding points to update_add_htlc. This TLV will be set for
nodes that are relaying payments in blinded routes that are _not_
the introduction node.
2024-03-27 09:38:50 -04:00
Carla Kirk-Cohen
d8979d3086
multi: add validation of blinded route encrypted data
Co-authored-by: Calvin Zachman <calvin.zachman@protonmail.com>
2024-03-27 09:36:40 -04:00
Carla Kirk-Cohen
c48841a38b
record: add TLV encoding/decoding for blinded route data blobs
This commit adds encoding and decoding for blinded route data blobs.
TLV fields such as path_id (which are only used for the final hop)
are omitted to minimize the change size.
2024-03-27 09:36:39 -04:00
Carla Kirk-Cohen
3cc50ced55
lnwire: create common encoder/decoder for raw feature vectors
We'll need to pack feature vectors for route blinding, so we pull
the encoding/decoding out into separate functions (currently
contained in ChannelType). Though it's more lines of code, we keep
most of the ChannelType assertions so that we strictly enforce
use of the alias.
2024-03-27 09:36:38 -04:00
Carla Kirk-Cohen
42069ef2f8
htlcswitch: remove unused decode hop iterator 2024-03-27 09:36:37 -04:00
Oliver Gugger
b76f733a9e
Merge pull request #8587 from zhiqiangxu/add_nil_check
channeldb: check return value of ReadWriteBucket
2024-03-26 09:30:07 -06:00
zhiqiangxu
5fd46b0dce channeldb: check return value of ReadWriteBucket 2024-03-26 17:28:09 +08:00
Oliver Gugger
d3e5b2f799
Merge pull request #8584 from yyforyongyu/fix-unit-race
chainntnfs: fix race in `TestInterfaces`
2024-03-26 02:37:53 -06:00