Skip to content

Conversation

@ziggie1984
Copy link
Collaborator

@ziggie1984 ziggie1984 commented Dec 10, 2025

Fixes: #10438

@gemini-code-assist
Copy link

Summary of Changes

Hello @ziggie1984, 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 addresses a subtle but critical bug in the invoice probing mechanism. Previously, the payment address might not have been correctly included in probe requests due to an uninitialized slice, leading to potential issues in payment path finding. The change ensures that the payment address slice is always properly sized before data is copied, thereby guaranteeing that the payment address is consistently added when an invoice is probed, improving the reliability of the routing process.

Highlights

  • Payment Address Copy Fix: Resolved an issue where the payment address was not being correctly copied when probing an invoice. This occurred because the destination slice (probeRequest.PaymentAddr) was not initialized with a sufficient size, causing the copy operation to be ineffective.
  • Slice Initialization: Ensured that the probeRequest.PaymentAddr slice is explicitly initialized with lntypes.HashSize before the payment address data is copied into it, guaranteeing that the address is always properly included in the probe request.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ziggie1984 ziggie1984 self-assigned this Dec 10, 2025
@ziggie1984 ziggie1984 added the payments Related to invoices/payments label Dec 10, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a bug where probing an invoice with a payment address would not work correctly because the destination slice for the copy operation was not initialized. The change correctly initializes the slice before copying.

My review includes a comment pointing out a similar bug in the same function for LSP route probing, which should also be fixed to ensure the feature works as intended in all cases.

@ziggie1984 ziggie1984 requested review from ellemouton, hieblmi and saubyk and removed request for saubyk December 10, 2025 08:40
@ziggie1984 ziggie1984 marked this pull request as ready for review December 10, 2025 08:40
using copy for a slice of size 0 will not copy anything so we need
to first initialize the slice before we do the deep copy.
Copy link
Collaborator

@hieblmi hieblmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, LGTM!

@ziggie1984 ziggie1984 requested review from bhandras and removed request for ellemouton December 10, 2025 13:50
@ziggie1984 ziggie1984 added this to the v0.20.1 milestone Dec 10, 2025
@yyforyongyu yyforyongyu merged commit 1e15efc into lightningnetwork:master Dec 10, 2025
39 of 41 checks passed
@ziggie1984 ziggie1984 added the backport-v0.20.x-branch This label is used to trigger the creation of a backport PR to the branch `v0.20.x-branch`. label Dec 12, 2025
@github-actions
Copy link

Git push to origin failed for v0.20.x-branch with exitcode 1

@github-actions
Copy link

Created backport PR for v0.20.x-branch:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-10439-to-v0.20.x-branch
git worktree add --checkout .worktree/backport-10439-to-v0.20.x-branch backport-10439-to-v0.20.x-branch
cd .worktree/backport-10439-to-v0.20.x-branch
git reset --hard HEAD^
git cherry-pick -x 1c4bcc3b7dba14ed52c69f4b7041bd431d528c49 ac30443cc19b0213912bc704462ddf5af7feae50
git push --force-with-lease

@ziggie1984 ziggie1984 deleted the bugfix/probing branch December 13, 2025 00:38
ziggie1984 added a commit that referenced this pull request Dec 15, 2025
…20.x-branch

[v0.20.x-branch] Backport #10439: Always add the payment address when probing an invoice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v0.20.x-branch This label is used to trigger the creation of a backport PR to the branch `v0.20.x-branch`. payments Related to invoices/payments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LND is not setting the PaymentAddr when Probing

4 participants