Repository navigation
chainntnfs: mark a set complete above the tip only with no scan pending - #33
Merged
Merged
Conversation
From lightningnetwork#11247 as re-pushed on 2026-11-17 (head 62e50af): the early returns for a start height above the notifier's tip leave a set pending while another scan for it is outstanding. In this tree the case is already handled earlier: a prefix that starts above the tip also starts above the prefix's end, so the prefix branch returns before this check and the set stays pending. The guard keeps the two trees alike, and upstream's TestTxNotifierPendingScanAfterDeepReorg covers the path here.
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.
Follow-up to #30. lightningnetwork#11247 was reviewed and re-pushed on 2026-11-17 (head 62e50af). This brings over its one behaviour change and its new test.
Change
When a registration's start height is above the notifier's tip,
RegisterConfandRegisterSpendreturn without a historical dispatch. They marked the set complete there even while another scan for it was still pending. Now they mark it complete only when no scan is pending, as upstream does.Does this tree need it?
No case reaches it here, as far as I can tell. In this tree the prefix branch (from #30) returns before this check whenever the prefix starts above its end, and a prefix that starts above the tip always does. So after a deep reorg, the earlier subscriber returns from the prefix branch and the set stays pending. A set that reaches the check any other way is new, with no scan pending. The guard keeps the two trees alike in case either path changes.
Test
Upstream's
TestTxNotifierPendingScanAfterDeepReorg, with its cache lookups adapted to this tree'sQueryConfirmHint/QuerySpendHint, which already return aHeightHint. It passes with and without the guard here, which is what shows the case is already handled; it now covers that path.The rest of upstream's re-push is not needed: the
…WithOrigininterfaces keep older out-of-tree caches compiling, and the documentation of a hint whose height is below its origin describes a state this tree already handles the same way. saubyk's question about pre-upgrade hints trusted for the first subscriber is the case #30's own change covers, by ignoring confirmation hints without an origin.