fix(protocol-dashboard): fetch latest validator version via getNumberOfVersions#14355
Merged
Merged
Conversation
…OfVersions getCurrentVersion on the ServiceTypeManager contract was returning a stale version (1.0.0) for the Validator service type. Switch to reading the latest registered version by calling getNumberOfVersions and then getVersion(numberOfVersions - 1). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Merged
2 tasks
raymondjacobson
added a commit
that referenced
this pull request
May 19, 2026
… fetch actually runs (#14356) ## 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 Node` → `Current 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](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
getCurrentVersionon the ServiceTypeManager contract was returning a stale version (1.0.0) for theValidatorservice type — the home page and other locations usinguseCurrentVersion(ServiceType.Validator)displayed the wrong number.fetchCurrentVersionto read the latest registered version by callinggetNumberOfVersions(serviceType)and thengetVersion(serviceType, numberOfVersions - 1). The latest onchain validator version (1.1.0) now shows correctly.Test plan
Register a Nodecard shows the latest onchain version (currently1.1.0) instead of1.0.0.RegisterNodeCard— verify the same.🤖 Generated with Claude Code