Commit message · Peter Neurothtests: add configurable misbehavior to the mock LSPS2 service
Each phase of the mock gets a table of named behaviors, each with its
own parameters, so that every attack in the security matrices is one
config entry:
- transport: drop, wrong_id, duplicate (optionally with a changed
second result), replace (send a raw payload), add_fields and error,
optionally limited to some methods.
- buy: the jit_channel_scid is a fixture too, next to
lsp_cltv_expiry_delta and client_trusts_lsp.
- open: never, or twice.
- htlc: deduct (per-part deduction and extra_fee, or no TLV),
forward_subset (fail the other parts) and deduct_again (charge the fee
again after the session).
lsps2-mock-send sends a message outside of any request and
lsps2-mock-open opens a zero-conf channel outside of any session.
Unknown behaviors and parameters, and missing required ones, are
rejected when the config is set.
100/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queuedexplicit security language
AI analysis · Informational 15/100This commit only adds new testing capabilities to a mock LSPS2 service used in Core Lightning's test suite. It lets developers simulate misbehaving LSPs (e.g., dropping messages, sending wrong IDs, opening channels twice, deducting fees incorrectly) so they can verify that the real client handles those cases safely. The change does not alter production code, wallets, or node behavior, and it does not fix or introduce any real vulnerability.