Skip to content

Conversation

@darioAnongba
Copy link
Contributor

  • Filter out orphan UTXOs with missing signing information: In prior versions, we didn't store KeyFamily and KeyIndex for orphan UTXOs. When both values are 0, LND fails to sign the transaction. This PR filters out these UTXOs to prevent signing failures.

  • Limit the number of orphan UTXOs fetched: Previously, there was no limit on how many orphan UTXOs could be included in a transaction. If too many were fetched, the transaction could become too large. This PR adds a limit of 20 orphan UTXOs per transaction (MaxOrphanUTXOs).

  • Enable wallet.sweep-orphan-utxos by default: Changed the default from false to true. This ensures tombstone and burn outputs are automatically swept during onchain transactions.

@gemini-code-assist
Copy link

Summary of Changes

Hello @darioAnongba, 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 enhances the robustness and usability of orphan UTXO management. It addresses potential transaction signing failures by filtering out improperly stored UTXOs and prevents transaction bloat by limiting the number of swept UTXOs. Furthermore, it streamlines the process by enabling automatic orphan UTXO sweeping by default, ensuring a cleaner and more efficient wallet operation.

Highlights

  • Orphan UTXO Filtering: Implemented filtering to exclude orphan UTXOs that lack necessary signing information (where both KeyFamily and KeyIndex are 0). This prevents LND from failing to sign transactions due to these malformed UTXOs, which were created in prior versions.
  • Orphan UTXO Limit: Introduced a limit of 20 (MaxOrphanUTXOs) on the number of orphan UTXOs fetched for sweeping. This prevents transactions from becoming excessively large when many orphan UTXOs are present.
  • Default Sweeping Enabled: The wallet.sweep-orphan-utxos configuration option is now enabled by default. This ensures that tombstone and burn outputs are automatically swept during on-chain transactions, improving wallet hygiene.
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.

@darioAnongba darioAnongba force-pushed the feat/orphan-limit-filter branch from 17421c3 to 02e110a Compare December 8, 2025 16:10
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 introduces several improvements to orphan UTXO sweeping, including filtering out UTXOs with missing signing information, limiting the number of UTXOs fetched, and enabling sweeping by default. The changes are logical and well-implemented, and the new functionality is covered by tests. I have a few suggestions to improve the new tests and align the logging with the repository's style guide.

@darioAnongba darioAnongba force-pushed the feat/orphan-limit-filter branch from 02e110a to c82b4dd Compare December 8, 2025 16:24
@coveralls
Copy link

coveralls commented Dec 8, 2025

Pull Request Test Coverage Report for Build 20035562459

Details

  • 10 of 13 (76.92%) changed or added relevant lines in 3 files are covered.
  • 8293 unchanged lines in 122 files lost coverage.
  • Overall coverage decreased (-0.006%) to 56.64%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tapdb/assets_store.go 6 9 66.67%
Files with Coverage Reduction New Missed Lines %
authmailbox/client.go 2 66.67%
commitment/proof.go 2 87.29%
fn/retry.go 2 92.5%
tapdb/interfaces.go 2 78.33%
universe/interface.go 3 74.21%
commitment/encoding.go 4 68.75%
mssmt/encoding.go 4 76.67%
rpcutils/price_oracle_marshal.go 4 85.07%
tapdb/sqlc/transfers.sql.go 4 82.65%
tapsend/proof.go 4 85.99%
Totals Coverage Status
Change from base Build 20033169882: -0.006%
Covered Lines: 64885
Relevant Lines: 114557

💛 - Coveralls

@darioAnongba darioAnongba force-pushed the feat/orphan-limit-filter branch from c82b4dd to 6edfe6a Compare December 8, 2025 16:40
@darioAnongba darioAnongba added this to the v0.8 milestone Dec 8, 2025
@darioAnongba darioAnongba moved this from 🆕 New to 🏗 In progress in Taproot-Assets Project Board Dec 8, 2025
@darioAnongba darioAnongba moved this from 🏗 In progress to 👀 In review in Taproot-Assets Project Board Dec 8, 2025
Copy link
Member

@jtobin jtobin left a comment

Choose a reason for hiding this comment

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

(Nit: I would avoid long lines in commit messages, e.g. in 4539224.)

LGTM. 👍 👍

Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

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

cACK, approach looks good, will take a look at the test in a while before approving

@jtobin jtobin linked an issue Dec 9, 2025 that may be closed by this pull request
@darioAnongba darioAnongba requested review from GeorgeTsagk and removed request for ffranr December 9, 2025 16:55
Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

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

LGTM

have some suggestions to extend the tests, otherwise looking good 🟢

Added filtering to exclude orphan UTXOs with missing
signing information (KeyFamily=0 and KeyIndex=0).

These UTXOs were created in prior versions that didn't store
this information, causing LND to fail when signing.
@darioAnongba darioAnongba force-pushed the feat/orphan-limit-filter branch from 6edfe6a to 7102e04 Compare December 11, 2025 15:31
@darioAnongba darioAnongba added this pull request to the merge queue Dec 11, 2025
Merged via the queue into main with commit ce65455 Dec 11, 2025
27 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Taproot-Assets Project Board Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Filter orphan utxos with no signing information and limit their amount

5 participants