chainnotifier: surface re-org depth and Done events#283
Open
ellemouton wants to merge 2 commits into
Open
Conversation
299ff09 to
a68fd53
Compare
Temporary replace onto the lnd branch that adds the reorg depth and Done events to the ChainNotifier proto (lightningnetwork/lnd#10943). Lands before the code change so each commit builds. Drop this once that lnd change is merged and tagged.
The ChainNotifier gRPC stream now carries the re-org depth on the Reorg
message and an explicit Done event at re-org safety depth. Expose both
through new functional options:
- WithReOrgDepthChan delivers the re-org depth (0 for spends, which
lnd does not track a depth for).
- WithDoneChan delivers the terminal Done signal, letting callers
distinguish reaching re-org safety depth from an unrelated stream
teardown.
Setting either option (like WithReOrgChan) keeps the listener alive past
the first event. A small generic deliver() helper fans each signal out
to the optional caller channel without blocking the read loop beyond the
registration context.
a68fd53 to
a3baa8d
Compare
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
ChainNotifierre-org depth and the terminalDone(pastre-org-safety-depth) signal that lnd's gRPC stream now carries, via
lightningnetwork/lnd#10943.
Previously the adapter received a payload-less re-org ping and had no way to
observe finality (lnd closed the stream instead of sending an explicit event),
so
ConfRegistration.Donewas allocated but never written over this transport.Changes
RegisterConfirmationsNtfn/RegisterSpendNtfn:WithReOrgDepthChan(chan int32)— delivers the re-org depth (0 for spends,which lnd does not track a depth for).
WithDoneChan(chan struct{})— delivers the terminal Done signal.WithReOrgChan) keeps the listener alive past thefirst event.
ConfEvent_Done/SpendEvent_Doneproto variants and readReorg.Depth. A small genericdeliver()helper fans each signal out to theoptional caller channel without blocking the read loop beyond the
registration context.
Notes
temporary
replaceonto that lnd branch so it builds/tests meanwhile; dropthe replace and bump the lnd require once it lands and tags.
v0.21.0-rc1tag, so it shows as behindmasterbut the Files-changed diff is just the two commits here.