Commit Graph

471 Commits

Author SHA1 Message Date
Keagan McClelland
ed2989ae33
multi: update to fn v2 2024-12-04 13:19:00 -07:00
Elle Mouton
ab7aae0708
multi: rename nolint:lll to nolint:ll
Find and replace all nolint instances refering to the `lll` linter and
replace with `ll` which is the name of our custom version of the `lll`
linter which can be used to ignore log lines during linting.

The next commit will do the configuration of the custom linter and
disable the default one.
2024-12-02 09:14:21 +02:00
Elle Mouton
c2923e2214
multi: remove PrefixLog
And instead use the new btclog Logger `WithPrefix` method.
2024-11-27 10:44:32 +02:00
chuangjinglu
bcfd8d5b47 multi: fix some function names in interface comment
Signed-off-by: chuangjinglu <chuangjinglu@outlook.com>
2024-11-25 10:49:00 +08:00
Oliver Gugger
e1df8e9161
Merge pull request #9281 from ziggie1984/export-towerclientdb-version
wtdb: export versions of wtclient.db
2024-11-19 17:53:14 +01:00
ziggie
aaa0abc8a9
wtdb: export versions of wtclient.db
We now make it possible to get the current db version of the
wtclient.db. Moreover we can now fetch the latest available
migration version for the client db. This allows us to compare
whether the client.db has all the expected migrations applied.
2024-11-19 16:42:52 +01:00
Matt Morehouse
9dd921243d
wtwire: explain emptyMsg parameter in function comment
This makes it unnecessary to explain the argument at every call site, so
we can simplify each fuzz target.
2024-11-13 15:53:29 -06:00
Matt Morehouse
567ff5d751
wtwire: remove incorrect function comment
The harness doesn't return anything, so don't say that it does.
2024-11-13 15:53:29 -06:00
Matt Morehouse
e2f7eb963f
wtwire: move message prefixing to the harness
The prefixing is done every time the harness is used, so it may as well
reside in the harness itself.

Since we already pass an empty message of the correct type, we can use
that message to get the required prefix bytes.
2024-11-13 15:53:29 -06:00
Matt Morehouse
38f9f795e4
wtwire: s/harness/wireMsgHarness
This slightly more descriptive name obviates the repetitive comments at
every call site.
2024-11-13 15:53:29 -06:00
Animesh Bilthare
ecd4480331
watchtower: Add retry logic for fetching blocks
By default, try to fetch the blocks 3 more times
in case of error.
2024-10-26 16:59:13 +05:30
Oren
54b30423a3 watchtower: fix comments on breach hint and key 2024-10-25 00:07:04 +03:00
Elle Mouton
9d0cd3ff4f
multi: update more loggers to the v2 type 2024-10-22 17:03:56 +02:00
Elle Mouton
23602e017e
multi: start updating various loggers to use the new v2 type 2024-10-22 17:03:55 +02:00
Olaoluwa Osuntokun
1aae47fd71
input+lnwallet: update taproot scripts to accept optional aux leaf
In this commit, we update all the taproot scripts to also accept an
optional aux leaf. This aux leaf can be used to add more redemption
paths for advanced channels, or just as an extra commitment space.
2024-08-28 11:52:31 +02:00
Oliver Gugger
e99e6662cf
multi: update linter, fix new issues 2024-08-20 19:14:44 +02:00
yyforyongyu
b6049ff94b
multi: add NewLogClosure in lnutils to avoid repetition
And replaces all usage of `logClosure` with `lnutils.LogClosure`.
2024-07-25 21:25:23 +08:00
yyforyongyu
8da68bb7db
multi: apply the new type lntypes.WeightUnit 2024-05-25 13:37:13 +08:00
erik
c7f81d3142 multi: replace ioutil.Discard 2024-04-25 11:23:54 +02:00
yyforyongyu
e771993785
multi: make input.OutPoint return wire.OutPoint 2024-04-19 21:33:32 +08:00
Oliver Gugger
648fb22f63
multi: wrap all errors 2024-04-11 15:04:03 +02:00
undefinedor
028959f5a0
kvdb+watchtower: fix unreachable code 2024-03-25 21:04:48 +08:00
Oliver Gugger
5cb4811e86
Merge pull request #8425 from ProofOfKeags/refactor/lnwallet/chan-point-leaks
[EZ Review]: avoid leaking pointers to authoritative ChannelPoint
2024-03-11 00:55:41 -06:00
Keagan McClelland
db39a905cb multi: make NewChanIDFromOutpoint accept value instead of pointer 2024-03-08 15:47:55 -08:00
cuinix
60bc30dd08 remove repetitive words
Signed-off-by: cuinix <915115094@qq.com>
2024-03-07 14:05:47 +08:00
ffranr
cd566eb097
multi: fix fmt.Errorf error wrapping
Refactor fmt.Errorf usage to correctly wrap errors instead of using
non-wrapping format verbs.
2024-02-27 11:13:40 +00:00
Elle Mouton
a9648cbdd1
wtclient: load all active towers into memory
Load an active tower into memory regardless of whether or not it has any
sessions.
2024-02-20 14:44:38 +02:00
Elle Mouton
24702ede14
wtclient: add TerminateSession method 2024-02-20 14:44:37 +02:00
Elle Mouton
05c03400a9
wtdb: add TerminateSession method 2024-02-20 14:44:11 +02:00
Elle Mouton
41582c0b8b
wtdb: create and remove tower should no longer change session status 2024-02-20 14:44:11 +02:00
Elle Mouton
cbf08940ca
wtdb: let DeleteCommitedUpdates move session to terminal
In this commit, we adjust the DeleteCommitmentUpdate method so that it
marks a session as Terminal (if there are updates to delete) since once
we have deleted a commitment update from a session - the session is no
longer useable.
2024-02-20 14:44:11 +02:00
Elle Mouton
5cb8c8df7e
wtdb: rename CSessionInactive to CSessionTerminal
Since we will now change this to mean that the session should not ever
be activated again.
2024-02-20 14:44:11 +02:00
Elle Mouton
beb9b2eeb8
wtclient: add DeactivateTower method
This commit adds the DeactiateTower method to the wtclient.ClientManager
interface along with its implementation. A test is also added for the
new method.
2024-02-20 14:44:09 +02:00
Elle Mouton
4548e72f79
wtdb: add a DeactivateTower method
This new method sets the tower's status to inactive so that it is not
loaded at startup as a candidate tower. We also ensure that a tower's
status is set to active if the CreateTower is called when the tower
already exists.
2024-02-20 09:02:36 +02:00
Elle Mouton
0bb1816fff
watchtower: add filter function to ListTowers
And then only load active towers on client start up.
2024-02-20 08:58:46 +02:00
Elle Mouton
ffd355c6c4
wtdb: add TowerStatus to Tower
This is added as a TLV record meaning that all the towers currently on
disk that don't have this new field will be seen as Active.
2024-02-20 08:58:46 +02:00
Elle Mouton
1ae802812c
watchtower: update DeleteCommittedUpdate to delete all
This commit updates the DeleteCommittedUpdate DB method to delete all of
a given session's committed updates instead of just one at a time. The
reason for this is that in an upcoming commit, we will introduce a
"Terminal" session state - once we have deleted a committed update for a
session it should be considered "Terminal" and there is never a case
where we would only want to delete one committed update and not the
rest. So we want these two actions (deleting committed updates of a
session and setting it's status to terminal) to be atomic.
2024-02-20 08:58:45 +02:00
Oliver Gugger
d7796b464e
Merge pull request #8377 from ellemouton/towerTestFlakeFix
wtclient: ensure correct disk mode for overflow queue
2024-01-23 09:47:27 -06:00
Elle Mouton
660f1f361e
watchtower/wtclient: prep client for taproot towers 2024-01-19 15:33:06 +02:00
Elle Mouton
c50aa10194
watchtower/lookout: make justice desciptor taproot ready 2024-01-18 18:06:00 +02:00
Elle Mouton
5960253357
watchtower/blob: add taproot Commitment type 2024-01-18 18:05:58 +02:00
Elle Mouton
d84a98e3db
watchtower/blob: add taprootJusticeKit implementation 2024-01-18 17:59:14 +02:00
Elle Mouton
0ec3f31780
watchtower/blob: add justiceKitPacketV1 encoding
In preparation for the new Taproot commitment type being supported by
watchtowers, we add a new justice packet type.
2024-01-18 17:58:13 +02:00
Elle Mouton
20a107600f
watchtower: add new TaprootCommit Type and flag
This commit adds a new FlagTaprootChannel Flag which is then used to
construct a new blob Type: TypeAltruistTaprootCommit. New watchtower
feature bits are also added (4/5).
2024-01-18 17:56:49 +02:00
Elle Mouton
65de80be7d
wtclient: remove temporary bug demonstration logic and test
This commit removes the temporary members added to the DiskOverflowQueue
that made it possible to more easily demonstrate a previous bug that
existed.
2024-01-15 17:28:43 +02:00
Elle Mouton
3d201dde50
wtclient: ensure correct disk mode for overflow queue
Before this commit, in the watchtower client's DiskOverflowQueue, there
could be a situation _if no consumer was reading from the queue_ that
could lead to an in-memory build up of backup tasks instead of the
expected disk overflow. This commit fixes this by ensuring that if a
task is read from disk, then the mode is set to disk mode to ensure that
any new items are persisted to disk in this scenario.
The unit tests added in the previous commit is updated here in order to
show that the fix does in-fact fix the test.
2024-01-15 17:28:17 +02:00
Elle Mouton
d4fefda10a
wtclient: demonstrate overflow queue flake
In this commit, some temporary variables and logic is added to the
DiskOverflowQueue for easy stop/go control from unit tests. This is then
used to write a temporary unit tests that demonstrates a race condition
that can cause the queue to be in disk mode when it should be in memory
mode. This new code & test will be removed after the issue has been
fixed.
2024-01-15 17:26:34 +02:00
Yong
26c466aa80
Merge pull request #8372 from mohamedawnallah/deep-copy-transactions-GetBlock
routing: deep copy any transaction we obtain from `GetBlock` call.
2024-01-15 20:13:00 +08:00
Mohamed Awnallah
99908ed2dc
routing: deep copy any transaciton we obtain from GetBlock call. 2024-01-15 11:35:55 +02:00
Elle Mouton
1daec3e890
wtclient: use the new filter options to fix the demo'd bug
In this commit, we use the newly added session listing options to ensure
that we only see a session as exhausted if it does not have any un-acked
updates on disk. This fixes the bug previously demonstrated.
2024-01-12 08:25:28 +02:00