itest: wait for full channel resolution in unstable-utxos PSBT test #11648
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
ziggie1984
Fixes #11645.
Flake:
open_psbt_channel_with_unstable_utxosfailed on the nightly Windows itest leg (run 45932644560) with carol'sFundingStateStep(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,MarkChanFullyClosedfor the force-closed channel was logged at 03:20:49.270 while the verify hitwallet.go:1319at 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.