- 
                Notifications
    You must be signed in to change notification settings 
- Fork 137
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 18946918516Details
 
 
 
 💛 - Coveralls | 
f3a3bff    to
    f55b6c5      
    Compare
  
    3bd769d    to
    6fe11a5      
    Compare
  
    a8f3ce4    to
    afbfebf      
    Compare
  
    bf3e3ee    to
    d812a8e      
    Compare
  
    d812a8e    to
    0ceaf76      
    Compare
  
    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  | 
ef93717    to
    d9383ba      
    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.
last nits, 99% there
d9383ba    to
    773c448      
    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.
LGTM
773c448    to
    4fb0135      
    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?