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

tests: mock LSPS2 service charges the opening fee from its params

Public commit record

What the developer wrote

Authored by Peter Neuroth

95/100 · Strong
tests: mock LSPS2 service charges the opening fee from its params

Until now the mock deducted a fixed `htlc.fee_msat` (default 0) and
did none of the fee checks bLIP-52 asks of an LSP. Compute the fee
instead:

- `lsps2.buy` with a `payment_size_msat` fails with 202 if the fee is
not below the payment size and with 203 if computing it overflows.
- In no-MPP+var-invoice mode the fee comes from the first HTLC, which
is failed with unknown_next_peer if it is outside the payment size
limits, if the fee overflows or if nothing would be left to forward.
- The honest deduction is the computed fee; `htlc.fee_msat` still
overrides it.

Failed HTLCs now record why they were failed.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit only changes test code. It updates a mock Lightning Service Provider (LSP) used in Core Lightning's test suite so that its simulated 'opening fee' follows the real bLIP-52 formula instead of being a hardcoded test value. No production wallet, node, or protocol code is touched, so it cannot directly affect real users or funds.

Recommended action

No security action required. Review as normal test-quality change.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/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.