Unwatch previous funding tx after splice #3218
Merged
Conversation
After a splice transaction confirms, we don't need to keep watching the previous funding output: it has been irrevocably spent and needlessly consumes resources in the `Watcher` actor. Those watches are cleaned up when the `Channel` actor dies, which does not happen if the channel isn't closed and the `Peer` actor is kept alive while disconnected.
Whenever we receive a new block, we log the number of watches we have. This lets us detect whether we're missing some clean-up of old watches in edge cases.
sstone
reviewed
Dec 8, 2025
eclair-core/src/test/scala/fr/acinq/eclair/channel/states/e/NormalSplicesStateSpec.scala
Outdated
Show resolved
Hide resolved
sstone
approved these changes
Dec 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a splice transaction confirms, we don't need to keep watching the previous funding output: it has been irrevocably spent and needlessly consumes resources in the
Watcheractor.Those watches are cleaned up when the
Channelactor dies, which does not happen if the channel isn't closed and thePeeractor is kept alive while disconnected.We also add some logs about the internal state of the
ZmqWatcherin the second commit, which lets us detect whether we're not properly cleaning up old watches.