From 18cace86f16de3bfab3f9bdf92e8d306bc94eeff Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Sun, 4 Jun 2023 13:26:18 -0700 Subject: [PATCH] Squashed commit of the following: commit fa0914b691888971da677dc231b131268ecfa501 Author: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Fri Jun 2 15:05:44 2023 -0700 fix another bug commit 88d7764a74e191926a3975a0199b6c7dbe5e083e Author: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Fri Jun 2 09:52:29 2023 -0700 tests commit ab372d6371c1f5f2e8ffdb2461575bd5694d7953 Author: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Fri Jun 2 09:46:32 2023 -0700 Update keys.go commit 9920121274605ee5bf79984a687d7b4586fdec71 Author: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Date: Fri Jun 2 17:55:13 2023 +0200 chore: Hardcode golangci-lint version (#990) * Hardcode golangci-lint version * Hardcode version in CI config commit 1ec81485bad165674334a51bcdc24eed06e28d1f Author: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Thu Jun 1 15:30:00 2023 -0700 docs: cleanup changelog for v2.0.0 on main (#988) cleans --- .github/workflows/golangci-lint.yml | 2 +- CHANGELOG.md | 4 ++++ Makefile | 2 +- x/ccv/consumer/types/keys.go | 35 ++++++++++++++++------------- x/ccv/consumer/types/keys_test.go | 20 ++++++++++------- 5 files changed, 37 insertions(+), 26 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 7dcf88c9c0..28eba10b41 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -25,7 +25,7 @@ jobs: uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: latest + version: v1.52.2 # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/CHANGELOG.md b/CHANGELOG.md index 5efd479791..3cdd6e50b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ Upgrading a provider from `v1.1.0-multiden` to `v2.0.0` will require state migra Upgrading a consumer from `v1.2.0-multiden` to `v2.0.0` will NOT require state migrations. See the consumer module's `ConsensusVersion` in [module](./x/ccv/consumer/module.go) +Upgrading a provider from `v1.1.0-multiden` to `v2.0.0` will require state migrations. See [migration.go](./x/ccv/provider/keeper/migration.go). See the provider module's `ConsensusVersion` in [module](./x/ccv/provider/module.go) + +Upgrading a consumer from `v1.2.0-multiden` to `v2.0.0` will NOT require state migrations. See the consumer module's `ConsensusVersion` in [module](./x/ccv/consumer/module.go) + ### High level changes included in v2.0.0 * MVP for standalone to consumer changeover, see [EPIC](https://github.com/cosmos/interchain-security/issues/756) diff --git a/Makefile b/Makefile index 600c617d70..b84eca6524 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ test-no-cache: ### Linting ### ############################################################################### -golangci_version=latest +golangci_version=v1.52.2 lint: @echo "--> Running linter" diff --git a/x/ccv/consumer/types/keys.go b/x/ccv/consumer/types/keys.go index d52c9c551e..e1c2194f12 100644 --- a/x/ccv/consumer/types/keys.go +++ b/x/ccv/consumer/types/keys.go @@ -49,6 +49,24 @@ const ( // received over CCV channel but not yet flushed over ABCI PendingChangesByteKey + // PendingDataPacketsByteKey is the byte key 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 + + // 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 + 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 @@ -67,24 +85,9 @@ const ( // CrossChainValidatorPrefix is the byte prefix that will store cross-chain validators by consensus address CrossChainValidatorBytePrefix - // PendingDataPacketsByteKey is the byte key 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 - - // InitialValSetByteKey is the byte to store the initial validator set for a consumer - InitialValSetByteKey - // 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 +173,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(), }