You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to query anything with a --height that is pruned, the return is a default response, i.e. empty values, rather than error, as it is documented it should. I've traced the problem to store/iavl/store.go and GetImmutable function. There if VersionExists returns false, an error is expected to be thrown, but instead it is nil.
I say error is expected to be returned because of the comment in store/rootmulti/store.go in CacheMultiStoreWithVersion where GetImmutable is called and before it the comment says:
// Attempt to lazy-load an already saved IAVL store version. If the
// version does not exist or is pruned, an error should be returned.
The problem code is this:
if !st.VersionExists(version) {
return &Store{tree: &immutableTree{&iavl.ImmutableTree{}}}, nil
}
Version
cosmos-sdk v0.45.3
Steps to Reproduce
Query a node with noded q staking validators --height <pruned_height_number> for a pruned block. It is expected to throw error, but returns empty array of balances.
Example return for pruned block: noded q staking validators --height 99
Summary of Bug
When trying to query anything with a
--height
that is pruned, the return is a default response, i.e. empty values, rather than error, as it is documented it should. I've traced the problem tostore/iavl/store.go
andGetImmutable
function. There ifVersionExists
returns false, an error is expected to be thrown, but instead it isnil
.I say error is expected to be returned because of the comment in
store/rootmulti/store.go
inCacheMultiStoreWithVersion
whereGetImmutable
is called and before it the comment says:The problem code is this:
Version
cosmos-sdk v0.45.3
Steps to Reproduce
Query a node with
noded q staking validators --height <pruned_height_number>
for a pruned block. It is expected to throw error, but returns empty array of balances.Example return for pruned block:
noded q staking validators --height 99
The text was updated successfully, but these errors were encountered: