Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe authored Jul 22, 2024
2 parents 32822a6 + 8384cad commit 41fbf46
Show file tree
Hide file tree
Showing 19 changed files with 115 additions and 72 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ jobs:
export CGO_CFLAGS="$(pkg-config --cflags rocksdb)" CGO_LDFLAGS="$(pkg-config --libs rocksdb)"
golangci-lint version
BUILD_TAGS=rocksdb,grocksdb_clean_link
BUILD_TAGS=rocksdb,grocksdb_clean_link,objstore
go build -tags $BUILD_TAGS ./cmd/cronosd
golangci-lint run --out-format=github-actions --path-prefix=./ --timeout 10m --build-tags $BUILD_TAGS
cd versiondb
golangci-lint run --out-format=github-actions --path-prefix=./versiondb --timeout 10m --build-tags $BUILD_TAGS
cd ../memiavl
golangci-lint run --out-format=github-actions --path-prefix=./memiavl --timeout 10m
golangci-lint run --out-format=github-actions --path-prefix=./memiavl --timeout 10m --build-tags objstore
cd ../store
golangci-lint run --out-format=github-actions --path-prefix=./store --timeout 10m
golangci-lint run --out-format=github-actions --path-prefix=./store --timeout 10m --build-tags objstore
# Check only if there are differences in the source code
if: steps.changed-files.outputs.any_changed == 'true'

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [#1394](https://github.com/crypto-org-chain/cronos/pull/1394) Add icahost wirings but disable in parameters.
* [#1414](https://github.com/crypto-org-chain/cronos/pull/1414) Integrate new evm tx format.
* [#1458](https://github.com/crypto-org-chain/cronos/pull/1458) Adjust require gas for recvPacket when ReceiverChainIsSource.
* [#1518](https://github.com/crypto-org-chain/cronos/pull/1518) Keep versiondb/memiavl compatible with upstream sdk, stop supporting other streaming service.

### Improvements

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COMMIT := $(shell git log -1 --format='%H')
DOCKER := $(shell which docker)

# process build tags
build_tags = netgo
build_tags = netgo objstore
ifeq ($(NETWORK),mainnet)
build_tags += mainnet
else ifeq ($(NETWORK),testnet)
Expand Down Expand Up @@ -99,9 +99,9 @@ install: check-network print-ledger go.sum
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/cronosd

test:
@go test -v -mod=readonly $(PACKAGES) -coverprofile=$(COVERAGE) -covermode=atomic
@cd memiavl; go test -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd ..
@cd store; go test -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd ..
@go test -tags=objstore -v -mod=readonly $(PACKAGES) -coverprofile=$(COVERAGE) -covermode=atomic
@cd memiavl; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd ..
@cd store; go test -tags=objstore -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd ..

test-versiondb:
@cd versiondb; go test -tags rocksdb -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic; cd ..
Expand Down
6 changes: 0 additions & 6 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,6 @@ func New(
app.MountMemoryStores(memKeys)
app.MountObjectStores(okeys)

// load state streaming if enabled
if err := app.RegisterStreamingServices(appOpts, keys); err != nil {
fmt.Printf("failed to load state streaming: %s", err)
os.Exit(1)
}

// wire up the versiondb's `StreamingService` and `MultiStore`.
if cast.ToBool(appOpts.Get("versiondb.enable")) {
var err error
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
let
version = "v1.3.0";
pname = "cronosd";
tags = [ "ledger" "netgo" network "rocksdb" "grocksdb_no_link" ] ++ lib.optionals nativeByteOrder [ "nativebyteorder" ];
tags = [ "ledger" "netgo" network "rocksdb" "grocksdb_no_link" "objstore" ] ++ lib.optionals nativeByteOrder [ "nativebyteorder" ];
ldflags = lib.concatStringsSep "\n" ([
"-X github.com/cosmos/cosmos-sdk/version.Name=cronos"
"-X github.com/cosmos/cosmos-sdk/version.AppName=${pname}"
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ require (

// release/v0.50.x
replace (
cosmossdk.io/client/v2 => github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240626040048-36295f051595
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240626040048-36295f051595
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240626040048-36295f051595
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240716063309-c47504d189d4
cosmossdk.io/client/v2 => github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240722033504-50f1fa0c49d1
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1
)

replace (
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,14 @@ github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c h1:MOgfS4+F
github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63 h1:R1QJ9a3XdYMSKo+1RdFifxb/g3lNypC52L/rpYrWoKo=
github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63/go.mod h1:rocwIfnS+kA060x64gkSIRvWB9StSppIkJuo5MWzL24=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240716063309-c47504d189d4 h1:ipjTVqr7gMct5OQvCmzrNbm7xIxb2wTCLpCXpUf0+KA=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240716063309-c47504d189d4/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E=
github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240626040048-36295f051595 h1:xfrVLBZgV2DXjQXTSlaWHcG/s6Fdeme8tczaN4TTERw=
github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240626040048-36295f051595/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240626040048-36295f051595 h1:gHBOTNAuuGeD9HXGkTE04x3zee+00bXcVd8Jb3WG0nY=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240626040048-36295f051595/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240626040048-36295f051595 h1:MPKv1EzM16dx+HzkJowgb9PrlbatRlgFYqk1IucsL2s=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240626040048-36295f051595/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1 h1:xahHemSiT79xgh8Ig8zOTeHSLHt9FfPzViK7rATWhUM=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E=
github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240722033504-50f1fa0c49d1 h1:zqTYZqMKnv15UkKwCEbGqshZ6tWczctBYP53FxmEiF8=
github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240722033504-50f1fa0c49d1/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 h1:ZlezTiQu9pYpVO+6sB9+W3fvthIpV1GgSI8kPjw+v5s=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1 h1:r0ALP31Wnw19FqEmqzsK2SFNqdMetHshnM/X/FeJRIo=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f h1:/27Pg87DNRG0xzctT8XcEANKF0OksPgFJtcQSRs5O0E=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240715061533-9c959a26e04f/go.mod h1:Xap56y3WoiP7DyNammmB6N7P+Y83QQd6363RHGuaYV0=
github.com/crypto-org-chain/go-block-stm v0.0.0-20240408011717-9f11af197bde h1:sQIHTJfVt5VTrF7po9eZiFkZiPjlHbFvnXtGCOoBjNM=
Expand Down
12 changes: 6 additions & 6 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ schema = 3
version = "v0.7.5"
hash = "sha256-Nuw697sJr56kU3EU7DV1eYNkyI76psznIVqYAV6RfbQ="
[mod."cosmossdk.io/client/v2"]
version = "v2.0.0-20240626040048-36295f051595"
version = "v2.0.0-20240722033504-50f1fa0c49d1"
hash = "sha256-60hmufv3Ml4Pv3zNwgn8eeqlEINOR6n9MKr2QHddoxo="
replaced = "github.com/crypto-org-chain/cosmos-sdk/client/v2"
[mod."cosmossdk.io/collections"]
Expand All @@ -45,8 +45,8 @@ schema = 3
version = "v0.0.0-20230608160436-666c345ad23d"
hash = "sha256-6BMBA98BpK3jG6++ZE4LdPQwwpS+lZ0GLMRF1fO4UfM="
[mod."cosmossdk.io/store"]
version = "v0.0.0-20240626040048-36295f051595"
hash = "sha256-zne7cIFs9WLg11pIr9VLBBc+G+kZfKLn8UU1mP4w6BM="
version = "v0.0.0-20240722033504-50f1fa0c49d1"
hash = "sha256-Dm3sSZNJBcnBF33PULoTpK4rkNQbsZl0DfTqH1GPCQM="
replaced = "github.com/crypto-org-chain/cosmos-sdk/store"
[mod."cosmossdk.io/tools/confix"]
version = "v0.1.1"
Expand All @@ -58,7 +58,7 @@ schema = 3
version = "v0.1.0"
hash = "sha256-/gWvrqvy6bW90+NU66T+9QysYgvG1VbwfYJZ8tkqpeA="
[mod."cosmossdk.io/x/tx"]
version = "v0.0.0-20240626040048-36295f051595"
version = "v0.0.0-20240722033504-50f1fa0c49d1"
hash = "sha256-xT5IdapEx1h46ofBpxcBQfzGF2EntmC8xZl7aym/6xE="
replaced = "github.com/crypto-org-chain/cosmos-sdk/x/tx"
[mod."cosmossdk.io/x/upgrade"]
Expand Down Expand Up @@ -170,8 +170,8 @@ schema = 3
version = "v1.0.0-beta.5"
hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.50.6-0.20240716063309-c47504d189d4"
hash = "sha256-ukD0WZAMJ9hdwzBXzc6a60VOopZ6u+pdf67iq/1Tfa4="
version = "v0.50.6-0.20240722033504-50f1fa0c49d1"
hash = "sha256-OjJgi6tq5c4czeQLZVeJRBo4s4kC37h4IFT/GGvF7G0="
replaced = "github.com/crypto-org-chain/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion store/cachemulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewStore(
if closer == nil {
closer = NoopCloser
}
store := cachemulti.NewStore(stores, traceWriter, traceContext)
store := cachemulti.NewStore(nil, stores, nil, traceWriter, traceContext)
return Store{
Store: store,
Closer: closer,
Expand Down
6 changes: 3 additions & 3 deletions store/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ require (

// release/v0.50.x
replace (
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240604100318-cf12e5ad62e4
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1
)

replace github.com/crypto-org-chain/cronos/memiavl => ../memiavl
12 changes: 6 additions & 6 deletions store/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4 h1:tU2H8foSm+CVtU9HPEephknr3C6mTrVeSERwRUs6yFY=
github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:bIUzWfqXnCF2WTFb2uN+FjzMIG3BsOk+P2QmvMtm4ic=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4 h1:aW5FkDdXGz+Nl9W5bkTTxkleEo3CNGLl78nU5CxikhQ=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240604100318-cf12e5ad62e4 h1:0SAVpeeKAJQLX+5aygBW57EIyVNtvYXXWs9zDusblKk=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1 h1:xahHemSiT79xgh8Ig8zOTeHSLHt9FfPzViK7rATWhUM=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 h1:ZlezTiQu9pYpVO+6sB9+W3fvthIpV1GgSI8kPjw+v5s=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1 h1:r0ALP31Wnw19FqEmqzsK2SFNqdMetHshnM/X/FeJRIo=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY=
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
33 changes: 33 additions & 0 deletions store/rootmulti/objstore.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//go:build objstore
// +build objstore

package rootmulti

import (
"fmt"

"cosmossdk.io/store/transient"
"cosmossdk.io/store/types"
"github.com/crypto-org-chain/cronos/memiavl"
)

// Implements interface MultiStore
func (rs *Store) GetObjKVStore(key types.StoreKey) types.ObjKVStore {
s, ok := rs.stores[key].(types.ObjKVStore)
if !ok {
panic(fmt.Sprintf("store with key %v is not ObjKVStore", key))
}
return s
}

func (rs *Store) loadExtraStore(db *memiavl.DB, key types.StoreKey, params storeParams) (types.CommitStore, error) {
if params.typ == types.StoreTypeObject {
if _, ok := key.(*types.ObjectStoreKey); !ok {
return nil, fmt.Errorf("unexpected key type for a ObjectStoreKey; got: %s, %T", key.String(), key)
}

return transient.NewObjStore(), nil
}

panic(fmt.Sprintf("unrecognized store type %v", params.typ))
}
15 changes: 15 additions & 0 deletions store/rootmulti/objstore_placeholder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//go:build !objstore
// +build !objstore

package rootmulti

import (
"fmt"

"cosmossdk.io/store/types"
"github.com/crypto-org-chain/cronos/memiavl"
)

func (rs *Store) loadExtraStore(db *memiavl.DB, key types.StoreKey, params storeParams) (types.CommitStore, error) {
panic(fmt.Sprintf("unrecognized store type %v", params.typ))
}
18 changes: 1 addition & 17 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,6 @@ func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore {
return s
}

// Implements interface MultiStore
func (rs *Store) GetObjKVStore(key types.StoreKey) types.ObjKVStore {
s, ok := rs.stores[key].(types.ObjKVStore)
if !ok {
panic(fmt.Sprintf("store with key %v is not ObjKVStore", key))
}
return s
}

// Implements interface MultiStore
func (rs *Store) TracingEnabled() bool {
return false
Expand Down Expand Up @@ -426,15 +417,8 @@ func (rs *Store) loadCommitStoreFromParams(db *memiavl.DB, key types.StoreKey, p

return mem.NewStore(), nil

case types.StoreTypeObject:
if _, ok := key.(*types.ObjectStoreKey); !ok {
return nil, fmt.Errorf("unexpected key type for a ObjectStoreKey; got: %s, %T", key.String(), key)
}

return transient.NewObjStore(), nil

default:
panic(fmt.Sprintf("unrecognized store type %v", params.typ))
return rs.loadExtraStore(db, key, params)
}
}

Expand Down
4 changes: 2 additions & 2 deletions versiondb/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ require (

replace (
// release/v0.50.x
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1
// release/v0.50.x
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1
github.com/crypto-org-chain/cronos/memiavl => ../memiavl
)
8 changes: 4 additions & 4 deletions versiondb/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4 h1:tU2H8foSm+CVtU9HPEephknr3C6mTrVeSERwRUs6yFY=
github.com/crypto-org-chain/cosmos-sdk v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:bIUzWfqXnCF2WTFb2uN+FjzMIG3BsOk+P2QmvMtm4ic=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4 h1:aW5FkDdXGz+Nl9W5bkTTxkleEo3CNGLl78nU5CxikhQ=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240604100318-cf12e5ad62e4/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1 h1:xahHemSiT79xgh8Ig8zOTeHSLHt9FfPzViK7rATWhUM=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240722033504-50f1fa0c49d1/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1 h1:ZlezTiQu9pYpVO+6sB9+W3fvthIpV1GgSI8kPjw+v5s=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240722033504-50f1fa0c49d1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
14 changes: 7 additions & 7 deletions versiondb/multistore.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"cosmossdk.io/store/types"
)

var _ types.RootMultiStore = (*MultiStore)(nil)
var _ types.MultiStore = (*MultiStore)(nil)

// MultiStore wraps `VersionStore` to implement `MultiStore` interface.
type MultiStore struct {
Expand Down Expand Up @@ -64,7 +64,7 @@ func (s *MultiStore) cacheMultiStore(version *int64) types.CacheMultiStore {
stores[k] = NewKVStore(s.versionDB, k, version)
}
}
return cachemulti.NewStore(stores, s.traceWriter, s.getTracingContext())
return cachemulti.NewStore(nil, stores, nil, s.traceWriter, s.getTracingContext())
}

// CacheMultiStore implements `MultiStore` interface
Expand Down Expand Up @@ -99,11 +99,6 @@ func (s *MultiStore) GetKVStore(storeKey types.StoreKey) types.KVStore {
return s.GetStore(storeKey).(types.KVStore)
}

// GetObjKVStore implements `MultiStore` interface
func (s *MultiStore) GetObjKVStore(storeKey types.StoreKey) types.ObjKVStore {
return s.GetStore(storeKey).(types.ObjKVStore)
}

// SetTracer sets the tracer for the MultiStore that the underlying
// stores will utilize to trace operations. A MultiStore is returned.
func (s *MultiStore) SetTracer(w io.Writer) types.MultiStore {
Expand Down Expand Up @@ -157,3 +152,8 @@ func (s *MultiStore) LatestVersion() int64 {
func (s *MultiStore) Close() error {
return s.versionDB.Flush()
}

// CacheWrapWithTrace is kept to build with upstream sdk.
func (s *MultiStore) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap {
panic("not implemented")
}
11 changes: 11 additions & 0 deletions versiondb/objstore.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build objstore
// +build objstore

package versiondb

import "cosmossdk.io/store/types"

// GetObjKVStore implements `MultiStore` interface
func (s *MultiStore) GetObjKVStore(storeKey types.StoreKey) types.ObjKVStore {
return s.GetStore(storeKey).(types.ObjKVStore)
}
5 changes: 5 additions & 0 deletions versiondb/store.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package versiondb

import (
"io"
"time"

"cosmossdk.io/store/cachekv"
Expand Down Expand Up @@ -81,3 +82,7 @@ func (st *Store) Set(key, value []byte) {
func (st *Store) Delete(key []byte) {
panic("write operation is not supported")
}

func (st *Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap {
panic("not implemented")
}

0 comments on commit 41fbf46

Please sign in to comment.