Uh oh!
There was an error while loading. Please reload this page.
Start tracking ChannelMonitors by channel ID in ChainMonitor and ChannelManager - #3554
Conversation
40aeb66 to
1c7a0a1CompareCodecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #3554 +/- ##
==========================================
- Coverage 88.54% 88.49% -0.05%
==========================================
Files 149 149 Lines 114459 114709 +250 Branches 114459 114709 +250 ==========================================
+ Hits 101345 101517 +172 - Misses 10618 10691 +73 - Partials 2496 2501 +5 ☔ View full report in Codecov by Sentry. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1c7a0a1 to
850ec1bCompare
jkczyz
left a comment
There was a problem hiding this comment.
CI Still unhappy initializing ChannelManagerReadArgs in the fuzz test.
850ec1b to
a24d821Compare
TheBlueMatt
left a comment
There was a problem hiding this comment.
Conceptually LGTM, I think the first two commits make sense, yea. The last commit will obviously have to wait a release or two.
a24d821 to
5bcca97Comparewpaulino
commented
Jan 28, 2025
Rebased due to conflicts and removed the last commit |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
5bcca97 to
c680c0fCompare
TheBlueMatt
left a comment
There was a problem hiding this comment.
On real comment, a few nits.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Once dual funding/splicing is supported, channels will no longer maintain their original funding outpoint. Ideally, we identify `ChannelMonitor`s with a stable identifier, such as the channel ID, which is fixed throughout the channel's lifetime. This commit replaces the use of funding outpoints as the key to the monitor index with the channel ID. Note that this is strictly done to the in-memory state; it does not change how we track monitors within their persisted state, they are still keyed by their funding outpoint there. Addressing that is left for follow-up work.
As motivated by the previous commit, we do some of the same work here at the `ChannelManager` level instead. Unfortunately, we still need to track the funding outpoint to support downgrades by writing the in flight monitor updates as two separate TLVs, one using the channel IDs, and the other using the funding outpoints. Once we are willing to stop supporting downgrades past this version, we can fully drop it.
It's not needed except for one place where we can just access the field directly, so we can avoid the allocation on each call. For API consumers, they may still access the funding script via `ChannelMonitor::get_funding_script`.
c680c0f to
717db82Compare
Once dual funding/splicing is supported, channels will no longer maintain their original funding outpoint. Ideally, we identify
ChannelMonitors with a stable identifier, such as the channel ID, which is fixed throughout the channel's lifetime.In the
ChainMonitor, we replace the use of funding outpoints as the key to the monitor index with the channel ID. Note that this is strictly done to the in-memory state; it does not change how we track monitors within their persisted state, they are still keyed by their funding outpoint there. Addressing that is left for follow-up work.In the
ChannelManager, in-flight monitor updates are persisted, so we still need to track the funding outpoint to support downgrades by writing the in them as two separate TLVs, one using the channel IDs, and the other using the funding outpoints. Once we are willing to stop supporting downgrades past this version, we can fully drop the old TLV.Looking to get concept ACKs on whether we want to go down this path. The first two commits can be considered today, but the last one will have to wait a few releases due to the backwards compatibility concern. Note that this PR does not represent all of the work to achieve our goal, there's still a good bit of refactoring/cleanup to follow.