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

Update to latest registry [bundled version] #1044

Merged
merged 3 commits into from
May 7, 2024
Merged

Update to latest registry [bundled version] #1044

merged 3 commits into from
May 7, 2024

Conversation

grod220
Copy link
Collaborator

@grod220 grod220 commented May 6, 2024

Pairs with: prax-wallet/registry#29
Closes: #1033

The new version bundles the registry inside. No need for async fetching. Also uses the new version() method to check if it's necessary to save (discussed in today's sync).

@@ -20,7 +20,7 @@
"@bufbuild/protobuf": "^1.9.0",
"@connectrpc/connect": "^1.4.0",
"@connectrpc/connect-web": "^1.4.0",
"@penumbra-labs/registry": "^5.1.0",
"@penumbra-labs/registry": "npm:@penumbra-zone/[email protected].0",
Copy link
Collaborator Author

@grod220 grod220 May 6, 2024

Choose a reason for hiding this comment

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

To be swapped with 7.0.0 when new registry version published

Copy link
Contributor

Choose a reason for hiding this comment

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

can we simply use latest

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not a bad idea, but given we are on v7, we've had 7 breaking changes of the registry api to date. Think this is worth revisiting when that stabilizes a bit. Otherwise, we'd risk dev env breaking on a registry update.

@grod220 grod220 force-pushed the v7-registry branch 3 times, most recently from f0aae2e to 718a4df Compare May 7, 2024 13:50
Copy link
Contributor

@Valentine1898 Valentine1898 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +260 to +264
const { commit } = registryClient.version();
const lastPosition = await this.db.get('REGISTRY_VERSION', 'commit');

// Registry version already saved
if (lastPosition === commit) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

An older registry commit can overwrite a newer one. But it seems this can never occur

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes this is true, but thinking this is not a likely scenario for us

Comment on lines +60 to +61
const registryClient = new ChainRegistryClient();
const chainId = 'penumbra-testnet-deimos-6';
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional
You could use mock for ChainRegistryClient instead, then the indexed-db tests would not depend on registry. And the tests won't break if the registry no longer contains data for the test chain-id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I started down this track, but realized that we'd need to implement an interface, but the registry wasn't currently exposing one. Given time constraints, just used a chain id we know is there. Can revisit this later though.

@grod220 grod220 merged commit bf28b67 into main May 7, 2024
6 checks passed
@grod220 grod220 deleted the v7-registry branch May 7, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bundle complete asset registry into Prax
3 participants