diff --git a/x/ccv/consumer/types/keys.go b/x/ccv/consumer/types/keys.go index d52c9c551e..093f78b450 100644 --- a/x/ccv/consumer/types/keys.go +++ b/x/ccv/consumer/types/keys.go @@ -49,6 +49,23 @@ const ( // received over CCV channel but not yet flushed over ABCI PendingChangesByteKey + // NOTE: This prefix is depreciated, but left in place to avoid consumer state migrations + // [DEPRECATED] + PendingDataPacketsByteKey + + // PreCCVByteKey is the byte to store the consumer is running on democracy staking module without consumer + PreCCVByteKey + + // InitialValSetByteKey is the byte to store the initial validator set for a consumer + InitialValSetByteKey + + // NOTE: This prefix is depreciated, but left in place to avoid consumer state migrations + // [DEPRECATED] + LastStandaloneHeightByteKey + + // SmallestNonOptOutPowerByteKey is the byte that will store the smallest val power that cannot opt out + SmallestNonOptOutPowerByteKey + // HistoricalInfoKey is the byte prefix that will store the historical info for a given height HistoricalInfoBytePrefix @@ -61,30 +78,18 @@ const ( // OutstandingDowntimePrefix is the byte prefix that will store the validators outstanding downtime by consensus address OutstandingDowntimeBytePrefix - // NOTE: This prefix is depreciated, but left in place to avoid consumer state migrations - PendingDataPacketsBytePrefix - - // CrossChainValidatorPrefix is the byte prefix that will store cross-chain validators by consensus address - CrossChainValidatorBytePrefix - - // PendingDataPacketsByteKey is the byte key for storing + // PendingDataPacketsBytePrefix is the byte prefix for storing // a list of data packets that cannot be sent yet to the provider // chain either because the CCV channel is not established or // because the client is expired - PendingDataPacketsByteKey - - // PreCCVByteKey is the byte to store the consumer is running on democracy staking module without consumer - PreCCVByteKey + PendingDataPacketsBytePrefix - // InitialValSetByteKey is the byte to store the initial validator set for a consumer - InitialValSetByteKey + // CrossChainValidatorPrefix is the byte prefix that will store cross-chain validators by consensus address + CrossChainValidatorBytePrefix // InitGenesisHeightByteKey is the byte that will store the init genesis height InitGenesisHeightByteKey - // SmallestNonOptOutPowerByteKey is the byte that will store the smallest val power that cannot opt out - SmallestNonOptOutPowerByteKey - // StandaloneTransferChannelIDByteKey is the byte storing the channelID of transfer channel // that existed from a standalone chain changing over to a consumer StandaloneTransferChannelIDByteKey @@ -170,7 +175,7 @@ func CrossChainValidatorKey(addr []byte) []byte { // that cannot be sent yet to the provider chain either because the CCV channel // is not established or because the client is expired. func PendingDataPacketsKey() []byte { - return []byte{PendingDataPacketsByteKey} + return []byte{PendingDataPacketsBytePrefix} } func PreCCVKey() []byte { diff --git a/x/ccv/consumer/types/keys_test.go b/x/ccv/consumer/types/keys_test.go index c0ab13391a..a63da6f326 100644 --- a/x/ccv/consumer/types/keys_test.go +++ b/x/ccv/consumer/types/keys_test.go @@ -27,16 +27,18 @@ func getAllKeyPrefixes() []byte { ProviderClientByteKey, ProviderChannelByteKey, PendingChangesByteKey, + PendingDataPacketsByteKey, + PreCCVByteKey, + InitialValSetByteKey, + LastStandaloneHeightByteKey, + SmallestNonOptOutPowerByteKey, HistoricalInfoBytePrefix, PacketMaturityTimeBytePrefix, HeightValsetUpdateIDBytePrefix, OutstandingDowntimeBytePrefix, + PendingDataPacketsBytePrefix, CrossChainValidatorBytePrefix, - PendingDataPacketsByteKey, - PreCCVByteKey, - InitialValSetByteKey, InitGenesisHeightByteKey, - SmallestNonOptOutPowerByteKey, StandaloneTransferChannelIDByteKey, PrevStandaloneChainByteKey, } @@ -61,16 +63,18 @@ func getAllFullyDefinedKeys() [][]byte { ProviderClientIDKey(), ProviderChannelKey(), PendingChangesKey(), + // PendingDataPacketsKey() does not use duplicated prefix with value of 0x06 + PreCCVKey(), + InitialValSetKey(), + // LastStandaloneHeightKey() is depreciated + SmallestNonOptOutPowerKey(), HistoricalInfoKey(0), PacketMaturityTimeKey(0, time.Time{}), HeightValsetUpdateIDKey(0), OutstandingDowntimeKey([]byte{}), - CrossChainValidatorKey([]byte{}), PendingDataPacketsKey(), - PreCCVKey(), - InitialValSetKey(), + CrossChainValidatorKey([]byte{}), InitGenesisHeightKey(), - SmallestNonOptOutPowerKey(), StandaloneTransferChannelIDKey(), PrevStandaloneChainKey(), }