Commit Graph

16058 Commits

Author SHA1 Message Date
Oliver Gugger
cbc11dac8f
multi: add coin selection strategy to channel funding
With this commit we prepare for the lnwallet channel funding logic to be
aware of the config-level coin selection strategy by adding it to the
wallet config.
2024-02-23 08:58:07 +01:00
Olaoluwa Osuntokun
935e550da6
Merge pull request #8463 from ProofOfKeags/refactor/chainreg/rm-channel-constraints
Remove `DefaultChannelConstraints` from PartialChainControl and lnwallet.Config
2024-02-22 14:39:35 -08:00
Elle
16279765eb
Merge pull request #8464 from ellemouton/resend-shutdown-2
multi: resend shutdown on reestablish
2024-02-21 14:10:05 +02:00
Elle Mouton
2fe8520c44
docs: update release notes 2024-02-21 11:58:18 +02:00
Elle Mouton
785790abed
peer/lnwallet: persist shutdown info on send
In this commit, we start persisting shutdown info when we send the
Shutdown message. When starting up a link, we also first check if we
have previously persisted Shutdown info and if we have, we start the
link in shutdown mode meaning that it will not accept any new outgoing
HTLC additions and it will queue the shutdown message after any pending
CommitSig has been sent.
2024-02-21 11:58:18 +02:00
Elle Mouton
5de7792520
htlcswitch: ability to start link in shutdown mode
In this commit, we add the ability to start a link in shutdown mode.
This means that we immediately disable any new HTLC adds in the outgoing
direction and that we queue up a Shutdown message after the next
CommitSig message is sent (or immediately if no CommitSig message is
owed).
2024-02-21 11:57:47 +02:00
Elle Mouton
dc25b425c0
channeldb+lnwallet: add ShutdownInfo with read and write methods
ShutdownInfo contains any info about a previous Shutdown message that we
have sent. This commit adds this type along with read and write methods
for it in the channel db. The existence of the ShutdownInfo on disk
represents the fact that we have previously sent the Shutdown message
and hence that we should resend it on re-establish.
2024-02-21 11:56:15 +02:00
Elle Mouton
987604effb
itest: demonstrate shutdown on restart bug
This commit adds an itest to demonstrate that the following bug exists:
If channel Shutdown is initiated but then a re-connect is done before
the shutdown is complete, then the initiating node currently does not
properly resend the Shutdown message as required by the spec. This will
be fixed in an upcoming commit.
2024-02-21 11:35:12 +02:00
Elle Mouton
8c064b86f1
peer: call DisableAdds before link.OnCommitOnce
This commit moves calls to link.DisableAdds to outside link.OnCommitOnce
call backs. This is done so that if a user requests shutdown, then we
can immediately block any new outgoing HTLCs. It's only the sending of
the Shutdown message that needs to wait until after any pending
CommitSig message is sent.
2024-02-21 11:35:11 +02:00
Elle Mouton
972f57e9a7
peer+htlcswitch: update Enable/DisableAdds API
In this commit, the `ChannelUpdateHandler`'s `EnableAdds` and
`DisableAdds` methods are adjusted to return booleans instead of errors.
This is done becuase currently, any error returned by these methods is
treated by just logging the error since today all it means is that the
proposed update has already been done. And so all we do today is log the
error. But in future, if these methods are updated to return actual
errors that need to be handled, then we might forget to handle them
correctly at the various call sights. So we instead change the signature
of the function to just return a boolean. In future, if we do need to
return any error, we will have to go inspect every call sight in any
case to fix compliation & then we can be sure we are handling the errors
correctly.
2024-02-21 11:35:11 +02:00
Elle Mouton
71753af8ee
multi: fix various typos 2024-02-21 11:35:10 +02:00
Elle
c398b0cc69
Merge pull request #8239 from ellemouton/loadSessionByActiveTower
wtclient: add DeactivateTower and TerminateSession commands
2024-02-21 11:28:25 +02:00
Oliver Gugger
e53f7c1018
Merge pull request #8494 from yyforyongyu/update-fn
gomod: bump `fn` version to `v1.0.2`
2024-02-21 02:09:57 -06:00
yyforyongyu
d38f949072
gomod: bump fn version to v1.0.2 2024-02-21 08:35:08 +08:00
Elle Mouton
a3ccae9a55
docs: update release notes 2024-02-20 14:44:39 +02:00
Elle Mouton
4ab17525ce
itest+lntest: add wtclient session & tower management test 2024-02-20 14:44:39 +02:00
Elle Mouton
59a4bfbc59
itest+refactor: extract various tower test helpers 2024-02-20 14:44:39 +02:00
Elle Mouton
d4424fbcfa
itest: refactor watchtower related tests 2024-02-20 14:44:39 +02:00
Elle Mouton
1c7a7543c7
lnrpc: add session ID to tower session info
This will be used in the itest added in an upcoming commit so that we can
test the TerminateSession command.
2024-02-20 14:44:39 +02: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
5d16491c13
lnrpc+lncli: add TerminateSession command 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
26432359ad
lnrpc+lncli: add DeactivateTower to rpc 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
Keagan McClelland
fb8de14798 lnwallet+funding+lnd: trim unused parameters, from lnwallet.Config
chainreg: remove unused GenDefaultBtcConstraints

lnwallet+funding+lnd: remove DefaultDustLimit from lnwallet.Config
2024-02-19 17:06:21 -08:00
Keagan McClelland
c6ecb10865 chainreg+lnd: remove ChannelConstraints from PartialChainControl 2024-02-19 17:06:21 -08:00
Oliver Gugger
a3bf2c70e5
Merge pull request #8486 from joaothallis/fix/link-typo
docs: fix typo and links
2024-02-19 02:43:11 -06:00
João Thallis
805c1c0d59
docs: fix contribution guide links [skip ci] 2024-02-17 21:48:01 -03:00
joao
1e7f0d42ad
docs: fix makefile typo [skip ci] 2024-02-17 21:47:38 -03:00
Olaoluwa Osuntokun
7a3101710c
Merge pull request #8430 from bhandras/update-pr-stats
github: bump pull-resquest-stats to v2.11.0
2024-02-14 17:52:11 -08:00
Oliver Gugger
f008a97082
Merge pull request #8479 from tdb3/master
lnrpc: Clarify payment_addr and payment_secret
2024-02-14 03:49:47 -06:00
tdb3
3288490df3
lnrpc: Clarify payment_addr and payment_secret
Fix #7438, adding clarification statements in lnrpc proto files.
Originally proposed by daredevil3435 in PR #7873 and PR #7885.
2024-02-13 19:04:18 -05:00
Oliver Gugger
4855faf162
Merge pull request #8471 from morehouse/codeowners
.github: add morehouse to CODEOWNERS
2024-02-12 02:24:22 -06:00
Matt Morehouse
7a0390fe59
.github: add morehouse to CODEOWNERS 2024-02-09 10:27:17 -06:00
Oliver Gugger
17f5798726
Merge pull request #8466 from weiliy/docs-fix-mining-address
docs: preserve MINING_ADDRESS across docker-compose sessions
2024-02-08 02:41:20 -06:00
Weili Y
d740e95c08
docs: preserve MINING_ADDRESS across docker-compose sessions
Export MINING_ADDRESS before docker-compose up to ensure it's retained for
subsequent operations, fixing block generation errors due to missing mining
addresses.
2024-02-07 20:24:24 +08:00
Yong
9651ee6372
Merge pull request #8452 from ProofOfKeags/refactor/contractcourt/naming-consistency
contractcourt: homogenize naming convention
2024-02-07 18:54:55 +08:00
Keagan McClelland
0f245bf237 contractcourt: rename breacharbiter*.go to breach_arbitrator
This is just to finish the cleaning things up to make them more
consistent.
2024-02-06 13:32:51 -07:00
Keagan McClelland
bc3feba267 contractcourt+lnrpc+lnd: s/BreachArbiter/BreachArbitrator
Since we have two other examples of XArbitrator, we rename
BreachArbiter to BreachArbitrator to keep things consistent.
The aim is to reduce the amount of lore you need to know to
intuit where things are or what they do.
2024-02-06 13:32:47 -07:00
Olaoluwa Osuntokun
771d1f0a9c
Merge pull request #8338 from lightningnetwork/coop-close-v2-wire-messages
lnwire: add new closing_complete and closing_sig messages
2024-02-05 17:08:36 -08:00
Olaoluwa Osuntokun
ba3c0c497a
.github: codeowners additions 2024-02-05 16:30:31 -08:00
Olaoluwa Osuntokun
5953eaa9d8
lnwire: add fuzz tests for ClosingComplete+ClosingSigs 2024-02-05 16:30:26 -08:00