tapdb+universe: implement new Universe tree for 1st party burns
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.
Pushed up a commit to consolidate a lot of the duplication between the ignore and burn trees.
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.
@guggero: review reminder
Pushed up latest iteration. This is dependent on the ignore tree PR.
I've changed base branch to main now that ignore-tree-impl PR is merged.
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.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
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 | |
|---|---|
| Change from base Build 14520380113: | 26.7% |
| Covered Lines: | 50957 |
| Relevant Lines: | 92156 |