Commit Graph

1179 Commits

Author SHA1 Message Date
Carla Kirk-Cohen
3f9f0ea5d1
multi/refactor: separate methods for get and set node announcement
In preparation for a more complex function signature for set node
announcement, separate get and set so that readonly callers don't need
to handle the extra arguments.
2023-05-04 10:35:42 -04:00
Slyghtning
8f5910bf91 rpc: fix code style 2023-04-29 22:44:26 +02:00
Slyghtning
903b5dde89 rpc: SendOutputs considers anchor reserve 2023-04-29 22:44:23 +02:00
Elle Mouton
7b186716a1
multi: populate both string and byte TXID in lnrpc.Outpoint
This commit adds a a new `MarshalOutPoint` helper in the `lnrpc` package
that can be used to convert a `wire.Outpoint` to an `lnrpc.Outpoint`.
By using this helper, we are less likely to forget to populate both the
string and byte form of the TXID.
2023-04-24 16:19:26 +02:00
Olaoluwa Osuntokun
66a85bf9db
Merge pull request #7473 from emilioziniades/realign-witness-types
input+lnrpc: realign witness types
2023-04-13 16:09:01 -07:00
Emilio Ziniades
ea341bddd5
lnrpc: test witness type mapping 2023-04-12 21:58:17 +02:00
Emilio Ziniades
396a138fb7
lnrpc: add allWitnessTypes map
Refactor `PendingSweeps` to use `allWitnessTypes` map, and
return an error from `PendingSweeps` if an unknown witness
type is used, instead of logging a warning.
2023-04-12 21:58:00 +02:00
Emilio Ziniades
e9547daae2
lnrpc: update and regenerate witness type proto 2023-04-12 21:57:35 +02:00
Oliver Gugger
b6b536a1b9
Merge pull request #7550 from ardevd/proto-gen-dockerize-go
lnrpc: fully dockerize protobuf generation
2023-04-11 18:57:02 +02:00
ardevd
7c7c95e58a lnrpc: fully dockerize protobuf generation
Remove the need for golang on the host by utilizing golang docker
containers to obtain protobuf and grpc gateway versions.
2023-04-11 16:25:11 +02:00
Olaoluwa Osuntokun
591ff120b6
Merge pull request #6903 from hieblmi/fundmax-flag
funding: add `fundmax` flag to `OpenChannelRequest`
2023-04-06 10:57:29 -07:00
Olaoluwa Osuntokun
2596a33529
Merge pull request #7575 from lightningnetwork/0-16-1-staging
lnd: merge the 0.16.1 staging branch into master
2023-04-05 16:48:25 -07:00
Bjarne Magnussen
e82410d24a lnrpc: adds a field FundMax to OpenChannelRequest 2023-04-05 23:05:07 +02:00
djkazic
41016587eb Add peer_scid_alias field to lnrpc.Channel 2023-03-31 11:20:27 -04:00
Eval EXEC
cbcbddfe29
rpcserver: add time_lock_delta overflow check 2023-03-23 21:34:12 +08:00
bitromortac
a3e46dae9f
multi: mark bimodal estimator experimental 2023-03-23 11:12:10 +01:00
bitromortac
ee40d3dd58
routerrpc: fix estimator model field
This commit fixes the capitalization of the estimator's model field.
2023-03-21 08:54:10 +01:00
Elle Mouton
13c656defe
lnrpc: use new ExcludeExhaustedSessions option 2023-03-20 20:14:01 +02:00
Elle Mouton
e6494889b0
wtclientrpc: add excludeExhaustedSessions option
Add a new `exclude_exhausted_sessions` field to the relevant
wtclient.proto requests. This was chosen instead of "include_exhausted"
so as to not break the API.
2023-03-20 20:14:01 +02:00
Elle Mouton
31beacc2c4
lnrpc/wtclientrpc: populate sessions from legacy channels 2023-03-20 16:51:51 +02:00
Elle Mouton
b635629e3c
lnrpc/wtclientrpc: correctly merge tower client info
Prior to this commit, the wtclient would request tower info from both
the legacy client and the anchors client and would then merge the
results returned. This is incorrect since the two clients will have
different session info and different "active" statuses for the same
tower. This commit thus ensures that we dont lose this info.
2023-03-16 14:59:08 +02:00
Daniel McNally
9cc9e40b89
lnrpc: update docs for invoice amt_paid
This corrects the documentation for the `amt_paid` and `amt_paid_msat`
fields on the `Invoice` message to indicate that the fields will be set
if the state of the invoice is either accepted or settled, not only
settled. This reflects the actual behavior of lnd, as demonstrated in
the below `lncli` output:

```
"amt_paid": "10000",
"amt_paid_sat": "10",
"amt_paid_msat": "10000",
"state": "ACCEPTED",
```
2023-03-06 20:23:25 -05:00
Oliver Gugger
54a1661c45
Merge pull request #7451 from CRex15/walletkit+labeltransaction
Add note to LabelTransaction [skip ci]
2023-03-06 18:54:23 +01:00
Olaoluwa Osuntokun
251802d796
Merge pull request #7444 from bitromortac/2302-capacity-config
routing: configurable capacity fraction for apriori probability
2023-03-02 18:39:01 -08:00
yyforyongyu
c26917ee1f
multi: rename LookupHtlc to LookupHtlcResolution for clarity 2023-03-01 01:47:08 +08:00
CRex15
fd49640256 Add note to LabelTransaction TXID field
The description for TXID in Label Transaction should include a note
that, in the case of GRPC, the TXID needs to be passed in little-endian
(reverse) byte order. A user passing the bytes in big-endian order is
met with an error message stating that the transaction is not found in
the wallet and no other information with which to troubleshoot.
2023-02-28 10:39:47 -05:00
yyforyongyu
2bf84fbe41
lnrpc: update docs on LookupHtlc 2023-02-27 16:59:17 +08:00
bitromortac
fce88e8b5d
lncli+routerrpc: dynamic capacity fraction config
Enable setting and getting of the apriori capacity fraction in lncli and
in the router rpc.
2023-02-24 15:28:55 +01:00
bitromortac
a73581610e
routing+lnrpc: make capacity factor configurable
We make the capacity factor configurable via an lnd.conf routerrpc
apriori parameter. The capacity factor trades off increased success
probability with a reduced set of channel candidates, which may lead to
increased fees. To let users choose whether the factor is active or not,
we add a config setting where a capacity fraction of 1.0 disables the
factor. We limit the capacity fraction to values between 0.75 and 1.0.
Lower values may discard too many channels.
2023-02-24 15:28:55 +01:00
Slyghtning
edb58a8b28 lnrpc: peer_alias field for Channel message 2023-02-24 10:49:11 +01:00
bitromortac
dd5273c88c
multi: rename due to required maxHTLC bit
We rename `ChanUpdateOptionMaxHtlc` to `ChanUpdateRequiredMaxHtlc`
as with the latest changes it is now required.

Similarly, rename `validateOptionalFields` to
`ValidateChannelUpdateFields`, export it to use it in a later commit.
2023-02-21 11:10:39 +01:00
Oliver Gugger
38dc67e1ef
Merge pull request #6815 from bitromortac/2205-bimodal
pathfinding: probability for bimodal distribution
2023-02-15 14:19:32 +01:00
bitromortac
2ccdfb1151
lncli+routerrpc: adapt mc api to dynamic estimator
The active probability estimator can be switched dynamically using the
`Set/GetMissionControl` API, maintaining backward compatibility. The
lncli commands `setmccfg` and `getmccfg` are updated around this
functionality. Note that deprecated configuration parameters were
removed from the commands.
2023-02-14 13:34:25 +01:00
bitromortac
58d5131e31
lnd+routerrpc: configure server with new estimator
We add new lnd.conf configuration options for both probability
estimators. Note that this is a breaking change for the existing apriori
parameters.
2023-02-14 13:34:25 +01:00
bitromortac
16986ee5c7
lnd+routing+rpc: switch mc to (external) estimator
We use a more general `Estimator` interface for probability estimation
in missioncontrol.

The estimator is created outside of `NewMissionControl`, passed in as a
`MissionControlConfig` field, to facilitate usage of externally supplied
estimators.
2023-02-14 13:34:25 +01:00
Oliver Gugger
c79b0799bf
Merge pull request #7402 from bottlepay/final-resolution-info
rpcserver: expose store final htlc resolutions flag on info call
2023-02-13 23:12:32 +01:00
Joost Jager
784c0631f3
rpcserver: expose store final htlc resolutions flag on info call
The storage of final htlc resolutions is a safety-critical feature. By
exposing it through the GetInfo call, connected applications can
ensure that the feature is turned on and avoid relying on the assumption
that lnd was configured correctly.
2023-02-13 11:53:27 +01:00
adiabat
17f7b9f322 routerrpc: Check for nil IncomingCircuitKey
The grpc stream.Recv() will decode an ForwardHtlcInterceptResponse
without an IncomingCircuit, which will leave that pointer nil,
causing a nil pointer dereferece when components of in.IncomingCircuitKey
are used in the resolveFromClient() function.

This commit checks for the nil pointer and returns an error before
the rest of the parsing.
2023-02-10 13:40:40 -05:00
Torakushi
cdb015223b
walletrpc+lnwallet: possibility to define an address type for changes in FundPsbt
By default, P2TR addresses are used for changes. However, some users
might encounter some problems with this change. We add the possibility
to define a custom address type in FundPsbt for default/imported accounts
(only P2TR for now). If no address type is specified for these accounts,
we will use P2WKH by default.
2023-02-08 12:35:44 +01:00
bitromortac
b0a998af8d
routing: rename apriori estimator
* we rename the current probability estimator to be the "apriori"
  probability estimator to distinguish from a different implementation
  later
* the AprioriEstimator is exported to later be able to type switch
* getLocalPairProbability -> LocalPairProbabiltiy (later part of an
  exported interface)
* getPairProbability -> getPairProbabiltiy (later part of an exported
  interface)
2023-02-07 16:18:38 +01:00
Oliver Gugger
13252aec1d
lnrpc+rpcwallet: add version to MuSig2 RPC calls 2023-02-06 10:50:29 +01:00
Oliver Gugger
ce5fa2e043
multi: add version to MuSig2 API, bump btcd/btcec to v2.3.2
With this commit we bump the github.com/btcd/btcec/v2 library to v2.3.2
which implements the MuSig2 BIP version v1.0.0rc2. With this the
github.com/btcsuite/btcd/btcec/v2/schnorr/musig2 package becomes
v1.0.0rc2 and the github.com/lightningnetwork/lnd/internal/musig2v040
stays at the old v0.4.0 version.
2023-02-03 18:30:10 +01:00
Oliver Gugger
cb9f2d0398
input+lnrpc: make key sorting optional in input pkg
To allow us to properly test all test vectors, we can't default to true
on key sorting. Instead we add a parameter to the input package and move
the default value to the RPC server.
2023-02-03 18:30:09 +01:00
Oliver Gugger
13789f5d95
input+lnwallet: move some MuSig2 calls to input pkg
As a preparation for making it possible to version switch calls to the
MuSig2 API, we move some of the calls to the input package where in a
future commit we'll call the corresponding code in the correct package.
2023-02-03 18:30:09 +01:00
Elle Mouton
2fd4f3f180
go.mod+lnrpc+github: point to latest kvdb changes
Use kvdb package v1.4.1. This update also forced the protobuf version to
be bumped which required `make rpc` to be run to update the generated
files. This also required a bump in the github pinned dependencies
config for the grpc and protobuf libs.
2023-01-25 14:03:00 +02:00
ziggie
7b68289a7a
walletrpc: add sign/verify methods
Adding the grpc functionality to sign and verify messages with
single addresses
2023-01-24 09:22:05 +01:00
positiveblue
8563e1f409
channeldb/invoices: add IsAMP and IsKeysend helpers
The only way to know if an invoice is AMP, Keysend, etc is to look at
its shape/characteristics. This commit adds a couple of helper functions
to encapsulate the logic of these checks.

If all these types cannot intersect: an invoice cannot be AMP and
Keysend or Keysend and Bolt12, etc it could be useful to add an extra
field to store this information instead of relying on checking how the
invoice looks like.
2023-01-20 03:43:39 -08:00
Olaoluwa Osuntokun
ea0eb2ce72
Merge pull request #7215 from positiveblue/invoices-channeldb-dep
Invoices: invert package dependency with `channeldb`
2023-01-17 10:13:22 -08:00
Oliver Gugger
04447927ea
Merge pull request #7055 from ellemouton/wtclientMigrations
watchtower: reduce AckedUpdate storage footprint
2023-01-17 10:37:52 +01:00
positiveblue
5ff5225245
multi: break invoice depenency on channeldb
Now that we have the new package `lnd/channeldb/models` we can invert the
depenency between `channeldb` and `invoices`.

- Move all the invoice related types and errors to the
`invoices` package.

- Ensure that all the packages dealing with invoices use the types and
  interfaces defined in the `invoices` package.

- Implement the InvoiceDB interface (defined in `lnd/invoices`) in
  channeldb.

- Add new mock for InterfaceDB.

- `InvoiceRegistery` tests are now in its own subpacakge (they need to
  import both invoices & channeldb). This is temporary until we can
  decouple them.
2023-01-16 07:31:09 -08:00
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