Commit graph

16250 commits

Author SHA1 Message Date
Keagan McClelland
5ab69aedc7 peer: remove tryLinkShutdown due to redundance
We don't need to try a link shutdown when the chan closer is fetched
since, by this commit, the only callsite manages the shutdown semantics.
After removing the call to tryLinkShutdown, we no longer need the
function at all.
2024-01-22 12:19:58 -08:00
Keagan McClelland
025e569f07 peer: fix local close requests to shutdown via link lifecycle hooks
In order to handle shutdown requests when there are still HTLCs on
the link, we have to manage the shutdown process via the link's
lifecycle hooks. This means we can't use the simple `tryLinkShutdown`
anymore and instead queue a `Shutdown` message at the next opportunity
to do so -- when we send our next `CommitSig`
2024-01-22 12:19:58 -08:00
Keagan McClelland
442f1dd677 peer: handle close messages using link lifecycle hooks 2024-01-22 12:19:58 -08:00
Keagan McClelland
70292253d1 htlcswitch: make link forward eligibility flush aware 2024-01-22 12:19:58 -08:00
Keagan McClelland
6955dc9f12 chancloser: remove ProcessCloseMsg 2024-01-22 12:19:58 -08:00
Keagan McClelland
704eb84bcb chancloser: rewrite tests in terms of new ChanCloser methods 2024-01-22 12:19:58 -08:00
Keagan McClelland
f81e7ada4c peer: rewrite handleCloseMsg in terms of new ChanCloser methods 2024-01-22 12:19:58 -08:00
Keagan McClelland
7b08899cdb chancloser: cache remote ClosingSigned to deal with race 2024-01-22 12:19:58 -08:00
Keagan McClelland
3aceeea4f3 chancloser: move nil MarkCoopBroadcasted to BeginNegotiation 2024-01-22 12:19:58 -08:00
Keagan McClelland
1b0f97a483 chancloser: move initFeeBaseline to BeginNegotiation 2024-01-22 12:19:58 -08:00
Keagan McClelland
45d30af273 chancloser: add BeginNegotiation method to bridge phases 2024-01-22 12:19:58 -08:00
Keagan McClelland
e77d3adef2 chancloser: extract ProcessCloseMsg ClosingSigned handling logic into dedicated method 2024-01-22 12:19:58 -08:00
Keagan McClelland
6fef9ea2d7 chancloser: extract ProcessCloseMsg Shutdown handling logic into dedicated method 2024-01-22 12:19:58 -08:00
Keagan McClelland
30ad49a29d chancloser: add new closeAwaitingFlushState 2024-01-22 12:19:58 -08:00
Keagan McClelland
9b2d1018f2 htlcswitch+peer: add flush api and lifecycle hooks to ChannelUpdateHandler
We also add dummy implementations to channelLink and various mocks.
2024-01-22 12:19:58 -08:00
Mohamed Awnallah
1402ffd17b
protolint: configure protolint and fix the protolinting issues
This PR addresses the following:
- Install and Configure protolint to enforce the protobuf style guide rules in the CI.
- Fix the protolinting issues (package and import ordering) while maintaining the comaptibility.
2024-01-22 22:00:00 +02:00
Elle Mouton
63a3882272
docs: add release note 2024-01-22 21:08:37 +02:00
Elle Mouton
6c427a6ba9
multi: update FetchChanInfos to take in an optional tx
In this commit, the FetchChanInfos ChannelGraph method is updated to
take in an optional read transaction for the case where it is called
from within another transaction.
2024-01-22 21:07:55 +02:00
Elle Mouton
8cf4044215
channeldb: rename delChannelEdge to delChannelEdgeUnsafe
In order to emphasise the fact that the ChannelGraph's cacheMu should be
acquired before calling the `delChannelEdge` method, we add the `Unsafe`
postfix and add a comment to alert readers.
2024-01-22 21:07:55 +02:00
Elle Mouton
ab06665fde
channeldb: acquire mutexes in the same order throughout
In this commit, we ensure that the channeldb cacheMu mutex is only ever
aquired _before_ acquiring the main DB lock in the cases where the two
locks need to be held simultaneously.

With this commit, the deadlock demonstrated in the previous commit is
now fixed.
2024-01-22 21:07:55 +02:00
Elle Mouton
76748bdbf7
channeldb: add ChannelGraph stress test
This commit adds a test that calls many of the ChannelGraph methods
concurrently and in a random order. This test demonstrates that a
deadlock currently exists in the ChannelGraph since the test does not
complete. This is fixed in the next commit.
2024-01-22 21:07:54 +02:00
Yong
ec5b824879
Merge pull request #8406 from ziggie1984/fix-channel-opening-issue
Fix case where Opening Channels get stuck forever.
2024-01-23 02:12:44 +08:00
ziggie
13e557d9b0
docs: add release-notes. 2024-01-22 16:45:39 +00:00
ziggie
ccac5c349c
multi: Add itest for a failed funding flow.
This adds an itest for a failed funding flow by our peer.
2024-01-22 16:45:38 +00:00
ziggie
3530254ff4
peer: add unit test.
Add a unit test for the removal of a pending channel.
2024-01-22 13:01:42 +00:00
ziggie
a5d2541292
funding: initialize remove channel. 2024-01-22 12:58:52 +00:00
Oliver Gugger
e1259cd3c7
Merge pull request #8411 from guggero/make-help
Makefile: add `make help` command that describes goals
2024-01-22 03:59:41 -06:00
Oliver Gugger
35fa053144
Merge pull request #8413 from ellemouton/add-0-17-4-release-notes
docs: add template for 0.17.4
2024-01-22 03:58:16 -06:00
Elle Mouton
2a237209d2
docs: add template for 0.17.4 2024-01-22 11:08:25 +02:00
Oliver Gugger
f35a3718ec
Makefile: add make help command that describes goals
This commit adds a description to each make goal that is printed when
`make help` is run.
Idea borrowed from btcsuite/btcd#2107.
2024-01-22 10:31:48 +02:00
Oliver Gugger
2b83ea309a
Merge pull request #8407 from mohamedawnallah/fix-typo-channel.go
fix: fix typo "(cltv_expiry" to "(cltv_expiry)" in `channeldb/channel.go` [skip ci]
2024-01-22 00:46:06 -06:00
Oliver Gugger
cc18ec4f55
Merge pull request #8354 from mohamedawnallah/add-bitcoind-docker-image-compose-setup
docker: setup `bitcoind` docker image in the `docker-compose.yml` file
2024-01-22 00:43:26 -06:00
Mohamed Awnallah
8407e6989e
fix: fix typo "(cltv_expiry" to "(cltv_expiry)" [skip ci] 2024-01-20 17:31:19 +02:00
Elle
0a29b37be6
Merge pull request #7733 from ellemouton/taprootTowers
watchtower: support taproot channel commitments
2024-01-19 22:55:20 +02:00
Oliver Gugger
24a79c78ed
Merge pull request #8403 from ellemouton/towerInterfaceGotcha
config: pass tower manager pointer in to PopulateDependencies
2024-01-19 07:59:30 -06:00
Mohamed Awnallah
a7914af264
docker: setup bitcoind docker image in the docker compose yaml file 2024-01-19 15:33:47 +02:00
Elle Mouton
2a61c914fb
docs: add release note entry for 7733 2024-01-19 15:33:07 +02:00
Elle Mouton
55ee01a6ca
itest: add taproot tower itest 2024-01-19 15:33:07 +02:00
Elle Mouton
f12cc12da5
server: register a taproot tower client 2024-01-19 15:33:07 +02:00
Elle Mouton
3cb194c45e
lnrpc+lncli: update wtclientrpc for taproot towers 2024-01-19 15:33:06 +02:00
Elle Mouton
660f1f361e
watchtower/wtclient: prep client for taproot towers 2024-01-19 15:33:06 +02:00
Oliver Gugger
c0e3ae6adc
Merge pull request #8399 from yyforyongyu/add-signing-key
scripts: add gpg key for yyforyongyu [skip ci]
2024-01-19 07:15:25 -06:00
Elle Mouton
589cebcec2
config: pass tower manager pointer in to PopulateDependencies
In this commit, we let the explicit wtclient.Manager struct be passed in
to PopulateDependencies instead of the tower client interface. We need
to do this since we do allow the tower client interface to be nil if the
client is not active. So to avoid the golang gotcha where the interface
value will be seen as not nil even though the underlying value is nil,
we pass in the explicit pointer instead.
2024-01-19 13:55:53 +02:00
yyforyongyu
6abfa0b1ee
scripts: add gpg key for yyforyongyu [skip ci] 2024-01-19 01:23:30 +08: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
fde982ad78
input: extract to_local script builders
Factor out the building of the delay and revoke scripts from
NewLocalCommitScriptTree so that they can be re-used later on.
2024-01-18 17:56:48 +02:00