Skip to content

fix(app/provider): use collections-aware iterator in prepForZeroHeightGenesis#43

Merged
giunatale merged 1 commit into
mainfrom
giunatale/fix-validator-iterator
May 18, 2026
Merged

fix(app/provider): use collections-aware iterator in prepForZeroHeightGenesis#43
giunatale merged 1 commit into
mainfrom
giunatale/fix-validator-iterator

Conversation

@giunatale
Copy link
Copy Markdown
Contributor

@giunatale giunatale commented May 14, 2026

The legacy KVStoreReversePrefixIterator pattern no longer works in SDK v0.50: validators are now stored via collections, and decoding iter.Key()[1:] as a ValAddress produces a key that GetValidator cannot resolve, causing every provider export --for-zero-height to panic with expected validator, not found. This blocks all state-export upgrades on the provider.

Replace the raw store iteration with StakingKeeper.IterateValidatorsand resolve operator addresses through ValidatorAddressCodec

Discovered while writing the e2e chain-restart test in PR #44
Merging this PR is required for the e2e test on that PR to pass.

Replace the raw store iteration with StakingKeeper.IterateValidators
and resolve operator addresses through ValidatorAddressCodec.
Also drop the now-unused storetypes import.
Copy link
Copy Markdown
Contributor

@tbruyelle tbruyelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@giunatale giunatale merged commit ed02eb6 into main May 18, 2026
7 of 8 checks passed
@giunatale giunatale deleted the giunatale/fix-validator-iterator branch May 18, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants