Commit graph

16034 commits

Author SHA1 Message Date
Andras Banki-Horvath
7d56d5385d
invoices: parametrize invoice(registry) tests with InvoiceDB constructor
This commit extracts the InvoiceDB construction from all invoice and
registry tests such that we can later on run subtests with multiple
backends without needing to use tags.
2024-02-19 20:47:25 +01:00
Andras Banki-Horvath
0e2b39ed44
invoices: fix linter issues after the move 2024-02-19 20:47:24 +01:00
Andras Banki-Horvath
5e746b4d2c
invoices: move InvoiceDB tests unrelated to kvdb to invoices package 2024-02-19 20:47:24 +01:00
Andras Banki-Horvath
6b0931af82
invoices: move UpdateInvoice implementation to the invoices package
With the introducation of the `InvoiceUpdater` interface we are now
able to move the non-kv parts of `UpdateInvoice` completely under
the invoices package. This is a preprequisite for being able to use
the same code-base for the sql InvoiceDB implementation of
UpdateInvoice.
2024-02-19 20:47:24 +01:00
Andras Banki-Horvath
ecbfc46312
invoices+channeldb: add InvoiceUpdater interface and the KV impl
This commit introduces the InvoiceUpdater interface which is meant
to abstract and assist the in-memory invoice update procedure with
the accompanying database updates. These abstract updater steps will
enable further refactoring later while also ensuring that a full
SQL implementation of the InvoiceDB interface will be possible.
2024-02-19 20:47:24 +01:00
Andras Banki-Horvath
998156930f
invoices: refactor updateInvoiceAmpState to return new state
With this commit updateInvoiceAmpState becomes getUpdatedInvoiceAmpState
which will only return the new AMP state but that needs to be applied at
the call site. This is a part of a larger refactor to gather all
mutations of an invoice update to be later applied by the invoice
updater.
2024-02-19 20:47:24 +01:00
Andras Banki-Horvath
08df7f4175
invoices: change cancelSingleHtlc to be purely used for validation
This change moves the HTLC state change out of the cancelSingleHtlc
function. This is part of the larger refactor of collecting all changes
to be later applied by the invoice updater.
2024-02-19 20:47:23 +01:00
Andras Banki-Horvath
87044b815c
invoices: rename updateInvoiceState to getUpdatedInvoiceState
This commit turns updateInvoiceState "const" by moving preimage update
out of the function while also removing it to getUpdatedInvoiceState.
2024-02-19 20:47:23 +01:00
Andras Banki-Horvath
342eb4eac2
invoices: refactor updateHtlc to return new state
With this refactor updateHtlc is renamed to getUpdatedHtlcState and
changed such that it won't change the HTLC's state and resolve time but
instead returns whether the change is needed. This change is part of a
multi-commit refactor to ensure that all changes to the invoice will be
tracked individually.
2024-02-19 20:47:23 +01:00
Andras Banki-Horvath
ef5a31733e
channeldb: do not change the update descriptor when cancelling htlcs 2024-02-19 20:47:23 +01:00
Andras Banki-Horvath
7298b2d190
channeldb: extract AMP state updates to updateInvoiceAmpState() 2024-02-19 20:47:23 +01:00
Andras Banki-Horvath
4bf6b52158
channeldb: fetch the invoice before calling into updateInvoice 2024-02-19 20:47:22 +01:00
Andras Banki-Horvath
eb4198b970
channeldb: extract store update methods when updaing an invoice
This commit is a small refactor to move all actual DB updates after
an invoice state is update to separate methods. This is a small
preliminary change before we completely decouple DB updates from
in-memory invocie update.
2024-02-19 20:47:22 +01:00
Olaoluwa Osuntokun
7a3101710c
Merge pull request #8430 from bhandras/update-pr-stats
github: bump pull-resquest-stats to v2.11.0
2024-02-14 17:52:11 -08:00
Oliver Gugger
f008a97082
Merge pull request #8479 from tdb3/master
lnrpc: Clarify payment_addr and payment_secret
2024-02-14 03:49:47 -06:00
tdb3
3288490df3
lnrpc: Clarify payment_addr and payment_secret
Fix #7438, adding clarification statements in lnrpc proto files.
Originally proposed by daredevil3435 in PR #7873 and PR #7885.
2024-02-13 19:04:18 -05:00
Oliver Gugger
4855faf162
Merge pull request #8471 from morehouse/codeowners
.github: add morehouse to CODEOWNERS
2024-02-12 02:24:22 -06:00
Matt Morehouse
7a0390fe59
.github: add morehouse to CODEOWNERS 2024-02-09 10:27:17 -06:00
Oliver Gugger
17f5798726
Merge pull request #8466 from weiliy/docs-fix-mining-address
docs: preserve MINING_ADDRESS across docker-compose sessions
2024-02-08 02:41:20 -06:00
Weili Y
d740e95c08
docs: preserve MINING_ADDRESS across docker-compose sessions
Export MINING_ADDRESS before docker-compose up to ensure it's retained for
subsequent operations, fixing block generation errors due to missing mining
addresses.
2024-02-07 20:24:24 +08:00
Yong
9651ee6372
Merge pull request #8452 from ProofOfKeags/refactor/contractcourt/naming-consistency
contractcourt: homogenize naming convention
2024-02-07 18:54:55 +08:00
Keagan McClelland
0f245bf237 contractcourt: rename breacharbiter*.go to breach_arbitrator
This is just to finish the cleaning things up to make them more
consistent.
2024-02-06 13:32:51 -07:00
Keagan McClelland
bc3feba267 contractcourt+lnrpc+lnd: s/BreachArbiter/BreachArbitrator
Since we have two other examples of XArbitrator, we rename
BreachArbiter to BreachArbitrator to keep things consistent.
The aim is to reduce the amount of lore you need to know to
intuit where things are or what they do.
2024-02-06 13:32:47 -07:00
Olaoluwa Osuntokun
771d1f0a9c
Merge pull request #8338 from lightningnetwork/coop-close-v2-wire-messages
lnwire: add new closing_complete and closing_sig messages
2024-02-05 17:08:36 -08:00
Olaoluwa Osuntokun
ba3c0c497a
.github: codeowners additions 2024-02-05 16:30:31 -08:00
Olaoluwa Osuntokun
5953eaa9d8
lnwire: add fuzz tests for ClosingComplete+ClosingSigs 2024-02-05 16:30:26 -08:00
Olaoluwa Osuntokun
3d88017b38
lnwire: add new closing_complete and closing_sig messages
These two messages will be used to implement the new and improved co-op
closing protocol. This PR also show cases how to use the new
`tlv.OptionalRecord` type to define and handle TLV level parsing.

I think we can make one additional helper function to clean up some of
the boiler plate for the encode/decode.
2024-02-05 16:30:23 -08:00
Olaoluwa Osuntokun
34fd35bc63
lnwire: add Record() method to lnwire.Sig
We'll use this later on to re-use the normal primitive record to create
a series of new TLV types for the new co-op close protocol.
2024-02-05 16:30:16 -08:00
Yong
63e698ec49
Merge pull request #8432 from yyforyongyu/fix-timestamp-precision
invoice+payment: fix timestamp precision for queries
2024-02-05 18:28:39 +08:00
Oliver Gugger
4584f7e39c
Merge pull request #8457 from mohamedawnallah/lnddir-option-overwrite-docs
docs: mention that `--lnddir` option overwrites all other directory options [skip ci]
2024-02-05 03:36:05 -06:00
Mohamed Awnallah
043834c698
config.go: mention that --lnddir option overwrites all other directory options [skip ci] 2024-02-05 11:30:09 +02:00
Oliver Gugger
e9bc9ad510
Merge pull request #8456 from Roasbeef/record-zero-fn
tlv: add new Zero method on RecordT
2024-02-05 02:48:38 -06:00
yyforyongyu
4da9582862
docs: add release notes for precision fix 2024-02-05 15:26:54 +08: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
221e7ff898
itest: update testListPayments to precisely test timestamp filters 2024-02-05 15:23:57 +08:00
Yong
d41b86bb7e
Merge pull request #7852 from ziggie1984/pathfind_sizeestimate
Path Finding Size Estimation including Blinded Path Data
2024-02-05 15:21:51 +08:00
ziggie
da5055c210
docs: add release-notes. 2024-02-03 12:16:07 +00:00
ziggie
4732c09a26
multi: Fix final hop payload size for AMP payments. 2024-02-03 12:16:06 +00:00
ziggie
ff30ff40bf
multi: Fix final hop payload size for blinded rt.
The final hop size is calculated differently therefore we extract
the logic in its own function and also account for the case where
the final hop might be a blinded hop.
2024-02-03 12:11:01 +00:00
ziggie
c1b91fff14
multi: use new AdditionalEdge interface.
In the previous commit the AdditionalEdge interface was introduced
with both of its implementations `BlindedEdge` and `PrivateEdge`.
In both cases where we append a route either by a blinded route
section or private route hints we now use these new types. In
addition the `PayloadSizeFunc` type is introduced in the
`unifiedEdge` struct. This is necessary to have the payload size
function at hand when searching for a route hence not overshooting
the max sphinx package size of 1300 bytes.
2024-02-03 12:10:46 +00:00
Yong
54c47a3feb
Merge pull request #8449 from ProofOfKeags/refactor/lnwallet/delete-LightningChannel-status
lnwallet: simplify status row
2024-02-03 13:48:31 +08:00
Olaoluwa Osuntokun
78e0e5ac5d
tlv: add new Zero method on RecordT
In this commit, we add a new `Zero` method for the `RecordT` type. This
method allows a caller to create the zero record for a type without
needing to reference the actual TLV type.

With this we go from this:
```go
sig1 := tlv.ZeroRecordT[tlv.TlvType1, Sig]()
```

To this:
```
sig1 := c.CloserNoClosee.Zero()
```
2024-02-02 17:31:06 -08:00
Olaoluwa Osuntokun
47fced69da
Merge pull request #8440 from saubyk/codeowners
Add CODEOWNERS file
2024-02-02 17:25:30 -08:00
Keagan McClelland
3a02f2ba65 lnwallet: use ResetState instead of tweaking private rows 2024-02-02 11:46:32 -08:00
Keagan McClelland
606f8e79d1 lnwallet: rewrite channelState to bool for clarity
Over the last few commits we have systematically eliminated all but
two states. This allows us to replace it with a boolean to encode
the two remaining states. We would like to be able to eliminate this
field entirely, but doing so requires being able to prove that the
concurrent request block is necessary. This is more difficult and
will be left to future commits.
2024-02-02 11:46:32 -08:00
Keagan McClelland
17e67348a8 lnwallet: remove unused channelPending channelState
lnwallet: remove unused channelPendingPayment channelState

Since this state is never set nor read, we remove it completely.

lnwallet: remove redundant channelDispute channelState

In this case, even though we do set this value, it is never read.
Further, the times we read the field at all from LightningChannel
we want the situation of force-closure to block any other
concurrent closure attempts, so we change the sites where we set
channelDispute to channelClosed.

lnwallet: remove redundant channelClosing channelStatus

This value is never used to impact control flow so we need not set
it. We also need not have it.
2024-02-02 11:46:20 -08:00
Keagan McClelland
4e6b1cda49 lnwallet: change channelDispute to channelClosed so errors are handled 2024-02-02 11:40:22 -08:00
Oliver Gugger
ca5f23a647
Merge pull request #7372 from bhandras/listsweeps-range
walletrpc: add `startheight` parameter to the `ListSweeps` RPC
2024-02-02 02:03:16 -06:00
saubyk
fd212ed8c2
.github: add CODEOWNERS file 2024-02-01 12:16:40 -08:00