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

[universe]: fix proof sync for large asset minting batches #1093

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Conversation

guggero
Copy link
Member

@guggero guggero commented Aug 19, 2024

I encountered this on testnet while trying to reproduce #675.

Can be reproduced with:

--universe.sync-all-assets
--universe.federationserver=testnet.universe.lightning.finance:10029

And tapcli u s --universe_host testnet.universe.lightning.finance:10029.

This PR fixes the issue by making sure any group anchors are inserted into the DB first.

@guggero guggero requested a review from jharveyb August 19, 2024 14:51
@coveralls
Copy link

coveralls commented Aug 19, 2024

Pull Request Test Coverage Report for Build 10470347293

Details

  • 0 of 63 (0.0%) changed or added relevant lines in 2 files are covered.
  • 16 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.04%) to 40.353%

Changes Missing Coverage Covered Lines Changed/Added Lines %
universe/base.go 0 15 0.0%
universe/syncer.go 0 48 0.0%
Files with Coverage Reduction New Missed Lines %
universe/base.go 1 0.0%
tappsbt/create.go 2 53.85%
commitment/tap.go 2 84.17%
tapgarden/caretaker.go 4 68.5%
tapdb/multiverse.go 7 60.32%
Totals Coverage Status
Change from base Build 10427488081: -0.04%
Covered Lines: 23901
Relevant Lines: 59230

💛 - Coveralls

Copy link
Contributor

@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! Just need that one fix + possible logging improvements.

universe/syncer.go Show resolved Hide resolved
universe/syncer.go Show resolved Hide resolved
universe/syncer.go Outdated Show resolved Hide resolved
This commit fixes an issue with large sets of asset issuances:
When there are more assets in a group than the current batch sync limit
(200), then there's a chance that the group anchor (the one asset
containing the group key reveal record) isn't in the first batch. So we
wouldn't be able to insert the first batch at all, since those assets
would all reference a group key that isn't yet known.

To avoid this problem, we insert any proofs with group key reveal
records immediately and only start batching the others after going
through all of them.
This means we'll keep more assets in memory and can start to process
them later. But at least the process won't fail anymore.
Copy link
Contributor

@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 👍🏽

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🚜

@Roasbeef Roasbeef merged commit 8eb6c53 into main Aug 22, 2024
17 checks passed
@guggero guggero deleted the proof-sync branch August 23, 2024 08:38
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.

4 participants