AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 26 Bitcoin

lnwallet: model the aux sig blob faithfully in tests

Public commit record

What the developer wrote

Authored by George Tsagkarelis

88/100 · Strong
lnwallet: model the aux sig blob faithfully in tests

Three places modelled the aux signature blob less faithfully than
production does, in ways that hid whether the blob was carried at all.

MockAuxSigner.UnpackSigs returned a single slot no matter how many HTLCs
were packed. A real aux signer emits exactly one slot per HTLC, and code
that pairs the unpacked slots with HTLCs by index depends on that. The
default mock now records the slot count in the packed blob and hands
back that many slots. Since the blob is parsed into custom records, it
has to stay a canonical TLV stream, so the count travels in the dummy
record's value. Registering a function rather than a fixed value is what
lets the result depend on the input.

restartChannel rebuilt the channel with no channel options, so a restart
silently dropped the aux signer and the restarted side stopped producing
aux signatures while its peer still expected them. Production re-applies
the aux components every time a channel is loaded.

Two chan sync tests rebuilt CommitSigs from a retransmitted wire message
without its aux signature blob, which the link carries across.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes test code in LND's Lightning wallet so that mock auxiliary (taproot/asset channel) signatures behave more like the real production code. The changes make tests correctly preserve the aux signer across channel restarts and carry the aux signature blob through retransmitted commitment messages. There is no direct production code change; it is a test-harness hardening patch that prevents future bugs in the aux-signature protocol from being hidden by inaccurate test mocks.

Recommended action

No production deployment action required. Reviewers should verify that the updated default mock now exercises the per-HTLC slot pairing correctly and that any future production changes to aux signature handling are run against these hardened tests.

Security signals we found

01

Test-only fix that removes false negatives in aux-signature handling

02

Restart helper previously dropped aux signer, which could mask protocol failures in tests

03

Mock unpack previously returned a single slot regardless of HTLC count, hiding index-mismatch bugs

04

Retransmitted commitment messages now carry the aux blob in tests, matching link-layer production behavior

Risk score

Why this scored 26/100

Our methodology →
Potential impact 5/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 4/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.