Skip to content

tapdb: support delegation key and universe commitment flag in seedlings #1638

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
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented Jul 3, 2025

This is part of the work towards completing #1534


  • Store and fetch delegation key references to/from the asset_seedlings table.

  • Add support for persisting the universe commitment flag in both asset_seedlings and minting_batches.

  • Add unit tests to verify flag round-trips correctly through the DB.

  • Other:

    • Remove dependency on ChangeOutputIndex when deriving asset anchor output index.

ffranr added 7 commits June 27, 2025 17:23
Avoid calculating the asset anchor output index based on the
ChangeOutputIndex, as this approach may not correctly account for
the presence of the pre-commitment output.
This commit updates the seedling storage logic to support delegation
keys. The delegation keys themselves are stored in the internal keys
table, and a reference to the relevant key is now saved in the
asset_seedlings table.
Update the NewMintingBatch SQL query to support setting the universe
commitments flag.

While the flag is currently set when the anchor transaction is assigned
to the batch (i.e., during funding), this change adds the same support
to CommitMintingBatch for completeness.
Update seedling retrieval logic to parse the delegation key field
from the database.
Add support for inserting and fetching the universe commitments
flag on the seedling when writing to and reading from the database.
Add a unit test to verify that the universe commitments flag is
correctly set on both the batch and seedling during database
read and write operations.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16061500957

Details

  • 80 of 95 (84.21%) changed or added relevant lines in 2 files are covered.
  • 67 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+0.002%) to 39.243%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tapdb/asset_minting.go 70 85 82.35%
Files with Coverage Reduction New Missed Lines %
tappsbt/create.go 2 26.74%
asset/mock.go 3 65.89%
commitment/tap.go 4 71.82%
tapfreighter/interface.go 4 48.0%
tapchannel/aux_leaf_signer.go 5 43.08%
asset/asset.go 6 46.9%
tapgarden/caretaker.go 6 68.0%
internal/test/copy.go 37 69.76%
Totals Coverage Status
Change from base Build 16059643780: 0.002%
Covered Lines: 30678
Relevant Lines: 78175

💛 - Coveralls

@ffranr ffranr requested review from Roasbeef and guggero July 3, 2025 22:48
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.

Flawless, LGTM 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants