Commit Graph

1041 Commits

Author SHA1 Message Date
Elle Mouton
387a1a8831
build: separate sublogger and rotator pipe management
These are two separate concerns. So this commit splits them up and just
passes a LogWriter from the one to the other. This will become cleaner
in an upcoming commit where the Rotator will implement io.Writer and
there will no longer be a need for LogWriter.
2024-10-22 15:19:58 +02:00
ziggie
8d4d3e0323
rpc: return loglevels of the current subsystems 2024-10-18 13:03:29 +02:00
Oliver Gugger
5d60da54a3
rpcserver: don't write any custom channel data if empty 2024-10-15 09:56:32 +02:00
Olaoluwa Osuntokun
e9fbbe2528
Merge pull request #9143 from ellemouton/rb-set-bit-required
feature+rpcserver: add SetBit helper to set dependent bits
2024-10-04 19:16:34 -07:00
Olaoluwa Osuntokun
2d333178c3
Merge pull request #8960 from lightningnetwork/0-19-staging-rebased
[custom channels 5/5]: merge custom channel staging branch into master
2024-10-03 10:07:16 -07:00
Olaoluwa Osuntokun
2395c4d0a1
rpc+funding: add taproot overlay as RPC chan type 2024-10-02 18:10:09 -07:00
Elle Mouton
4d44d11ece
rpcserver: use SetBit helper for setting Bolt11 blinded bit
This commit uses the new SetBit helper for setting the Bolt11 route
blinding required bit in a generated invoice. This helper will take care
of setting the dependent bits of the feature bit (namely the route
blinding and TLV feature bits and will use the required variant of
both).
2024-10-02 10:52:59 +02:00
Elle Mouton
8126930d6c
routing: support multiple namespaced MissionControls 2024-10-01 14:11:05 +02:00
Elle Mouton
f0f4f2df21
routing: separate MissionControl from MissionControlManager
This commit renames the previous MissionControl to MissionController and
the previous MissionController interface to MissionControlQuerier. This
is done because soon the (new) MissionController will back multiple
namespaced MissionControl instances.  For now, it just houses a single
MissionControl in the default namespace.

This commit also replaces the MissionControl's `now` function with a
`clock.Clock`.
2024-10-01 14:06:50 +02:00
Elle Mouton
7dc86acb8c
multi: update PaymentAddr to use fn.Option
Since it is allowed to not be set and so can lead to nil deref panics if
it is a pointer.
2024-09-25 11:14:35 +09:00
Oliver Gugger
e0b4601fb9
multi: add co-op close custom data to close update
With this commit we populate additional information about the close
outputs (including potential custom channel data) in the close update
RPC message.
This will allow custom channels to find out how the additional close
outputs look like on chain and what data they might commit to.

We also hook up the aux custom data formatter, so it can format the
custom channel data to JSON.
2024-09-19 10:18:41 +02:00
Oliver Gugger
d37df75bc0
lnrpc+rpcserver: encode custom records as custom channel data
With this commit we encode the custom records as a TLV stream into the
custom channel data field of the invoice HTLC.
This allows the custom data parser to parse those records and replace it
with human-readable JSON on the RPC interface.
2024-09-19 09:21:38 +02:00
ffranr
008d265cdb
invoicesrpc: add HTLC modifier to invoices RPC server
This commit integrates the HTLC modifier service into the
invoices RPC server.
2024-09-19 09:21:37 +02:00
Oliver Gugger
d49da574e3
lnd: add aux data parser
This commit adds an optional data parser that can inspect and in-place
format custom data of certain RPC messages.
We don't add an implementation of the interface itself, as that will be
provided by external components when packaging up lnd as a bundle with
other software.
2024-09-18 19:07:27 +02:00
Oliver Gugger
5e1a98cd43
lnrpc+rpcserver: add and populate custom channel data 2024-09-18 19:07:26 +02:00
George Tsagkarelis
42e358e3d3
lnrpc: add wire records fields to payment+interceptor RPCs 2024-09-05 11:18:16 +02:00
George Tsagkarelis
70f82bc4ff
routerrpc: add XAddLocalChanAliases & XDeleteLocalChanAliases 2024-09-05 10:29:42 +02:00
Olaoluwa Osuntokun
cc9e2b783e
Merge pull request #8961 from yyforyongyu/fix-leaseoutput
Improve the performace of `LeaseOutput`
2024-08-21 16:31:26 -07:00
MPins
cde5c5b59d lnd: Update the DebugLevel on main cfg 2024-08-14 14:42:49 -03:00
yyforyongyu
d7381ce3fe
rpcserver: remove redundant call to FetchInputInfo 2024-08-09 22:01:56 +08:00
Elle Mouton
5e84ba92af
multi: add IsBlinded to lnrpc.Invoice for nicer UX
The BlindedPathConfig struct is nice for invoice creation but when we
use the Invoice message for viewing an invoice, it would be nicer to see
an "is_blinded" field.
2024-08-08 16:46:01 +02:00
Elle Mouton
48a9a8d20e
zpay32: add functional opt to error out on unknown feature bit
This commit adds two functional options to the zpay32.Decode function.
`WithKnownFeatureBits` allows the caller to overwrite the default set of
known feature bits used by the function.
`WithErrorOnUnknownFeatureBit` allows the caller to instruct the
function to error out if the invoice that is decoded contaijns unknown
feature bits. We then use this new error-out option from the
`rpcServer`'s `extractPaymentIntent` method.
2024-08-07 17:03:12 +02:00
Elle Mouton
e4619afc08
multi: add node omission list for blinded paths 2024-08-07 17:03:11 +02:00
Elle Mouton
3de6c5415a
multi: let blinded path invoice options be set per addinvoice call
Extend the configurability of blinded paths in invoices by adding the
ability to change the global config options on a per-RPC basis.
2024-08-07 17:02:55 +02:00
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
Ononiwu Maureen
b50a1e6360
lnd: modify sendcoin rpc impl for select utxos
Signed-off-by: Ononiwu Maureen <59079323+Chinwendu20@users.noreply.github.com>
2024-08-07 20:42:28 +08:00
Ononiwu Maureen
13bad2c20c
sweep: Add selectUtxos to CraftSweepAllTx args 2024-08-07 20:42:28 +08: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
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
Olaoluwa Osuntokun
9decf80a68
Merge pull request #8735 from ellemouton/rb-receives
[2/4] Route Blinding Receives: Receive and send to a single blinded path in an invoice.
2024-07-29 19:00:06 -07:00
Oliver Gugger
b7c59b36a7
Merge pull request #8896 from ziggie1984/batchopen-feerate-fix
Fix batchopen fee calculation
2024-07-26 05:52:48 -06: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
ziggie
d0a7765c68
rpcserver: include fee calc. for psbt flow.
Include the fee calculaltion for the psbt flow. Moreover include
fee rate testing in the itest environment.
2024-07-26 10:48:00 +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
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
fe34d62eb1
graph+routing: address linter errors
This is done in a separate commit so as to keep the original code-move
commit mostly a pure code move.
2024-07-15 15:56:33 +02:00
Elle Mouton
7f1be39d45
refactor: move various duties from ChannelRouter to graph.Builder
This commit is a large refactor that moves over various responsibilities
from the ChannelRouter to the graph.Builder. These include all graph
related tasks such as:
- graph pruning
- validation of new network updates & persisting new updates
- notifying topology update clients of any changes.

This is a large commit but:
- many of the files are purely moved from `routing` to `graph`
- the business logic put in the graph Builder is copied exactly as is
  from the ChannelRouter with one exception:
- The ChannelRouter just needs to be able to call the Builder's
  `ApplyChannelUpdate` method. So this is now exported and provided to
the ChannelRouter as a config option.
- The trickiest part was just moving over the test code since quite a
  bit had to be duplicated.
2024-07-15 15:56:33 +02:00
Elle Mouton
e9c89ae0ec
multi+refactor: create ForEachNodeChannel with no tx param
In prep for a clean Graph DB interface, we add a version of
ForEachNodeChannel that does not take in an existing db transaction.
2024-07-15 15:13:58 +02:00
Elle Mouton
c20d759d41
refactor: create FetchLightningNode with no tx param
In preparation for adding a clean Graph DB interface, we create a
version of FetchLightningNode that doesnt allow a caller to provide in a
transaction.
2024-07-15 15:13:57 +02:00
Elle Mouton
8c0df98439
multi: add abstraction for Router and SessionSource graph access
In this commit, we completely remove the Router's dependence on a Graph
source that requires a `kvdb.RTx`. In so doing, we are more prepared for
a future where the Graph source is backed by different DB structure such
as pure SQL.

The two areas affected here are: the ChannelRouter's graph access that
it uses for pathfinding. And the SessionSource's graph access that it
uses for payments.

The ChannelRouter gets given a Graph and the SessionSource is given a
GraphSessionFactory which it can use to create a new session. Behind the
scenes, this will acquire a kvdb.RTx that will be used for calls to the
Graph's `ForEachNodeChannel` method.
2024-07-15 15:13:57 +02:00
Elle Mouton
90d6b863a8
routing+refactor: remove the need to give CachedGraph source node access
In preparation for the next commit.
2024-07-15 13:10:24 +02: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
Oliver Gugger
931b3dc0c3
Merge pull request #8815 from yyforyongyu/fix-edge-policy
trivial: fix linter errors and return verbose errors
2024-06-10 12:48:59 -06:00
yyforyongyu
e61cba8d22
multi: return verbose errors when fetching edges 2024-06-10 08:40:18 +08:00
yyforyongyu
78cc1619d7
multi: fix complaints from IDE and linter
Fixed unused param and nilness cond.
2024-06-07 00:45:15 +08:00
Slyghtning
7923ca0de4
rpcserver: retrieve channel info for channel point 2024-06-06 13:37:58 +02:00