Skip to content

chainntnfs: mark a set complete above the tip only with no scan pending - #33

Merged
paulscode merged 1 commit into
blake2bfrom
conf-hint-guard
Nov 20, 2026
Merged

paulscode merged 1 commit into
blake2bfrom
conf-hint-guard

Conversation

@paulscode

Copy link
Copy Markdown
Owner

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, RegisterConf and RegisterSpend return 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's QueryConfirmHint/QuerySpendHint, which already return a HeightHint. 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 …WithOrigin interfaces 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.

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.
@paulscode
paulscode merged commit 4a1006c into blake2b Nov 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant