Commit graph

18163 commits

Author SHA1 Message Date
yyforyongyu
c68b8e8c1e
sweep: rename Failed to Fatal
This commit renames `Failed` to `Fatal` as it sounds too close to
`PublishFailed`. We also wanna emphasize that inputs in this state won't
be retried.
2025-02-05 19:48:18 +08:00
András Bánki-Horváth
6bf895aeb9
Merge pull request #9469 from bhandras/use-sqldb-1.0.7 2025-02-03 10:31:56 +01:00
András Bánki-Horváth
327eb8d8ca
Merge pull request #9438 from bhandras/invoice-bucket-tombstone
channeldb+lnd: set invoice bucket tombstone after migration
2025-02-01 10:59:51 +01:00
Andras Banki-Horvath
c10b765fff
build: use the tagged 1.0.7 version of sqldb 2025-02-01 10:54:11 +01:00
Olaoluwa Osuntokun
e40324358a
Merge pull request #9459 from ziggie1984/amp-htlc-invoices
invoices: amp invoices bugfix.
2025-01-31 13:11:52 -06:00
Oliver Gugger
d2c0279647
Merge pull request #9456 from mohamedawnallah/deprecate-warning-sendpayment-and-sendtoroute
lnrpc+docs: deprecate warning `SendToRoute`, `SendToRouteSync`, `SendPayment`, and `SendPaymentSync` in Release 0.19
2025-01-31 11:05:27 -06:00
Mohamed Awnallah
d4044c2fb6 docs: update release-notes-0.19.0.md
In this commit, we warn users about the removal
of RPCs `SendToRoute`, `SendToRouteSync`, `SendPayment`,
and `SendPaymentSync` in the next release 0.20.
2025-01-31 16:23:43 +00:00
ziggie
715cafa59a
docs: add release-notes. 2025-01-31 13:10:03 +01:00
ziggie
118261aca4
invoices+channeldb: Fix AMP invoices behaviour.
We now cancel all HTLCs of an AMP invoice as soon as it expires.
Otherwise because we mark the invoice as cancelled we would not
allow accepted HTLCs to be resolved via the invoiceEventLoop.
2025-01-31 13:10:02 +01:00
Oliver Gugger
f4bf99b161
Merge pull request #9462 from guggero/go-1-22-11
Update to Go 1.22.11
2025-01-30 10:18:50 -06:00
Oliver Gugger
94efe06495
docs: add release notes 2025-01-30 16:14:56 +01:00
Oliver Gugger
191c838ad1
multi: bump Go version to v1.22.11 2025-01-30 16:13:26 +01:00
Olaoluwa Osuntokun
32cdbb43f6
Merge pull request #9454 from ziggie1984/add_custom_error_msg
Add Custom Error msg and Prioritise replayed HTLCs
2025-01-29 22:48:22 -06:00
ziggie
f4e2f2a396 docs: add release-notes. 2025-01-29 22:45:37 -06:00
ziggie
15e6e35cdb
invoices: fix log entries and add a TODO.
We need to make sure if we cancel an AMP invoice we also cancel
all remaining HTLCs back.
2025-01-29 18:21:41 +01:00
ziggie
46f3260924
invoices: make sure the db uses the same testTime. 2025-01-29 18:21:40 +01:00
ziggie
34e56b69e9
invoicerpc: add clarifying comment. 2025-01-29 18:21:40 +01:00
ziggie
c95d73c898
invoices: remove obsolete code for AMP invoices.
We always fetch the HTLCs for the specific setID, so there is no
need to keep this code. In earlier versions we would call the
UpdateInvoice method with `nil` for the setID therefore we had
to lookup the AMPState. However this was error prune because in
case one partial payment times-out the AMPState would change to
cancelled and that could lead to not resolve HTLCs.
2025-01-29 18:21:40 +01:00
ziggie
0532990a04
invoices: enhance the unit test suite.
The invoiceregistry test suite also includes unit tests for
multi part payment especially also including payments to AMP
invoices.
2025-01-29 18:21:40 +01:00
ziggie
17e37bd7c2
multi: introduce new traffic shaper method.
We introduce a new specific fail resolution error when the
external HTLC interceptor denies the incoming HTLC. Moreover
we introduce a new traffic shaper method which moves the
implementation of asset HTLC to the external layers.
Moreover itests are adopted to reflect this new change.
2025-01-29 09:59:02 +01:00
ziggie
9ee12ee029
invoices: treat replayed HTLCs beforehand.
We make sure that HTLCs which have already been decided upon
are resolved before before allowing the external interceptor to
potentially cancel them back. This makes the implementation for
the external HTLC interceptor more streamlined.
2025-01-29 09:59:02 +01:00
Mohamed Awnallah
8d3611a3bd lnrpc: deprecate legacy RPCs
In this commit, we deprecate `SendToRouteSync`
and `SendPaymentSync` RPC endpoints.
2025-01-29 02:48:22 +00:00
Oliver Gugger
f25e44712f
Merge pull request #9445 from yyforyongyu/itest-flake
itest: fix flake in `testAnchorThirdPartySpend`
2025-01-27 02:12:34 -06:00
Oliver Gugger
1ed76af179
Merge pull request #9442 from ellemouton/miscErrorFormats
misc: fix incorrect inclusion of nil err in various formatted strings
2025-01-26 06:49:31 -06:00
yyforyongyu
bc8c1643c6
itest: move channel force closes into one sub test var 2025-01-26 09:16:02 +08:00
yyforyongyu
e4b205cd90
itest: fix flake in testAnchorThirdPartySpend
When mining lots of blocks in the itest, the subsystems can be out of
sync in terms of the best block height. We now assert the num of pending
sweeps on Alice's node to give her more time to sync the blocks,
essentially behaving like a `time.Sleep` as in reality, the blocks would
never be generated this fast.
2025-01-26 09:15:36 +08:00
Olaoluwa Osuntokun
c3cbfd8fb2
Merge pull request #9241 from Crypt-iQ/fix_vb
discovery+graph: track job set dependencies in vb
2025-01-24 11:21:35 -08:00
Oliver Gugger
baa34b06d3
Merge pull request #9232 from Abdulkbk/archive-channel-backups
chanbackup: archive old channel backup files
2025-01-24 05:42:13 -06:00
Elle Mouton
e3b94e4578
routerrpc: only log TrackPayment error if err is not nil 2025-01-24 12:49:45 +02:00
Elle Mouton
af8c8b4bb3
lntest: remove always-nil error from formatted error 2025-01-24 12:49:41 +02:00
Abdullahi Yunus
3bf15485ce
docs: add release note 2025-01-24 10:58:42 +01:00
Abdullahi Yunus
84f039db45
lnd+chanbackup: add lnd config flag
In this commit, we add the --no-backup-archive with a default
as false. When set to true then previous channel backup file will
not be archived but replaced. We also modify TestUpdateAndSwap
test to make sure the new behaviour works as expected.
2025-01-24 10:56:15 +01:00
Abdullahi Yunus
a51dfe9a7d
chanbackup: archive old channel backups
In this commit, we first check if a previous backup file exists,
if it does we copy it to archive folder before replacing it with
a new backup file. We also added a test for archiving chan backups.
2025-01-24 10:56:14 +01:00
Eugene Siegel
323b633895 graph -> discovery: move ValidationBarrier to discovery 2025-01-23 13:04:39 -05:00
Eugene Siegel
e0e4073bcd release-notes: update for 0.19.0 2025-01-23 11:43:07 -05:00
Eugene Siegel
6a47a501c3 discovery+graph: track job set dependencies in ValidationBarrier
This commit does two things:
- removes the concept of allow / deny. Having this in place was a
  minor optimization and removing it makes the solution simpler.
- changes the job dependency tracking to track sets of abstact
  parent jobs rather than individual parent jobs.

As a note, the purpose of the ValidationBarrier is that it allows us
to launch gossip validation jobs in goroutines while still ensuring
that the validation order of these goroutines is adhered to when it
comes to validating ChannelAnnouncement _before_ ChannelUpdate and
_before_ NodeAnnouncement.
2025-01-23 11:43:07 -05:00
Eugene Siegel
2731d09a0b graph: change ValidationBarrier usage in the builder code
This omits calls to InitJobDependencies, SignalDependants, and
WaitForDependants. These changes have been made here because
the router / builder code does not actually need job dependency
management. Calls to the builder code (i.e. AddNode, AddEdge,
UpdateEdge) are all blocking in the gossiper. This, combined
with the fact that child jobs are run after parent jobs in the
gossiper, means that the calls to the router will happen in the
proper dependency order.
2025-01-23 11:43:07 -05:00
Andras Banki-Horvath
3f6f6c19c1
docs: update release-notes-0.19.0.md 2025-01-23 15:14:26 +01:00
Andras Banki-Horvath
444524a762
channeldb+lnd: set invoice bucket tombstone after migration
This commit introduces the functionality to set a tombstone key
in the invoice bucket after the migration to the native SQL
database. The tombstone prevents the user from switching back
to the KV invoice database, ensuring data consistency and
avoiding potential issues like lingering invoices or partial
state in KV tables. The tombstone is checked on startup to
block any manual overrides that attempt to revert the migration.
2025-01-23 15:06:09 +01:00
Oliver Gugger
6cabc74c20
Merge pull request #8831 from bhandras/sql-invoice-migration
invoices: migrate KV invoices to native SQL for users of KV SQL backends
2025-01-23 05:48:25 -06:00
Oliver Gugger
49affa2dc3
Merge pull request #9424 from yyforyongyu/fix-gossip-ann
multi: fix inconsistent state in gossip syncer
2025-01-23 05:25:01 -06:00
Andras Banki-Horvath
b1a462ddba
docs: update release notes for 0.19.0 2025-01-23 09:11:03 +01:00
Andras Banki-Horvath
97c025f289
invoices: raise the number of allowed clients for the Postgres fixture 2025-01-23 09:11:02 +01:00
Andras Banki-Horvath
84598b6dc1
sqldb: ensure schema definitions are fully SQLite compatible
Previously, we applied replacements to our schema definitions
to make them compatible with both SQLite and Postgres backends,
as the files were not fully compatible with either.

With this change, the only replacement required for SQLite has
been moved to the generator script. This adjustment ensures
compatibility by enabling auto-incrementing primary keys that
are treated as 64-bit integers by sqlc.
2025-01-23 09:11:02 +01:00
Andras Banki-Horvath
ea98933317
invoices: allow migration test to work on kv sqlite channeldb 2025-01-23 09:11:02 +01:00
Andras Banki-Horvath
5e3ef3ec0c
invoices+sql: use the stored AmtPaid value instead of recalculating
Previously we'd recalculate the paid amount by summing amounts of
settled HTLCs. This approach while correct would stop the SQL migration
process as some KV invoices may have incorrectly stored paid amounts.
2025-01-23 09:11:02 +01:00
Andras Banki-Horvath
0839d4ba7b
itest: remove obsolete itest 2025-01-23 09:11:02 +01:00
Andras Banki-Horvath
a29f2430c1
itest: add integration test for invoice migration 2025-01-23 09:11:01 +01:00
Andras Banki-Horvath
8d20e2a23b
lnd: run invoice migration on startup
This commit runs the invoice migration if the user has a KV SQL backend
configured.
2025-01-23 09:11:01 +01:00
Andras Banki-Horvath
94e2724a34
sqldb+invoices: Optimize invoice fetching when the reference is only a hash
The current sqlc GetInvoice query experiences incremental slowdowns during
the migration of large invoice databases, primarily due to its complex
predicate set. For this specific use case, a streamlined GetInvoiceByHash
function provides a more efficient solution, maintaining near-constant
lookup times even with extensive table sizes.
2025-01-23 09:11:01 +01:00