penumbra-zone / dex-explorer

Web app for visualization the state of the Penumbra DEX
Apache License 2.0
9 stars 1 forks source link

Update asset registry for `penumbra-testnet-phobos-2` #57

Closed conorsch closed 1 month ago

conorsch commented 1 month ago

When trying to redeploy a testnet deployment of dex-explorer, I encountered an error about unrecognized assets:

-- [2024-09-19T21:35:14.402Z] 0.160 GET /
-- [2024-09-19T21:35:14.566Z] 0.008 GET /trade
-- [2024-09-19T21:35:22.177Z] 0.007 GET /trade/penumbra:usdc
-- [2024-09-19T21:35:22.871Z] 0.002 GET /favicon.ico
-- [2024-09-19T21:35:22.958Z] 0.004 GET /
-- [2024-09-19T21:35:22.962Z] 0.002 GET /
-- [2024-09-19T21:35:22.965Z] 0.005 GET /trade
-- [2024-09-19T21:35:22.965Z] 0.006 GET /trade
Error simulation trade grpc data: Error: Registry not found for penumbra-testnet-phobos-2
    at Nt.get (/app/node_modules/.pnpm/@penumbra-labs+registry@11.1.0/node_modules/@penumbra-labs/registry/dist/index.js:2:89800)
    at c (/app/.next/server/pages/api/simulations/[...params].js:1:4032)
    at u (/app/.next/server/pages/api/simulations/[...params].js:1:4053)
    at u (/app/.next/server/pages/api/simulations/[...params].js:1:1554)
    at K (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:16887)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async U.render (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/pages-api.runtime.prod.js:20:17520)
    at async NextNodeServer.runApi (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/next-server.js:598:9)
    at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/next-server.js:269:37)
    at async NextNodeServer.handleRequestImpl (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:813:17)
Error simulation trade grpc data: Error: Registry not found for penumbra-testnet-phobos-2

The asset registry was updated for penumbra-testnet-phobos-2 in https://github.com/prax-wallet/registry/pull/91, but dex-explorer doesn't know about that yet. We should perform the intermediate steps to update dex-explorer with the latest asset info. At a guess, those steps are:

If there's something I'm missing, please add here! cc @grod220

grod220 commented 1 month ago

There are two ways to get asset data from the registry using our NPM package:

It seems that the dex explorer uses the bundled version everywhere. It is probably best to move the codebase to using the remote fetch so it stays current (cc @JasonMHasperhoven fyi). But since it's an async function, it would require refactoring a bunch of places.

The faster immediate fix is to do as you've mentioned, cut a release, and update the npm package here. Will do this now.

conorsch commented 1 month ago

Not quite: after deploying #59, I still see "Registry not found" errors:

Error simulation trade grpc data: Error: Registry not found for penumbra-testnet-phobos-2
    at Ut.get (/app/node_modules/.pnpm/@penumbra-labs+registry@11.3.0/node_modules/@penumbra-labs/registry/dist/index.js:2:104308)
    at c (/app/.next/server/pages/api/simulations/[...params].js:1:4038)
    at u (/app/.next/server/pages/api/simulations/[...params].js:1:4059)
    at u (/app/.next/server/pages/api/simulations/[...params].js:1:1556)
    at K (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-ser
ver/pages-api.runtime.prod.js:20:16887)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async U.render (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/comp
iled/next-server/pages-api.runtime.prod.js:20:17520)
    at async NextNodeServer.runApi (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/n
ext/dist/server/next-server.js:598:9)
    at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@
18.3.1/node_modules/next/dist/server/next-server.js:269:37)
    at async NextNodeServer.handleRequestImpl (/app/node_modules/.pnpm/next@14.2.9_@babel+core@7.25.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/nod
e_modules/next/dist/server/base-server.js:813:17)
Error simulation trade grpc data: Error: Registry not found for penumbra-testnet-phobos-2

Confirmed with @grod220 that we missed a step: in https://github.com/prax-wallet/registry/blob/964fe8b5a5a6fa82fd348bda1daf8a0fac22a955/npm/src/json.ts#L54 there should be an entry for the penumbra-testnet-phobos-2 chain, but we missed that. We'll need to make that change, then cut another registry release.