-
Couldn't load subscription status.
- Fork 138
garbage collect zero-value UTXOs #1832
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: 0-8-0-staging
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 18382547235Details
💛 - Coveralls |
f3a3bff to
f55b6c5
Compare
3bd769d to
6fe11a5
Compare
a8f3ce4 to
afbfebf
Compare
bf3e3ee to
d812a8e
Compare
d812a8e to
0ceaf76
Compare
f4fb800 to
127946d
Compare
965998d to
83a4116
Compare
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.
awesome work!
| // Bip32Derivation is the BIP32 derivation info for the internal key. | ||
| // This is used to preserve the key derivation through the allocation | ||
| // flow so that PSBTs can be properly signed. | ||
| Bip32Derivation []*psbt.Bip32Derivation |
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.
why is this needed now?
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.
Before, we were not persisting the necessary information in the DB to be able to sign the input for zero value UTXOs. Laolu described the bug here: https://github.com/lightninglabs/taproot-assets/blob/main/docs/debug-handbook/psbt-finalization-failures.md#a-bip32-key-derivation-mismatch.
Specifically the KeyFamily or KeyIndex not preserved when storing keys.
|
also needs a rebase |
faf184a to
d52a498
Compare
d52a498 to
6edd03c
Compare
|
Non-blocking, but for the |
This includes the addition of a "swept" field in the "managed_utxos" table with the corresponding migration and the "MarkManagedUTXOAsSwept" function.
…ng family and index
5635183 to
0b60ce3
Compare
|
I like |
cdac2f2 to
ef93717
Compare
ef93717 to
d9383ba
Compare
Garbage collect the residue orphaned UTXOs when creating transactions. Orphaned UTXOs 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 to collect these UTXOs and use them as inputs of transactions initiated by
tapd:The PR adds a new
sweptflag to themanaged_utxotable because UTXOs are not removed from the table when spent. This flag is also returned by theListUtxosRPC endpoint.The mechanism preserves the liveness and safety properties, ensuring that zero-value UTXOs can never accumulate in the DB. Adding garbage collection to Mint transactions is not necessary to ensure these properties.
Fixes #514
Note to reviewers
unspent, keeping the spent outputs in a table calledmanage_utxosseems like a contradiction, same logic applies for the need of asweptflag in that table. We should either rename the table or store spent utxos somewhere else?