Remove Goerli (0x5) and dead environment toggle#263
Conversation
- Remove dev environment and Goerli entries from environments.js; export a single environment config with only Mainnet (0x1) - Remove isProd function and Netlify env var debug logs - Remove Goerli entry from networkMap in ethereumProvider.jsx - Remove Goerli entry from blockExplorers.js - Fix hardcoded /0x5/ link in arbitrationDetails to use current chain from route params Co-authored-by: 0xferit <3106907+0xferit@users.noreply.github.com>
Co-authored-by: 0xferit <3106907+0xferit@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes deprecated Goerli (0x5) support and the non-functional prod/dev environment toggle so the app consistently targets Mainnet and avoids dead hosted-subgraph endpoints.
Changes:
- Simplified environment configuration to a single exported
environmentcontaining only Mainnet (0x1). - Removed Goerli entries from the in-app network map and block explorer constants.
- Updated an arbitration “court” link to use the
chainroute param instead of hardcoding/0x5/.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/data/environments.js | Collapses prod/dev configs into a single Mainnet-only environment. |
| src/data/ethereumProvider.jsx | Removes Goerli from networkMap, leaving Mainnet-only chain support. |
| src/constants/blockExplorers.js | Removes Goerli explorer URL mapping. |
| src/components/others/route_article/arbitrationDetails/index.jsx | Fixes court link routing to respect the current chain param. |
Comments suppressed due to low confidence (1)
src/data/ethereumProvider.jsx:18
- After removing Goerli from
networkMap, the app can still receive an unsupported chain ID from the URL (e.g. navigating directly to/0x5/...).EthereumProviderinitializeschainIdfromchainIdFromUrlandhandleChainChangeonly switches to a supported/default chain when!chainId, so an unsupported initialchainIdwill persist and later code paths that indexnetworkMap[chainId]will throw. Consider validatingchainIdFromUrl(or any existingchainId) againstnetworkMapon initialization/chain changes and falling back togetDefaultNetwork()when unsupported (and/or redirecting the router accordingly).
export const networkMap = {
"0x1": {
name: "Ethereum Mainnet",
shortname: "Mainnet",
default: environment.networkMap["0x1"].default,
explorerURL: (address) => `https://etherscan.io/address/${address}`,
deployments: environment.networkMap["0x1"].deployments,
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
0xferit
left a comment
There was a problem hiding this comment.
Removing networkMap["0x5"] leaves the router and provider accepting legacy /0x5/... URLs, but several code paths still index networkMap[chainId] without validating that the route chain is supported. In the PR head this can throw immediately for old/bookmarked Goerli URLs, because App still seeds chainId from any 0x* path segment, RouteRedirect dereferences networkMap[chainId].deployments, and EthereumProvider later does the same in its chainId effect.\n\nPlease add a fallback to getDefaultNetwork() (or redirect unsupported chains before these lookups) so removing Goerli support doesn’t turn existing /0x5/... links into a crash.
Validate the URL chain against networkMap before passing it to EthereumProvider. Unsupported chains like 0x5 from old bookmarks now resolve to undefined, letting EthereumProvider fall back to the default network instead of crashing. Co-authored-by: 0xferit <3106907+0xferit@users.noreply.github.com>
Fixed in db1cf53. The URL chain is now validated against const chainId = pathSegment.startsWith("0x") && networkMap[pathSegment] ? pathSegment : undefined;Unsupported chains like |
0xferit
left a comment
There was a problem hiding this comment.
The new src/index.jsx guard fixes the top-level /0x5 case, but it still leaves legacy article/court/account URLs broken. For routes like /0x5/:contract/:id, App now passes undefined into EthereumProvider, and RouteRedirect immediately does Object.keys(networkMap[chainId].deployments) when params.contract is present. With chainId === undefined, that still throws before the app can redirect to mainnet.\n\nPlease either normalize unsupported route chains to the default network up front, or harden RouteRedirect against an undefined/unsupported chainId before dereferencing networkMap[chainId].
Add early return in RouteRedirect's useEffect when chainId is undefined or not in networkMap. This prevents crashes on legacy /0x5/... URLs where EthereumProvider hasn't yet resolved the default network via handleChainChange. Co-authored-by: 0xferit <3106907+0xferit@users.noreply.github.com>
Co-authored-by: 0xferit <3106907+0xferit@users.noreply.github.com>
0xferit
left a comment
There was a problem hiding this comment.
There are still two blockers on the current head:\n\n1. The unsupported-chain fallback is still bypassed by the route loaders. , , and loaders all pass directly into / / , and those helpers still dereference . So legacy and URLs can still fail during loader execution before or have a chance to normalize the chain.\n\n2. The latest commit also reintroduced and large unrelated churn. Unless this PR is intentionally changing package-manager artifacts, those lockfile changes should be removed before merge.
0xferit
left a comment
There was a problem hiding this comment.
Still blocked on two points. First, the Browse, Article, and Court loaders still use params.chain directly before any RouteRedirect fallback runs, so legacy 0x5 routes can still fail during loader execution. Second, the last commit reintroduced package-lock.json and large unrelated yarn.lock churn, which should be removed unless this PR is intentionally changing package manager artifacts.
Fixed in 04a435e. Added an early return guard in if (!chainId || !networkMap[chainId]) return;This prevents the |
0xferit
left a comment
There was a problem hiding this comment.
Ignoring incidental improvements/package-manager churn per maintainer guidance. The remaining blocker is still the unsupported-chain loader path: browse/article/court loaders use params.chain directly, so legacy /0x5 URLs can still fail before the app-level fallback runs.
0xferit
left a comment
There was a problem hiding this comment.
Loader-level redirects now normalize unsupported chain routes before any networkMap lookup. Local production build passes.
0x5) entries from bothprodanddevconfigs insrc/data/environments.jsdevenvironment entirely; export single environment config with only Mainnet, remove theisProdfunction and env var debug logs0x5) entry fromnetworkMapinsrc/data/ethereumProvider.jsx0x5) entry fromsrc/constants/blockExplorers.js/0x5/link insrc/components/others/route_article/arbitrationDetails/index.jsxto use the current chain from route paramsnetworkMapinsrc/index.jsxso unsupported chains (e.g. old/0x5/bookmarks) fall back to the default network instead of crashingRouteRedirectagainst undefined/unsupportedchainIdto prevent crashes on legacy/0x5/...article/court/account URLsparcel buildOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.