taproot-assets icon indicating copy to clipboard operation
taproot-assets copied to clipboard

tapdb+universe: implement new Universe tree for 1st party burns

Open Roasbeef opened this issue 9 months ago • 3 comments

In this commit, we add a new interface, the BurnTree. This interface will be used by a future sub-system to maintain the on-chain asset commitment for a given asset group.

The structure of this tree is very similar to the existing issuance tree. The main difference is that we'll only insert burn proofs into this tree.

We then implement a concrete implementation of this interface using the existing universe tree routines.

Roasbeef avatar Mar 27 '25 02:03 Roasbeef

Pushed up a commit to consolidate a lot of the duplication between the ignore and burn trees.

Roasbeef avatar Mar 28 '25 00:03 Roasbeef

Pushed up a commit to solve the collision issues. We add a new interface for LeafKey, then make a new concrete BaseLeafKey implementation. This way any methods that needs the old leaf key can continue to accept it, so we're able to re-use many helper functions. We then add a UniqueLeafKey interface, along with a concrete implementation that'll be used by the burn tree.

For the ignore tree, we use the hash of the prev ID as a key, which already includes the asset ID, so we're safe there.

Roasbeef avatar Apr 03 '25 00:04 Roasbeef

@guggero: review reminder

lightninglabs-deploy avatar Apr 10 '25 00:04 lightninglabs-deploy

Pushed up latest iteration. This is dependent on the ignore tree PR.

Roasbeef avatar Apr 16 '25 03:04 Roasbeef

I've changed base branch to main now that ignore-tree-impl PR is merged.

ffranr avatar Apr 16 '25 15:04 ffranr

Pull Request Test Coverage Report for Build 14527889119

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 369 of 500 (73.8%) changed or added relevant lines in 10 files are covered.
  • 20 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+26.7%) to 55.294%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tapgarden/caretaker.go 0 1 0.0%
tapgarden/planter.go 0 1 0.0%
tapdb/multiverse.go 2 4 50.0%
rpcserver.go 0 6 0.0%
universe/base.go 0 6 0.0%
tapdb/ignore_tree.go 50 63 79.37%
tapdb/burn_tree.go 177 208 85.1%
tapdb/universe.go 135 167 80.84%
universe/interface.go 0 39 0.0%
<!-- Total: 369 500
Files with Coverage Reduction New Missed Lines %
universe/base.go 1 0.0%
address/mock.go 2 86.93%
asset/group_key.go 2 57.89%
commitment/tap.go 2 72.05%
tapdb/ignore_tree.go 2 81.77%
tappsbt/create.go 2 26.74%
tapchannel/aux_leaf_signer.go 3 43.43%
tapgarden/caretaker.go 6 68.63%
<!-- Total: 20
Totals Coverage Status
Change from base Build 14520380113: 26.7%
Covered Lines: 50957
Relevant Lines: 92156

💛 - Coveralls

coveralls avatar Apr 18 '25 01:04 coveralls