Commit Graph

1179 Commits

Author SHA1 Message Date
positiveblue
383cb40f8d
multi: create channeldb/models package
Add a new subpackage to `lnd/channeldb` to hold some of the types that
are used in the package itself and in other packages that should not
depend on `channeldb`.
2023-01-16 07:14:55 -08:00
Oliver Gugger
3dd9e04b8b
Merge pull request #7306 from YusukeShimizu/docs-invoice-default-expiry
Docs invoice default expiry
2023-01-12 10:29:07 +01:00
bruwbird
71f2615190
lnrpc: update invoice request expiry comment 2023-01-12 09:17:34 +09:00
bitromortac
045e5cf307
routerrpc: update QueryProbability documentation
Changes the docstring of QueryProbability to reflect changes that were
introduced in #6857.
2023-01-11 16:47:54 +01:00
Elle Mouton
c3a2368f46
multi: migrate towers to use RangeIndex for AckedUpdates
In this commit, a migration is done that takes all the AckedUpdates of
all sessions and stores them in the RangeIndex pattern instead and
deletes the session's old AckedUpdates bucket. All the logic in the code
is also updates in order to write and read from this new structure.
2023-01-11 13:59:03 +02:00
Carla Kirk-Cohen
1cb08e42ef
lnrpc: update custom message API to explain ability to override 2023-01-05 12:05:06 -05:00
bitromortac
2d7fda2a41
routerrpc: mark QueryProbability deprecated
We deprecate `QueryProbability`, as it displays the same information as
`QueryMissionControl` less the probability. `QueryRoutes` still contains
the total probability of a route.
2022-12-12 13:23:31 +01:00
bitromortac
454c115b6e
routing+routerrpc: add capacity in rpcs
FetchPairCapacity is used by the following endpoints to introduce the
capacity for probability calculations:

* QueryProbability
* QueryRoutes
2022-12-12 13:22:29 +01:00
bitromortac
66ffc64776
router: return probability from findPath
The returned probability can then be used in QueryRoutes to not having
to reconstruct the probability.
2022-12-12 13:22:29 +01:00
bitromortac
516e3a8cca
routing: use capacity in pathfinding
Extends the pathfinder with a capacity argument for later usage.

In tests, the inserted testCapacity has no effect, but will be used
later to estimate reduced probabilities from it.
2022-12-12 13:22:28 +01:00
ffranr
561bf82985
chainrpc: add chainkit RPC service
New endpoints: GetBlock, GetBestBlock, and GetBlockHash.
2022-12-07 14:50:14 +00:00
ffranr
308e7ce72d
lnrpc: identify *.proto files as separate files within a given directory 2022-12-06 12:52:31 +00:00
ffranr
03f9549f97
chainrpc: generalise chain notifier RPC server name 2022-12-06 12:52:25 +00:00
yyforyongyu
7533de4a8f
proto: fix typo [skip ci] 2022-12-06 14:04:42 +08:00
yyforyongyu
b7c829f792
proto: add creation data filters in ListPaymentsRequest 2022-12-05 20:04:42 +08:00
yyforyongyu
cfa2cb01d0
proto: add creation date filters in ListInvoiceRequest 2022-12-05 20:03:55 +08:00
Tommy Volk
372333fd2b
lnrpc: clarify proto documentation for Invoice 2022-12-05 20:01:27 +08:00
Oliver Gugger
e7170ef819
Merge pull request #7135 from st4rgut24/revise-addinvoice-help-text
revise help text for addinvoice lncli command
2022-11-18 18:43:58 +01:00
alpeb-btc
eefe1c816e
lnrpc+cmd: clarify docs about addinvoice no-amount hop hints
Add additional comment to `lnclic addinvoice`'s `--private` flag warning
about including a large number of private channel hints when using zero
ammounts.

Also added a comment to the `private` field in the `Invoice` proto
message.
2022-11-12 05:01:10 -05:00
alpeb-btc
0cae501009
lnrpc: provide hop hints when adding an invoice with no amount
With this change we allow adding hop hints when adding an invoice, even
if its amount is zero.

A couple of new unit test case have been added, and the
`testInvoiceRoutingHints` itest was expanded to account for this
scenario.
2022-11-12 05:01:10 -05:00
alpeb-btc
e68ae33c9a
lnrpc: refactor populateHopHintsTestCases in addinvoice_test.go
Extract into a separate function the steps to set up the two-channel
mock, to be reused in other cases.
2022-11-12 05:01:09 -05:00
alpeb-btc
143111e368
lnrpc: fix typos in addinvoice_test.go 2022-11-12 05:01:09 -05:00
st4rgut24
8d6d1564c0 cli: revise help text for addinvoice lncli command [skip ci] 2022-11-11 14:31:04 -08:00
habibitcoin
0b1e881d18
scripted-diff: replace ⛰ emoji with $ [skip ci]
-BEGIN VERIFY SCRIPT-
sed -i 's/⛰/$/g' $(git grep -l '⛰')
-END VERIFY SCRIPT-
2022-10-28 12:06:49 -04:00
Joost Jager
3a89a84744
rpcserver: add LookupHtlc call 2022-10-27 16:43:09 +02:00
Joost Jager
511fb00777
htlcswitch: add final htlc event to notifier 2022-10-27 16:42:36 +02:00
Joost Jager
b85cda2a1d
routerrpc: add htlc notifier subscribed event 2022-10-27 16:42:35 +02:00
Slyghtning
46b8de35ac lnrpc+lncli: rename skip_peer_alias_lookup to reflect opt-in behavior 2022-10-27 07:11:19 -04:00
Joost Jager
6e073cb213
rpcserver: expose graph tlv data 2022-10-25 18:17:35 +02:00
Oliver Gugger
8c66353e4c
Merge pull request #7001 from hieblmi/fwdinghistory-alias-info
lncli: incoming and outgoing peer alias in `fwdinghistory`
2022-10-20 17:16:47 +02:00
Joost Jager
a0a50fa844
htlcswitch: auto-fail held htlcs
Make the interceptable switch aware of htlc expiry and fail back htlcs in-time
to prevent the counterparty from force-closing the channel.
2022-10-18 18:06:49 +02:00
Slyghtning
425ce55968 lnrpc: peer_alias_in and peer_alias_out fields for ForwardingEvent 2022-10-18 11:08:00 -04:00
benthecarman
4607dff2c3
lnrpc: fix description of tx_index to be correct[skip ci] 2022-10-16 19:59:40 -05:00
Oliver Gugger
d2d3cf3408
Merge pull request #6956 from ellemouton/configureChanReserve
multi: configurable remote chan reserve
2022-10-13 15:39:40 +02:00
Elle Mouton
15858cae1c
watchtower+lnrpc: remove AckedUpdates from ClientSession struct
In this commit, we start making use of the new ListClientSession
functional options added in the previous commit. We use the functional
options in order to calculate the max commit heights per channel on the
construction of the tower client. We also use the options to count the
total number of acked and committed updates. With this commit, we are
also able to completely remove the AckedUpdates member of the
ClientSession since it is no longer used anywhere in the code.
2022-10-13 14:36:33 +02:00
Oliver Gugger
f02528f304
multi: bump Golang version to v1.19.2 2022-10-11 09:49:30 +02:00
Roei Erez
b6a24b52fe
lnrpc+rpcserver: add remote reserve to openchannel request 2022-10-07 14:57:05 +02:00
Olaoluwa Osuntokun
94ab72363a
Merge pull request #6914 from positiveblue/fix-6898
addinvoice: refactor hint hop selection algorithm
2022-09-30 11:57:54 -07:00
positiveblue
4b0bc9a7c6
invoicesrpc: unit tests for invoice hop hints 2022-09-30 06:55:16 -07:00
positiveblue
fbe79811cf
invoicesrpc: refactor addinvocie hop hint selection
In order to reduce the number of calls to the db we try to process as
few channels as we can + try to not do extra work for each of them.

- First fetch all the channels. Then, filter all the public ones and
  sort the potential candidates by remote balance.

- Filter out each potential candidate as soon as possible.

- Only check the alias if the channel supports scid aliases.

- Because we sort the channels by remote balance, we will hit the
  target amount, if possible, as soon as we can.

We do not want to leak information about our remote balances, so we
shuffle the hop hints (the forced ones go always first) so the invoice
receiver does not know which channels have more balance than others.
2022-09-30 06:55:10 -07:00
Slyghtning
021cb07b39 lnrpc: channel fee parameters for OpenChannelRequest 2022-09-28 09:28:11 -04:00
positiveblue
0e803172d6
style: format invoicesrpc/addinvoice.go 2022-09-28 02:19:55 -07:00
ueno
1384366994 lnrpc: add comment for AnchorState [skip ci] 2022-09-26 20:38:58 +09:00
Oliver Gugger
2dee112fe9
Merge pull request #6919 from benthecarman/state-desc
Add comments for all wallet states
2022-09-22 17:06:40 +02:00
Oliver Gugger
01cd1c991e
lnrpc: add additional REST binding for QueryRoutes
Lists with non-primitive members aren't supported in the query string of
a GET request with the current version of the grpc-gateway library. To
allow route_hints to be set through REST, we also offer a POST endpoint
for that call where the encoding of the request parameter can be
specified as JSON.
2022-09-19 10:18:34 +02:00
benthecarman
96326e045a
Add comments for all wallet states [skip ci] 2022-09-15 09:14:36 -05:00
Olaoluwa Osuntokun
89ebd03ff8
Merge pull request #6899 from kaloudis/protos-remove-js-build-tag
lnrpc/gen_protos.sh: remove js build tag
2022-09-13 17:36:14 -07:00
Jesse de Wit
0266ab77ab
routing+routerrpc: test stream cancellation
Test stream cancellation of the TrackPayments rpc call. In order to achieve
this, ControlTowerSubscriber is converted to an interface, to avoid trying to
close a null channel when closing the subscription. By returning a mock
implementation of the ControlTowerSubscriber in the test that problem is
avoided.
2022-09-10 21:53:01 +02:00
Jesse de Wit
275f085e6d
routerrpc: add TrackPayments
Add method to track all payments rather than tracking a payment by payment hash.
2022-09-08 10:48:34 +02:00
Evan Kaloudis
981f8969b4
lnrpc/gen_protos.sh: remove js build tag 2022-09-07 18:32:05 -04:00
Oliver Gugger
2dac7ef35a
lnrpc: add wallet output type for Taproot 2022-08-25 09:21:52 +02:00
Oliver Gugger
74fbd61d5f
walletrpc: add ImportTapscript RPC 2022-08-25 09:21:50 +02:00
Oliver Gugger
97dfc04117
lnrpc: allow importing Taproot pubkeys 2022-08-25 09:20:23 +02:00
Olaoluwa Osuntokun
b3998ddb5c
lnrpc: re-compile protos w/ Go 1.19 2022-08-24 11:43:00 -05:00
Olaoluwa Osuntokun
65a5eeb24e
build: make Go 1.18 the min version, update to Go 1.19
As usual, we keep with the last two Go versions, which means the last
year of Go release (they release every 6 months or so).

This change means we can now use the type params (generics) in the
project!
2022-08-23 10:54:13 -05:00
yyforyongyu
0735522194
multi: fix make fmt 2022-08-23 22:10:24 +08:00
priyanshiiit
dba77edf2a lnrpc: adds list addresses rpc 2022-08-18 08:09:16 +05:30
Slyghtning
b2e624cd52 psbt: Indicate which psbt inputs were signed 2022-08-16 19:31:06 -04:00
Oliver Gugger
e488bbfc9d
Merge pull request #6457 from sangaman/init-macaroon-root-key
Specify macaroon root key during wallet init
2022-08-15 09:29:05 +02:00
Oliver Gugger
996f4bc260
Merge pull request #6510 from ErikEk/neutrinorpc-add-getblockhash
neutrinorpc: add getblockhash
2022-08-15 09:20:23 +02:00
ErikEk
74023fe230 neutrinorpc: add getblockhash functionality 2022-08-13 21:41:30 +02:00
eugene
4ab80b012d
chanacceptor+lnrpc: update the commitmentTypes, send zero-conf to client
This updates the RPCAcceptor to send the correct commitment type
even if the zero-conf or scid-alias channel types are set. This also
adds two bools to the ChannelAcceptRequest struct that denotes whether
the funder set the zero-conf and scid-alias channel types.
2022-08-12 16:36:17 -04:00
Daniel McNally
86e5f9d0db
lnrpc: add macaroon_root_key to InitWalletRequest
This adds a field for specifying the macaroon root key to use during the
wallet initialization process instead of having lnd generate a random
macaroon root key itself.
2022-08-12 10:30:32 -04:00
Olaoluwa Osuntokun
559160e95c
Merge pull request #6734 from Crypt-iQ/alias_listchannels
rpc: add alias info to some rpcs
2022-08-10 18:38:18 -07:00
Oliver Gugger
17014b592e
Merge pull request #6730 from Roasbeef/notifier-optional-block
chainntfns: add new option for conf notifications to send block
2022-08-10 13:52:49 +02:00
eugene
aa576adecc
rpc+cli: add general ListAliases function to dump all aliases 2022-08-09 14:11:08 -04:00
eugene
48f270fe20
rpc: add zero-conf, alias information to {list,closed}channels 2022-08-09 14:09:41 -04:00
Olaoluwa Osuntokun
e4b5aa94a3
Merge pull request #6770 from Roasbeef/co-op-close-with-more-spec-innit
lnwallet/chancloser: remove the commit fee clamp, introduce max fee
2022-08-08 18:14:22 -07:00
Data Retriever
9a368f0e8c trivial: typo fix [skip ci] 2022-08-07 20:29:19 +00:00
Oliver Gugger
e86a69b815
Merge pull request #6748 from Kixunil/patch-3
doc: Deprecation reason of `settled` on `Invoice`
2022-08-02 12:38:08 +02:00
Martin Habovštiak
b4647bc37f doc: Deprecation reason of settled on Invoice
This documents how to deal with `settled` being deprecated. It took me quite a bit of digging without such documentation.

[skip ci]
2022-08-02 11:04:01 +02:00
Olaoluwa Osuntokun
cdb15e77d5
lnrpc/chainrpc: include the block in the conf ntfn if specified 2022-08-01 19:59:28 -07:00
Olaoluwa Osuntokun
c791b18cc0
lnrpc: add a new max_fee field to the CloseChannel RPC call
In this commit, we add a new max_fee field that we'll use to decide when
to bail out of a co-op close dance as the initiator.
2022-07-26 17:23:13 -07:00
Elle Mouton
25acb51ba3
multi: registration complete MW interceptor msg
In this commit, we change the flow of the rpc middleware registration
a bit. In order to allow a client to add rpc middleware interceptors in
a deterministic order, we now make the server send a "registration
complete" message to the client after compeleting the registration
process so that the client knows when it can go ahead and register the
next client.
2022-07-20 14:58:47 -05:00
yyforyongyu
07e9adfd8c
routerrpc+cmd: use skip_temp_err when sending to route 2022-07-15 19:03:12 +08:00
yyforyongyu
46ca28fe22
routerrpc: add new field skip_temp_err in SendToRouteRequest 2022-07-15 19:03:12 +08:00
Oliver Gugger
e6b25309bd
Merge pull request #6731 from guggero/linter-upgrade
tools: upgrade linter version to v1.46.2
2022-07-15 11:25:25 +02:00
ErikEk
b5af0ce327
signrpc: add schnorr sig to sign and validate msg 2022-07-14 10:29:29 +02:00
Oliver Gugger
502542da60
lnrpc: add is_error to intercept message 2022-07-14 09:36:48 +02:00
Oliver Gugger
d604055ccc
lnrpc: describe request replacement in API docs
This commit updates the comments in the proto file to mention the new
behavior of also being able to replace request messages.
2022-07-14 09:36:36 +02:00
Oliver Gugger
66258ee7b5
lnrpc: enable RPC middleware in REST WebSockets
If we don't flag the /v1/middleware call as request streaming, it can't
be used properly with REST WebSockets because the proxy would close the
connection after the first request message.
2022-07-14 09:36:36 +02:00
Oliver Gugger
850330a34e
multi: fix linter issues
Fix some issues found by the new nonamedreturn rule and rename some
nolint comment to the new rule name.
2022-07-14 09:30:53 +02:00
eugene
49dd4b9e34
multi: add zero-conf, scid-alias channel-types to rpc
This allows the open channel rpcs to use the zero-conf or scid-alias
channel types.
2022-07-07 17:10:30 -04:00
eugene
0ba67015da
rpcserver+invoicesrpc: alias-aware AddInvoice,AddHoldInvoice rpc
AddInvoice,AddHoldInvoice now issue invoices that include our
peer's aliases. Some extra sanity checks are included to ensure we
don't leak our confirmed SCID for a private channel.
2022-07-07 17:10:29 -04:00
eugene
1aa9626606
server+funding: allow scid-alias, zero-conf chantypes, scid-alias
feature-bit channels

This allows opening zero-conf chan-type, scid-alias chan-type, and
scid-alias feature-bit channels. scid-alias chan-type channels are
required to be private. Two paths are available for opening a zero-conf
channel:

* explicit chan-type negotiation
* LDK carve-out where chan-types are not used, LND is on the
  receiving end, and a ChannelAcceptor is used to enable zero-conf

When a zero-conf channel is negotiated, the funding manager:
* sends a FundingLocked with an alias
* waits for a FundingLocked from the remote peer
* calls addToRouterGraph to persist the channel using our alias in
  the graph. The peer's alias is used to send them a ChannelUpdate.
* wait for six confirmations. If public, the alias edge in the
  graph is deleted and replaced (not atomically) with the confirmed
  edge. Our policy is also read-and-replaced, but the counterparty's
  policy won't exist until they send it to us.

When a scid-alias-feature channel is negotiated, the funding manager:
* sends a FundingLocked with an alias:
* calls addToRouterGraph, sends ChannelUpdate with the confirmed SCID
  since it exists.
* when six confirmations occurs, the edge is deleted and re-inserted
  since the peer may have sent us an alias ChannelUpdate that we are
  storing in the graph.

Since it is possible for a user to toggle the scid-alias-feature-bit
to on while channels exist in the funding manager, care has been taken
to ensure that an alias is ALWAYS sent in the funding_locked message
if this happens.
2022-07-07 17:10:28 -04:00
Oliver Gugger
b8f1541800
signrpc: fix p2tr support in ComputeInputScript 2022-06-29 18:28:59 +02:00
priyanshiiit
3befeadaf3 lnrpc+lncli: adds required reserve rpc & cli 2022-06-28 23:31:51 +05:30
priyanshiiit
8578433b3d lnrpc+lnd: adds required reserve in walletbalance rpc 2022-06-28 23:31:51 +05:30
priyanshiiit
983d917d4a lnrpc: add previous_outpoints to listchaintxns 2022-06-27 15:57:57 +05:30
ErikEk
26ba01a5cb doc: subscribe/cancel/lookup invoices rest 2022-06-26 07:15:27 +02:00
Oliver Gugger
c492f367cd
lnrpc: fix comment and formatting in ConnectPeerRequest [skip ci]
Fixes #6643.
2022-06-14 22:09:51 +02:00
priyanshiiit
1e0a271ddb lnrpc: improves invoice documentation [skip ci] 2022-06-14 15:56:36 +05:30
Oliver Gugger
36d6656d0d
walletrpc: add p2tr to NextAddr and BumpFee RPCs 2022-06-10 14:03:46 +02:00
Olaoluwa Osuntokun
2298ef81ab
lnrpc/walletrpc: reject PSBT packets w/o any UTXO input info
Fixes https://github.com/lightningnetwork/lnd/issues/6567
2022-06-02 13:05:58 -07:00
Oliver Gugger
70103a1838
multi: return more information in list of leased outputs
With this commit we return the additional information the wallet now
provides about locked/leased outputs.
2022-05-12 10:24:40 +02:00
Oliver Gugger
a25d5255fb
walletrpc: add pkScript and value to UTXO lease 2022-05-12 10:24:39 +02:00
Olaoluwa Osuntokun
630fc36dcf
multi: introduce and use new TapTweak and SignMethod fields
In this commit, we add a new field `TapTweak` to be used for key path
spends. Before this commit, we'd overload the existing `WitnessScript`
field to pass this information to the signing context. This was
confusing as for tapscript spends, this was the leaf script, which
mirrors the other script based spending types.

With this new filed, users need to set this to the script root for
keypath spends where the output key commits to a real merkle root, and
nothing when bip 86 spending is being used.

To make the signing even more explicit, we also add a new field called
sign_method with an enum type that differentiates between the different
segwit v0 and v1 signing methods.

Fixes https://github.com/lightningnetwork/lnd/issues/6446.
2022-05-11 10:07:49 +02:00
Oliver Gugger
10f7213998
Merge pull request #6472 from tvolk131/document_confirmation_height
Document that `confirmation_height` is unset
2022-05-09 10:55:31 +02:00
Tommy Volk
a2db074eec lnrpc: remove confirmation_height from PendingOpenChannel proto 2022-05-06 17:28:43 +00:00
Andras Banki-Horvath
c4c188f6d9
signer: fix crash when musig combine doesn't have final sig 2022-05-06 12:29:38 +02:00
Oliver Gugger
48695dd801
Merge pull request #6495 from guggero/musig2-session-cleanup
MuSig2: Add session cleanup RPC
2022-05-04 21:30:52 +02:00
Oliver Gugger
52e42fc107
lnrpc+itest: implement MuSig2Cleanup RPC 2022-05-04 19:23:58 +02:00
Oliver Gugger
771d77d875
signrpc: add MuSig2Cleanup RPC 2022-05-04 19:23:57 +02:00
Olaoluwa Osuntokun
12b82d0156
Merge pull request #5652 from ErikEk/neutrino-sub-server
Neutrino sub-server
2022-05-03 16:01:24 -07:00
Oliver Gugger
a44e56b51a
lnrpc: add new request/response fields for payment count 2022-05-02 12:32:06 +02:00
Torkel Rogstad
d6db386663
chainrpc: clarify documentation
Clarify the comment on RegisterConfirmationsNtfn. The output script
is in fact mandatory, not optional.
2022-04-30 10:44:34 +02:00
ErikEk
8c7be4ebf5 neutrinorpc: subserver functionality 2022-04-30 08:55:55 +02:00
ErikEk
635cffa871 multi: add sub-server dep 2022-04-30 08:55:49 +02:00
Oliver Gugger
f7275c7fc4
multi: implement MuSig2 RPCs and remote signing 2022-04-29 11:41:09 +02:00
Joost Jager
caf11d2607
rpcserver: expose interceptor required flag on info call 2022-04-25 11:05:18 +02:00
ErikEk
b2646edc52 neutrinorpc: logger 2022-04-20 10:36:45 +02:00
ErikEk
0ce449f99b neutrinorpc: config 2022-04-20 10:07:42 +02:00
Olaoluwa Osuntokun
d397e3e680
Merge pull request #6340 from Roasbeef/go-1-18
build: update to Go 1.18
2022-04-13 15:02:26 -07:00
Joost Jager
9195f29e61
routing+channeldb: send payment metadata from invoice 2022-04-13 22:55:40 +02:00
Joost Jager
ba5abdc090
routing: add time_pref parameter to queryroutes and sendpayment 2022-04-13 20:26:46 +02:00
Olaoluwa Osuntokun
a90dfff9a5
build: update to Go 1.18 2022-04-12 16:14:04 -07:00
Oliver Gugger
1e72d6737d
lnrpc+itest: fix panic with missing UTXO info
Fixes #6396.
This commit fixes a panic that occurred when trying to sign for a
Taproot output without specifying the full UTXO information for each
input. Instead of panicking an error is now returned.
2022-04-12 19:30:12 +02:00
Olaoluwa Osuntokun
2fd900b172
Merge pull request #5587 from positiveblue/5466-update-node-announcement-data
lnrpc: Add UpdateNodeAnnouncement endpoint
2022-04-11 22:32:12 -04:00
Olaoluwa Osuntokun
427a518b0a
lnrpc: ignore legacy onion payload as an option for SendToRoute
In this commit, we start to ignore the option to allow the caller to use
the legacy onion payload. The new payload is much more flexible and
efficient, so there's really no reason to still use it, other than for
backwards compatibility tests. Our existing tests that exercise the
legacy feature uses a build tag, which forces nodes to not advertise the
new payload format, which then forces path finding to include the legacy
payload, so we can be confident that route is still being tested.

The existence of this option (which actually makes the TLV payload
opt-in for `SendToRoute` users) makes it harder to remove it from the
protocol all together. With this PR, we take a step forward to allowing
such a change which is being tracked on the spec level at:
https://github.com/lightning/bolts/pull/962.

In a future release, we'll move to remove the field all together.
Ignoring the field today doesn't seem to have any clear downsides, as
most payments always include the MPP payload (due to payment secrets),
so this shouldn't impact users in a significant way.
2022-04-11 20:29:57 -04:00
positiveblue
ae2aa5671f
lnrpc/peers: handle feature bit changes in updateNodeAnnouncement 2022-04-02 19:10:25 -07:00
positiveblue
76196db70e
lnrpc/peers: handle net address changes in updateNodeAnnouncement 2022-04-02 19:09:10 -07:00
positiveblue
aacb2565f5
lnrpc/peers: handle color changes in updateNodeAnnouncement 2022-04-01 18:36:26 -07:00
positiveblue
ce4813940d
lnrpc/peers: handle alias changes in updateNodeAnnouncement 2022-04-01 18:36:26 -07:00
positiveblue
e4e0935816
lnrpc/peers: skeleton logic for updateNodeAnnouncement
Basic logic for the endpoint:

- Get the current nodeAnn information
- Calculate modifications
- Apply modifications
- Return changes
2022-04-01 18:36:21 -07:00
positiveblue
5ab0cbd433
lnrpc: add updatenodeannouncement to Peers service
New endpoint for the `Peers` subrpc.
2022-04-01 18:20:05 -07:00
positiveblue
d4021c5aca
lnrpc: fix log.go files
The `log.go` file of each subserver is a copy and paste of the others.
All of them have the same typo, an extra space in a comment, and the
the definition of a function not used anywhere.
2022-04-01 18:12:59 -07:00
positiveblue
9db17d7a22
lnrpc: add peersrpc subsever 2022-04-01 18:12:58 -07:00
positiveblue
d2f016c105
lnrpc: add peers .proto files 2022-04-01 18:12:58 -07:00
Oliver Gugger
40358d406d
lnrpc: fix websocket proxy data race
Was discovered in a race unit test in lightning node connect that uses
the websocket proxy to connect to the hashmail server on the client
side.
By not shadowing the err variable we end up reading and writing to the
same variable from two different goroutines, which causes the data race.
2022-03-30 17:03:30 +02:00
Oliver Gugger
3b5585c12b
multi: fix and test v1 output spend ntfns
Because Taproot key spend only spends don't allow us to re-construct the
spent pkScript from the witness alone, we cannot support registering
spend notifications for v1 pkScripts only. We instead require the
outpoint to be specified. This commit makes it possible to only match by
outpoint and also adds an itest for it.
2022-03-24 18:02:40 +01:00
Oliver Gugger
ef98f2df8a
multi: add p2tr tapscript key path signing capabilities 2022-03-24 18:02:39 +01:00
Oliver Gugger
78db46be7e
multi: add p2tr tapscript signing capabilities 2022-03-24 18:02:39 +01:00
Oliver Gugger
c73cf03a55
multi: add p2tr keyspend wallet support 2022-03-24 18:02:38 +01:00
Oliver Gugger
72c9582b85
multi: bump btcd to taproot aware version 2022-03-24 15:00:25 +01:00
Oliver Gugger
1670000fd8
walletrpc: add debug log statement for invalid PSBT
To help debug remote signing issues, it's helpful to get the raw PSBT
that failed to be parsed. This is necessary since serializing an invalid
PSBT is allowed and the checks only fail when trying to de-serialize
such an invalid packet.
2022-03-24 09:28:27 +01:00
Bjarne Magnussen
48c773ec87
lnrpc: add DestOutput information to RPC GetTransactions 2022-03-23 11:29:09 +01:00
Bjarne Magnussen
188b39268d
lnrpc: add DestOutput to the protobuf 2022-03-23 11:29:09 +01:00
Oliver Gugger
57840bba36
Merge pull request #6232 from bottlepay/require-interceptor
htlcswitch: add an always on mode to htlc interceptor
2022-03-19 10:47:22 +01:00
Olaoluwa Osuntokun
4ecd153be2
lnrpc: add new locked balance field for WalletBalance
In this commit, we add a new field to the WalletBalance call that
permits users to account for the set of outputs that may be locked due
to a pending transaction. Without this field any time users locked
outputs for things like PSBT signing, then they disappear from the
WalletBalance call, which may cause a panic.
2022-03-17 16:36:44 -07:00
Olaoluwa Osuntokun
f13399bc49
Merge pull request #6190 from ErikEk/listunspent-deafult-values
walletrpc: add default values to listunspent
2022-03-16 16:16:45 -07:00
Joost Jager
169f0c0bf4
routerrpc+htlcswitch: move intercepted htlc tracking to switch
In this commit we move the tracking of the outstanding intercepted htlcs
to InterceptableSwitch. This is a preparation for making the htlc
interceptor required.

Required interception involves tracking outstanding htlcs across
multiple grpc client sessions. The per-session routerrpc
forwardInterceptor object is therefore no longer the best place for
that.
2022-03-15 08:44:57 +01:00
Oliver Gugger
95c270d1f8
Merge pull request #6217 from liviu-ln/psbt-finalize-check
walletrpc: return an error when finalizing an already complete PSBT
2022-03-14 10:45:24 +01:00
Oliver Gugger
7dfe4018ce
multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
2022-03-09 19:02:37 +01:00
ErikEk
74db83bbfb walletrpc: add default values to listunspent 2022-02-17 10:05:16 +01:00
Oliver Gugger
13f187046b
multi: fix issues reported by whitespace linter 2022-02-15 16:26:08 +01:00
Oliver Gugger
895a2e497b
multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
Oliver Gugger
dfdc2bff8b
multi: run gosimports 2022-02-10 11:02:01 +01:00
carla
0092c731e5
lnrpc: limit hop hint selection in both passes by amount + count
Previously, we'd always add up to the maximum number of hop hints
(and beyond!) when selecting hop hints in our first pass. This
change updates hop hint selection to always stick to our hop hint
limit, and to the "hop hint factor" that we scale our invoices by.

This change will result in selecting fewer channels in our first
pass if their total inbound capacity reaches our hop hint factor.
This prevents us from revealing as many private channels as
before, but has the downside of providing fewer options for
payers.
2022-02-07 09:04:30 +02:00
carla
5836d58a99
lnrpc: add unit test covering too many hop hints 2022-02-07 09:03:10 +02:00
Olaoluwa Osuntokun
80e304573c
lnwallet: increase legacy fee limit threshold to 1k sats
In this commit, we increase the legacy fee limit threshold (the amount
below which we'll allow 100% of funds to go to fees for the non-v2 RPC
calls) from 50 sats to 1k sats.
2022-02-03 11:54:01 -08:00
Oliver Gugger
d22f543906
lnrpc: use amount based default routing fee 2022-02-02 14:24:53 +01:00
Joost Jager
e2b56f212f
htlcswitch: accept failure reason for intercepted htlcs 2022-02-01 17:18:59 +01:00
Oliver Gugger
a5849bb189
devrpc: remove lncli API docs tag [skip ci]
The API doc generator failed after merging #6149 because of the `lncli
importgraph` tag in the proto file.
We could also fix the API doc generator by adding the "dev" build tag,
but not including any dev only features in the API docs is probably the
preferred path.
2022-01-31 13:05:27 +01:00
Liviu
e11c41ba8f walletrpc: return an error when finalizing an already complete PSBT
Return an error to the client if attempting to finalize a PSBS with no missing signatures.
2022-01-30 21:37:32 -08:00
Oliver Gugger
b77c1fb200
Merge pull request #6149 from bhandras/graph_import_rpc
lnd: add `devrpc` sub server and `devrpc.ImportGraph` to import graph dumps
2022-01-28 10:24:59 +01:00
carla
714a1fb05c
invoicerpc: move hop hint to constant and add tests to select hop hint 2022-01-27 15:09:21 +02:00
carla
80bf4bf014
invoicerpc: return hop hints from select hop hint rather than functions
Update SelectHopHints to return a set of hop hints that can be
converted to route hints / functional options by the caller. This
change allows external code to call SelectHopHints to get a set of
route hints and use them as it likes, rather than limiting the
return value to functional options for invoice creation.
2022-01-27 15:09:20 +02:00
carla
00a47740c8
invoicesrpc: pass in specialized config for select hop hints 2022-01-27 15:09:19 +02:00
carla
56e83de9ef
invoicesrpc: add HopHintInfo decoupling hop hint from channel internals 2022-01-27 15:09:18 +02:00
ErikEk
ef1eff1058 lnrpc: fix the existing routing fee inaccuracy
When updating the channel routing policy, we encounter an inaccurate
precision error when calculating the routing fee. The issue stems from
the way the IEEE 754 standard works.

The solution here is to add a uint64 parameter (as mentioned in the
issue) and keep the float64 fee_rate parameter but rounding the product
of the base and fee rate.
2022-01-25 15:42:57 -08:00
Andras Banki-Horvath
eeea141e01
lnd: allow large GRPC messages 2022-01-24 17:43:00 +01:00
Andras Banki-Horvath
1a8f094503
lnrpc: add the devrpc development only subserver + devrpc.ImportGraph
This commits adds the devrpc package which implements a subserver that
adds clean separation for RPC calls useful for development and
debugging. This subserver is only compiled in if the dev tag is set.
Furthermore the commit adds the devrpc.ImportGraph call which can
import a graph dump obtained from another node by calling DescribeGraph.
Since the graph dump does not include the auth proofs, the imported
channels will be considered private.
2022-01-24 17:42:59 +01:00
Dimitris Apostolou
530a2059e5
multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
Andras Banki-Horvath
23c157a07b
routing: add option to force import MC pair history
This commit adds the `force` flag to the `XImportMissionControl` RPC
which allows skipping rules around the pair import except for what is
mandatory to make values meaningful. This can be useful for when clients
would like to forcibly override MC state in order to manipulate routing
results.
2022-01-19 17:18:05 +01:00
mads krogh
1e3c05399c lnd+lnrpc: add private status to pendingchannels response 2022-01-18 09:42:14 +01:00
Oliver Gugger
ed511bb37f
Merge pull request #6146 from yyforyongyu/add-closing-txid
rpcserver: add closing txid in PendingChannels' WaitingCloseChannel
2022-01-12 13:23:16 +01:00
yyforyongyu
99378b22c3
rpcserver: add closing txid in WaitingCloseChannel 2022-01-07 18:21:02 +08:00
Oliver Gugger
8994d86a1d
walletrpc+itest: add SignPsbt RPC 2022-01-06 14:35:07 +01:00
Oliver Gugger
1902ad724e
signrpc: remove incomplete sentence and TODO
We use SignOutputRaw which expects a witness script being set, even for
P2WKH. There is a special case in SignOutputRaw for the case where the
script is a p2wkh script, then the input script is reconstructed
correctly for the sighash.
2022-01-06 13:24:30 +01:00
Oliver Gugger
9da8333a6e
multi: fix formatting 2022-01-06 13:24:30 +01:00
yyforyongyu
df2ecd6bc5
invoices: refactor invoice subscriptions to avoid blocking
This commit fixes a potential blocking when notifying invoice updates.
When a new subscription client is created followed by an immediate
cancel, it's likely the client will be removed from the registry's
map(noop) and then added to its map again. This subscription will then
be kept in registry until lnd is restarted. Another more serious issue
is when multiple subscriptions are made for the same invoice, when the
above case happens, other subscriptions may never send invoice updates
because a previous client has a stopped notification queue that blocks
following notifications.
2021-12-15 02:38:51 +08:00
Bjarne Magnussen
93e5de9306
lnrpc: refactor populating lnrpc.Transaction inside SubscribeTransaction 2021-12-10 08:26:16 +01:00
kon
59b215fe09 routerrpc: fix wrong error messages
when payment_hash or final_cltv_delta and payment_request was set, the error message showed that the parameters shouldn't be set with dest instead of payment_request

[skip ci]
2021-12-09 10:36:32 +01:00
yyforyongyu
53e02fa83d
rpcserver: expose ChanStatusFlags in pending close
This commit exposes the ChanStatusFlags inside waitingCloseResp such
that the channel close type is exposed.
2021-12-08 04:50:23 +08:00
naveen
b3ef3db0f2
multi: Remove GO111MODULE env variable in Makefile
The `GO111MODULE` variable is not required from go 1.16
https://go.dev/blog/go116-module-changes
2021-11-30 09:35:30 +01:00
Olaoluwa Osuntokun
e94ddf7b17
build: bump release+build version to Go 1.17.3 2021-11-15 17:29:02 -08:00
Oliver Gugger
9a28a4a9ff
lnrpc+rpcperms+lntest: add unique MW message ID
This commit adds a new unique intercept message ID that is different for
each message sent to an RPC middleware. This will allow us to re-purpose
the existing request ID field into its original intention, which was to
have a unique ID for a full gRPC request/response pair or gRPC stream as
a whole.
2021-11-08 15:00:29 +01:00
Oliver Gugger
32101db873
Merge pull request #5916 from blastshielddown/docs_5899
lnrpc: add public key detail to signrpc KeyDescriptor [skip ci]
2021-11-02 15:03:14 +01:00
Michael Rhee
7c18fb64ae lnrpc: add public key detail to signrpc KeyDescriptor [skip ci]
Clarification that KeyDescriptor describes the public key in
raw_key_bytes and the key_loc identifies the private key. Helps
clarify responses from calls like DeriveKey and DeriveNextKey from
WalletKit.

Fixes #5899
2021-11-02 07:57:12 -05:00
Olaoluwa Osuntokun
66ca2a994b
Merge pull request #5901 from Roasbeef/dedup-interceptor
Dedup interceptor
2021-10-28 17:44:49 -07:00
Roei Erez
fe44aedb25
itest: dedup interceptor packets
Aded a test for the dedup intercepted packets of htlc interceptor.
2021-10-28 16:16:55 -07:00
Roei Erez
1f1b33bf85
routerrpc: de-duplicate htlc held by interceptor
This commit ensures htlcs currently held by the interceptor
Are not sent again. This prevents potential races in the user code that
may lead to loosing funds.
2021-10-28 16:16:50 -07:00
Olaoluwa Osuntokun
698b5a8079
lnrpc: populate new AmpInvoiceState field in CreateRPCInvoice 2021-10-28 15:50:20 -07:00
Olaoluwa Osuntokun
d8ce00e016
lnrpc/invoicesrpc: expose new lookup modifier to LookupInvoiceV2 2021-10-28 15:50:17 -07:00
Olaoluwa Osuntokun
8299d632e8
lnrpc/invoicesrpc: add new invoice ref LookupInvoiceV2 method
In this commit, we add a new `LookupInvoiceV2` method attached to the
invoice RPC sub-server. Compared to the existing version, this version
allows an invoice to be looked up by an invoice ref. This enables users
to query an AMP invoice based on a specific _set ID_, so they can get
the information related to the set of cumulative settles to that
invoices.
2021-10-28 15:49:25 -07:00
positiveblue
416a96e2c1
lnrpc: migrate deprecated go get to go install
Starting in Go 1.17, installing executables with go get is deprecated.
Migrate our docker file for lnrpc protos.
2021-10-22 09:25:22 -07:00
Wilmer Paulino
e15ad026d4
chanacceptor: include commitment type in channel acceptor requests 2021-10-19 18:30:45 -07:00
Wilmer Paulino
c9f6d788e2
lnrpc: add new CommitmentType for script enforced leased channels 2021-10-19 18:30:43 -07:00
Olaoluwa Osuntokun
e6c65f1cbd
Merge pull request #5346 from joostjager/custom-messages
lnrpc+peer: custom peer messages
2021-10-18 19:07:39 -07:00
Joost Jager
ade50d0b2c
lnrpc: receive custom message 2021-10-15 17:08:55 +02:00
Joost Jager
ae959b16ae
lnrpc: send custom message 2021-10-15 17:08:53 +02:00
Oliver Gugger
78b700387c
cmd/lncli+walletrpc: add createwatchonly command 2021-10-14 15:42:58 +02:00
Oliver Gugger
1541b2ef1b
multi: create and list all default internal accounts 2021-10-14 15:42:56 +02:00
Oliver Gugger
ceb31f9034
multi: allow watch-only wallet creation 2021-10-14 15:42:55 +02:00
Oliver Gugger
a3addcc927
multi: forward SendCoins call over RPC 2021-10-14 15:42:52 +02:00
Oliver Gugger
19db382e24
multi: forward address and import calls over RPC
In order to support the full range of on-chain functionality, including
importing watch-only accounts in the watch-only instance, we need to
forward some calls like creating new addresses or importing accounts to
the remote signing instance.
2021-10-14 15:42:51 +02:00
Oliver Gugger
917cf4e99b
signrpc: add compact_sig flag to SignMessage 2021-10-14 15:42:48 +02:00
Oliver Gugger
afa03f22cc
multi: use key locator only for signing messages
To simplify the API surface of a remote signer even more, we refactor
the SignMessage and SignMessageCompact calls to only accept a key
locator as we always know what key we're using for signing anyway.
2021-10-08 12:06:52 +02:00
Oliver Gugger
8b7c88537c
multi: refactor SignDigestCompact into SignMessageCompact
To make it possible to use a remote lnrpc server as a signer for our
wallet, we need to change our main interface to sign the message instead
of the message's digest. Otherwise we'd need to alter the
lnrpc.SignMessage RPC to accept a digest instead of only the message
which has security implications.
2021-10-08 12:06:52 +02:00
Oliver Gugger
02757f6735
multi: refactor SignDigest into SignMessage
To make it possible to use a remote signrpc server as a signer for our
wallet, we need to change our main interface to sign the message instead
of the message's digest. Otherwise we'd need to alter the
signrpc.SignMessage RPC to accept a digest instead of only the message
which has security implications.
2021-10-08 12:06:51 +02:00