Skip to content

Fixing populating genesis info#2039

Open
sergey3bv wants to merge 1 commit intolightninglabs:mainfrom
sergey3bv:fix/populate-genesis-info
Open

Fixing populating genesis info#2039
sergey3bv wants to merge 1 commit intolightninglabs:mainfrom
sergey3bv:fix/populate-genesis-info

Conversation

@sergey3bv
Copy link
Copy Markdown

Should solve #2038

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 an issue where the GenesisInfo field in the DecodeAssetPayReq RPC response was not always correctly populated, especially when dealing with asset group invoices. The changes ensure that GenesisInfo is consistently provided and that the AssetId within it accurately represents the anchor tranche's genesis ID for grouped assets, improving the reliability and correctness of invoice decoding.

Highlights

  • RPC Response Correction: Corrected the logic for populating the GenesisInfo field in the DecodeAssetPayReq RPC response to ensure it is always present and accurate, especially for asset group invoices.
  • Asset Group Genesis ID: Ensured that when decoding invoices for asset groups, the GenesisInfo.AssetId correctly reflects the anchor tranche's genesis ID, rather than an arbitrary leaf ID.
  • Test Coverage: Added a new test assertion in decode_invoice_test.go to validate the consistent population of GenesisInfo when decoding custom channel invoices, verifying equality between asset ID and group key based responses.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

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.

Copy link
Copy Markdown

@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 an issue where genesis information was not being populated for group key queries in DecodeAssetPayReq. The change correctly populates the GenesisInfo field by using the anchor tranche's genesis ID when available for group key requests. A corresponding integration test has been added to verify this fix. The changes look good and address the issue effectively.

@jtobin jtobin added the bug fix label Mar 24, 2026
@jtobin jtobin requested a review from darioAnongba March 24, 2026 13:20
@sergey3bv sergey3bv force-pushed the fix/populate-genesis-info branch 3 times, most recently from 9401153 to 8a4aca8 Compare March 27, 2026 14:03
@sergey3bv
Copy link
Copy Markdown
Author

Hey, @darioAnongba, could you please review?

cc @Roasbeef

Copy link
Copy Markdown
Contributor

@darioAnongba darioAnongba 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 PR. Currently, the behavior is not to populate the genesis info because we didn't accommodate the types to have a GenesisInfo when decoding by group key. Always filling the GenesisInfo might be fine but needs some more changes:

  1. We need to update the proto comment and regenerate Swagger docs. Suggested text: "Always populated. For group-key queries, the asset_id reflects the resolved tranche's genesis ID."
  2. We sadly don't use conventional commits in this repo but use commit titles as package: description(e.g: rpc: populate genesis info when decoding asset requests by group key). Could you please align?

@github-project-automation github-project-automation bot moved this from 🆕 New to 👀 In review in Taproot-Assets Project Board Mar 31, 2026
@sergey3bv sergey3bv force-pushed the fix/populate-genesis-info branch 2 times, most recently from 2022433 to 889f15a Compare April 2, 2026 10:16
@sergey3bv sergey3bv requested a review from darioAnongba April 2, 2026 10:18
@sergey3bv sergey3bv force-pushed the fix/populate-genesis-info branch from 889f15a to 4b1ac2e Compare April 6, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

3 participants