What changed, and why it matters
This commit is a pure code refactoring change. It takes one existing Go interface called OpenChannelCommitmentStore and splits it into two smaller interfaces: one for write/mutation operations and one for read/query operations. The original interface is preserved by embedding the two new ones. No behavior, logic, or security properties of the software change.
No security action needed. Treat as normal maintenance/refactoring code review.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff in chanstate/interface.go refactors OpenChannelCommitmentStore[Channel any] to embed two newly introduced interfaces: OpenChannelCommitmentMutationStore (UpdateChannelCommitment, AdvanceCommitChainTail) and OpenChannelCommitmentQueryStore (CommitmentHeight). This is an interface-segregation refactor with no functional changes, no new methods, no method signature changes, and no implementation changes.
Changed components
chanstate/interface.goInspect captured patch +11 / −0
diff --git a/chanstate/interface.go b/chanstate/interface.go
index 7a1322c..397a05f 100644
--- a/chanstate/interface.go
+++ b/chanstate/interface.go
@@ -229,6 +229,13 @@ type OpenChannelCloseTxStore[Channel any] interface {
// OpenChannelCommitmentStore owns persisted commitment state for open channel
// records.
type OpenChannelCommitmentStore[Channel any] interface {
+ OpenChannelCommitmentMutationStore[Channel]
+ OpenChannelCommitmentQueryStore[Channel]
+}
+
+// OpenChannelCommitmentMutationStore owns persisted commitment mutations for
+// open channel records.
+type OpenChannelCommitmentMutationStore[Channel any] interface {
// UpdateChannelCommitment updates the local commitment state. It
// locks in pending local updates received from the remote party and
// persists remote log updates that have been acked, but not signed
@@ -265,7 +272,11 @@ type OpenChannelCommitmentStore[Channel any] interface {
AdvanceCommitChainTail(channel Channel, fwdPkg *FwdPkg,
updates []LogUpdate, ourOutputIndex,
theirOutputIndex uint32) error
+}
+// OpenChannelCommitmentQueryStore owns persisted commitment queries for open
+// channel records.
+type OpenChannelCommitmentQueryStore[Channel any] interface {
// CommitmentHeight returns the current persisted commitment height.
CommitmentHeight(channel Channel) (uint64, error)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.