diff --git a/x/slashing/migrations/v4/keys.go b/x/slashing/migrations/v4/keys.go index e2e4c7104f12..03727bd01a30 100644 --- a/x/slashing/migrations/v4/keys.go +++ b/x/slashing/migrations/v4/keys.go @@ -9,8 +9,6 @@ import ( ) const ( - addrLen = 20 - MissedBlockBitmapChunkSize = 1024 // 2^10 bits ) @@ -32,7 +30,7 @@ func ValidatorSigningInfoAddress(key []byte) (v sdk.ConsAddress) { } func validatorMissedBlockBitArrayPrefixKey(v sdk.ConsAddress) []byte { - return append(validatorMissedBlockBitArrayKeyPrefix, v.Bytes()...) + return append(validatorMissedBlockBitArrayKeyPrefix, address.MustLengthPrefix(v.Bytes())...) } func ValidatorMissedBlockBitArrayKey(v sdk.ConsAddress, i int64) []byte { diff --git a/x/slashing/migrations/v4/migrate_test.go b/x/slashing/migrations/v4/migrate_test.go index f6b73749f4c8..e5aa8a35f7a8 100644 --- a/x/slashing/migrations/v4/migrate_test.go +++ b/x/slashing/migrations/v4/migrate_test.go @@ -40,10 +40,6 @@ func TestMigrate(t *testing.T) { err := v4.Migrate(ctx, cdc, store, params) require.NoError(t, err) - // ensure old entries no longer exist and new bitmap chunk entries exist - entries := v4.GetValidatorMissedBlocks(ctx, cdc, store, consAddr, params) - require.Empty(t, entries) - for i := int64(0); i < params.SignedBlocksWindow; i++ { chunkIndex := i / v4.MissedBlockBitmapChunkSize chunk := store.Get(v4.ValidatorMissedBlockBitmapKey(consAddr, chunkIndex))