Commit graph

15401 commits

Author SHA1 Message Date
Elle Mouton
031dbd7760 multi: remove ChainRegistry 2023-10-06 16:34:47 -07:00
Elle Mouton
2a7fffe441 lnrpc: remove litecoin from lightning.proto 2023-10-06 16:34:47 -07:00
Elle Mouton
215e0f26fe docker: remove litcoin docker scripts 2023-10-06 16:34:47 -07:00
Elle Mouton
0d89a45abe docs: remove Litecoin references from INSTALL.md file 2023-10-06 16:34:47 -07:00
Elle Mouton
be90bcbe46 multi: remove litecoin references and comments 2023-10-06 16:34:47 -07:00
Elle Mouton
a24a4c2996 zpay32: remove litecoin tests 2023-10-06 16:34:47 -07:00
Elle Mouton
94c4642db6 lncfg+config: only allow btcd or bitcoind backends 2023-10-06 16:34:47 -07:00
Elle Mouton
913aa36fe9 chainreg: remove Litecoin support
This commit removes the Litecoin, LtcMode and LitcoinMode members from
the chainreg `Config` struct.
2023-10-06 16:34:47 -07:00
Elle Mouton
a76bdf606b chainreg: let IsTestnet consider bitcoin only 2023-10-06 16:34:47 -07:00
Elle Mouton
d128c18cc5 keychain+chainreg: remove Litecoin CoinType 2023-10-06 16:34:47 -07:00
Elle Mouton
3912d5a0c6 multi: remove Litecoin config options
This commit removes the `Litecoin`, `LtcMode` and `LitecoindMode`
members from the main LND `Config` struct. Since only the bitcoin
blockchain is now supported, this commit also deprecates the
`cfg.Bitcoin.Active` config option.
2023-10-06 16:34:47 -07:00
Elle Mouton
ba93cde07a sample-lnd.conf: remove litecoin conf options 2023-10-06 16:34:47 -07:00
yyforyongyu
f6664d572e docs: update release notes for payment status 2023-10-06 16:34:47 -07:00
yyforyongyu
36f9d7b8db routerrpc: make sure error is transformed into grpc error code 2023-10-06 16:34:47 -07:00
yyforyongyu
17a0a8de06 cmd+lntest: use the new rpc field Payment_INITIATED 2023-10-06 16:34:47 -07:00
yyforyongyu
65879a45e6 lnrpc: update routerrpc to use the new status 2023-10-06 16:34:47 -07:00
yyforyongyu
c175386c4d channeldb+routing: apply method Terminated to decide a payment's terminal state
This commit applies the new method `Terminated`. A side effect from
using this method is, we can now save one query `fetchPayment` inside
`FetchInFlightPayments`.
2023-10-06 16:34:47 -07:00
yyforyongyu
fac6044501 channeldb: add unit test for decidePaymentStatus 2023-10-06 16:34:47 -07:00
yyforyongyu
390f3c8253 channeldb: expand PaymentStatus to explicitly represent payment status
This commit introduces more granular statuses to better determine a
payment's current state. Based on whether there are inflight HTLCs, the
state of each of the HTLCs, and whether the payment is failed, a total
of 5 states are derived, which can give a finer control over what action
to take based on a given state.

Also, `fetchPayment` now uses `decidePaymentStatus`. After applying the
new function, the returned payment status would be different,

```
| inflight | settled | failed | reason |       previous  ->   now          |
|:--------:|:-------:|:------:|:------:|:---------------------------------:|
|   true   |   true  |  true  |   yes  |    StatusInFlight(unchanged)      |
|   true   |   true  |  true  |   no   |    StatusInFlight(unchanged)      |
|   true   |   true  |  false |   yes  |    StatusInFlight(unchanged)      |
|   true   |   true  |  false |   no   |    StatusInFlight(unchanged)      |
|   true   |   false |  true  |   yes  |    StatusInFlight(unchanged)      |
|   true   |   false |  true  |   no   |    StatusInFlight(unchanged)      |
|   true   |   false |  false |   yes  |    StatusInFlight(unchanged)      |
|   true   |   false |  false |   no   |    StatusInFlight(unchanged)      |
|   false  |   true  |  true  |   yes  |    StatusSucceeded(unchanged)     |
|   false  |   true  |  true  |   no   |    StatusSucceeded(unchanged)     |
|   false  |   true  |  false |   yes  |    StatusSucceeded(unchanged)     |
|   false  |   true  |  false |   no   |    StatusSucceeded(unchanged)     |
|   false  |   false |  true  |   yes  |     StatusFailed(unchanged)       |
|   false  |   false |  true  |   no   |     StatusInFlight(unchanged)     |
|   false  |   false |  false |   yes  |     StatusFailed(unchanged)       |
|   false  |   false |  false |   no   |  StatusInFlight -> StatusInitiated|
```
2023-10-06 16:34:47 -07:00
yyforyongyu
09b67af48d channeldb: add method Registrable to decide adding HTLCs
This commit adds a new method, `Registrable`, to help decide whether
adding new HTLCs to a given payment is allowed. A new unit test,
`TestRegistrable` is also added to test it.
2023-10-06 16:34:47 -07:00
yyforyongyu
c71601124a channeldb: fix variable name used in RegisterAttempt
Renamed `p` to `payment` to since it's used by the method's pointer receiver.
2023-10-06 16:34:47 -07:00
yyforyongyu
105c275b91 channeldb: add method updatable to decide updating payments
This commit adds a new method, `updatable`, to help decide whether
updating a given payment is allowed.
2023-10-06 16:34:47 -07:00
yyforyongyu
a6f4f0dfc9 channeldb: add method removable to decide removing payments
This commit adds a new method, `removable`, to help decide whether
deleting a payment is allowed.
2023-10-06 16:34:47 -07:00
yyforyongyu
de33c3e009 channeldb: add method initializable to decide initiating payment
This commit adds a new method, `initializable`, to help decide whether
initiating a payment is allowed.
2023-10-06 16:34:47 -07:00
yyforyongyu
30fd29371c channeldb: add new payment status StatusInitiated
This commit adds a new payment status, `StatusInitiated`, to properly
represent the state where a payment is newly created without attempting
any HTLCs. Since the `PaymentStatus` is a memory representation of a
given payment's status, the enum used for the statuses are directly
updated.
2023-10-06 16:34:47 -07:00
yyforyongyu
6be3817eed channeldb: return error when payment is not initialized
This commit changes `fetchPaymentStatus` to return an error when the
payment creation info bucket cannot be found. Instead of using the
ambiguous status `StatusUnknown`, we tell the callsite explictly that
there's no such payment. This also means the vague `StatusUnknown` can
now be removed as it has multiple meanings.
2023-10-06 16:34:47 -07:00
yyforyongyu
21cecc40e1 channeldb: return error when payment is not found in duplicate payments
We also update the legacy code to return an error when the payment is
not found.
2023-10-06 16:34:47 -07:00
Suheb
b7d1c6666f docs/release-notes: add template for 0.18.0
Signed-off-by: saubyk <39208279+saubyk@users.noreply.github.com>
2023-10-06 16:34:47 -07:00
Vincent
80bfd17cf2
docs: add instructions to generate type hints (#8025)
* Add instructions to generate type hints 

Use mypy to generate .pyi files as well. These files are useful for type hinting in IDEs.

* Update python.md

fix lines that got swapped in copy-paste

* remove mypy 

mypy is not a dependency
2023-10-06 16:47:17 +02:00
Oliver Gugger
dce4bb16be
Merge pull request #8063 from guggero/fix-linter
cmd/lncli: fix linter complaint by running make fmt
2023-10-06 13:14:17 +00:00
Oliver Gugger
7ef11e8ae4
cmd/lncli: fix linter complaint by running make fmt 2023-10-05 22:47:02 +02:00
Olaoluwa Osuntokun
92fe545b0a
Merge pull request #8053 from kilrau/fix/lncli-desc
lncli: fix description of connect/disconnect peer
2023-10-05 13:27:46 -07:00
Kilian
682827c7af
lncli: fix description of connect/disconnect peer 2023-10-05 18:13:32 +02:00
Oliver Gugger
31ba616b1c
Merge pull request #7925 from Crypt-iQ/funding_maturity
funding: wait for coinbase maturity before sending channel_ready
2023-10-05 15:26:30 +00:00
Oliver Gugger
563d6d5427
Merge pull request #7970 from bartoli/master
Fix missing space in message
2023-10-05 15:20:14 +00:00
Oliver Gugger
529dc203a5
Merge pull request #8017 from Rooke/master
trivial: Fix spelling errors
2023-10-05 08:42:08 +00:00
Oliver Gugger
3ffd59a8c9
Merge pull request #7998 from bota87/master
sample-lnd.conf: fix typo
2023-10-05 08:06:31 +00:00
bota87
6041f97fb6 sample-lnd.conf: fix typo 2023-10-04 21:59:17 +02:00
Olaoluwa Osuntokun
13e1fd3f09
Merge pull request #8056 from guggero/release-template-link-fix
GitHub: fix link in release template
2023-10-04 11:13:49 -07:00
Oliver Gugger
3b0d918ea4
GitHub: fix link in release template
Fixes #8055.
This PR fixes a broken link in the release page template.
2023-10-04 09:36:51 +02:00
Olaoluwa Osuntokun
2fb150c8fe
build: bump version to v0.17.0 2023-10-03 10:20:31 -07:00
Olaoluwa Osuntokun
caa9bf9222
Merge pull request #8043 from Roasbeef/0-17-rc6
build: bump version to v0.17.0 rc6
2023-09-28 13:45:52 -05:00
Olaoluwa Osuntokun
4e6bb71c0f
build: bump version to v0.17.0 rc6 2023-09-28 12:00:41 -05:00
Olaoluwa Osuntokun
bb7a257359
Merge pull request #8037 from yyforyongyu/fix-weight-calc
lnwallet+rpcserver: fix weight calculation for taproot channels
2023-09-28 11:21:29 -05:00
Olaoluwa Osuntokun
edeb0d7db5
Merge pull request #8041 from Roasbeef/background-peer-prune
peer: launch persistent peer pruning in background goroutine
2023-09-28 11:18:10 -05:00
yyforyongyu
522518922f
lnwallet+rpcserver: fix weight calculation for taproot channels 2023-09-28 19:42:13 +08:00
yyforyongyu
62d240bba1
itest: add testSendDirectPayment
Adds a new test to check direct payments between two nodes. The fee rate
is tuned to 1 sat/vb to catch edge cases.
2023-09-28 19:42:11 +08:00
Olaoluwa Osuntokun
eae9dd07f0
peer: launch persistent peer pruning in background goroutine
This PR is a follow up, to a [follow
up](https://github.com/lightningnetwork/lnd/pull/7938) of an [initial
concurrency issue](https://github.com/lightningnetwork/lnd/pull/7856)
fixed in the peer goroutine.

In #7938, we noticed that the introduction of `p.startReady` can cause
`Disconnect` to block. This happens as `Disconnect` cannot be called
until `p.startReady` has been closed. `Disconnect` is also called from
`InboundPeerConnected` (the case of concurrent peers, so we need to
remove one of the connections) while the main server mutex is held. If
`p.Start` blocks for any reason, then this leads to the deadlock as: we
can't disconnect until we've finished starting, and we can't finish
starting as we need the disconnect caller to exit as it has the mutex.

In this commit, we now make the call to `prunePersistentPeerConnection`
async. The call to `prunePersistentPeerConnection` eventually wants to
grab the server mutex, which triggers the circular waiting scenario
above.

The main learning here is that no calls to the main server mutex path
can block from `p.Start`. This is more or less a stop gap to resolve the
issue initially introduced in v0.16.4. Assuming we want to move forward
with this fix, we should reexamine `p.startReady` all together, and also
revisit attempt to refactor this section of the code to eliminate the
mega mutex in the server in favor of a dedicated event loop.
2023-09-27 21:24:50 -05:00
Olaoluwa Osuntokun
1ebfe95772
Merge pull request #8035 from Roasbeef/0-17-rc5
build: bump version to v0.17.0 rc5
2023-09-26 18:21:07 -05:00
Olaoluwa Osuntokun
f63a2b9507
build: bump version to v0.17.0 rc5 2023-09-26 16:11:45 -05:00