Commit graph

18339 commits

Author SHA1 Message Date
ziggie
9382fcb801
multi: fix debug log 2025-02-20 10:44:19 +01:00
yyforyongyu
7ab0e15937
sweep: fix error logging 2025-02-20 14:41:52 +08:00
yyforyongyu
353f208031
sweep: refactor IsOurTx to not return an error
Before this commit, the only error returned from `IsOurTx` is when the
root bucket was not created. In that case, we should consider the tx to
be not found in our db, since technically our db is empty.

A future PR may consider treating our wallet as the single source of
truth and query the wallet instead to check for past sweeping txns.
2025-02-20 14:41:52 +08:00
yyforyongyu
8d49246a54
docs: add release notes 2025-02-20 14:41:50 +08:00
yyforyongyu
c61f781be7
itest: split up force close tests
So we can focus on testing normal flow vs persistence flow.
2025-02-20 14:40:54 +08:00
yyforyongyu
74161f0d57
sweep: make sure recovered inputs are retried
Previously, when a given input is found spent in the mempool, we'd mark
it as Published and never offer it to the fee bumper. This is dangerous
as the input will never be fee bumped. We now fix it by always
initializing the input with state Init, and only use mempool to check
for fee and fee rate.

This changes the current restart behavior - as previously when a
sweeping tx is broadcast, the node shuts down, when it starts again, the
input will be offered to the sweeper again, but not to the fee bumper,
which means the sweeping tx will stay in the mempool with the last-tried
fee rate. After this change, after a restart, the input will be swept
again, and the fee bumper will monitor its status. The restart will also
behave like a fee bump if there's already an existing sweeping tx in the
mempool.
2025-02-20 14:40:54 +08:00
yyforyongyu
4bd1a344b9
sweep: signal tx in markInputFatal
This commit adds the failed tx to the result when marking the input as
fatal, which is used in the commit resolver when handling revoked
outputs.
2025-02-20 14:40:54 +08:00
yyforyongyu
b184afe227
sweep: handle missing inputs during fee bumping
This commit handles the case when the input is missing during the RBF
process, which could happen when the bumped tx has inputs being spent by
a third party. Normally we should be able to catch the spend early via
the spending notification and never attempt to fee bump the record.
However, due to the possible race between block notification and spend
notification, this cannot be guaranteed. Thus, we need to handle the
case during the RBF when seeing a `ErrMissingInputs`, which can only
happen when the inputs are spent by others.
2025-02-20 14:40:53 +08:00
yyforyongyu
4f469de18e
sweep: refactor handleInitialTxError and createAndCheckTx
This commit refactors `handleInitialTxError` and `createAndCheckTx` to
take a `monitorRecord` param, which prepares for the following commit
where we start handling missing inputs.
2025-02-20 14:40:53 +08:00
yyforyongyu
f614e7aed9
sweep: add createUnknownSpentBumpResult
A minor refactor to break the method `handleUnknownSpent` into two
steps, which prepares the following commit where we start handling
missing inputs.
2025-02-20 14:40:53 +08:00
yyforyongyu
db8319d70b
sweep: add method handleReplacementTxError
This is a minor refactor so the `createAndPublishTx` flow becomes more
clear, also prepares for the following commit where we start to handle
missing inputs.
2025-02-20 14:40:53 +08:00
yyforyongyu
42818949dc
sweep: retry sweeping inputs upon TxUnknownSpend
We now start handling `TxUnknownSpend` in our sweeper to make sure the
failed inputs are retried when possible.
2025-02-20 14:40:53 +08:00
yyforyongyu
2f1205a394
sweep: start tracking inputs spent by unknown tx
This commit adds a new field `InputsSpent` to the `BumpResult` so they
can be used to track inputs spent by txns not recoginized by the fee
bumper.
2025-02-20 14:40:53 +08:00
yyforyongyu
388183e173
itest: add fee replacement test 2025-02-20 14:40:52 +08:00
yyforyongyu
db351e1908
sweep: rename methods for clarity
We now rename "third party" to "unknown" as the inputs can be spent via
an older sweeping tx, a third party (anchor), or a remote party (pin).
In fee bumper we don't have the info to distinguish the above cases, and
leave them to be further handled by the sweeper as it has more context.
2025-02-20 14:40:52 +08:00
yyforyongyu
121116cff7
sweep: remove dead code and add better logging 2025-02-20 14:40:52 +08:00
yyforyongyu
50bc191feb
sweep: handle unknown spent in processRecords
This commit refactors the `processRecords` to always handle the inputs
spent when processing the records. We now make sure to handle unknown
spends for all backends (previously only neutrino), and rely solely on
the spending notification to give us the onchain status of inputs.
2025-02-20 14:40:52 +08:00
yyforyongyu
61cec43951
sweep: add a new event TxUnknownSpend 2025-02-20 14:40:52 +08:00
yyforyongyu
8c9ba327cc
sweep: add method getSpentInputs
To track the input and its spending tx, which will be used later to
detect unknown spends.
2025-02-20 14:40:52 +08:00
Oliver Gugger
0e87863481
Merge pull request #9523 from ellemouton/graph9
graph/db: use View directly instead of manual DB tx creation and commit
2025-02-19 01:55:18 -06:00
Oliver Gugger
31418e4b85
Merge pull request #9525 from ellemouton/graph10
graph: Restrict interface to update channel proof instead of entire channel
2025-02-18 11:34:38 -06:00
Elle
f9d29f90cd
Merge pull request #9513 from ellemouton/graph5
graph+routing: refactor to remove `graphsession`
2025-02-18 11:54:24 -03:00
Elle Mouton
9df8773163
graph: update proof by ID
This commit restricts the graph CRUD interface such that one can only
add a proof to a channel announcement and not update any other fields.
This pattern is better suited for SQL land too.
2025-02-18 11:05:28 -03:00
Elle Mouton
e58abbf0e5
graph/db: fix edges bucket check
This commit fixes a bug that would check that the passed `edge` argument
of UpdateChannelEdge is nil but it should actually be checking if the
`edges` bucket is nil.
2025-02-18 11:04:27 -03:00
Elle Mouton
03899ab1f9
graph/db: use View directly instead of manual Tx handling
In this commit, we use the available kvdb `View` method directly for
starting a graph session instead of manually creating and commiting the
transaction. Note this changes behaviour since failed tx create/commit
will now error instead of just log.
2025-02-18 10:18:55 -03:00
Elle Mouton
f3805002ff
graph/db: unexport methods that take a transaction
Unexport and rename the methods that were previously used by the
graphsession package.
2025-02-18 10:15:55 -03:00
Elle Mouton
e004447da6
multi: remove the need for the graphsession package
In this commit, we add a `GraphSession` method to the `ChannelGraph`.
This method provides a caller with access to a `NodeTraverser`. This is
used by pathfinding to create a graph "session" overwhich to perform a
set of queries for a pathfinding attempt. With this refactor, we hide
details such as DB transaction creation and transaction commits from the
caller. So with this, pathfinding does not need to remember to "close
the graph session". With this commit, the `graphsession` package may be
completely removed.
2025-02-18 10:15:41 -03:00
Elle Mouton
dfe2314a2a
routing: refactor pathfinding loop
In preparation for the next commit where we will start hiding underlying
graph details such as that a graph session needs to be "closed" after
pathfinding is done with it, we refactor things here so that the main
pathfinding logic is done in a call-back.
2025-02-18 10:11:34 -03:00
Elle Mouton
99c9440520
graph/db: define a NodeTraverser interface
Which describes methods that will use the graph cache if it is available
for fast read-only calls.
2025-02-18 10:10:04 -03:00
Elle Mouton
8ec08fbfa4
multi: remove the need for NewRoutingGraph
The `graphsession.NewRoutingGraph` method was used to create a
RoutingGraph instance with no consistent read transaction across calls.
But now that the ChannelGraph directly implements this, we can remove
The NewRoutingGraph method.
2025-02-18 07:59:57 -03:00
Elle Mouton
5d5cfe36c7
routing: rename routing Graph method
In preparation for having the ChannelGraph directly implement the
`routing.Graph` interface, we rename the `ForEachNodeChannel` method to
`ForEachNodeDirectedChannel` since the ChannelGraph already uses the
`ForEachNodeChannel` name and the new name is more appropriate since the
ChannelGraph currently has a `ForEachNodeDirectedChannelTx` method which
passes the same DirectedChannel type to the given call-back.
2025-02-18 07:59:57 -03:00
Elle Mouton
971832c792
graph: temporarily rename some ChannelGraph methods
Add the `Tx` suffix to both ForEachNodeDirectedChannelTx and
FetchNodeFeatures temporarily so that we free up the original names for
other use. The renamed methods will be removed or unexported in an
upcoming commit. The aim is to have no exported methods on the
ChannelGraph that accept a kvdb.RTx as a parameter.
2025-02-18 07:59:57 -03:00
Elle Mouton
9068ffcd8b
graph: let FetchNodeFeatures take an optional read tx
For consistency in the graphsessoin.graph interface, we let the
FetchNodeFeatures method take a read transaction just like the
ForEachNodeDirectedChannel. This is nice because then all calls in the
same pathfinding transaction use the same read transaction.
2025-02-18 07:59:57 -03:00
Oliver Gugger
b08bc99945
Merge pull request #9518 from starius/bumpfee-immediate-doc-fix
walletrpc: fix description of bumpfee.immediate
2025-02-18 02:02:36 -06:00
Olaoluwa Osuntokun
5ee81e1876
Merge pull request #9512 from Roasbeef/go-1-23
multi: update build system to Go 1.23
2025-02-17 16:45:12 -08:00
Boris Nagaev
0916f3e9b3
walletrpc: fix description of bumpfee.immediate
It waits for the next block and sends CPFP even if there are no other
inputs to form a batch.
2025-02-17 13:33:16 -03:00
Oliver Gugger
01819f0d42
Merge pull request #9516 from ellemouton/graph6
invoicesrpc: remove direct access to ChannelGraph pointer
2025-02-17 07:40:56 -06:00
Yong
65a18c5b35
Merge pull request #9515 from ellemouton/graphFixFlake
graph: ensure topology subscriber handling and network msg handling is synchronous
2025-02-17 20:48:05 +08:00
Oliver Gugger
fa10991545
multi: fix linter by updating to latest version 2025-02-17 10:40:55 +01:00
Olaoluwa Osuntokun
c40ea0cefc
invoices: fix new linter error w/ Go 1.23 2025-02-13 17:09:28 -08:00
Olaoluwa Osuntokun
bf192d292f
docs: update INSTALL.md with Go 1.23 instructions 2025-02-13 16:57:07 -08:00
Olaoluwa Osuntokun
7bc88e8360
build: update go.mod to use Go 1.23
This enables us to use the new language features that are a part of this
release.
2025-02-13 16:57:06 -08:00
Olaoluwa Osuntokun
61852fbe95
multi: update build system to Go 1.23 2025-02-13 16:57:06 -08:00
Oliver Gugger
68105be1eb
Merge pull request #9507 from saubyk/18.5-releasenotes-patch
Update release-notes-0.18.5.md
2025-02-13 13:03:23 -06:00
Suheb
5b93ab6a8f
Update release-notes-0.18.5.md and release-notes-0.19.0.md 2025-02-13 10:45:38 -08:00
Oliver Gugger
319a0ee470
Merge pull request #9493 from ziggie1984/lncli-no-replacement
For some lncli cmds we should not replace the content with other data
2025-02-13 09:52:52 -06:00
Oliver Gugger
2ec972032e
Merge pull request #9517 from yyforyongyu/fix-coverage
workflows: skip coverage error in job `finish`
2025-02-13 09:11:57 -06:00
yyforyongyu
2b0c25e31d
workflows: skip coverage error in job finish
Also updates the coverage action used.
2025-02-13 22:05:38 +08:00
Oliver Gugger
d5ac05ce87
Merge pull request #9501 from yyforyongyu/getinfo-blockheight
rpcserver: check `blockbeatDispatcher` when deciding `isSynced`
2025-02-13 04:17:45 -06:00
Elle Mouton
da43541c63
invoicesrpc: remove direct access to ChannelGraph pointer 2025-02-13 11:45:09 +02:00