Fix Total Stake hero value to use validator staking pool - #62
Open
ignacio-rsg wants to merge 1 commit into
Open
Conversation
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
Fixes the dashboard hero
Total Stakemetric on Lava Info.Previously,
/index/statscalculatedtotalStakeby summing provider stake plus provider delegation across all providers:That made the dashboard display a provider restake/delegation total instead of the validator staking total expected by the UI label.
This PR changes
totalStaketo use the official Cosmos staking pool value from:Specifically, the dashboard now uses:
This matches the ticket expectation of approximately
381M LAVA.What Changed
GET /index/statsto fetch the staking pool via the existingfetchStakingPool()helper.totalStaketo returnstakingPool.bonded_tokens.fetchAllProviders()in place foractiveProviderCount./index/statsroute test to ensuretotalStakecomes from the staking pool, not provider stake/delegation totals.What Did Not Change
The rest of the dashboard stat logic is unchanged:
totalCustill comes from Indexer GraphQL all-time relay aggregates.totalRelaysstill comes from Indexer GraphQL all-time relay aggregates.cu30dstill comes from Indexer GraphQL 30-day aggregates.relays30dstill comes from Indexer GraphQL 30-day aggregates.activeProviderCountstill comes fromfetchAllProviders().latestBlockstill comes fromfetchLatestBlockHeight().Local Verification
Verified locally that
/index/statsnow returns:which renders as approximately:
Verified source endpoint:
returns:
{ "pool": { "not_bonded_tokens": "41395102178952", "bonded_tokens": "381345490217757" } }Tests
Passed:
Notes
The local dashboard may show
0for CU and relay metrics unless a realINDEXER_GRAPHQL_URLis configured. That is unrelated to this fix. Those values still use the same existing indexer logic.