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: sync "missing universe id" when syncing unknown asset ID #1316

Merged
merged 4 commits into from
Jan 27, 2025

Conversation

guggero
Copy link
Member

@guggero guggero commented Jan 22, 2025

Fixes #990, at least partially.

We'll need another fix in future versions and actually return an error properly (#1315).
But to not break older clients, we'll only do that after a full version (e.g. we ship this fix in 0.5.1, then with 0.6 or 0.7 we return an actual error, knowing that enough clients will understand to not interrupt the whole sync process).

This commit shows what's wrong/weird with the response of the
QueryAssetRoots RPC when a root doesn't exist.

We can't change this behavior right away as that would potentially break
older sync clients, if we just started returning an error.

So we'll first update the syncer to _expect_ a
universe.ErrNoUniverseRoot error, then in a future version we can start
returning that.
This is the actual preparation for being able to return an error in the
future. We start handling the error as non-terminating in the syncer.
This prevents the actual error with current versions of the universe by
detecting if a response is empty (and should've just been the
ErrNoUniverseRoot which future servers will respond).
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12915294932

Details

  • 0 of 42 (0.0%) changed or added relevant lines in 3 files are covered.
  • 32 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-0.05%) to 40.757%

Changes Missing Coverage Covered Lines Changed/Added Lines %
universe_rpc_diff.go 0 7 0.0%
rpcserver.go 0 9 0.0%
universe/syncer.go 0 26 0.0%
Files with Coverage Reduction New Missed Lines %
universe/syncer.go 1 0.0%
commitment/tap.go 1 84.09%
tappsbt/create.go 2 53.22%
fn/option.go 3 43.3%
tapgarden/caretaker.go 4 68.5%
universe/interface.go 5 50.65%
asset/asset.go 6 77.01%
asset/mock.go 10 91.25%
Totals Coverage Status
Change from base Build 12912505634: -0.05%
Covered Lines: 26677
Relevant Lines: 65454

💛 - Coveralls

@Roasbeef Roasbeef modified the milestones: v0.6, v0.5.1 Jan 23, 2025
@ffranr
Copy link
Contributor

ffranr commented Jan 23, 2025

How does this change affect older nodes?

If an older node attempts to sync an asset ID that is unknown to a universe server implementing this change, the older node will receive an error. Does this terminate the universe syncing process for that server?

Maybe we should add a version field to RPC endpoint's QueryAssetRoots request message universerpc.AssetRootQuery?

@guggero
Copy link
Member Author

guggero commented Jan 23, 2025

There are no errors returned yet. I tried to make that very clear in the commit messages and all the comments. We're preparing for being able to deal with an error being returned but we don't return it yet. We'll return errors with #1315, which will be done in 0.6 or 0.7.

Copy link
Contributor

@ffranr ffranr left a comment

Choose a reason for hiding this comment

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

Once we start returning this new error, syncing might break for v0.5.0 nodes and older. But we're ok with that because the new group key formulation is only understood by nodes v0.5.1 and newer anyway.

So we expect everyone to upgrade their nodes past v0.5.0 soon enough.

Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

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

Lgtm 🚢

@guggero guggero merged commit b61c95b into main Jan 27, 2025
18 checks passed
@guggero guggero deleted the no-asset-id-fix branch January 27, 2025 15:39
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.

[bug] - universe: QueryAssetRoots returns an empty error when no asset root can be found
5 participants