This repository was archived by the owner on Jul 5, 2026. It is now read-only.
fix(explorer): validate chain analytics rows#275
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
metagraphed-ui | ea6bc7d | Commit Preview URL Branch Preview URL |
Jun 26 2026, 12:53 PM |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
src/lib/metagraphed/queries.tsby treating/api/v1/chain/*rows as untrusted display data and adding row-level normalizers for activity, calls, signers, fee days, and fee payers.MAX_CHAIN_ACTIVITY_DAYS,MAX_CHAIN_CALLS,MAX_CHAIN_SIGNERS,MAX_CHAIN_FEE_DAYS,MAX_CHAIN_FEE_PAYERS) and a helpernormalizeChainRowsto slice and normalize arrays before mapping into typed results.coerceFiniteNumber,firstString) and validate signer identifiers withisValidSs58before producing account links.chainActivityQuery,chainCallsQuery,chainSignersQuery,chainFeesQuery) to return the normalized/capped rows instead of unvalidated casts.Testing
npx prettier --check src/lib/metagraphed/queries.ts— succeeded.git diff --check— succeeded.npm run typecheck— blocked because project dependencies were not installed locally and type definitions forvite/clientwere unavailable;npm installalso failed due to registry policy (403) while fetching a dependency (zod), so full type-checking could not be performed in this environment.Codex Task