-
Notifications
You must be signed in to change notification settings - Fork 123
staticaddr: channel funding with deposits #1040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @hieblmi, 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 significantly extends the functionality of static addresses by enabling them to be used as a source for funding Lightning channels. It introduces a new 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.
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 introduces a new openchannel subcommand for static addresses, allowing users to fund channels from their deposits. The implementation is comprehensive, covering the command-line interface, RPC definitions, daemon logic, and documentation.
My review focuses on the new cmd/loop/openchannel.go file, where I've identified a few issues related to context handling, input validation, and error wrapping. These are important for ensuring the robustness and maintainability of the new command.
The refactoring to move utility functions into a staticutil package is a great improvement for code organization and reuse. The protocol changes to use PSBT for withdrawals are also a solid enhancement.
Overall, this is a well-structured PR that adds significant functionality. Addressing the feedback will further improve its quality.
f9b49dc to
9d37fca
Compare
94f45cc to
375cf47
Compare
ca63cb5 to
2b9378a
Compare
Make our own type StaticAddressLoopInRequest which has a single field of type lnrpc.OpenChannelRequest. Removed copy-pasted lnrpc types which are needed for OpenChannelRequest.
2b9378a to
5b6631d
Compare
|
@hieblmi, remember to re-request review from reviewers when ready |
|
@gemini-code-assist review |
There was a problem hiding this 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 introduces a significant new feature: funding channels from static address deposits via a new openchannel subcommand. The changes are extensive, touching the CLI, daemon, RPC definitions, and state management logic. The implementation appears well-structured, reusing existing components from lnd and internal logic where appropriate. I've identified a few issues: one regarding error handling in the CLI, a potential resource leak in the deposit state machine, and a minor typo in a test function name. Overall, this is a solid contribution that adds valuable functionality.
5b6631d to
48bb35e
Compare
|
@gemini-code-assist review |
There was a problem hiding this 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 introduces a valuable new feature, allowing users to open channels funded by static address deposits. The implementation is well-structured, following existing patterns in the codebase and reusing functionality from lnd where appropriate. The new openchannel command is comprehensive, offering a user experience similar to lncli openchannel. The changes to the state machine and RPC definitions are correct and consistent. I have one suggestion regarding test file location to improve maintainability.
| // TestCalculateFundingTxValues tests the calculateFundingTxValaues function | ||
| // with various scenarios. | ||
| func TestCalculateFundingTxValues(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR introduces a
openchannelsubcommand to static addresses.It provides the same experience as
lncli openchannel.Exmples:
Open a channel with all available deposits:
Open a channel with specified local funding amount, coin-selected from available deposits under fee and dust considerations.
Open a channel from two deposits AAA and BBB while taking their combined value(fundmax) as funding amount and considering fees and dust limit.
Open a channel from two deposits AAA and BBB while taking a specified amount(local_amt) as funding amount and considering fees and dust limit.
TODOs: