Enforces low-S canonical signatures when the n field is present in a BOLT11 invoice#10372
Enforces low-S canonical signatures when the n field is present in a BOLT11 invoice#10372MPins wants to merge 3 commits into
n field is present in a BOLT11 invoice#10372Conversation
Summary of ChangesHello @MPins, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a critical update to LND's BOLT11 invoice processing by enforcing low-S canonical signatures when the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request enforces low-S canonical signatures for BOLT11 invoices when the destination public key is provided in the n field, aligning with recent BOLT spec updates. The changes include the core logic in zpay32/decode.go and corresponding test cases. My review focuses on improving the implementation's maintainability by leveraging existing library functions. Overall, the change is correct and well-tested.
|
Hello @Roasbeef the helper function was created btcsuite/btcd#2463 |
|
🟡 PR Severity: MEDIUM Automated classification | 2 files (excl. tests) | 8 lines changed (excl. tests) MEDIUM files (1):
LOW files (1):
Excluded from classification (1):
Analysis: This PR modifies zpay32/decode.go in the zpay32 package (BOLT-11 invoice encoding/decoding). Per classification rules, zpay32/* is MEDIUM severity. The change is small (4 lines added to the decoder) with an accompanying test and release note. No severity bump conditions apply: only 2 non-test files changed (threshold >20), only 8 lines changed (threshold >500), no multiple critical packages touched. Recommendation: Focused review by an engineer familiar with BOLT-11 invoice parsing. To override, add a severity-override-{critical,high,medium,low} label. |
Enforce low-S canonical signatures when the `n` is present and include test vectors to validate the new behavior.
|
Hello @Roasbeef and @yyforyongyu, since the btcd dependency has been merged, we can move this PR forward. |
Fixes #10222
This change enforces low-S canonical signatures in BOLT11 invoices when
nis present and adds the corresponding Bolts test vectors (PR#1284 and PR#1298).This PR depends on btcd PR btcsuite/btcd#2524
This cannot be merged until that PR is merged and LND updates btcdc/v2.