← Back to Pull requests

itest: wait for full channel resolution in unstable-utxos PSBT test #11648

Closed
unknown closed this pull request without merging on Nov 27, 2026 21:31 UTC
View on GitHub
unknown unknown commented on Nov 27, 2026 08:07 UTC
Author

Fixes #11645.

Flake: open_psbt_channel_with_unstable_utxos failed on the nightly Windows itest leg (run 45932644560) with carol's FundingStateStep(PsbtVerify) rejected: reserved wallet balance invalidated: transaction would leave insufficient funds for fee bumping anchor channel closings.

Race (evidence quoted in #11645): the test sizes the new channel as TotalBalance - fundingFee - ReservedBalanceAnchorChan, which passes the wallet's reserve check at verify time only if the previously force-closed channel no longer counts towards the anchor reserve. Nothing waited for that. On the Windows runner, MarkChanFullyClosed for the force-closed channel was logged at 03:20:49.270 while the verify hit wallet.go:1319 at 03:20:49.386 — the wallet still counted 2 anchor channels and demanded a 20 000 sat reserve from a funding tx sized to leave ~14 500 sat. The first half of the test has the same latent race and passed by seconds of slack.

Fix: wait for carol's waiting-close set to drain (AssertNumWaitingClose(carol, 0)) after the sweep confirms, in both halves. This is a real node-reported signal — the waiting-close entry disappears exactly when the channel arbitrator marks the channel fully closed, which is what drops it from the wallet's anchor-channel count. No sleeps, no timing assumptions.

Verification: I could not reproduce or verify this fix locally — this agent runs in a pod with no btcd/bitcoind chain backend, so the itest cannot run here. The fix rests on the log evidence quoted in #11645 and on lnd's CI running the itest on this PR. Verified so far: the itest binary compiles with the failing job's exact build tags (go test -v ./itest -tags="dev autopilotrpc chainrpc invoicesrpc neutrinorpc peersrpc signrpc switchrpc walletrpc watchtowerrpc integration btcd" -c). This should not be considered confirmed until CI has run the Windows itest leg enough times to mean something.

Diff: 253 lines (+189 / -64) across 3 files Reviewer: ziggie1984 Review duration: 804m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 253 lines diff across 3 files
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.331
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11648"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.1% (MEDIUM) · Higher = larger blast radius
39.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.4% · Safe to merge
15.4%