Commit Graph
38 Commits
Author SHA1 Message Date
ziggie bdea68bebf sqldb: add queries for deleting a payment and attempts 2026-02-25 08:02:08 +01:00
ziggie f8241748a1 paymentsdb: enhance some godoc function descriptions 2026-02-25 08:02:08 +01:00
ziggie 8aae9ffc2c paymentsdb: implement FetchPayment for sql backend 2026-02-25 08:02:08 +01:00
ziggie e8fe45fe65 paymentsdb: implement QueryPayments for sql backend 2026-02-25 08:02:08 +01:00
ziggie eeca189b87 paymentsdb: add new internal error 2026-02-25 08:02:07 +01:00
ziggie 18e7768837 multi: add relevant queries for QueryPayments implemenation 2026-02-25 08:02:04 +01:00
ziggie 93626822f7 lnd+paymentsdb: introduce harness for the payment sql backend
We prepare the code for the sql payment backend. However no
payment db interface method for the sql backend is implemented
yet. This will be done in the following commits. They currently
use the embedded KVStore to satify the build environment.
2026-02-25 08:01:14 +01:00
ziggie c08f918ffc paymentsdb: make verifyAttempt more robust
We now return an error when blinded and non blinded attempts are
combined. This was theoretically possible to register a legacy
attempt in combination with a blinded payment. This would have
been prevented by other checks in the code because legacy payments
are not split into shards.
2025-11-12 22:54:03 +08:00
ziggie cbfc0e0dc2 mulit: don't set customData on the lnrpc route level
We now make sure we only set the custom channel data in the
lnrpc.Route only if it contains relevant data.
2025-11-12 22:54:03 +08:00
ziggie 870d603ce5 multi: allow invalid tlv data when decoding payment fail info
Older payments might have a invalid tlv stream, we now catch this
case and add a unit test.
2025-11-03 12:54:29 +01:00
ziggie f540e9c8ec paymentsdb: add helper method to set session key
This is only used for testing because we have now a unique
contraint on the session key and need to swap it in tests for
the sql backend.
pick f17baec94 paymentsdb: fix linter
2025-09-08 08:23:58 +02:00
ziggie 335a9b3f40 lnd: reduce max limit when querying for payments 2025-09-05 09:54:00 +02:00
ziggie e20a34de46 paymentsdb: refactor attempt verification 2025-09-05 09:52:41 +02:00
ziggie 0320dfcc89 paymentsdb: add compile time check for the kv db implementation 2025-09-05 09:52:40 +02:00
ziggie 3d4ee8b874 paymentsdb: rename defaultKVStoreOptions func
We rename the modifier to use the same naming as used in the
graphDB to align the codebase.
2025-09-05 09:52:40 +02:00
Boris Nagaev dee8ad3754 multi: context.Background() -> t.Context()
Use the new feature of Go 1.24, fix linter warnings.

This change was produced by:
 - running golangci-lint run --fix
 - sed 's/context.Background/t.Context/' -i `git grep -l context.Background | grep test.go`
 - manually fixing broken tests
 - itest, lntest: use ht.Context() where ht or hn is available
 - in HarnessNode.Stop() we keep using context.Background(), because it is
   called from a cleanup handler in which t.Context() is canceled already.
2025-08-30 14:13:44 -03:00
ziggie b16782caeb multi: move DBMPPayment to paymentsdb package 2025-08-20 09:08:19 +02:00
ziggie 9ac93e75ac paymentsdb: fix linter 2025-08-20 09:08:18 +02:00
ziggie f87841d638 paymentsdb: declare helper functions and add comments 2025-08-20 09:07:53 +02:00
ziggie 82242f5342 multi: rename KVPaymentDB to KVStore
This matches the same naming as used in the graph package.
2025-08-20 09:07:53 +02:00
ziggie 6abd539a2d paymentsdb: add missing function comments 2025-08-20 09:07:53 +02:00
ziggie 8245e356e5 paymentsdb: move serialization methods to kv_store file 2025-08-20 09:07:53 +02:00
ziggie 7423bfece9 paymentsdb: rename assertPaymentstatus 2025-08-20 09:07:53 +02:00
ziggie a1fc8a3eee paymentsdb: rename db agnostic tests to highlight their behaviour 2025-08-20 09:07:52 +02:00
ziggie 68a8cf199d paymentsdb: rename assertPayments 2025-08-20 09:07:52 +02:00
ziggie 8726ba3d7c paymentsdb: move more tests
we make the index assertion db independant so it is a noop for
a future native sql backend. This allows us to reuse even more
tests for the different db architectures.
2025-08-20 09:07:52 +02:00
ziggie e22b898c1e paymentsdb: move db interface dependant tests to different file
This commit starts reusing test cases which are not dependant on
the kv db backend. So they can be later used with the native db
implementation as well.
2025-08-20 09:07:52 +02:00
ziggie 39b7417797 paymentsdb: use querypayments method to make test db agnostic 2025-08-20 09:07:52 +02:00
ziggie 9f824fe1ee multi: introduce interface for payment database 2025-08-20 09:07:48 +02:00
ziggie 2b856f036e multi: fix linter 2025-08-14 19:53:18 +02:00
ziggie e24ae0d7f3 paymentsdb: add missing comments for variables 2025-08-14 19:53:18 +02:00
ziggie df9bac2ecf multi: move PaymentCreationInfo to payment pkg 2025-08-14 19:53:18 +02:00
ziggie d138e23919 multi: move FailureReason to payment package 2025-08-14 19:53:18 +02:00
ziggie d77b2f9c26 mulit: move payment query code to separate file
We also rename the struct since it is now in its own package
there is no need to prefix it.
2025-08-14 19:53:18 +02:00
ziggie 03af9858d2 multi: move payment related code into own package
This commit moves most of the code into its own package. It is
the smallest code move possible without moving import cycles and
keeping the changes to the code base as small as possible during
refactor.
2025-08-14 19:53:15 +02:00
ziggie 88da582526 mulit: use kvdb.Backend for the kv payment db
Instead of the ChannelState struct we now use the kv backend
interface for the payment kv database.
2025-08-11 16:44:14 +02:00
ziggie 3aec40293d paymentsdb: add subsystem logging for payments package 2025-08-11 16:44:14 +02:00
ziggie 18afd4442d multi: introduce new paymentsDB package
We introduce a new package paymentsDB and start by moving the
payment specifc errors from the channeldb package to the
paymentsDB package. We also fix linter issues which showed up
due to changing this code part.
2025-08-11 16:44:14 +02:00