From 5f9f3e9246c667c92ec5cee64f12fcc22939332d Mon Sep 17 00:00:00 2001 From: 3alpha <15694175+3alpha@users.noreply.github.com> Date: Tue, 17 Nov 2026 13:40:06 +0100 Subject: [PATCH] fix: point Gnosis explorer links at beaconchain.gnosischain.com gnosischa.in no longer resolves, so every Gnosis explorer link was broken. beaconchain.gnosischain.com serves /validator/. That explorer redirects /dashboard?validators=... to an empty /dashboard, and Lukso's explorer (Dora) has no dashboard page. Only build dashboard links for mainnet and Hoodi, and disable the dashboard button elsewhere with a tooltip pointing to the per-validator links. --- .../ValidatorList/KeystoresDataGrid.tsx | 24 +++++++++++++++---- packages/ui/src/params.ts | 8 ++++++- .../ui/src/utils/buildValidatorSummaryURL.ts | 3 ++- packages/ui/test/testBuildSummaryUrl.test.ts | 16 ++++++++++--- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/packages/ui/src/components/ValidatorList/KeystoresDataGrid.tsx b/packages/ui/src/components/ValidatorList/KeystoresDataGrid.tsx index ea99857b..521b37ec 100644 --- a/packages/ui/src/components/ValidatorList/KeystoresDataGrid.tsx +++ b/packages/ui/src/components/ValidatorList/KeystoresDataGrid.tsx @@ -1,7 +1,7 @@ import type { JSX } from "react"; import { DataGrid, GridAlignment, GridRowId } from "@mui/x-data-grid"; import { useEffect, useState } from "react"; -import { blockExplorerUrls } from "../../params"; +import { blockExplorerUrls, dashboardNetworks } from "../../params"; import { MAINNET_ORACLE_URL, TESTNET_ORACLE_URL, @@ -61,6 +61,7 @@ export default function KeystoresDataGrid({ }): JSX.Element { const [paginationModel, setPaginationModel] = useState({ page: 0, pageSize: 10 }); const blockExplorerUrl = blockExplorerUrls.get(network); + const hasDashboard = dashboardNetworks.has(network); const [validatorsSubscriptionMap, setValidatorsSubscriptionMap] = useState(null); @@ -475,10 +476,23 @@ export default function KeystoresDataGrid({ label={selectedRows.length ? `${selectedRows.length} selected` : `${rows.length} validators`} /> - - - - + + {/* A span keeps the tooltip working while the button is disabled. */} + + + + + diff --git a/packages/ui/src/params.ts b/packages/ui/src/params.ts index 877f817e..8d22d6e0 100644 --- a/packages/ui/src/params.ts +++ b/packages/ui/src/params.ts @@ -2,11 +2,17 @@ import { Network } from "@stakingbrain/common"; export const blockExplorerUrls = new Map([ ["mainnet", "https://beaconcha.in"], - ["gnosis", "https://gnosischa.in"], + ["gnosis", "https://beaconchain.gnosischain.com"], ["lukso", "https://explorer.consensus.mainnet.lukso.network"], ["hoodi", "https://hoodi.beaconcha.in"] ]); +/** + * Explorers that open a dashboard for several validators from `/dashboard?validators=`. The Gnosis + * explorer redirects that URL to an empty dashboard, and Lukso's (Dora) has no dashboard page. + */ +export const dashboardNetworks = new Set(["mainnet", "hoodi"]); + export interface AppParams { network: string; signerUrl: string; diff --git a/packages/ui/src/utils/buildValidatorSummaryURL.ts b/packages/ui/src/utils/buildValidatorSummaryURL.ts index 76706666..1aca461b 100644 --- a/packages/ui/src/utils/buildValidatorSummaryURL.ts +++ b/packages/ui/src/utils/buildValidatorSummaryURL.ts @@ -1,4 +1,4 @@ -import { blockExplorerUrls } from "../params"; +import { blockExplorerUrls, dashboardNetworks } from "../params"; export default function buildValidatorSummaryURL({ validatorIndexes, @@ -12,6 +12,7 @@ export default function buildValidatorSummaryURL({ throw new Error(`Invalid network: ${network}`); } + if (!dashboardNetworks.has(network)) return ""; if (validatorIndexes.length === 0 || validatorIndexes.some((index) => !/^\d+$/.test(index))) return ""; return baseUrl + "/dashboard?validators=" + validatorIndexes.join(","); diff --git a/packages/ui/test/testBuildSummaryUrl.test.ts b/packages/ui/test/testBuildSummaryUrl.test.ts index dd77e1e0..d003f835 100644 --- a/packages/ui/test/testBuildSummaryUrl.test.ts +++ b/packages/ui/test/testBuildSummaryUrl.test.ts @@ -1,12 +1,11 @@ import { expect } from "chai"; import buildValidatorSummaryURL from "../src/utils/buildValidatorSummaryURL.js"; +import { blockExplorerUrls } from "../src/params.js"; describe("Validator dashboard URLs", () => { for (const [network, baseUrl] of [ ["mainnet", "https://beaconcha.in"], - ["hoodi", "https://hoodi.beaconcha.in"], - ["gnosis", "https://gnosischa.in"], - ["lukso", "https://explorer.consensus.mainnet.lukso.network"] + ["hoodi", "https://hoodi.beaconcha.in"] ]) { it(`builds a ${network} link from local indexes, including index zero`, () => { expect(buildValidatorSummaryURL({ validatorIndexes: ["0", "42", "123"], network })).to.equal( @@ -15,6 +14,17 @@ describe("Validator dashboard URLs", () => { }); } + // Their explorers would open an empty dashboard (Gnosis) or a missing page (Lukso). + for (const network of ["gnosis", "lukso"]) { + it(`builds no dashboard link for ${network}, whose explorer has no multi-validator dashboard`, () => { + expect(buildValidatorSummaryURL({ validatorIndexes: ["0", "42"], network })).to.equal(""); + }); + } + + it("points Gnosis explorer links at a live explorer", () => { + expect(blockExplorerUrls.get("gnosis")).to.equal("https://beaconchain.gnosischain.com"); + }); + it("includes selections larger than the former API batch limit", () => { const validatorIndexes = Array.from({ length: 103 }, (_, index) => index.toString()); expect(buildValidatorSummaryURL({ validatorIndexes, network: "mainnet" })).to.equal(