chainnotifier: surface re-org depth and Done events - #283
Open
ellemouton wants to merge 3 commits into
Open
Conversation
ellemouton
marked this pull request as ready for review
June 30, 2026 21:11
ellemouton
force-pushed
the
ellemouton/chainntfn-reorg-depth-done
branch
2 times, most recently
from
July 1, 2026 21:32
a68fd53 to
a3baa8d
Compare
ellemouton
force-pushed
the
ellemouton/chainntfn-reorg-depth-done
branch
4 times, most recently
from
July 15, 2026 20:54
73f64c9 to
d2783b5
Compare
Temporarily replace lnd with the branch that adds reorg depth and Done events to the ChainNotifier RPC. Include finality signaling for mature historical registrations so this commit provides the complete server behavior required by the following client change. Replace the fork pin with a released upstream lnd version after the server change lands and is tagged.
The ChainNotifier RPC now reports the reorg depth and emits an explicit Done event at the reorg-safety depth. Expose both with WithReOrgDepthChan and WithDoneChan options. Reorg depth is zero for spend notifications because lnd does not track it. Keep a listener alive past its first event when either option is set. Deliver optional notifications without blocking the stream read loop beyond the registration context.
ellemouton
force-pushed
the
ellemouton/chainntfn-reorg-depth-done
branch
from
July 16, 2026 17:34
36a1e65 to
1082b8e
Compare
|
@Roasbeef: review reminder |
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.
Summary
Surfaces the reversible
ChainNotifierlifecycle added bylightningnetwork/lnd#10943:
Previously lndclient only exposed a payload-less re-org ping and had no
unambiguous finality event. In particular, stream completion alone could not
distinguish policy finality from transport teardown.
Changes
WithReOrgDepthChan(chan int32):0, because lnd does not currently trackspend re-org depth.
WithDoneChan(chan struct{})for explicit backend policy finality.Done channel is configured, while preserving the legacy first-positive-event
behavior for callers which configure none of them.
ConfEvent_DoneandSpendEvent_Done, and stop cleanly afterdelivering the terminal event.
cancellation, so callers must drain every channel they configure.
positive/reorg/positive/Done lifecycles, re-org depth mapping, spend depth
0, terminal completion, and legacy behavior.Dependency
This PR is blocked on lightningnetwork/lnd#10943
for the additive proto variants. Until that lands and is released,
go.modtemporarily replaces lnd with the exact reviewed PR head. The replace should be
removed when lndclient can bump to the released upstream version.
Validation
make buildgo test ./...go test -race ./...golangci-lint run --new ./...— 0 issues