Commit Graph
100 Commits
Author SHA1 Message Date
Andras Banki-Horvath debfaf41b9 lncfg: use the sqldb config types instead of the kvdb counterparts 2024-03-01 10:08:09 +01:00
Andras Banki-Horvath aba45018a8 sqldb: merge SQLite and Postgres configs with the kvdb counterparts
This commit is part of a refactor that unifies configuration of the
sqldb and kvdb packages for SQL backends.
In order to unify the SQLite and Postgres configuration under sqldb we
first need to ensure that the final config types are compatible with
the alreay deployed versions.
2024-03-01 10:08:09 +01:00
Andras Banki-Horvath aee1f7f563 invoices: run InvoiceStore and InvoiceRegistry tests on PostgreSQL too 2024-03-01 10:08:09 +01:00
Andras Banki-Horvath 06730824a2 sqldb: fixup PostgreSQL fixture to allow creating separate DBs per test
This change will enable us to use a single PostgreSQL container instead of
spawning new a one for each (parallel) unit test reducing overall test
runtime.
2024-03-01 10:08:08 +01:00
Andras Banki-Horvath b10ce17cd4 invoices: run InvoiceStore and InvoiceRegistry tests on SQLite too 2024-03-01 10:08:08 +01:00
Andras Banki-Horvath 734d3a9d66 invoices: small test fixes 2024-03-01 10:08:08 +01:00
Andras Banki-Horvath 39211d25ed invoices: make test HTLC circuit keys unique 2024-03-01 10:08:08 +01:00
Andras Banki-Horvath 3d56d2f1ee sqldb: add full SQL InvoiceStore implementation 2024-03-01 10:08:08 +01:00
Andras Banki-Horvath 5cf67c4440 sqldb: add utility functions for SQL NULL types 2024-03-01 10:08:07 +01:00
Andras Banki-Horvath 74e7a50f4a sqldb: convert primary key violation to ErrSQLUniqueConstraintViolation
Besides the usual unique constraint violation that we already support we
also want to return the same error if the primary key constraint is
violated.
2024-03-01 10:08:07 +01:00
Andras Banki-Horvath 6a360fb2e2 sqldb: simplify and fixup the existing invoice store schema and queries
This commit attempts to fix some issues with the invoice store's schema that we
couldn't foresee before the implementation was finished. This is safe as the
schema has not been instantiated yet outside of unit tests. Furthermore the
commit updates invoice store SQL queries according to fixes in the schema as
well as to prepare the higher level implementation in the upcoming commits.
2024-03-01 10:08:07 +01:00
Andras Banki-Horvath 3e0f98a75a sqldb: introduce replace for the BIGINT type alias 2024-03-01 10:08:07 +01:00
Andras Banki-Horvath bcc6a3f517 docs: update release notes for 0.18.0 2024-02-19 20:47:25 +01:00
Andras Banki-Horvath f5abc94bdf mod: bump kvdb to v1.4.5 2024-02-19 20:47:25 +01:00
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
Andras Banki-Horvath c4472254ef docs: update release notes for 0.18.0 2024-02-01 21:02:25 +01:00
Andras Banki-Horvath 187e61da23 itests: add itest for ListSweeps's start_height 2024-02-01 21:02:25 +01:00
Andras Banki-Horvath 7725a57055 walletkit: add startheight parameter to ListSweeps
By default ListSweeps will list all sweeps known to the wallet. Over
time this may become expensive to call and callers may not be interested
in the full history. This commit adds a `startheight` parameter to the
`ListSweeps` RPC call. This parameter can be used to fetch sweeps only
from a specified start block height or only unconfirmed ones if it is
set to -1.
2024-02-01 21:02:24 +01:00
Andras Banki-Horvath 59ce7d9845 github: bump pull-resquest-stats to v2.11.0 2024-01-25 18:08:34 +01:00
Andras Banki-Horvath 560ea95a59 docs: update release notes for 0.18 2024-01-24 21:38:54 +01:00
Andras Banki-Horvath 25af657ad5 kvdb: set postgres max_connections on the started instance 2024-01-24 21:38:54 +01:00
Andras Banki-Horvath 524fa66abf kvdb: bump embedded postgres to v1.25.0 2024-01-24 21:38:53 +01:00
Andras Banki-Horvath bedafca49d docs: update release notes for 0.18.0 2023-10-18 16:15:59 +02:00
Andras Banki-Horvath 8bf7503aa4 invoices: remove the now unused ScanInvoices method 2023-10-18 16:15:58 +02:00
Andras Banki-Horvath d7d385f78f invoices: refactor initial invoice scan when the registry starts
In this commit we change how we select invoices to follow or delete when
starting the InvoiceRegistry to instead of using the deperecated scan
func from channeldb, use specific functions to gather pending and delete
canceled invoices.
2023-10-18 16:15:58 +02:00
Andras Banki-Horvath 8ab267ad90 channeldb: add k/v implementation for InvoiceDB.DeleteCanceledInvoices method 2023-10-18 16:15:58 +02:00
Andras Banki-Horvath 1f8065de35 channeldb: add k/v implementation for InvoiceDB.FetchPendingInvoices 2023-10-18 16:15:57 +02:00
András Bánki-Horváth ad5cd9c8bb multi: extend InvoiceDB methods with a context argument (#8066)
* multi: extend InvoiceDB methods with a context argument

This commit adds a context to InvoiceDB's methods. Along this refactor
we also extend InvoiceRegistry methods with contexts where it makes
sense. This change is essential to be able to provide kvdb and sqldb
implementations for InvoiceDB.

* channeldb: restrict invoice tests to only use an InvoiceDB instance

* docs: update release notes for 0.18.0
2023-10-11 13:42:59 +02:00
Andras Banki-Horvath 91af62a031 lnd: bump lnd/cert version
This commit bumps the lnd/cert version to 1.2.1 and fixes all call sites
where cert.GenCertPair was called.
2023-02-07 09:50:56 +01:00
Andras Banki-Horvath c3445e79d9 cert: removed unused args from cert.GenCertPair
Since the cert pair is written with a subsequent call to
cert.WriteCertPair we can safely remove the two file paths from the
argument list of cert.GenCertPair.
2023-02-06 17:11:56 +01:00
Andras Banki-Horvath c09a81624c keys: update key for bhandras 2022-06-09 09:28:46 +02:00
Andras Banki-Horvath 699f9c0d23 docs: update release notes for 0.15.0 2022-05-31 17:36:44 +02:00
Andras Banki-Horvath 98f39deb38 invoices: fix deadlock in hodl subscription handling 2022-05-31 17:36:43 +02:00
Andras Banki-Horvath cc8a1f0d2b invoices: fix deadlock in notification handling 2022-05-31 17:36:40 +02:00
Andras Banki-Horvath bbe953d70d docs: update release notes 0.15.0 2022-05-06 12:29:38 +02:00
Andras Banki-Horvath c4c188f6d9 signer: fix crash when musig combine doesn't have final sig 2022-05-06 12:29:38 +02:00
Andras Banki-Horvath ddf0571031 itest: cover musig2 combine without all signatures ready 2022-05-06 12:29:32 +02:00
Andras Banki-Horvath 70ac0070fa docs: update release notes 0.15.0 2022-04-12 11:56:34 +02:00
Andras Banki-Horvath 3d5f33a0cf routing: fail in-flight attempts cleanly on terminal payment failure
In case of a multi shard payment with more than one in-flight shards,
one shard quitting with a terminal failure will stop the payment
lifecycle and close the `shardHandler`'s `quit` channel. In the
`collectResult` function we're waiting for the `Switch` to
asynchronously return a result for each shard. This may have been
interrupted by the aformentioned `quit` channel's closing skipping
attempt failure (or success) notification towards the control tower
and therefore skipping proper settle/fail info fill in the channel db.
Since payments have a composite state of a global failure reason and
settle/fail info for all attempts, any attempt with an unfilled
settle/fail info keeps a payment in-flight even if the payment itself
isn't in-flight anymore.
2022-04-12 11:56:33 +02:00
Andras Banki-Horvath 64ea883105 switch+test: fix race condition in unit test 2022-03-23 13:26:15 +01:00
Andras Banki-Horvath 31cb876301 docs: update release notes 0.15.0 2022-03-22 14:20:40 +01:00
Andras Banki-Horvath 0e4d7cf143 itest: make use of session ttl in failover test 2022-03-22 14:20:40 +01:00
Andras Banki-Horvath 7c8093ad1a config: update sample-lnd.conf 2022-03-22 14:20:40 +01:00
Andras Banki-Horvath 8eca46f142 cluster: configurable session TTL for the leader elector 2022-03-22 14:20:36 +01:00
Andras Banki-Horvath 95d8fd8007 docs: update release notes 0.15.0 2022-03-14 15:16:01 +01:00
Andras Banki-Horvath c548a70e0d invoices: fix deadlock in invoice registry 2022-03-14 15:15:58 +01:00
Andras Banki-Horvath d28c9000c5 docs: update release notes 0.15.0 2022-02-28 12:03:06 +01:00
Andras Banki-Horvath bee5e7b761 docs: update etcd docs 2022-02-28 12:03:05 +01:00
Andras Banki-Horvath 1093683b47 etcd: set embedded etcd default max msg size and up txn limit 2022-02-28 12:03:05 +01:00
Andras Banki-Horvath 5e90193180 etcd: fix config clone 2022-02-28 12:03:05 +01:00
Andras Banki-Horvath 40af029413 etcd: extend kvdb_etcd with a real ForAll implementation 2022-02-28 12:03:04 +01:00
Andras Banki-Horvath 9591e058ea itest: add test for the channel policy fee rate round down bug 2022-01-25 15:58:43 -08:00
Andras Banki-Horvath 39ea802eb1 docs: update release notes 0.15.0 2022-01-24 17:43:01 +01:00
Andras Banki-Horvath eeea141e01 lnd: allow large GRPC messages 2022-01-24 17:43:00 +01:00
Andras Banki-Horvath 996be217b9 lncli: add (dev only) importgraph 2022-01-24 17:43:00 +01:00
Andras Banki-Horvath d059f78b4d build: add dev tag to the linter config 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
Andras Banki-Horvath 825422a82a lncfg: move ParseHexColor to lncfg 2022-01-24 17:42:54 +01:00
Andras Banki-Horvath 2dff5ba216 docs: update release notes 0.14.2 2022-01-20 18:20:44 +01:00
Andras Banki-Horvath ec046aec1b lncli: add force flag to 2022-01-19 17:18:06 +01: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
Andras Banki-Horvath 5efbb2b0ff docs: update release notes 2021-12-08 23:10:20 +01:00
Andras Banki-Horvath 8cd607447e routing: fix memory corruption in MC store
Since bbolt returns references to internally stored data when storing
locally it's best to copy the byte slices returned or alternatively
convert them to string (which also makes a copy) to avoid crashes casued
by memory corruption.
2021-12-08 23:10:16 +01:00
Andras Banki-Horvath 24d5146894 docs: update release notes 2021-12-02 21:07:50 +01:00
Andras Banki-Horvath 1ccc5e8014 etcd: make max message size configurable 2021-12-02 21:07:49 +01:00
Andras Banki-Horvath 0beaee0336 docs: update release notes 2021-11-08 12:40:18 +01:00
Andras Banki-Horvath 3df216f6c3 channeldb: avoid locking the graph cache while iterating channels
It may happen that we do pathfinding while also attempt to change the
graph. In this case changing the database, channel state, graph while
reading from the same sources may create deadlocks. To resolve this we
change locking policy in the graph cache when pathfinding.
2021-11-08 12:40:14 +01:00
Andras Banki-Horvath 4d4b525058 docs: update release notes 2021-11-02 20:19:07 -07:00
Andras Banki-Horvath ea5d43a2a8 channeldb: fix crash when inbound policy is unset 2021-11-02 20:18:58 -07:00
Andras Banki-Horvath c9533bf6b9 docs: update leader election docs [skip ci] 2021-11-01 16:30:13 +01:00
Andras Banki-Horvath 76065e84d3 invoices: do not log when invoice is already deleted 2021-11-01 16:10:45 +01:00
Andras Banki-Horvath 11cf4216e4 multi: move all channelstate operations to ChannelStateDB 2021-09-29 17:00:03 +02:00
Andras Banki-Horvath 60cccf8409 multi: carve out LinkNodeDB from channeldb.DB for cleaner separation 2021-09-29 17:00:02 +02:00
Andras Banki-Horvath 292b8e1ce6 channeldb: fix dangerous type casting hack 2021-09-29 17:00:02 +02:00
Andras Banki-Horvath 639faeed6d channeldb: use kvdb.Backend instead of channeldb.DB for the Graph 2021-09-29 17:00:01 +02:00
Andras Banki-Horvath 16436a3230 docs: update release notes 2021-09-15 10:27:00 +02:00
Andras Banki-Horvath ef7e46bc2e travis: fix ARM and Windows itest parallelism 2021-09-15 10:26:52 +02:00
Andras Banki-Horvath 23ded04ff5 docs: update release notes 0.14 2021-09-14 13:12:23 +02:00
Andras Banki-Horvath 3648f2fa4b payments: prefetch payment on hot paths 2021-09-14 13:12:23 +02:00
Andras Banki-Horvath 152d1dc36a kvdb: extra test coverage for kvdb.Prefetch 2021-09-14 13:12:23 +02:00
Andras Banki-Horvath 256b62e0d5 etcd: add kvdb.Prefetch
This commit extends the kvdb interface in a backwards compatible way
such that we'll be able to prefetch all keys in a bucket in one go reducing the
number of roundtrips.
2021-09-14 13:12:22 +02:00
Andras Banki-Horvath daec66a4e4 etcd: STM to allow prefetching of keys and full ranges
This commit adds more full range caching to the STM such that we'll
be able to prefetch keys and ranges on the kvdb level. This will allow
us to reduce roundtrips to etcd do fast iteration of small ranges.
2021-09-14 13:12:19 +02:00
Andras Banki-Horvath 400cc0eb96 docs: update release-notes-0.14.0.md 2021-09-10 14:40:58 +02:00
Andras Banki-Horvath 9bf04f9870 itest+etcd: save etcd logs along the node logs 2021-09-10 14:40:57 +02:00
Andras Banki-Horvath 6c2d8bb176 etcd: enable optional log file for embedded etcd log output
In this commit we add an extra config for enabling logging to an
external file when using embedded etcd. This can be useful when running
integration tests to see more details about etcd related issues.
2021-09-10 14:40:54 +02:00
Andras Banki-Horvath f2cc783043 docs: update release-notes-0.14.0.md 2021-09-07 10:46:50 +02:00
Andras Banki-Horvath 204966db40 channeldb: migration to flatten the htlc attempts bucket 2021-09-07 10:46:49 +02:00
Andras Banki-Horvath 63d7f5fca7 channeldb: flatten the payment-htlcs-bucket 2021-09-07 10:46:46 +02:00