Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: test & coverage report creation
run: |
nix develop .#rocksdb -c make test test-versiondb
nix develop .#rocksdb -c make test
if: steps.changed-files.outputs.any_changed == 'true'
- name: filter out proto files
run: |
Expand All @@ -88,7 +88,7 @@ jobs:
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt,./memiavl/coverage.txt,./store/coverage.txt,./versiondb/coverage.txt
files: ./coverage.txt
if: steps.changed-files.outputs.any_changed == 'true'

gomod2nix:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ jobs:
BUILD_TAGS=rocksdb,grocksdb_clean_link,objstore
go build -tags $BUILD_TAGS ./cmd/cronosd
golangci-lint run --fix --output.text.path stdout --path-prefix=./ --timeout 30m --build-tags $BUILD_TAGS
cd versiondb
golangci-lint run --fix --output.text.path stdout --path-prefix=./versiondb --timeout 30m --build-tags $BUILD_TAGS
cd ../memiavl
golangci-lint run --fix --output.text.path stdout --path-prefix=./memiavl --timeout 30m --build-tags objstore
cd ../store
golangci-lint run --fix --output.text.path stdout --path-prefix=./store --timeout 30m --build-tags objstore
# Check only if there are differences in the source code
if: steps.changed-files.outputs.any_changed == 'true'
- name: check working directory is clean
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

## UNRELEASED

* [#1895](https://github.com/crypto-org-chain/cronos/pull/1895) feat: use cronos store.
* [#1908](https://github.com/crypto-org-chain/cronos/pull/1908) Add db migration/patch CLI tool
* [#1875](https://github.com/crypto-org-chain/cronos/pull/1875) Support for preinstalls
* [#1882](https://github.com/crypto-org-chain/cronos/pull/1882) Support for eip2935
Expand Down
36 changes: 22 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,10 @@ build: check-network print-ledger go.sum
install: check-network print-ledger go.sum
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/cronosd

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

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

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

test-versiondb:
@cd versiondb && go test -tags=objstore,rocksdb -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;

.PHONY: clean build install test test-memiavl test-store test-versiondb
.PHONY: all clean build install test

clean:
rm -rf $(BUILDDIR)/
Expand Down Expand Up @@ -297,6 +288,21 @@ endif
###############################################################################

HTTPS_GIT := https://github.com/crypto-org-chain/cronos.git
CRONOS_STORE_GIT := https://github.com/crypto-org-chain/cronos-store.git
CRONOS_STORE_VERSION := $(shell go list -m -f '{{if .Replace}}{{.Replace.Version}}{{else}}{{.Version}}{{end}}' github.com/crypto-org-chain/cronos-store/memiavl 2>/dev/null)
ifeq ($(CRONOS_STORE_VERSION),)
CRONOS_STORE_VERSION := $(shell awk '/^[[:space:]]*github.com\/crypto-org-chain\/cronos-store\/memiavl[[:space:]]+=>/ {print $$NF; exit}' go.mod)
endif
ifeq ($(CRONOS_STORE_VERSION),)
CRONOS_STORE_VERSION := $(shell sed -nE -e '/=>/d' -e 's/^[[:space:]]*github.com\/crypto-org-chain\/cronos-store\/memiavl[[:space:]]+([^[:space:]]+).*/\1/p' go.mod | head -n 1)
endif
CRONOS_STORE_REF := $(CRONOS_STORE_VERSION)
ifneq (,$(findstring -, $(CRONOS_STORE_VERSION)))
CRONOS_STORE_REF := $(shell echo $(CRONOS_STORE_VERSION) | awk -F- '{print $$NF}')
endif
ifeq ($(CRONOS_STORE_REF),)
CRONOS_STORE_REF := main
endif
Comment thread
coderabbitai[bot] marked this conversation as resolved.
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImageCi=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace --user root $(protoImageName)
Expand Down Expand Up @@ -329,12 +335,14 @@ proto-format:
@$(protoImage) find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \;

proto-check-breaking:
@echo "Checking Protobuf files for breaking changes"
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main
@echo "Checking Cronos protobuf files for breaking changes"
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main --exclude-path proto/memiavl
@echo "Checking memiavl protobuf files against cronos-store ref $(CRONOS_STORE_REF)"
@$(protoImage) buf breaking --path proto/memiavl --against $(CRONOS_STORE_GIT)#ref=$(CRONOS_STORE_REF) || echo "Warning: memiavl proto check skipped (files may not exist in cronos-store yet)"


.PHONY: proto-all proto-gen proto-format proto-lint proto-check-breaking

vulncheck: $(BUILDDIR)/
GOBIN=$(BUILDDIR) go install golang.org/x/vuln/cmd/govulncheck@latest
$(BUILDDIR)/govulncheck ./...
$(BUILDDIR)/govulncheck ./...
5 changes: 3 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import (
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
memiavlstore "github.com/crypto-org-chain/cronos-store/store"
"github.com/crypto-org-chain/cronos/client/docs"
memiavlstore "github.com/crypto-org-chain/cronos/store"
"github.com/crypto-org-chain/cronos/x/cronos"
cronosclient "github.com/crypto-org-chain/cronos/x/cronos/client"
cronoskeeper "github.com/crypto-org-chain/cronos/x/cronos/keeper"
Expand Down Expand Up @@ -430,7 +430,8 @@ func New(
// only enable memiavl cache if neither block-stm nor optimistic execution is enabled, because it's not concurrency-safe.
cacheSize = cast.ToInt(appOpts.Get(memiavlstore.FlagCacheSize))
}
baseAppOptions = memiavlstore.SetupMemIAVL(logger, homePath, appOpts, false, false, cacheSize, baseAppOptions)
chainId := cast.ToString(appOpts.Get(flags.FlagChainID))
baseAppOptions = memiavlstore.SetupMemIAVL(logger, homePath, appOpts, false, false, cacheSize, chainId, baseAppOptions)

// The default value of optimisticExecution is enabled.
if !optimisticExecutionDisabled {
Expand Down
2 changes: 1 addition & 1 deletion app/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmtypes "github.com/cometbft/cometbft/types"
dbm "github.com/cosmos/cosmos-db"
memiavlstore "github.com/crypto-org-chain/cronos/store"
memiavlstore "github.com/crypto-org-chain/cronos-store/store"
"github.com/crypto-org-chain/cronos/x/cronos/types"
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
Expand Down
4 changes: 2 additions & 2 deletions app/versiondb.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"
"path/filepath"

"github.com/crypto-org-chain/cronos/versiondb"
"github.com/crypto-org-chain/cronos/versiondb/tsrocksdb"
"github.com/crypto-org-chain/cronos-store/versiondb"
"github.com/crypto-org-chain/cronos-store/versiondb/tsrocksdb"

storetypes "cosmossdk.io/store/types"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cronosd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
cmtcli "github.com/cometbft/cometbft/libs/cli"
dbm "github.com/cosmos/cosmos-db"
rosettaCmd "github.com/cosmos/rosetta/cmd"
memiavlcfg "github.com/crypto-org-chain/cronos-store/store/config"
"github.com/crypto-org-chain/cronos/app"
config2 "github.com/crypto-org-chain/cronos/cmd/cronosd/config"
"github.com/crypto-org-chain/cronos/cmd/cronosd/opendb"
memiavlcfg "github.com/crypto-org-chain/cronos/store/config"
"github.com/crypto-org-chain/cronos/x/cronos"
e2eecli "github.com/crypto-org-chain/cronos/x/e2ee/client/cli"
ethermintclient "github.com/evmos/ethermint/client"
Expand Down
2 changes: 1 addition & 1 deletion cmd/cronosd/cmd/versiondb.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package cmd
import (
"sort"

versiondbclient "github.com/crypto-org-chain/cronos-store/versiondb/client"
"github.com/crypto-org-chain/cronos/app"
"github.com/crypto-org-chain/cronos/cmd/cronosd/opendb"
versiondbclient "github.com/crypto-org-chain/cronos/versiondb/client"
"github.com/linxGnu/grocksdb"
"github.com/spf13/cobra"
)
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ require (
// release/v10.0.x
github.com/cosmos/ibc-go/v10 v10.4.0
github.com/cosmos/rosetta v0.50.12
github.com/crypto-org-chain/cronos/store v0.0.4
github.com/crypto-org-chain/cronos/versiondb v0.0.0-00010101000000-000000000000
github.com/crypto-org-chain/cronos-store/store v0.0.0-20251203075505-0670ff683f07
github.com/crypto-org-chain/cronos-store/versiondb v0.0.0-20251203075505-0670ff683f07
github.com/ethereum/go-ethereum v1.15.11
github.com/evmos/ethermint v0.0.0-00010101000000-000000000000
github.com/golang/protobuf v1.5.4
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/go-metrics v0.5.4
github.com/linxGnu/grocksdb v1.9.10-0.20250331012329-9d5f074653d1
github.com/linxGnu/grocksdb v1.10.3
github.com/spf13/cast v1.10.0
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
Expand Down Expand Up @@ -109,7 +109,7 @@ require (
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
github.com/creachadair/atomicfile v0.3.1 // indirect
github.com/creachadair/tomledit v0.0.24 // indirect
github.com/crypto-org-chain/cronos/memiavl v0.0.4 // indirect
github.com/crypto-org-chain/cronos-store/memiavl v0.0.4 // indirect
github.com/crypto-org-chain/go-block-stm v0.0.0-20241213061541-7afe924fb4a6 // indirect
github.com/danieljoos/wincred v1.2.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
Expand Down Expand Up @@ -285,9 +285,9 @@ replace (
)

replace (
github.com/crypto-org-chain/cronos/memiavl => ./memiavl
github.com/crypto-org-chain/cronos/store => ./store
github.com/crypto-org-chain/cronos/versiondb => ./versiondb
github.com/crypto-org-chain/cronos-store/memiavl => github.com/crypto-org-chain/cronos-store/memiavl v0.0.0-20251203075505-0670ff683f07
github.com/crypto-org-chain/cronos-store/store => github.com/crypto-org-chain/cronos-store/store v0.0.0-20251203075505-0670ff683f07
github.com/crypto-org-chain/cronos-store/versiondb => github.com/crypto-org-chain/cronos-store/versiondb v0.0.0-20251203075505-0670ff683f07
)

replace (
Expand Down
10 changes: 8 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,12 @@ github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254 h1:JzLOFRiKsDtLJt5h0M0jkEIPDKvFFyja7VEp7gG6O9U=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
github.com/crypto-org-chain/cronos-store/memiavl v0.0.0-20251203075505-0670ff683f07 h1:VaN152NPUILR3O3SllZBgd2J9TKjltgucMcp1qWrH0A=
github.com/crypto-org-chain/cronos-store/memiavl v0.0.0-20251203075505-0670ff683f07/go.mod h1:qIKlI0tMgU/zrxzB0TnM4K9lhbp23ACReh5PsXiwnaU=
github.com/crypto-org-chain/cronos-store/store v0.0.0-20251203075505-0670ff683f07 h1:v2tEsEpSGycbmJUpc6Wfdap7NGkveSjZvi4+ASa/BAk=
github.com/crypto-org-chain/cronos-store/store v0.0.0-20251203075505-0670ff683f07/go.mod h1:QtmMmgHYQqioX/U2OfucmqDgXMmrL3N8/QXom4UWeKg=
github.com/crypto-org-chain/cronos-store/versiondb v0.0.0-20251203075505-0670ff683f07 h1:eMuGwzyL4ond46wHHIybHT9fBoFxfWzkeX87IannqG4=
github.com/crypto-org-chain/cronos-store/versiondb v0.0.0-20251203075505-0670ff683f07/go.mod h1:6sg+tT7xMKDS8HL9Rxq1QsLJHApMuh+vnr2HVl3utl0=
github.com/crypto-org-chain/ethermint v0.22.1-0.20251208051817-9f5d1db3246d h1:x57dT8gpztM9OEx2DhhQYxZ0RGyeHXzPOPHrxRyMJzc=
github.com/crypto-org-chain/ethermint v0.22.1-0.20251208051817-9f5d1db3246d/go.mod h1:bfcBQITxYzsbXuF+VWOtL3EhBi9mEIOzsFT0UvB+mso=
github.com/crypto-org-chain/go-block-stm v0.0.0-20241213061541-7afe924fb4a6 h1:6KPEi8dWkDSBddQb4NAvEXmNnTXymF3yVeTaT4Hz1iU=
Expand Down Expand Up @@ -1411,8 +1417,8 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/linxGnu/grocksdb v1.9.10-0.20250331012329-9d5f074653d1 h1:vN+8kgA6qUlVUiU9qs5h0LqObXInjdnzM8XxLPUpF3g=
github.com/linxGnu/grocksdb v1.9.10-0.20250331012329-9d5f074653d1/go.mod h1:C3CNe9UYc9hlEM2pC82AqiGS3LRW537u9LFV4wIZuHk=
github.com/linxGnu/grocksdb v1.10.3 h1:0laII9AQ6kFxo5SjhdTfSh9EgF20piD6TMHK6YuDm+4=
github.com/linxGnu/grocksdb v1.10.3/go.mod h1:OLQKZwiKwaJiAVCsOzWKvwiLwfZ5Vz8Md5TYR7t7pM8=
github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o=
Expand Down
16 changes: 14 additions & 2 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ schema = 3
[mod."github.com/creachadair/tomledit"]
version = "v0.0.24"
hash = "sha256-4vUukHONOjNn0qfQr4esK6TWfPWsIp+rbdz65og84lw="
[mod."github.com/crypto-org-chain/cronos-store/memiavl"]
version = "v0.0.0-20251203075505-0670ff683f07"
hash = "sha256-9Zebgh4yp/tqrIgWdwLLsALa3BdkHwSLt5f2iidX+Zs="
replaced = "github.com/crypto-org-chain/cronos-store/memiavl"
[mod."github.com/crypto-org-chain/cronos-store/store"]
version = "v0.0.0-20251203075505-0670ff683f07"
hash = "sha256-OCh8b4Vb5UVb6rSmf/RAsTj4MjaedgtUocFdQ4Zoj1U="
replaced = "github.com/crypto-org-chain/cronos-store/store"
[mod."github.com/crypto-org-chain/cronos-store/versiondb"]
version = "v0.0.0-20251203075505-0670ff683f07"
hash = "sha256-u/QCh16u5UMKgC6KHiUkuHnF8L2BHxDVL+mf837jRI4="
replaced = "github.com/crypto-org-chain/cronos-store/versiondb"
[mod."github.com/crypto-org-chain/go-block-stm"]
version = "v0.0.0-20241213061541-7afe924fb4a6"
hash = "sha256-bl5jVL5oouu9/kbuJv9ua4w4hRhchnWQ8ogIEnW9NLs="
Expand Down Expand Up @@ -511,8 +523,8 @@ schema = 3
version = "v1.10.9"
hash = "sha256-Gl6dLtL+yk6UrTTWfas43aM4lP/pNa2l7+ITXnjQyKs="
[mod."github.com/linxGnu/grocksdb"]
version = "v1.9.10-0.20250331012329-9d5f074653d1"
hash = "sha256-liFv2CO0IM79XRyEvF3zzfpqRmzYrUxlLBffl48kI88="
version = "v1.10.3"
hash = "sha256-JaIjWMOKsF/WRvsIP0bdkWvu1Q/8aaHcxW4jjE0mmnk="
[mod."github.com/manifoldco/promptui"]
version = "v0.9.0"
hash = "sha256-Fe2OPoyRExZejwtUBivKhfJAJW7o9b1eyYpgDlWQ1No="
Expand Down
129 changes: 0 additions & 129 deletions memiavl/README.md

This file was deleted.

Loading
Loading