Skip to content

fix(protocol-dashboard): remove '1.0.0' validator-version fallback so fetch actually runs#14356

Merged
raymondjacobson merged 3 commits into
mainfrom
claude/validator-version-fallback
May 19, 2026
Merged

fix(protocol-dashboard): remove '1.0.0' validator-version fallback so fetch actually runs#14356
raymondjacobson merged 3 commits into
mainfrom
claude/validator-version-fallback

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

Summary

Follow-up to #14355. The dashboard was still showing 1.0.0 for the Validator current version after that PR shipped. Root cause: the getCurrentVersion selector returned '1.0.0' as a fallback when services.validator.currentVersion was undefined, and useCurrentVersion only dispatches fetchCurrentVersion when the selected value is undefined. The hardcoded fallback short-circuited the dispatch, so the new getNumberOfVersions + getVersion logic introduced in #14355 never ran.

  • Remove the ?? '1.0.0' fallback from the selector so the fetch dispatches.
  • Harden the setCurrentVersion reducer to initialize state.services.validator if it doesn't exist yet, since fetchCurrentVersion can resolve before fetchServiceStakeValues populates it.

Test plan

  • Open the dashboard and confirm Register a NodeCurrent Version shows the latest onchain version (currently 1.1.0) instead of 1.0.0.
  • Hard refresh and confirm no race-condition crashes from setCurrentVersion running before service info loads.

🤖 Generated with Claude Code

…ersion race-safe

The getCurrentVersion selector returned '1.0.0' when the validator's
currentVersion wasn't loaded yet. Because useCurrentVersion only
dispatches fetchCurrentVersion when the selected value is undefined,
the fallback string short-circuited the dispatch and the real version
was never fetched.

Also harden the setCurrentVersion reducer to initialize the validator
slot if it doesn't exist yet, since fetchCurrentVersion may resolve
before fetchServiceStakeValues populates services.validator.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

⚠️ No Changeset found

Latest commit: 2dfe534

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

raymondjacobson and others added 2 commits May 19, 2026 11:08
…rageCommitment

The version pill's loading spinner was keyed off storageCommitment ==
null, which usually resolves first (single HTTP call vs two RPC calls
for currentVersion). When storage loaded first, the pill swapped from
spinner to an empty <Text> while currentVersion was still undefined,
then the version text flashed in once the contract calls resolved.

Gate the pill on currentVersion's own loading state so it stays as a
spinner until the value is actually available.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…nfo runs

setServiceTypeInfo overwrites state.services.validator wholesale with
the {isValid, minStake, maxStake} payload from getServiceTypeInfo. If
fetchCurrentVersion resolves first (it has fewer RPC calls), the
already-stored currentVersion gets wiped, the selector returns
undefined, useCurrentVersion re-dispatches, and the user sees a double
load: spinner -> 1.1.0 -> spinner -> 1.1.0.

Merge over the existing currentVersion when applying new service info
so the version stays put once it's been fetched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@raymondjacobson raymondjacobson merged commit 2e77a41 into main May 19, 2026
3 checks passed
@raymondjacobson raymondjacobson deleted the claude/validator-version-fallback branch May 19, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant