fix(grpc): return actual earliest_store_height in node.Status endpoint (backport #25647)#25901
Closed
mergify[bot] wants to merge 4 commits intorelease/v0.53.xfrom
Closed
fix(grpc): return actual earliest_store_height in node.Status endpoint (backport #25647)#25901mergify[bot] wants to merge 4 commits intorelease/v0.53.xfrom
mergify[bot] wants to merge 4 commits intorelease/v0.53.xfrom
Conversation
Contributor
Author
|
Cherry-pick of ae80efb has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
| _ "cosmossdk.io/api/cosmos/app/v1alpha1" | ||
| fmt "fmt" | ||
| io "io" | ||
| reflect "reflect" |
Check notice
Code scanning / CodeQL
Sensitive package import Note
Member
|
@Cordtus unfortunately i won't be able to backport this one, as it would require a bump to store. this one is only going to be supported in future releases |
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.
Description
Closes: #15463
Add
EarliestVersion()to theCommitMultiStoreinterface to enable querying the earliest available state height.This addresses the longstanding TODO in the Status gRPC endpoint that was returning
0forEarliestStoreHeight.Problem
Indexers and tooling need to know which heights a pruned node can serve queries for. Currently:
earliest_block_heightin CometBFT's STATUS RPC returns the earliest block, not the earliest stateEarliestStoreHeightfield incosmos.base.node.v1beta1.Statuswas hardcoded to0Solution
EarliestVersion() int64to theCommitMultiStoreinterface (notMultiStore, sinceCacheMultiStorelacks root DB access)rootmulti.Store:s/earliestkey1for unpruned chainsPruneStores()EarliestStoreHeight()andWithEarliestStoreHeight()tosdk.ContextearliestStoreHeightin query context creation (CreateQueryContextWithCheckHeader)Changes
store/types/store.goEarliestVersion()toCommitMultiStoreinterfacestore/rootmulti/store.goEarliestVersion(),GetEarliestVersion(),flushEarliestVersion(), updatePruneStores()store/rootmulti/store_test.gotypes/context.goearliestStoreHeightfield with getter/setterbaseapp/abci.goearliestStoreHeightwhen creating query contextclient/grpc/node/service.goEarliestStoreHeightfrom contextruntime/app.gosimapp/app.goTesting
TestEarliestVersion- basic functionality, default valueTestEarliestVersionWithPruning- tracks updates after pruningTestEarliestVersionPersistence- persists across restartsTestNodeStatus- gRPC endpoint returns valid heightsAPI Changes
Breaking change for any code implementing
CommitMultiStore— must now implementEarliestVersion() int64.No impact on
MultiStoreorCacheMultiStoreimplementations.This is an automatic backport of pull request #25647 done by Mergify.