Commit Graph

1284 Commits

Author SHA1 Message Date
Elle Mouton
ca91e17115
invoicesrpc: move blinded path config to AddInvoiceData
since `AddInvoiceData` is config _per invoice_ where as `AddInvoiceConfig`
is config for the invoice server itself and so pretty much should stay
the same for the lifetime of LND. This change sets us up for moving some
of the blinded path config options to be changeable per AddInvoice call
rather that having fixed config values in the config file.
2024-08-07 17:01:21 +02:00
Oliver Gugger
d77617461d
Merge pull request #8955 from yyforyongyu/cr-8516-240729-sendcoins
Allow selecting coins in `sendcoins`
2024-08-07 08:42:25 -06:00
Oliver Gugger
b63e5decad
Merge pull request #8886 from bitromortac/buildroute-inbound-fees
routing: inbound fees support for BuildRoute
2024-08-07 08:11:17 -06:00
Ononiwu Maureen
99339f706f
multi: expand SendOutputs and CreateSimpleTx to take utxos
This commit updates the interface methods from
`lnwallet.WalletController` to take optional input set which can be used
to create the tx.
2024-08-07 20:42:27 +08:00
Ononiwu Maureen
468ca87499
lnrpc: Add Outpoint field in SendCoinsRequest
Signed-off-by: Ononiwu Maureen <59079323+Chinwendu20@users.noreply.github.com>
2024-08-07 20:42:27 +08:00
bitromortac
b0e1a722c6
routerrpc: add check for empty hops 2024-08-07 14:24:59 +02:00
bitromortac
452db01ad7
lnrpc+routing: convert amt pointer to fn.Option 2024-08-07 14:24:56 +02:00
Oliver Gugger
63af63dfa8
lnrpc: avoid needing to download Golang
Because the Go version used to run the `go list` commands is below the
minimum version specified in the main go.mod file, every time the `make
rpc` command is executed, the Golang runtime is downloaded twice, which
looks like this and takes a couple of seconds at least:

go: downloading go1.21.4 (linux/amd64)
go: downloading go1.21.4 (linux/amd64)

We fix this by using the correct minimum version.
2024-08-06 18:38:10 +02:00
Elle Mouton
e8da2fa0bd
lnrpc/gen_protos: remove manual_imports
With the updated falafel version, there is no longer a need to specify
manual imports.
2024-08-05 16:00:00 +02:00
Elle Mouton
58317e66d3
lnrpc/Dockerfile: update falafel version
Update the falafel version.
2024-08-05 15:59:50 +02:00
Oliver Gugger
546c8ebb99
Merge pull request #8954 from ffranr/check-go-versions
Linter checks go versions in Dockerfile and YAML files
2024-08-05 02:01:00 -06:00
Slyghtning
2e3c96f986
routing: new failure reason for cancelled payments 2024-08-01 10:24:08 +02:00
Slyghtning
d18c4d61ce
lnrpc: payment failure reason canceled 2024-08-01 10:24:07 +02:00
ffranr
d7a81a1fe3
multi: use Go version 1.22.5 throughout 2024-07-31 16:53:47 +01:00
Elle Mouton
4a22ec8413
routing: pass BlindedPaymentPathSet around everywhere
Building on from the previous commit, here we pass the PathSet around
everywhere where we previously passed around the single BlindedPayment.
2024-07-31 09:14:28 +02:00
Elle Mouton
3d5f20b70f
multi: introduce BlindedPaymentPathSet
This commit introduces a new type, `BlindedPaymentPathSet`. For now, it
holds only a single `BlindedPayment` but eventually it will hold and
manage a set of blinded payments provided for a specific payment. To
make the PR easier to follow though, we start off just letting it hold a
single one and do some basic replacements.
2024-07-31 09:11:49 +02:00
Elle Mouton
c490279002
blindedpath: smarter dummy hop policy selection
This commit introduces more sophisticated code for selecting dummy hop
policy values for dummy hops in blinded paths.

For the case where the path does contain real hops, the dummy hop policy
values are derived by taking the average of those hop polices. For the
case where there are no real hops (in other words, we are the
introduction node), we use the default policy values used for normal
ChannelUpdates but then for the MaxHTLC value, we take the average of
all our open channel capacities.
2024-07-26 13:03:07 +02:00
Elle Mouton
398623bde5
blindedpath: move blinded path logic to own pkg 2024-07-26 09:54:59 +02:00
Elle Mouton
735d7d9738
multi: send to a blinded path in an invoice
Update the SendPayment flow so that it is able to send to an invoice
containing a blinded path.
2024-07-26 09:54:37 +02:00
Elle Mouton
de975334cd
multi: add blinded paths to invoices
Expose the ability to add blinded paths to an invoice. Also expose
various configuration values.

We also let the lncfg.Invoices struct satisfy the Validator interface so
that we can verify all its config values in one place.
2024-07-26 09:54:17 +02:00
Elle Mouton
9787ae9c89
lnrpc/invoicesrpc: prep AddInvoice for blinded routes
Here we add a new `Blind` option to the `AddInvoiceData` which will
signal that the new invoice should encode a blinded route.

Certain other changes are also made in the case that this invoice
contains a blinded route:
1) the payment address/secret no longer needs to be in the invoice
   itself since it will be put in the `PathID` recored of the encrypted
   recipient record for our hop.
2) When we sign the invoice, we now use an ephemeral key since we dont
   want the sender to be able to derive our real node pub key from the
   invoice signature.
3) The invoice's FinalCLTV field should be zero for blinded invoices
   since the CLTV delta info will be communicated in the accumulated
   route policy values.
2024-07-26 09:54:17 +02:00
Elle Mouton
4b5327f057
lnrpc/invoicesrpc: build blinded path
This commit adds all the logic for building a blinded path (from a given
route) and packaging it up in a zpay32.BlindedPaymentPath struct so that
it is ready for adding to an invoice. It also includes logic for padding
a path with dummy hops.

Note that in this commit, the logic for choosing an actual path to us
that can then be used in a blinded path is abstracted away. This logic
will be fleshed out in a future commit.
2024-07-26 09:54:17 +02:00
Elle Mouton
0855e3e71a
lnrpc/invoicesrpc: add blinded path policy buffer
This commit adds a helper function that will be used to adjust a hops
policy values by certain given increase and decrease multipliers. This
will be used in blinded paths to give policy values some buffer to avoid
easy probing of blinded paths.
2024-07-26 09:54:17 +02:00
Elle Mouton
3b2a6042ff
lnrpc/invoicesrpc: blinded path total path policy calc
This commit adds a function that can be used to compute the accumulated
path policy for a blinded path as defined in the spec:

db278ab9b2/04-onion-routing.md (L255)
2024-07-26 09:54:17 +02:00
Elle Mouton
f87cc6274f
lnrpc/invoicesrpc: add function for padding encrypted data
This commit adds a helper function called `padHopInfo` along with a test
for it. This function will be used later on when building a blinded
path. It is used to ensure that all encrypted blobs of a blinded path
that we construct are padded to the same size.
2024-07-26 09:54:16 +02:00
Olaoluwa Osuntokun
8c0d7862c2
Merge pull request #8937 from Roasbeef/go-1-22-5
build: update to Go 1.22.5
2024-07-25 13:14:57 -07:00
Olaoluwa Osuntokun
bc2922232c
build: remove old Travis references
We no longer use Travis.
2024-07-25 13:14:26 -07:00
yyforyongyu
d992cf94d6
multi: add SpewLogClosure to avoid code repetition 2024-07-25 22:18:49 +08:00
yyforyongyu
b6049ff94b
multi: add NewLogClosure in lnutils to avoid repetition
And replaces all usage of `logClosure` with `lnutils.LogClosure`.
2024-07-25 21:25:23 +08:00
Elle Mouton
93f89512ae
lnrpc+rpcserver: Add blinded payment paths to PayReq
This commit adds a blinded_paths field to the PayReq proto message. A
new helper called `CreateRPCBlindedPayments` is then added to convert
the zpay32 type to the existing `lnrpc.BlindedPaymentPath` type and add
this to the `PayReq` in the `DecodePayReq` rpc method.
2024-07-10 17:51:55 +02:00
Slyghtning
bba01cf634
routing+routerrpc: cancelable context in SendPaymentV2
In this commit we set up the payment loop context
according to user-provided parameters. The
`cancelable` parameter indicates whether the user
is able to interrupt the payment loop by cancelling
the server stream context. We'll additionally wrap
the context in a deadline if the user provided a
payment timeout.
We remove the timeout channel of the payment_lifecycle.go
and in favor of the deadline context.
2024-06-17 09:32:26 +02:00
Slyghtning
e729084149
lnrpc: cancelable sendpayment request 2024-06-17 09:32:26 +02:00
Slyghtning
06bff6f81a
routing: fix typos and wrap errors 2024-06-17 09:32:25 +02:00
Slyghtning
1936aa7261
lnrpc: channel point for GetChanInfo 2024-06-06 13:28:41 +02:00
Oliver Gugger
a832371d61
Merge pull request #8491 from davidgumberg/invoice_cltv_expiry
Expose `cltv_expiry` flag of `addinvoice` to cli
2024-06-04 13:59:50 +02:00
David Gumberg
4646afb366 lnrpc: Fix bug in 'cltv below minimum' error msg
Previously the error message produced when `CltvExpiry` is less
than the minimum final cltv (18 at present) set by
`routing.MinCLTVDelta` inserted the values into the wrong spots of the
formatted string.
2024-06-04 06:19:12 -04:00
Bufo
4a3af519b8
chore: allow 0 failure amount on import mission control 2024-06-03 11:28:26 +02:00
Olaoluwa Osuntokun
ff85328050
Merge pull request #8774 from yyforyongyu/fix-size-calc
lnwallet+sweep: fix wrong unit used in fee calculation
2024-05-27 18:44:29 -07:00
yyforyongyu
2e40a23146
lnrpc: fix linter 2024-05-25 13:37:16 +08:00
yyforyongyu
8da68bb7db
multi: apply the new type lntypes.WeightUnit 2024-05-25 13:37:13 +08:00
feelancer21
f62c00fe34
multi: Inbound fees are retained when not provided
Fixes the problem that inbound base fee and fee rate are overwritten
with 0 if they are not specified in PolicyUpdateRequest. This ensures
backward compatibility with older rpc clients that do not yet support
the inbound feature.
2024-05-22 20:48:42 +02:00
yyforyongyu
9f2995251e
lnrpc: fix typo 2024-04-29 19:14:27 +08:00
Olaoluwa Osuntokun
add2691954
Merge pull request #8485 from carlaKC/7298-3-forwardblindedroutes
[3/3]: Blinded Route Error Handling
2024-04-26 12:39:11 -07:00
Carla Kirk-Cohen
eaa85920ea
multi: enable optional route blinding feature 2024-04-26 11:35:17 -04:00
Olaoluwa Osuntokun
e8031fdccf
lnrpc: ensure parsing of the Amp flag for payments is consistent
In this commit, we fix an inconsistent in the API related to AMP
payments. When a payment request isn't specified, we require the `--amp`
flag on the CLI to make an AMP payment. However, for payment requests,
we don't require this flag. To fix this inconsistency, we now require
the `--amp` flag to _also_ be set for payment requests.
2024-04-25 16:16:16 -07:00
Oliver Gugger
2089a88f4b
Merge pull request #7765 from ErikEk/retire-io-ioutil-dep
Remove io/ioutil package dependency
2024-04-25 13:17:15 +02:00
erik
789c6bac8c multi: replace ioutil.WriteFile 2024-04-25 11:23:31 +02:00
Mohamed Awnallah
4f48cc69fb
lnrpc: add all_payments opt to DeleteAllPayments 2024-04-24 18:48:52 +02:00
ziggie
b954ee4c72
rpcserver: allow unconf. inputs for psbt shim.
Allow unconfirmed inputs to be used when funding a channel via
the psbt channel opening flow. We do now check for unstable utxos.
2024-04-24 13:58:20 +01:00
ziggie
ab7634b276
multi: Add utxo restriction for batchchannel openings.
Add utxo restrictions for psbt internal wallet funded lightning
channels. This also includes batchopening channels backed by the
internal wallet.
2024-04-24 13:58:20 +01:00