Skip to content

Conversation

@MPins
Copy link
Contributor

@MPins MPins commented Dec 5, 2025

Changed the RBF Coop Close to make it use internally sat/kw instead of sat/vb.

This PR must be merged before PR#10067 as it provides the necessary groundwork.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 refactors the RBF cooperative close process to align all fee rate calculations and representations with the sat/kw unit. This change standardizes the internal handling of transaction fees, improving consistency and preparing the codebase for upcoming features that rely on this unified approach. The modifications span across API definitions, internal state management, and fee estimation logic.

Highlights

  • Fee Rate Unit Standardization: The RBF cooperative close mechanism has been updated to consistently use sat/kw (satoshi per kiloweight) instead of sat/vb (satoshi per virtual byte) for all internal fee rate calculations and representations.
  • API and Data Structure Updates: The lnrpc/lightning.proto and lnrpc/lightning.swagger.json files have been modified to include a new fee_per_kw field in the PendingUpdate message, reflecting the change in fee rate units for external communication.
  • Internal Logic Refinement: Core logic within lnwallet/chancloser and peer packages has been adjusted to handle chainfee.SatPerKWeight types directly, removing previous conversions and ensuring consistent fee handling throughout the RBF cooperative close state machine.
  • Preparation for Future PR: This pull request serves as foundational work, providing the necessary changes for a subsequent PR (Fees: add fractional sat/vB support (lncli) and sats_per_kw (RPC) #10067) that will likely build upon this standardized fee rate handling.
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.

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 refactors the RBF cooperative close logic to use sat/kw instead of sat/vb for fee rates. The changes are consistent across the codebase, including protocol definitions, RPC server logic, and tests. My feedback includes a suggestion to deprecate the old fee_per_vbyte field in the protobuf definition for API clarity and an improvement to a comment to better align with the style guide by explaining the intention of the code.

MPins added 2 commits December 5, 2025 04:50
Change rbf coop close flow to use sat/kw insted of sat/vb,
and update the unit tests accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant