lnd icon indicating copy to clipboard operation
lnd copied to clipboard

[g175:4] graph/db: continue graph store for V2 data

Open ellemouton opened this issue 5 months ago • 2 comments

Description TBD

Depends on https://github.com/lightningnetwork/lnd/pull/10379 Part of #10293

ellemouton avatar Nov 19 '25 17:11 ellemouton

Summary of Changes

Hello @ellemouton, I'm Gemini Code Assist[^1]! 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 continues the ongoing work to evolve the graph database for Gossip V2 support. It introduces version-awareness to critical graph database operations, enabling the system to correctly distinguish and process both V1 and V2 channel announcements. The SQL database backend is extended to store and retrieve V2-specific channel information, including new cryptographic details for funding outputs, while the KV store explicitly retains its V1-only scope. These infrastructural changes are crucial for a smooth transition to Gossip V2 without impacting existing V1 functionality.

Highlights

  • Gossip V2 Data Preparation: The graph database is being prepared to handle Gossip V2 channel data, introducing version-awareness to core graph operations across various components.
  • Versioned Graph Operations: Key database operations such as deleting channel edges, checking public nodes, and fetching channel edges now explicitly accept a gossip version parameter, allowing for differentiated handling of V1 and V2 data.
  • SQL Store V2 Support: The SQL database store has been updated to support V2 channel insertion, proof addition, and public node checks, including new fields specific to V2 channels like MerkleRootHash and FundingScript.
  • KV Store V1 Limitation: The Key-Value store implementation is explicitly limited to Gossip V1 data, returning an error if operations for other gossip versions are attempted.
  • V2 Channel Model Enhancements: The ChannelEdgeInfo model now includes fields and logic specific to V2 channels, such as optional Bitcoin keys, MerkleRootHash, FundingScript, and ExtraSignedFields, along with a new NewV2Channel constructor.
  • Updated Testing Framework: The testing suite has been enhanced to run graph database tests against both V1 and V2 gossip versions, ensuring future compatibility and correctness.
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 :thumbsup: and :thumbsdown: 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.

[^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.

gemini-code-assist[bot] avatar Nov 19 '25 17:11 gemini-code-assist[bot]

@ellemouton, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Dec 10 '25 20:12 lightninglabs-deploy