-
Notifications
You must be signed in to change notification settings - Fork 131
tapdb: add implementation of supplycommit.SupplyTreeView #1507
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
Roasbeef
wants to merge
12
commits into
lightninglabs:asset-commitment-creator
Choose a base branch
from
Roasbeef:universe-supply-trees
base: asset-commitment-creator
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
tapdb: add implementation of supplycommit.SupplyTreeView #1507
Roasbeef
wants to merge
12
commits into
lightninglabs:asset-commitment-creator
from
Roasbeef:universe-supply-trees
+2,186
−415
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
7c88480
to
522c3ee
Compare
8d5041c
to
648cb72
Compare
d786104
to
af5f8f5
Compare
In this commit, we add new namespace routines for the supply tree. We'll use these to modify exactly which namespace we use for the ignore and burn trees. Rather than store using the old universe namespace, we choose to roll a new set of namespaces, as these trees are specific to a given group key.
…space directly In this commit, as a prep for the new universe supply tree routines, we refactor the InsertBurns method to rely on a new internal helper function. We also change the namespace we store things under to use the new supply tree namespaces. Finally, we fix a bug that would use different roots for the merkle tree proofs after insertion. We'll now ensure that the merkle tree proofs all use the same merkle root.
…pace Similar to the last commit, in this commit, we refactor the AddTuples method to use a new helper function. We then start to use the new supply tree namespace just like we did for the burn tree.
…ce directly In this commit, we update the helper functions that the ignore and burn tree use to take the namespace directly instead of the universe.Identifier. This makes the functions more flexible, as they don't assume a namespace derivation.
In this commit, we break up the singular universeUpsertProofLeaf function into two: one for inserting into the universe tree, and one for taking the updated universe root to insert into the multi-verse tree.
In this commit, we add a new migration for the universe supply trees. Rather than use the multi-verse pointers (which are namespaced by proof type), we instead move to use a new set of smt tree pointers, that are scoped by the group key instead. We'll use these later to keep track of the new supply sub-trees, and also root supply tree. We also add a new proof type of mint_supply, to distinguish from the normal issuance type.
In this commit, we add a concrete implementation of SupplyTreeStore in tapdb. This is similar to the structs we used to manage the multiverse tree, which is scoped by proof type. Instead, the supply trees are scoped by group key. We can use this to stage a series of updates for a group key (mint, ignore, burn), and insert into a supply tree in a single atomic transaction. We also expose methods to fetch each sub supply tree as well.
af5f8f5
to
64516c9
Compare
In this commit, we add tests for the supply tree store. We use rapid to ensure that we can handle any combiniation of events when we go to update them in the tree.
64516c9
to
6e0b6a4
Compare
6e0b6a4
to
aa782c8
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.
In this commit, we add an implementation of the
supplycommitment.SupplyTreeView
interface to tapdb. This provides us with a concrete interface to be used along side #1464.The structure is similar to the existing multi-verse trees, but we instead of scoping by proof type (issuance or transfer), we instead scope by the group key of a given asset.
Along the way we do some refactors to allow us to do atomic inserts across all the sub-trees, and also the root tree.