Skip to content

Conversation

Roasbeef
Copy link
Member

In this PR, we add a new done channel to the events that queue up a new supply commit update on disk. Callers can then call WaitForDone to block until the event has been written to disk. This addresses a gap that could cause lost events when sent by other sub systems.

@Roasbeef Roasbeef added enhancement New feature or request database labels Aug 13, 2025
@Roasbeef Roasbeef force-pushed the sync-supply-commit branch from 14c2562 to d701373 Compare August 13, 2025 01:22
@coveralls
Copy link

coveralls commented Aug 13, 2025

Pull Request Test Coverage Report for Build 16980644335

Details

  • 63 of 97 (64.95%) changed or added relevant lines in 4 files are covered.
  • 91 unchanged lines in 18 files lost coverage.
  • Overall coverage decreased (-0.01%) to 56.633%

Changes Missing Coverage Covered Lines Changed/Added Lines %
universe/supplycommit/states.go 23 33 69.7%
universe/supplycommit/multi_sm_manager.go 14 26 53.85%
universe/supplycommit/transitions.go 23 35 65.71%
Files with Coverage Reduction New Missed Lines %
fn/context_guard.go 1 91.94%
address/mock.go 2 95.11%
asset/asset.go 2 80.07%
asset/group_key.go 2 72.15%
fn/iter.go 2 62.07%
rpcserver.go 2 61.35%
universe_rpc_diff.go 2 76.0%
universe/syncer.go 2 82.73%
itest/multisig.go 3 97.91%
tapdb/mssmt.go 4 90.45%
Totals Coverage Status
Change from base Build 16968929223: -0.01%
Covered Lines: 60634
Relevant Lines: 107064

💛 - Coveralls

Copy link
Contributor

@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 design, I like it!

LGTM, just two nits.

This interface wraps the existing SupplyUpdateEvent interface with two
methods: one to signal that the event has been processed, and the other
to wait on this.

We'll use this to implement a sync callback/event to allow callers to
block until the event has been written to disk.
In this commit, we start to use the new interface, and signal done after
an error or succesful write.
…anager

This'll be used by callers to make sure that they only exit once the new
pending update has been written to disk.
@Roasbeef Roasbeef force-pushed the sync-supply-commit branch from d701373 to 7438d5c Compare August 15, 2025 01:27
@Roasbeef
Copy link
Member Author

Addressed comments in a new push.

@Roasbeef
Copy link
Member Author

Merging so I can rebase on top of: #1675.

@Roasbeef Roasbeef merged commit bafd905 into main Aug 15, 2025
18 of 19 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Taproot-Assets Project Board Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants