diff --git a/api/cosmos/orm/v1alpha1/schema.pulsar.go b/api/cosmos/orm/v1alpha1/schema.pulsar.go index f48193210c..5d22e96a35 100644 --- a/api/cosmos/orm/v1alpha1/schema.pulsar.go +++ b/api/cosmos/orm/v1alpha1/schema.pulsar.go @@ -1109,7 +1109,7 @@ const ( // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent // KV-storage where primary key entries are stored in merkle-tree // backed commitment storage and indexes and seqs are stored in - // fast index storage. Note that the Cosmos SDK before store/v2 + // fast index storage. Note that the Cosmos SDK before store/v2alpha1 // does not support this. StorageType_STORAGE_TYPE_DEFAULT_UNSPECIFIED StorageType = 0 // STORAGE_TYPE_MEMORY indicates in-memory storage that will be @@ -1124,14 +1124,14 @@ const ( StorageType_STORAGE_TYPE_TRANSIENT StorageType = 2 // STORAGE_TYPE_INDEX indicates persistent storage which is not backed // by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK - // before store/v2 does not support this. + // before store/v2alpha1 does not support this. StorageType_STORAGE_TYPE_INDEX StorageType = 3 // STORAGE_TYPE_INDEX indicates persistent storage which is backed by // a merkle-tree. With this type of storage, both primary and index keys // will affect the app hash and this is generally less efficient // than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index // keys into index storage. Note that modules built with the - // Cosmos SDK before store/v2 must specify STORAGE_TYPE_COMMITMENT + // Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT // instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX // because this is the only type of persistent storage available. StorageType_STORAGE_TYPE_COMMITMENT StorageType = 4 diff --git a/docs/architecture/adr-040-storage-and-smt-state-commitments.md b/docs/architecture/adr-040-storage-and-smt-state-commitments.md index 78e8d5cf55..f60e3adcff 100644 --- a/docs/architecture/adr-040-storage-and-smt-state-commitments.md +++ b/docs/architecture/adr-040-storage-and-smt-state-commitments.md @@ -173,7 +173,7 @@ NOTE: modules will be able to use a special commitment and their own DBs. For ex To ease the transition to this new interface for users, we can create a shim which wraps a `CommitMultiStore` but provides a `CommitRootStore` interface, and expose functions to safely create and access the underlying `CommitMultiStore`. -The new `RootStore` and supporting types can be implemented in a `store/v2` package to avoid breaking existing code. +The new `RootStore` and supporting types can be implemented in a `store/v2alpha1` package to avoid breaking existing code. #### Merkle Proofs and IBC diff --git a/docs/core/store.md b/docs/core/store.md index 12a8fecb07..e7ff13e687 100644 --- a/docs/core/store.md +++ b/docs/core/store.md @@ -232,7 +232,7 @@ Additional information about state streaming configuration can be found in the [ When `KVStore.Set` or `KVStore.Delete` methods are called, `listenkv.Store` automatically writes the operations to the set of `Store.listeners`. -## New Store package (`store/v2`) +## New Store package (`store/v2alpha1`) The SDK is in the process of transitioning to use the types listed here as the default interface for state storage. At the time of writing, these cannot be used within an application and are not directly compatible with the `CommitMultiStore` and related types. @@ -266,7 +266,7 @@ A minimal interface that only allows accessing substores. Note: substores return ### Implementation (`root.Store`) -The canonical implementation of `MultiStore` is in `store/v2/root`. It internally decouples the concerns of state storage and state commitment: values are stored in, and read directly from, the backing key-value database (state storage, or *SS*), but are also mapped in a logically separate database which generates cryptographic proofs (for state-commitment or *SC*). +The canonical implementation of `MultiStore` is in `store/v2alpha1/root`. It internally decouples the concerns of state storage and state commitment: values are stored in, and read directly from, the backing key-value database (state storage, or *SS*), but are also mapped in a logically separate database which generates cryptographic proofs (for state-commitment or *SC*). The state-commitment component of each substore is implemented as an independent `smt.Store` (see below). Internally, each substore is allocated in a logically separate partition within the same backing DB, such that commits apply to the state of all substores. Therefore, views of past versions also include the state of all substores (including *SS* and *SC* data). @@ -274,7 +274,7 @@ This store can optionally be configured to use a different backend database inst ## SMT Store -`store/v2/smt.Store` maps values into a Sparse Merkle Tree (SMT), and supports a `BasicKVStore` interface as well as methods for cryptographic proof generation. +`store/v2alpha1/smt.Store` maps values into a Sparse Merkle Tree (SMT), and supports a `BasicKVStore` interface as well as methods for cryptographic proof generation. ## Next {hide} diff --git a/proto/cosmos/orm/v1alpha1/schema.proto b/proto/cosmos/orm/v1alpha1/schema.proto index 30f9e3a996..ab713340e3 100644 --- a/proto/cosmos/orm/v1alpha1/schema.proto +++ b/proto/cosmos/orm/v1alpha1/schema.proto @@ -43,7 +43,7 @@ enum StorageType { // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent // KV-storage where primary key entries are stored in merkle-tree // backed commitment storage and indexes and seqs are stored in - // fast index storage. Note that the Cosmos SDK before store/v2 + // fast index storage. Note that the Cosmos SDK before store/v2alpha1 // does not support this. STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0; @@ -61,7 +61,7 @@ enum StorageType { // STORAGE_TYPE_INDEX indicates persistent storage which is not backed // by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK - // before store/v2 does not support this. + // before store/v2alpha1 does not support this. STORAGE_TYPE_INDEX = 3; // STORAGE_TYPE_INDEX indicates persistent storage which is backed by @@ -69,7 +69,7 @@ enum StorageType { // will affect the app hash and this is generally less efficient // than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index // keys into index storage. Note that modules built with the - // Cosmos SDK before store/v2 must specify STORAGE_TYPE_COMMITMENT + // Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT // instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX // because this is the only type of persistent storage available. STORAGE_TYPE_COMMITMENT = 4; diff --git a/store/transient/store_test.go b/store/transient/store_test.go index a1c8ea90ba..16a165b3ba 100644 --- a/store/transient/store_test.go +++ b/store/transient/store_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" - types "github.com/cosmos/cosmos-sdk/store/v2" - "github.com/cosmos/cosmos-sdk/store/v2/transient" + types "github.com/cosmos/cosmos-sdk/store/v2alpha1" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/transient" ) var k, v = []byte("hello"), []byte("world") diff --git a/store/v2/dbadapter/store.go b/store/v2alpha1/dbadapter/store.go similarity index 100% rename from store/v2/dbadapter/store.go rename to store/v2alpha1/dbadapter/store.go diff --git a/store/v2/dbadapter/store_test.go b/store/v2alpha1/dbadapter/store_test.go similarity index 96% rename from store/v2/dbadapter/store_test.go rename to store/v2alpha1/dbadapter/store_test.go index f28fa5f065..9bfa68518a 100644 --- a/store/v2/dbadapter/store_test.go +++ b/store/v2alpha1/dbadapter/store_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/store/cachekv" - types "github.com/cosmos/cosmos-sdk/store/v2" - "github.com/cosmos/cosmos-sdk/store/v2/dbadapter" + types "github.com/cosmos/cosmos-sdk/store/v2alpha1" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/dbadapter" mocks "github.com/cosmos/cosmos-sdk/tests/mocks/db" ) diff --git a/store/v2/mem/store.go b/store/v2alpha1/mem/store.go similarity index 95% rename from store/v2/mem/store.go rename to store/v2alpha1/mem/store.go index 88d4697ca1..b984aac81d 100644 --- a/store/v2/mem/store.go +++ b/store/v2alpha1/mem/store.go @@ -4,7 +4,7 @@ import ( dbm "github.com/cosmos/cosmos-sdk/db" "github.com/cosmos/cosmos-sdk/db/memdb" "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/store/v2/dbadapter" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/dbadapter" ) var ( diff --git a/store/v2/mem/store_test.go b/store/v2alpha1/mem/store_test.go similarity index 88% rename from store/v2/mem/store_test.go rename to store/v2alpha1/mem/store_test.go index 822f5eaeb3..297e2a75df 100644 --- a/store/v2/mem/store_test.go +++ b/store/v2alpha1/mem/store_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - types "github.com/cosmos/cosmos-sdk/store/v2" - "github.com/cosmos/cosmos-sdk/store/v2/mem" + types "github.com/cosmos/cosmos-sdk/store/v2alpha1" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/mem" ) func TestStore(t *testing.T) { diff --git a/store/v2/multi/cache_store.go b/store/v2alpha1/multi/cache_store.go similarity index 94% rename from store/v2/multi/cache_store.go rename to store/v2alpha1/multi/cache_store.go index 3fcf7170bc..5d7ee786da 100644 --- a/store/v2/multi/cache_store.go +++ b/store/v2alpha1/multi/cache_store.go @@ -2,7 +2,7 @@ package multi import ( "github.com/cosmos/cosmos-sdk/store/cachekv" - types "github.com/cosmos/cosmos-sdk/store/v2" + types "github.com/cosmos/cosmos-sdk/store/v2alpha1" ) // GetKVStore implements BasicMultiStore. diff --git a/store/v2/multi/doc.go b/store/v2alpha1/multi/doc.go similarity index 97% rename from store/v2/multi/doc.go rename to store/v2alpha1/multi/doc.go index a977d4d5bd..87f5b88705 100644 --- a/store/v2/multi/doc.go +++ b/store/v2alpha1/multi/doc.go @@ -1,4 +1,4 @@ -// This package provides concrete implementations of the store/v2 "MultiStore" types, including +// This package provides concrete implementations of the store/v2alpha1 "MultiStore" types, including // CommitMultiStore, CacheMultiStore, and BasicMultiStore (as read-only stores at past versions). // // Substores are declared as part of a schema within StoreOptions. diff --git a/store/v2/multi/proof.go b/store/v2alpha1/multi/proof.go similarity index 93% rename from store/v2/multi/proof.go rename to store/v2alpha1/multi/proof.go index 25fc2b8e38..1e8b538c53 100644 --- a/store/v2/multi/proof.go +++ b/store/v2alpha1/multi/proof.go @@ -6,8 +6,8 @@ import ( "github.com/tendermint/tendermint/crypto/merkle" tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" - types "github.com/cosmos/cosmos-sdk/store/v2" - "github.com/cosmos/cosmos-sdk/store/v2/smt" + types "github.com/cosmos/cosmos-sdk/store/v2alpha1" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" ) // DefaultProofRuntime returns a ProofRuntime supporting SMT and simple merkle proofs. diff --git a/store/v2/multi/proof_test.go b/store/v2alpha1/multi/proof_test.go similarity index 98% rename from store/v2/multi/proof_test.go rename to store/v2alpha1/multi/proof_test.go index 8f7d05de23..86e9fbfd2e 100644 --- a/store/v2/multi/proof_test.go +++ b/store/v2alpha1/multi/proof_test.go @@ -8,7 +8,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" "github.com/cosmos/cosmos-sdk/db/memdb" - "github.com/cosmos/cosmos-sdk/store/v2/smt" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" ) // We hash keys produce SMT paths, so reflect that here diff --git a/store/v2/multi/snapshot.go b/store/v2alpha1/multi/snapshot.go similarity index 98% rename from store/v2/multi/snapshot.go rename to store/v2alpha1/multi/snapshot.go index 68155e5001..37f6878739 100644 --- a/store/v2/multi/snapshot.go +++ b/store/v2alpha1/multi/snapshot.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/snapshots" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" - types "github.com/cosmos/cosmos-sdk/store/v2" + types "github.com/cosmos/cosmos-sdk/store/v2alpha1" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/store/v2/multi/snapshot_test.go b/store/v2alpha1/multi/snapshot_test.go similarity index 100% rename from store/v2/multi/snapshot_test.go rename to store/v2alpha1/multi/snapshot_test.go diff --git a/store/v2/multi/store.go b/store/v2alpha1/multi/store.go similarity index 99% rename from store/v2/multi/store.go rename to store/v2alpha1/multi/store.go index 07cb175bc9..191239bc83 100644 --- a/store/v2/multi/store.go +++ b/store/v2alpha1/multi/store.go @@ -17,10 +17,10 @@ import ( "github.com/cosmos/cosmos-sdk/store/listenkv" "github.com/cosmos/cosmos-sdk/store/prefix" "github.com/cosmos/cosmos-sdk/store/tracekv" - types "github.com/cosmos/cosmos-sdk/store/v2" - "github.com/cosmos/cosmos-sdk/store/v2/mem" - "github.com/cosmos/cosmos-sdk/store/v2/smt" - "github.com/cosmos/cosmos-sdk/store/v2/transient" + types "github.com/cosmos/cosmos-sdk/store/v2alpha1" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/mem" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/transient" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/kv" ) diff --git a/store/v2/multi/store_test.go b/store/v2alpha1/multi/store_test.go similarity index 99% rename from store/v2/multi/store_test.go rename to store/v2alpha1/multi/store_test.go index cc45eb9daf..d157f00990 100644 --- a/store/v2/multi/store_test.go +++ b/store/v2alpha1/multi/store_test.go @@ -13,7 +13,7 @@ import ( codecTypes "github.com/cosmos/cosmos-sdk/codec/types" dbm "github.com/cosmos/cosmos-sdk/db" "github.com/cosmos/cosmos-sdk/db/memdb" - types "github.com/cosmos/cosmos-sdk/store/v2" + types "github.com/cosmos/cosmos-sdk/store/v2alpha1" "github.com/cosmos/cosmos-sdk/types/kv" ) diff --git a/store/v2/multi/sub_store.go b/store/v2alpha1/multi/sub_store.go similarity index 100% rename from store/v2/multi/sub_store.go rename to store/v2alpha1/multi/sub_store.go diff --git a/store/v2/multi/test_util.go b/store/v2alpha1/multi/test_util.go similarity index 100% rename from store/v2/multi/test_util.go rename to store/v2alpha1/multi/test_util.go diff --git a/store/v2/multi/view_store.go b/store/v2alpha1/multi/view_store.go similarity index 97% rename from store/v2/multi/view_store.go rename to store/v2alpha1/multi/view_store.go index 79e080e05c..29c391287a 100644 --- a/store/v2/multi/view_store.go +++ b/store/v2alpha1/multi/view_store.go @@ -11,8 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/cachekv" "github.com/cosmos/cosmos-sdk/store/listenkv" "github.com/cosmos/cosmos-sdk/store/tracekv" - types "github.com/cosmos/cosmos-sdk/store/v2" - "github.com/cosmos/cosmos-sdk/store/v2/smt" + types "github.com/cosmos/cosmos-sdk/store/v2alpha1" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" ) var ErrReadOnly = errors.New("cannot modify read-only store") diff --git a/store/v2/smt/ics23.go b/store/v2alpha1/smt/ics23.go similarity index 100% rename from store/v2/smt/ics23.go rename to store/v2alpha1/smt/ics23.go diff --git a/store/v2/smt/ics23_test.go b/store/v2alpha1/smt/ics23_test.go similarity index 98% rename from store/v2/smt/ics23_test.go rename to store/v2alpha1/smt/ics23_test.go index 6382bcb2f5..a94cc6f0a4 100644 --- a/store/v2/smt/ics23_test.go +++ b/store/v2alpha1/smt/ics23_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/cosmos/cosmos-sdk/db/memdb" - store "github.com/cosmos/cosmos-sdk/store/v2/smt" + store "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" ) func TestProofICS23(t *testing.T) { diff --git a/store/v2/smt/proof.go b/store/v2alpha1/smt/proof.go similarity index 100% rename from store/v2/smt/proof.go rename to store/v2alpha1/smt/proof.go diff --git a/store/v2/smt/proof_test.go b/store/v2alpha1/smt/proof_test.go similarity index 96% rename from store/v2/smt/proof_test.go rename to store/v2alpha1/smt/proof_test.go index ee84b57fbd..3ef6573dab 100644 --- a/store/v2/smt/proof_test.go +++ b/store/v2alpha1/smt/proof_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/db/memdb" - smtstore "github.com/cosmos/cosmos-sdk/store/v2/smt" + smtstore "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" "github.com/lazyledger/smt" ) diff --git a/store/v2/smt/store.go b/store/v2alpha1/smt/store.go similarity index 100% rename from store/v2/smt/store.go rename to store/v2alpha1/smt/store.go diff --git a/store/v2/smt/store_test.go b/store/v2alpha1/smt/store_test.go similarity index 96% rename from store/v2/smt/store_test.go rename to store/v2alpha1/smt/store_test.go index e02ede93fc..2ad50be53d 100644 --- a/store/v2/smt/store_test.go +++ b/store/v2alpha1/smt/store_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/cosmos/cosmos-sdk/db/memdb" - store "github.com/cosmos/cosmos-sdk/store/v2/smt" + store "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" ) func TestGetSetHasDelete(t *testing.T) { diff --git a/store/v2/transient/store.go b/store/v2alpha1/transient/store.go similarity index 94% rename from store/v2/transient/store.go rename to store/v2alpha1/transient/store.go index 1c68e15e16..2a9609afb1 100644 --- a/store/v2/transient/store.go +++ b/store/v2alpha1/transient/store.go @@ -4,7 +4,7 @@ import ( dbm "github.com/cosmos/cosmos-sdk/db" "github.com/cosmos/cosmos-sdk/db/memdb" "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/store/v2/dbadapter" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/dbadapter" ) var ( diff --git a/store/v2/transient/store_test.go b/store/v2alpha1/transient/store_test.go similarity index 91% rename from store/v2/transient/store_test.go rename to store/v2alpha1/transient/store_test.go index 4b051245be..272b7a34a8 100644 --- a/store/v2/transient/store_test.go +++ b/store/v2alpha1/transient/store_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/store/v2/transient" + "github.com/cosmos/cosmos-sdk/store/v2alpha1/transient" ) var k, v = []byte("hello"), []byte("world") diff --git a/store/v2/types.go b/store/v2alpha1/types.go similarity index 100% rename from store/v2/types.go rename to store/v2alpha1/types.go