Commit Graph

1004 Commits

Author SHA1 Message Date
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
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
Bufo
af9858c3ed
feat: add inbound fees to channel notifications 2024-05-07 18:58:25 +02:00
Oliver Gugger
3d56ffd0e4
Merge pull request #8662 from fuyangpengqi/master
chore: fix function names in comment
2024-04-29 15:10:20 +02:00
fuyangpengqi
5f22d97b51 chore: fix function names in comment
Signed-off-by: fuyangpengqi <995764973@qq.com>
2024-04-27 00:04:09 +08:00
yyforyongyu
d0441a2a29
multi: add default conf targt in SendCoins/SendMany/OpenChannel/CloseChannel 2024-04-26 10:42:44 +08:00
Mohamed Awnallah
5c3015b223
rpcserver: validate DeleteAllPayments options 2024-04-24 18:48:57 +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
Olaoluwa Osuntokun
7af195768a
Merge pull request #8667 from lightningnetwork/elle-new-sweeper
Merge new sweeper branch to master
2024-04-22 11:20:49 -07:00
Oliver Gugger
73fd389e9a
Merge pull request #8627 from feelancer21/inbound-fees-reject
lnrpc: rejects positive inbound fees by default
2024-04-22 01:56:02 -06:00
feelancer21
a2319e4313 lnrpc: rejects positive inbound fees by default
Positive inbound are now rejected by default. The user can enable positive
inbound fees with the option 'accept-positive-inbound-fees'.
2024-04-20 00:11:36 +02:00
yyforyongyu
61e9c11881
rpcserver: skip calculating fee rate for PSBT funding 2024-04-19 21:33:22 +08:00
yyforyongyu
530eed92a0
multi: rename FeePreference to FeeEstimateInfo
Results from running,
```
gofmt -d -w -r 'FeePreference -> FeeEstimateInfo' .
```
2024-04-19 21:33:21 +08:00
yyforyongyu
6ff6c86155
multi: merge DetermineFeePerKw and Estimate
This commit moves `DetermineFeePerKw` into the `Estimate` method on
`FeePreference`. A few callsites previously calling `DetermineFeePerKw`
without the max fee rate is now also temporarily fixed by forcing them
to use `Estimate` with the default sweeper max fee rate.
2024-04-19 21:33:21 +08:00
Oliver Gugger
648fb22f63
multi: wrap all errors 2024-04-11 15:04:03 +02: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
ziggie
eba4911599
lnd: fix sweepall argument call.
maxFeeRate and feePerKw were switched in CraftSweepAllTx.
2024-04-01 20:00:54 +01: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
Joost Jager
763787e08c routing+lnrpc: add inbound fee policy update 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
Keagan McClelland
db39a905cb multi: make NewChanIDFromOutpoint accept value instead of pointer 2024-03-08 15:47:55 -08:00
Andras Banki-Horvath
7a45bbbeab
lnd: call into the correct InvoiceStore from RPC calls 2024-03-01 10:08:10 +01:00
ffranr
cd566eb097
multi: fix fmt.Errorf error wrapping
Refactor fmt.Errorf usage to correctly wrap errors instead of using
non-wrapping format verbs.
2024-02-27 11:13:40 +00:00
yyforyongyu
605211823d
multi: fix timestamp filters for payment query
This commit fixes the timestamp precision to always compare the dates
using unix seconds for payments.
2024-02-05 15:26:49 +08:00
yyforyongyu
18333e8c7d
multi: fix timestamp filters for invoice query
This commit fixes the timestamp precision to always compare the dates
using unix seconds for invoices.
2024-02-05 15:26:43 +08:00
yyforyongyu
1057eb729d
multi: add unsafedisconnect as a dev config
This commit adds a new dev config `unsafedisconnect` as we sometimes
want to disconnect nodes in our itests.
2024-02-01 21:21:18 +08:00
yyforyongyu
78d552de22
config+rpcserver: hide deprecated option unsafe-disconnect
Also fix a case where this deprecated flag is used. We will always
bypass the active channels check when `DisconnectPeer` because
`!r.cfg.UnsafeDisconnect` is always false.
2024-02-01 21:20:11 +08:00
yyforyongyu
157c84cc4d
multi: log warnings if deprecated config options are used
This commit adds warning logs if the user uses deprecated config
options, paving the way for future removal.
2024-02-01 21:20:11 +08:00
Jesse de Wit
e794bd37a4
lnrpc: include raw closing tx in waiting_close_channels 2024-01-29 14:16:50 +01:00
Keagan McClelland
804dabb4ea lnd: make closechannel send an instant empty update when no_wait set
We do things this way to keep behavior consistent across REST, gRPC
and CLI consistent. This was done to not alter the way we handle
Recv calls from the streams.
2024-01-23 12:25:01 -08:00
Oliver Gugger
8a2c3a3d85
lnrpc+rpcserver: add new GetDebugInfo RPC method 2024-01-09 12:32:37 +01:00
bitcoin-lightning
b72fc9529e docs: fix typos 2023-12-21 15:21:35 +00:00
Elle
4fa483f1bc
Merge pull request #7702 from ellemouton/towerClientMux
wtclient: Tower Client Multiplexer
2023-12-05 12:27:05 +02:00
Marcos
90b5037d73
lnrpc: add MinConfs to WalletBalanceRequest 2023-12-01 18:22:35 +01:00
Elle Mouton
fcfdf699e3
multi: move BackupState and RegisterChannel to Manager
This commit moves over the last two methods, `RegisterChannel` and
`BackupState` from the `Client` to the `Manager` interface. With this
change, we no longer need to pass around the individual clients around
and now only need to pass the manager around.

To do this change, all the goroutines that handle channel closes,
closable sessions needed to be moved to the Manager and so a large part
of this commit is just moving this code from the TowerClient to the
Manager.
2023-11-28 10:59:40 +02:00
Elle Mouton
a44bf381c4
multi: move AddTower to Tower Client Manager
In this commit we move the AddTower method from the Client interface to
the TowerClientManager interface. The wtclientrpc is updated to call the
`AddTower` method of the Manager instead of calling the `AddTower`
method of each individual client. The TowerClient now is also only
concerned with adding a new tower (or new tower address) to its
in-memory state; the tower Manager will handle adding the tower to the
DB.
2023-11-28 09:54:02 +02:00
yyforyongyu
816a70e08c
multi: add new config usestatusinitiated for the new payment status
This commit adds a new config value to signal that the user understands
the new payment status `StatusInitiated`.
2023-11-15 20:18:17 +08:00
Elle Mouton
0e82293e45
multi: address linter issues 2023-11-08 14:50:35 +02:00