-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
apps/extension/package.json
Outdated
@@ -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", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
f0aae2e
to
718a4df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
const { commit } = registryClient.version(); | ||
const lastPosition = await this.db.get('REGISTRY_VERSION', 'commit'); | ||
|
||
// Registry version already saved | ||
if (lastPosition === commit) return; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
const registryClient = new ChainRegistryClient(); | ||
const chainId = 'penumbra-testnet-deimos-6'; |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
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).