Commit graph

18195 commits

Author SHA1 Message Date
yyforyongyu
58e76b726e
routing: add docs and monior refactor decideNextStep
Add verbose docs and refactor the method to exit early when `allow` is
true.
2025-02-10 11:36:18 +08:00
yyforyongyu
ca10707b26
itest+lntest: assert payment is failed once the htlc times out 2025-02-10 11:31:51 +08:00
yyforyongyu
faa3110127
docs: update release notes 2025-02-10 11:31:50 +08:00
yyforyongyu
5a62528fd7
routing: improve loggings for attempt result handling 2025-02-10 11:31:50 +08:00
yyforyongyu
1acf4d7d4d
routing: always update payment in the same goroutine
This commit refactors `collectResultAsync` such that this method is now
only responsible for collecting results from the switch. The method
`decideNextStep` is expanded to process these results in the same
goroutine where we fetch the payment from db, to make sure the lifecycle
loop always have a consistent view of a given payment.
2025-02-10 11:29:29 +08:00
yyforyongyu
e1279aab20
routing: add new method reloadPayment
To further shorten the lifecycle loop.
2025-02-10 11:28:23 +08:00
yyforyongyu
1fe2cdb765
routing: move amendFirstHopData into requestRoute 2025-02-10 11:28:23 +08:00
yyforyongyu
966cfccb94
routing: add new method reloadInflightAttempts
To shorten the method `resumePayment` and make each step more clear.
2025-02-10 11:28:23 +08:00
yyforyongyu
f96eb50ca8
channeldb+routing: cache circuit and onion blob for htlc attempt
This commit caches the creation of sphinx circuit and onion blob to
avoid re-creating them again.
2025-02-10 11:28:23 +08:00
yyforyongyu
46eb811543
routing: remove redundant GetHash 2025-02-10 11:28:18 +08:00
Olaoluwa Osuntokun
ce8cde6911
Merge pull request #9470 from ziggie1984/fix-sweepInput-bug
Make BumpFee RPC user inputs more stricter.
2025-02-07 14:39:31 -08:00
ziggie
022b3583b4
docs: update release-notes 2025-02-07 15:14:05 +01:00
Oliver Gugger
3c0350e481
Merge pull request #9476 from ellemouton/graph1
graph: refactor `graph.Builder` update handling
2025-02-07 07:23:41 -06:00
Elle Mouton
a86a5edbd5
docs: update release notes 2025-02-07 13:01:39 +02:00
Elle Mouton
6169b47d65
graph: rename routerStats to builderStats
This logic used to be handled by the router. Update to reflect new
owner.
2025-02-07 13:01:39 +02:00
Elle Mouton
d757b3bcfc
graph: refactor Builder network message handling
The point of the `graph.Builder`'s `networkHandler` goroutine is to
ensure that certain requests are handled in a synchronous fashion.
However, any requests received on the `networkUpdates` channel, are
currently immediately handled in a goroutine which calls
`handleNetworkUpdate` which calls `processUpdate` before doing topology
notifications. In other words, there is no reason for these
`networkUpdates` to be handled in the `networkHandler` since they are
always handled asynchronously anyways. This design is most likely due to
the fact that originally the gossiper and graph builder code lived in
the same system and so the pattern was copied across.

So in this commit, we just remove the complexity. The only part we need
to spin off in a goroutine is the topology notifications.
2025-02-07 13:01:35 +02:00
ziggie
34c4d12c71
walletrpc: add new deadline-delta param to bumpfee rpc
Add new parameter deadline-delta to the bumpfee request and only
allow it to be used when the budget value is used as well.
2025-02-07 11:28:41 +01:00
Yong
5b1eaf9978
Merge pull request #9474 from ellemouton/nodeAnnConversion
graph/db: correctly handle de(ser)ialisation of `models.LightningNode` opaque addresses
2025-02-07 18:06:10 +08:00
Elle Mouton
276b335cf5
graph: refactor announcement handling logic
In this commit, we remove the `processUpdate` method which handles each
announement type (node, channel, channel update) in a separate switch
case. Each of these cases currently has a non-trivial amount of code.
This commit creates separate methods for each message type we want to
handle instead. This removes a level of indentation and will make things
easier to review when we start editing the code for each handler.
2025-02-07 07:30:00 +02:00
Elle Mouton
1974903fb2
multi: move node ann validation code to netann pkg
The `netann` package is a more appropriate place for this code to live.
Also, once the funding transaction code is moved out of the
`graph.Builder`, then no `lnwire` validation will occur in the `graph`
package.
2025-02-07 07:30:00 +02:00
Yong
457a245a4e
Merge pull request #9482 from yyforyongyu/itest-log-ts
lntest: log timestamp when printing errors
2025-02-06 16:16:54 +08:00
yyforyongyu
5f4716c699
lntest: log timestamp when printing errors 2025-02-05 22:51:46 +08:00
Yong
bac699df8f
Merge pull request #9446 from yyforyongyu/yy-prepare-fee-replace
sweeper: rename `Failed` to `Fatal` and minor refactor
2025-02-05 22:48:41 +08:00
yyforyongyu
b98542bd96
docs: update release notes 2025-02-05 19:49:09 +08:00
yyforyongyu
e5f39dd644
sweep: refactor storeRecord to updateRecord
To make it clear we are only updating fields, which will be handy for
the following commit where we start tracking for spending notifications.
2025-02-05 19:49:09 +08:00
yyforyongyu
7eea7a7e9a
sweep: add requestID to monitorRecord
This way we can greatly simplify the method signatures, also paving the
upcoming changes where we wanna make it clear when updating the
monitorRecord, we only touch a portion of it.
2025-02-05 19:49:04 +08:00
yyforyongyu
bde5124e1b
sweep: shorten storeRecord method signature
This commit shortens the function signature of `storeRecord`, also makes
sure we don't call `t.records.Store` directly but always using
`storeRecord` instead so it's easier to trace the record creation.
2025-02-05 19:48:18 +08:00
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
Elle Mouton
16e2a48d0f
docs: update release notes 2025-02-05 12:41:50 +02:00
Elle Mouton
71b2338d53
graph/db: de(ser)ialise opaque node addrs
In this commit, we fix the bug demonstrated in the prior commit. We
correctly handle the persistence of lnwire.OpaqueAddrs.
2025-02-05 12:41:50 +02:00
Elle Mouton
d68d24d97e
graph/db: demonstrate LightningNode serialisation bug 2025-02-05 08:24:45 +02:00
Elle Mouton
b7509897d5
models: create a helper to convert wire NodeAnn to models.LNNode type
And use it in the gossiper. This helps ensure that we do this conversion
consistently.
2025-02-05 08:20:10 +02:00
Elle Mouton
c5cff4052b
lnwire_test: fix test doc string
This test started out demonstrating a bug. But that bug has since been
fixed. Fix the comment to reflect.
2025-02-05 08:17:42 +02: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