Skip to content

Conversation

darioAnongba
Copy link
Contributor

Garbage collect the residue zero-value UTXOs when creating transactions. Zero-value UTXOs can occur when creating tombstones or full burns.
Currently, these UTXOs accumulate in the DB and are never cleaned. This PR introduces a garbage collection mechanism in an opportunistic way to collect these UTXOs and use them as inputs of any transaction initiated by tapd:

  • Mint
  • Burn
  • Supply commit
  • Funding channels

The mechanism is to select all zero-value UTXOs up to a certain quantity (too avoid exceeding the tx max size).

@darioAnongba darioAnongba self-assigned this Oct 1, 2025
@coveralls
Copy link

coveralls commented Oct 1, 2025

Pull Request Test Coverage Report for Build 18227816695

Details

  • 63 of 276 (22.83%) changed or added relevant lines in 7 files are covered.
  • 27955 unchanged lines in 195 files lost coverage.
  • Overall coverage decreased (-15.1%) to 34.578%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tapfreighter/parcel.go 0 1 0.0%
tapcfg/server.go 0 2 0.0%
tapfreighter/chain_porter.go 0 9 0.0%
tapgarden/planter.go 1 28 3.57%
tapfreighter/wallet.go 60 140 42.86%
tapdb/assets_store.go 1 95 1.05%
Files with Coverage Reduction New Missed Lines %
universe/supplyverifier/util.go 1 98.75%
proof/util.go 2 81.63%
tapdb/migrations.go 2 76.06%
tapdb/mssmt.go 2 88.64%
address/log.go 3 0.0%
commitment/log.go 3 0.0%
internal/pedersen/commitment.go 3 95.31%
lndservices/log.go 3 0.0%
rfq/log.go 3 0.0%
tapchannel/log.go 3 0.0%
Totals Coverage Status
Change from base Build 18145713853: -15.1%
Covered Lines: 30543
Relevant Lines: 88330

💛 - Coveralls

@levmi levmi moved this from 🆕 New to 🏗 In progress in Taproot-Assets Project Board Oct 2, 2025
@darioAnongba darioAnongba force-pushed the feat/zero-value-utxo-selection branch from f3a3bff to f55b6c5 Compare October 3, 2025 16:21
@darioAnongba darioAnongba changed the base branch from main to 0-8-0-staging October 6, 2025 09:43
@darioAnongba darioAnongba force-pushed the feat/zero-value-utxo-selection branch 2 times, most recently from bc1c0b5 to 3bd769d Compare October 6, 2025 11:26
- Add database query to fetch managed UTXOs containing only zero-value assets (tombstones/burns)
- Implement ZeroValueInput interface for accessing UTXO details
- Modify PSBT creation to include zero-value inputs with proper BIP32 derivation
- Update integration test to verify sweeping functionality
- Add sweeping logic to automatically include tombstone inputs in new on-chain transactions

Note: LND limitation prevents imported Taproot keys from being signed, so sweeping
requires LND changes to fully work.
@darioAnongba darioAnongba force-pushed the feat/zero-value-utxo-selection branch from 3bd769d to 6fe11a5 Compare October 6, 2025 15:03
@darioAnongba darioAnongba changed the base branch from 0-8-0-staging to main October 6, 2025 15:03
Add the missing integration test for zero-value UTXO sweeping functionality.
@darioAnongba darioAnongba force-pushed the feat/zero-value-utxo-selection branch 3 times, most recently from 1159322 to bfac918 Compare October 7, 2025 15:39
@darioAnongba darioAnongba force-pushed the feat/zero-value-utxo-selection branch from bfac918 to b5fab78 Compare October 7, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

2 participants