-
Notifications
You must be signed in to change notification settings - 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
Open
darioAnongba
wants to merge
6
commits into
main
Choose a base branch
from
feat/zero-value-utxo-selection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull Request Test Coverage Report for Build 18382547235Details
💛 - Coveralls |
f3a3bff
to
f55b6c5
Compare
3bd769d
to
6fe11a5
Compare
a8f3ce4
to
afbfebf
Compare
0bb387d
to
bf3e3ee
Compare
This includes the addition of a field in the table with the corresponding migration and the and functions.
…ng family and index
bf3e3ee
to
d812a8e
Compare
d812a8e
to
0ceaf76
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Garbage collect the residue zero-value UTXOs when creating transactions. Zero-value 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
swept
flag to themanaged_utxo
table because UTXOs are not removed from the table when spent. This flag is also returned by theListUtxos
RPC 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 this properties.
Fixes #514
** Note to reviewers**
unspent
, keeping the spent outputs in a table calledmanage_utxos
seems like a contradiction, same logic applies for the need of aswept
flag in that table. We should either rename the table or store spent utxos somewhere else?ListUtxos
call. Should we rename this toListOutputs
?pkScript
is retrieved by querying thechain_txs
table. Is it possible/more efficient to avoid this and somehow recompute it from the data we have?