Skip to content
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

tarodb+tarogarden: construct+store proof files on disk for all minted assets #66

Merged
merged 10 commits into from
Aug 9, 2022

Conversation

Roasbeef
Copy link
Member

In this PR, we start to store a valid proof file for all minted assets on disk. Along the way we add a new (currently specific) routine for creating a minting file based on real data. For now we're just storing all the proof files directly in the database. In the future, I think we want to also have a replicator/archive the maintains the proof files both on disk and in the database. A third future source for replication would also be a base universe (for just the minting proofs) and also a universe/multi-verse, etc, etc.

In a follow up PR, we'll start to add verification+export RPC calls. These calls will be the future bridge for any variant of a send+receive flow.

Depends on #34

Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I see the pieces are coming together 🎉
Did a first pass to update my mental model. Will attempt to add RPC and itest coverage to this tomorrow.

go.mod Outdated Show resolved Hide resolved
@guggero
Copy link
Member

guggero commented Jul 28, 2022

A rebase would be useful as well here.

@Roasbeef
Copy link
Member Author

Roasbeef commented Aug 2, 2022

Rebased!

Copy link
Collaborator

@jharveyb jharveyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Neat to see the changes needed wrt. the state machine as well.

I'll come back to revisit the SQL and overall state machine structure.

proof/mint_test.go Outdated Show resolved Hide resolved
proof/mint.go Outdated Show resolved Hide resolved
@Roasbeef
Copy link
Member Author

Roasbeef commented Aug 4, 2022

Pushed up a fully rebased version.

chain_bridge.go Show resolved Hide resolved
tarodb/sqlutils.go Outdated Show resolved Hide resolved
tarodb/asset_minting.go Show resolved Hide resolved
tarodb/assets_store.go Show resolved Hide resolved
This will be used later to construct SPV proofs for the flat file
format.
In this commit, we add a new function that creates asset minting proofs.
In particular, it assumes that all assets are created in the same
transaction, and that transaction only has a change output and the
minting output.
Allows us to enforce other variants elsewhere, in particular, we want
all script keys to also be unique.
Similar to the prior commit, we'll use this later to use an UPSERT to
update a proof file if one already exists when we go to insert.
…sets

In this commit, we extend the pending asset storage to also store the
complete set of proof files for all the assets created in the batch.
This ensures that once an asset is seen as final, we can query the for
the proof file.
With this commit, we ensure that once an asset is created, we retain a
proof of the event on disk. This will be used later for transfers, and
also challenge/reveal instances.
This ensures that we're always inserting the compressed encoded key into
the database.
@Roasbeef
Copy link
Member Author

Roasbeef commented Aug 5, 2022

Pushed up a commit to add that 33 byte constraint on all internal keys, and also display 33-byte keys on the RPC interface everywhere.

Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great update, everything now works well with the full keys being stored and returned in the RPC.

@Roasbeef Roasbeef requested a review from jharveyb August 9, 2022 02:29
Copy link
Collaborator

@jharveyb jharveyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@dstadulis
Copy link
Collaborator

Seems ready for merge

@guggero guggero merged commit 0084c3f into main Aug 9, 2022
@guggero guggero deleted the mint-with-asset-proof branch August 9, 2022 18:45
@Roasbeef
Copy link
Member Author

FWIW this commit still was pointing to an lnd fork: 20a82e7

I'll remedy that in the next push for #77

dstadulis pushed a commit that referenced this pull request May 16, 2023
universe: add new federation envoy for managing federated universe sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants