From 7da28e105726944ca52a27d18282105dd5c7d2fe Mon Sep 17 00:00:00 2001 From: Spoorthi <9302666+spoo-bar@users.noreply.github.com> Date: Tue, 29 Aug 2023 13:16:59 +0530 Subject: [PATCH] chore: replacing tendermint with cometbft (#433) * replacing tendermint refs with comet bft * replacing tm-db with cometbft-db --- app/app.go | 12 ++++++------ app/app_test.go | 6 +++--- app/export.go | 2 +- app/sim_test.go | 6 +++--- app/test_helpers.go | 10 +++++----- cmd/archwayd/root.go | 6 +++--- contracts/go/voter/go.mod | 2 +- e2e/gastracking_test.go | 2 +- e2e/testing/chain.go | 10 +++++----- e2e/testing/chain_ops_ibc.go | 12 ++++++------ e2e/testing/chain_options.go | 2 +- e2e/testing/client.go | 2 +- e2e/testing/common.go | 2 +- e2e/txfees_test.go | 2 +- go.mod | 7 +++---- go.sum | 2 ++ x/genmsg/module.go | 2 +- x/rewards/abci.go | 2 +- x/rewards/keeper/keeper.go | 2 +- x/rewards/module.go | 2 +- x/tracking/abci.go | 2 +- x/tracking/keeper/keeper.go | 2 +- x/tracking/module.go | 2 +- 23 files changed, 50 insertions(+), 49 deletions(-) diff --git a/app/app.go b/app/app.go index 1c2d98a2..b7f743a3 100644 --- a/app/app.go +++ b/app/app.go @@ -13,6 +13,12 @@ import ( wasmdKeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmdTypes "github.com/CosmWasm/wasmd/x/wasm/types" cosmwasm "github.com/CosmWasm/wasmvm" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + tmjson "github.com/cometbft/cometbft/libs/json" + "github.com/cometbft/cometbft/libs/log" + tmos "github.com/cometbft/cometbft/libs/os" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" @@ -101,12 +107,6 @@ import ( "github.com/gorilla/mux" "github.com/rakyll/statik/fs" "github.com/spf13/cast" - abci "github.com/tendermint/tendermint/abci/types" - tmjson "github.com/tendermint/tendermint/libs/json" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - dbm "github.com/tendermint/tm-db" "github.com/archway-network/archway/wasmbinding" "github.com/archway-network/archway/x/rewards" diff --git a/app/app_test.go b/app/app_test.go index 8b846f16..5b72f76e 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -5,12 +5,12 @@ import ( "os" "testing" + db "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - db "github.com/tendermint/tm-db" - abci "github.com/tendermint/tendermint/abci/types" + abci "github.com/cometbft/cometbft/abci/types" "github.com/CosmWasm/wasmd/x/wasm" ) diff --git a/app/export.go b/app/export.go index a0d0e478..00d6dcc1 100644 --- a/app/export.go +++ b/app/export.go @@ -4,7 +4,7 @@ import ( "encoding/json" "log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/app/sim_test.go b/app/sim_test.go index b3cc8aa6..6c078be9 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -7,6 +7,9 @@ import ( "path/filepath" "testing" + dbm "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -28,9 +31,6 @@ import ( ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - dbm "github.com/tendermint/tm-db" "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" diff --git a/app/test_helpers.go b/app/test_helpers.go index dc2bc1ad..78ff6bc6 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -9,14 +9,14 @@ import ( "testing" "time" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" - dbm "github.com/tendermint/tm-db" "github.com/CosmWasm/wasmd/x/wasm" diff --git a/cmd/archwayd/root.go b/cmd/archwayd/root.go index 97c4096e..15a01bf6 100644 --- a/cmd/archwayd/root.go +++ b/cmd/archwayd/root.go @@ -6,6 +6,9 @@ import ( "os" "path/filepath" + dbm "github.com/cometbft/cometbft-db" + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" @@ -27,9 +30,6 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/spf13/cast" "github.com/spf13/cobra" - tmcli "github.com/tendermint/tendermint/libs/cli" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" diff --git a/contracts/go/voter/go.mod b/contracts/go/voter/go.mod index ab1be983..c8762b54 100644 --- a/contracts/go/voter/go.mod +++ b/contracts/go/voter/go.mod @@ -29,7 +29,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect - github.com/tendermint/tm-db v0.6.7 // indirect + github.com/cometbft/cometbft-db v0.7.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect diff --git a/e2e/gastracking_test.go b/e2e/gastracking_test.go index 0029cfd7..f19bfd06 100644 --- a/e2e/gastracking_test.go +++ b/e2e/gastracking_test.go @@ -8,8 +8,8 @@ import ( archway "github.com/archway-network/archway/types" wasmdTypes "github.com/CosmWasm/wasmd/x/wasm/types" + abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" voterTypes "github.com/archway-network/voter/src/types" diff --git a/e2e/testing/chain.go b/e2e/testing/chain.go index 329034b3..76f77aac 100644 --- a/e2e/testing/chain.go +++ b/e2e/testing/chain.go @@ -10,6 +10,11 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/CosmWasm/wasmd/x/wasm" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/libs/log" + tmProto "github.com/cometbft/cometbft/proto/tendermint/types" + tmTypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/codec" codecTypes "github.com/cosmos/cosmos-sdk/codec/types" cryptoCodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -24,11 +29,6 @@ import ( "github.com/cosmos/ibc-go/v4/testing/mock" "github.com/golang/protobuf/proto" //nolint:staticcheck "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmProto "github.com/tendermint/tendermint/proto/tendermint/types" - tmTypes "github.com/tendermint/tendermint/types" - dbm "github.com/tendermint/tm-db" "github.com/archway-network/archway/app" ) diff --git a/e2e/testing/chain_ops_ibc.go b/e2e/testing/chain_ops_ibc.go index c343d0a5..182443fa 100644 --- a/e2e/testing/chain_ops_ibc.go +++ b/e2e/testing/chain_ops_ibc.go @@ -4,6 +4,12 @@ import ( "fmt" "time" + abci "github.com/cometbft/cometbft/abci/types" + tmHash "github.com/cometbft/cometbft/crypto/tmhash" + tmProto "github.com/cometbft/cometbft/proto/tendermint/types" + tmProtoVersion "github.com/cometbft/cometbft/proto/tendermint/version" + tmTypes "github.com/cometbft/cometbft/types" + tmVersion "github.com/cometbft/cometbft/version" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -14,12 +20,6 @@ import ( "github.com/cosmos/ibc-go/v4/modules/core/exported" ibcTmTypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - tmHash "github.com/tendermint/tendermint/crypto/tmhash" - tmProto "github.com/tendermint/tendermint/proto/tendermint/types" - tmProtoVersion "github.com/tendermint/tendermint/proto/tendermint/version" - tmTypes "github.com/tendermint/tendermint/types" - tmVersion "github.com/tendermint/tendermint/version" ) // GetMerklePrefix returns a Merkle tree prefix. diff --git a/e2e/testing/chain_options.go b/e2e/testing/chain_options.go index 043adfbe..11a765f4 100644 --- a/e2e/testing/chain_options.go +++ b/e2e/testing/chain_options.go @@ -1,10 +1,10 @@ package e2eTesting import ( + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" mintTypes "github.com/cosmos/cosmos-sdk/x/mint/types" - abci "github.com/tendermint/tendermint/abci/types" archway "github.com/archway-network/archway/types" diff --git a/e2e/testing/client.go b/e2e/testing/client.go index a4e55afc..015dd8ed 100644 --- a/e2e/testing/client.go +++ b/e2e/testing/client.go @@ -4,8 +4,8 @@ import ( "context" "fmt" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/codec" - abci "github.com/tendermint/tendermint/abci/types" "google.golang.org/grpc" "github.com/archway-network/archway/app" diff --git a/e2e/testing/common.go b/e2e/testing/common.go index 986ff00e..71a1fd6f 100644 --- a/e2e/testing/common.go +++ b/e2e/testing/common.go @@ -6,10 +6,10 @@ import ( "strings" wasmKeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" ) // GetStringEventAttribute returns TX response event attribute string value by type and attribute key. diff --git a/e2e/txfees_test.go b/e2e/txfees_test.go index 249a907f..21f42b21 100644 --- a/e2e/txfees_test.go +++ b/e2e/txfees_test.go @@ -6,9 +6,9 @@ import ( "time" wasmdTypes "github.com/CosmWasm/wasmd/x/wasm/types" + abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkErrors "github.com/cosmos/cosmos-sdk/types/errors" - abci "github.com/tendermint/tendermint/abci/types" voterTypes "github.com/archway-network/voter/src/types" diff --git a/go.mod b/go.mod index 67487552..5660e035 100644 --- a/go.mod +++ b/go.mod @@ -21,8 +21,8 @@ require ( github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.2 - github.com/tendermint/tendermint v0.34.27 - github.com/tendermint/tm-db v0.6.7 + github.com/cometbft/cometbft v0.37.2 + github.com/cometbft/cometbft-db v0.7.0 golang.org/x/exp v0.0.0-20230321023759-10a507213a29 google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc google.golang.org/grpc v1.53.0 @@ -53,6 +53,7 @@ require ( github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 // indirect github.com/cockroachdb/redact v1.1.3 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect + github.com/cometbft/cometbft v0.34.27 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/cosmos/btcutil v1.0.4 // indirect @@ -160,6 +161,4 @@ replace github.com/CosmWasm/wasmd => github.com/archway-network/archway-wasmd v0 replace github.com/archway-network/voter => ./contracts/go/voter -replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 - replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 diff --git a/go.sum b/go.sum index 211911bb..d8dcd389 100644 --- a/go.sum +++ b/go.sum @@ -213,6 +213,8 @@ github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZ github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= github.com/cometbft/cometbft v0.34.27 h1:ri6BvmwjWR0gurYjywcBqRe4bbwc3QVs9KRcCzgh/J0= github.com/cometbft/cometbft v0.34.27/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= +github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= +github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= diff --git a/x/genmsg/module.go b/x/genmsg/module.go index fa4bc125..4c6c5379 100644 --- a/x/genmsg/module.go +++ b/x/genmsg/module.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -13,7 +14,6 @@ import ( "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" v1 "github.com/archway-network/archway/x/genmsg/v1" ) diff --git a/x/rewards/abci.go b/x/rewards/abci.go index 4a5d614a..6fe2c0c4 100644 --- a/x/rewards/abci.go +++ b/x/rewards/abci.go @@ -3,9 +3,9 @@ package rewards import ( "time" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" "github.com/archway-network/archway/x/rewards/keeper" "github.com/archway-network/archway/x/rewards/types" diff --git a/x/rewards/keeper/keeper.go b/x/rewards/keeper/keeper.go index 4ee34686..0397cab2 100644 --- a/x/rewards/keeper/keeper.go +++ b/x/rewards/keeper/keeper.go @@ -2,13 +2,13 @@ package keeper import ( wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkErrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" paramTypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/tendermint/tendermint/libs/log" "github.com/archway-network/archway/x/rewards/types" trackingTypes "github.com/archway-network/archway/x/tracking/types" diff --git a/x/rewards/module.go b/x/rewards/module.go index 258fee61..c90a78a3 100644 --- a/x/rewards/module.go +++ b/x/rewards/module.go @@ -10,6 +10,7 @@ import ( "fmt" "math/rand" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codecTypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -19,7 +20,6 @@ import ( "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/archway-network/archway/x/rewards/client/cli" "github.com/archway-network/archway/x/rewards/keeper" diff --git a/x/tracking/abci.go b/x/tracking/abci.go index c1067d2a..392c1d93 100644 --- a/x/tracking/abci.go +++ b/x/tracking/abci.go @@ -3,9 +3,9 @@ package tracking import ( "time" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/tendermint/tendermint/abci/types" "github.com/archway-network/archway/x/tracking/keeper" "github.com/archway-network/archway/x/tracking/types" diff --git a/x/tracking/keeper/keeper.go b/x/tracking/keeper/keeper.go index 3275d707..a98d4b33 100644 --- a/x/tracking/keeper/keeper.go +++ b/x/tracking/keeper/keeper.go @@ -2,9 +2,9 @@ package keeper import ( wasmKeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/libs/log" "github.com/archway-network/archway/x/tracking/types" ) diff --git a/x/tracking/module.go b/x/tracking/module.go index 7a578371..d1135fba 100644 --- a/x/tracking/module.go +++ b/x/tracking/module.go @@ -9,6 +9,7 @@ import ( "fmt" "math/rand" + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codecTypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -18,7 +19,6 @@ import ( "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" "github.com/archway-network/archway/x/tracking/client/cli" "github.com/archway-network/archway/x/tracking/keeper"