Add Epoch 1000 validator edition page#1677
Conversation
Introduce /epoch1000/validator with vote account lookup via Trillium, validator survivor cards with logo support, and wallet/validator edition nav.
|
@Jotatavo is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR adds the
Confidence Score: 5/5Safe to merge; the new validator flow is well-bounded with address validation, rate limiting, an SSRF allowlist, and a size-capped streaming reader. The previously flagged SSRF, unbounded download, and unsafe-cast issues have all been addressed. The remaining notes are confined to the OG image route and neither can cause incorrect validator data to be returned or user-facing errors to escape silently. apps/web/src/app/api/epoch1000/og/route.tsx — stream cancellation and content-type validation in readLimitedResponseBody and getRemoteImageDataUrl. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant ValidatorChecker as ValidatorChecker (client)
participant CheckRoute as POST /api/epoch1000/validator/check
participant HotCache as In-process cache
participant NextCache as unstable_cache
participant Trillium as Trillium API
participant OGRoute as GET /api/epoch1000/og
User->>ValidatorChecker: Enter vote account
ValidatorChecker->>CheckRoute: POST voteAccount
CheckRoute->>CheckRoute: Validate Solana address
CheckRoute->>HotCache: getHotValidatorFirstTransaction
alt Cache hit
HotCache-->>CheckRoute: Promise ValidatorLookup
else Cache miss
CheckRoute->>CheckRoute: Apply rate limit
CheckRoute->>NextCache: getCachedValidatorFirstTransaction
NextCache->>Trillium: GET /validator_rewards/voteAccount
Trillium-->>NextCache: array of epoch rows with icon_url
NextCache-->>HotCache: Settle and store
NextCache-->>CheckRoute: ValidatorLookup
end
CheckRoute->>CheckRoute: buildValidatorLookupPayload
CheckRoute-->>ValidatorChecker: epochsSurvived firstEpoch tier logoUrl
ValidatorChecker->>OGRoute: "GET /api/epoch1000/og?k=validator&vl=logoUrl"
OGRoute->>OGRoute: Validate vl URL allowlist trillium.so HTTPS only
OGRoute->>Trillium: GET logoUrl up to 512 KB
Trillium-->>OGRoute: image bytes
OGRoute-->>ValidatorChecker: PNG card image
ValidatorChecker-->>User: Show card with share copy PNG buttons
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant ValidatorChecker as ValidatorChecker (client)
participant CheckRoute as POST /api/epoch1000/validator/check
participant HotCache as In-process cache
participant NextCache as unstable_cache
participant Trillium as Trillium API
participant OGRoute as GET /api/epoch1000/og
User->>ValidatorChecker: Enter vote account
ValidatorChecker->>CheckRoute: POST voteAccount
CheckRoute->>CheckRoute: Validate Solana address
CheckRoute->>HotCache: getHotValidatorFirstTransaction
alt Cache hit
HotCache-->>CheckRoute: Promise ValidatorLookup
else Cache miss
CheckRoute->>CheckRoute: Apply rate limit
CheckRoute->>NextCache: getCachedValidatorFirstTransaction
NextCache->>Trillium: GET /validator_rewards/voteAccount
Trillium-->>NextCache: array of epoch rows with icon_url
NextCache-->>HotCache: Settle and store
NextCache-->>CheckRoute: ValidatorLookup
end
CheckRoute->>CheckRoute: buildValidatorLookupPayload
CheckRoute-->>ValidatorChecker: epochsSurvived firstEpoch tier logoUrl
ValidatorChecker->>OGRoute: "GET /api/epoch1000/og?k=validator&vl=logoUrl"
OGRoute->>OGRoute: Validate vl URL allowlist trillium.so HTTPS only
OGRoute->>Trillium: GET logoUrl up to 512 KB
Trillium-->>OGRoute: image bytes
OGRoute-->>ValidatorChecker: PNG card image
ValidatorChecker-->>User: Show card with share copy PNG buttons
Reviews (3): Last reviewed commit: "fix(epoch1000): restrict validator logo ..." | Re-trigger Greptile |
- Fix Trillium lookup when sw_first_epoch_with_stake is missing on latest epoch row - Add Array.isArray guard on Trillium API response - Harden OG validator logo fetch with HTTPS host allowlist and cache cap - Move ValidatorChecker strings to i18n
Introduce /epoch1000/validator with vote account lookup via Trillium, validator survivor cards with logo support, and wallet/validator edition nav.
Summary
/epoch1000/validatorfor validator vote account checkssw_first_epoch_with_stake) for first validating epoch