Skip to content

Commit

Permalink
chore: prep store v1.0.0 (cosmos#18318)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
tac0turtle and julienrbrt authored Nov 1, 2023
1 parent 1788e32 commit 3595581
Show file tree
Hide file tree
Showing 27 changed files with 276 additions and 166 deletions.
6 changes: 6 additions & 0 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,9 @@ Those modules can be considered as part of the Cosmos SDK, but features and impr
### Modules that do not depend on the Cosmos SDK

Modules that do not depend on the Cosmos SDK can be released at any time from the `main` branch of the Cosmos SDK repository.

#### Branches For Go Modules

Branches that go modules are released from:

* Store v1 is released from `release/v0.50.x` branch.
17 changes: 8 additions & 9 deletions store/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,26 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## [Unreleased]
## v1.0.0 (October 31, 2023)

### Features

* [#17294](https://github.com/cosmos/cosmos-sdk/pull/17294) Add snapshot manager Close method.
* [#15568](https://github.com/cosmos/cosmos-sdk/pull/15568) Migrate the `iavl` to the new key format.
* Remove `DeleteVersion`, `DeleteVersions`, `LazyLoadVersionForOverwriting` from `iavl` tree API.
* Add `DeleteVersionsTo` and `SaveChangeSet`, since it will keep versions sequentially like `fromVersion` to `toVersion`.
* Refactor the pruning manager to use `DeleteVersionsTo`.
* [#15712](https://github.com/cosmos/cosmos-sdk/pull/15712) Add `WorkingHash` function to the store interface to get the current app hash before commit.

* [#14645](https://github.com/cosmos/cosmos-sdk/pull/14645) Add limit to the length of key and value.
* [#15683](https://github.com/cosmos/cosmos-sdk/pull/15683) `rootmulti.Store.CacheMultiStoreWithVersion` now can handle loading archival states that don't persist any of the module stores the current state has.
* [#16060](https://github.com/cosmos/cosmos-sdk/pull/16060) Support saving restoring snapshot locally.
* [#14746](https://github.com/cosmos/cosmos-sdk/pull/14746) The `store` module is extracted to have a separate go.mod file which allows it be a standalone module.
* [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height.

### API Breaking Changes

* [#16321](https://github.com/cosmos/cosmos-sdk/pull/16321) QueryInterface defines its own request and response types instead of relying on comet/abci & returns an error
### Improvements

## [v0.1.0-alpha.1](https://github.com/cosmos/cosmos-sdk/releases/tag/store%2Fv0.1.0-alpha.1) - 2023-03-17
* [#17158](https://github.com/cosmos/cosmos-sdk/pull/17158) Start the goroutine after need to create a snapshot.

### Features
### API Breaking Changes

* [#14746](https://github.com/cosmos/cosmos-sdk/pull/14746) The `store` module is extracted to have a separate go.mod file which allows it be a standalone module.
* [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height.
* [#16321](https://github.com/cosmos/cosmos-sdk/pull/16321) QueryInterface defines its own request and response types instead of relying on comet/abci & returns an error
1 change: 1 addition & 0 deletions store/cachekv/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
)

func DoBenchmarkDeepCacheStack(b *testing.B, depth int) {
b.Helper()
db := dbm.NewMemDB()
initialStore := cachekv.NewStore(dbadapter.Store{DB: db})

Expand Down
1 change: 1 addition & 0 deletions store/cachekv/internal/btree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ func TestDBIterator(t *testing.T) {
}

func verifyIterator(t *testing.T, itr types.Iterator, expected []int64, msg string) {
t.Helper()
i := 0
for itr.Valid() {
key := itr.Key()
Expand Down
4 changes: 4 additions & 0 deletions store/cachekv/store_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const defaultValueSizeBz = 1 << 12

// This benchmark measures the time of iterator.Next() when the parent store is blank
func benchmarkBlankParentIteratorNext(b *testing.B, keysize int) {
b.Helper()
mem := dbadapter.Store{DB: dbm.NewMemDB()}
kvstore := cachekv.NewStore(mem)
// Use a singleton for value, to not waste time computing it
Expand Down Expand Up @@ -44,6 +45,7 @@ func benchmarkBlankParentIteratorNext(b *testing.B, keysize int) {

// Benchmark setting New keys to a store, where the new keys are in sequence.
func benchmarkBlankParentAppend(b *testing.B, keysize int) {
b.Helper()
mem := dbadapter.Store{DB: dbm.NewMemDB()}
kvstore := cachekv.NewStore(mem)

Expand All @@ -66,6 +68,7 @@ func benchmarkBlankParentAppend(b *testing.B, keysize int) {
// Benchmark setting New keys to a store, where the new keys are random.
// the speed of this function does not depend on the values in the parent store
func benchmarkRandomSet(b *testing.B, keysize int) {
b.Helper()
mem := dbadapter.Store{DB: dbm.NewMemDB()}
kvstore := cachekv.NewStore(mem)

Expand Down Expand Up @@ -96,6 +99,7 @@ func benchmarkRandomSet(b *testing.B, keysize int) {
// We essentially are benchmarking the cacheKV iterator creation & iteration times
// with the number of entries deleted in the parent.
func benchmarkIteratorOnParentWithManyDeletes(b *testing.B, numDeletes int) {
b.Helper()
mem := dbadapter.Store{DB: dbm.NewMemDB()}

// Use a singleton for value, to not waste time computing it
Expand Down
8 changes: 8 additions & 0 deletions store/cachekv/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ func randInt(n int) int {

// useful for replaying a error case if we find one
func doOp(t *testing.T, st types.CacheKVStore, truth dbm.DB, op int, args ...int) {
t.Helper()
switch op {
case opSet:
k := args[0]
Expand All @@ -491,6 +492,7 @@ func doOp(t *testing.T, st types.CacheKVStore, truth dbm.DB, op int, args ...int
}

func doRandomOp(t *testing.T, st types.CacheKVStore, truth dbm.DB, maxKey int) {
t.Helper()
r := randInt(totalOps)
switch r {
case opSet:
Expand Down Expand Up @@ -520,6 +522,7 @@ func doRandomOp(t *testing.T, st types.CacheKVStore, truth dbm.DB, maxKey int) {

// iterate over whole domain
func assertIterateDomain(t *testing.T, st types.KVStore, expectedN int) {
t.Helper()
itr := st.Iterator(nil, nil)
i := 0
for ; itr.Valid(); itr.Next() {
Expand All @@ -533,6 +536,7 @@ func assertIterateDomain(t *testing.T, st types.KVStore, expectedN int) {
}

func assertIterateDomainCheck(t *testing.T, st types.KVStore, mem dbm.DB, r []keyRange) {
t.Helper()
// iterate over each and check they match the other
itr := st.Iterator(nil, nil)
itr2, err := mem.Iterator(nil, nil) // ground truth
Expand Down Expand Up @@ -566,6 +570,7 @@ func assertIterateDomainCheck(t *testing.T, st types.KVStore, mem dbm.DB, r []ke
}

func assertIterateDomainCompare(t *testing.T, st types.KVStore, mem dbm.DB) {
t.Helper()
// iterate over each and check they match the other
itr := st.Iterator(nil, nil)
itr2, err := mem.Iterator(nil, nil) // ground truth
Expand All @@ -577,6 +582,7 @@ func assertIterateDomainCompare(t *testing.T, st types.KVStore, mem dbm.DB) {
}

func checkIterators(t *testing.T, itr, itr2 types.Iterator) {
t.Helper()
for ; itr.Valid(); itr.Next() {
require.True(t, itr2.Valid())
k, v := itr.Key(), itr.Value()
Expand All @@ -592,6 +598,7 @@ func checkIterators(t *testing.T, itr, itr2 types.Iterator) {
//--------------------------------------------------------

func setRange(t *testing.T, st types.KVStore, mem dbm.DB, start, end int) {
t.Helper()
for i := start; i < end; i++ {
st.Set(keyFmt(i), valFmt(i))
err := mem.Set(keyFmt(i), valFmt(i))
Expand All @@ -600,6 +607,7 @@ func setRange(t *testing.T, st types.KVStore, mem dbm.DB, start, end int) {
}

func deleteRange(t *testing.T, st types.KVStore, mem dbm.DB, start, end int) {
t.Helper()
for i := start; i < end; i++ {
st.Delete(keyFmt(i))
err := mem.Delete(keyFmt(i))
Expand Down
44 changes: 22 additions & 22 deletions store/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,76 @@ module cosmossdk.io/store
go 1.20

require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/errors v1.0.0
cosmossdk.io/log v1.2.1
cosmossdk.io/math v1.1.3-rc.1
github.com/cometbft/cometbft v0.38.0
github.com/cosmos/cosmos-db v1.0.0
github.com/cosmos/gogoproto v1.4.11
github.com/cosmos/iavl v1.0.0-rc.1
github.com/cosmos/iavl v1.0.0
github.com/cosmos/ics23/go v0.10.0
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3 // indirect
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-metrics v0.5.1
github.com/hashicorp/go-plugin v1.4.10
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/hashicorp/go-plugin v1.5.2
github.com/hashicorp/golang-lru v1.0.2
github.com/spf13/cast v1.5.1 // indirect
github.com/stretchr/testify v1.8.4
github.com/tidwall/btree v1.6.0
github.com/tidwall/btree v1.7.0
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
google.golang.org/grpc v1.57.0
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
gotest.tools/v3 v3.5.0
gotest.tools/v3 v3.5.1
)

require (
github.com/DataDog/zstd v1.5.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.10.0 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/emicklei/dot v1.4.2 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/getsentry/sentry-go v0.21.0 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/jhump/protoreflect v1.15.1 // indirect
github.com/jhump/protoreflect v1.15.3 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/linxGnu/grocksdb v1.7.16 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/zerolog v1.31.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 3595581

Please sign in to comment.