From c17c3caab86a1426a1eef4541e8203f5f54a1a54 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 8 Feb 2023 21:09:28 +0100 Subject: [PATCH] refactor: rename commands to match consensus engine name (#14956) --- UPGRADING.md | 12 +- api/cosmos/bank/v1beta1/query.pulsar.go | 2 +- client/broadcast.go | 13 +- client/flags/flags.go | 2 +- .../grpc/{tmservice => cmtservice}/block.go | 2 +- .../{tmservice => cmtservice}/query.pb.go | 172 +++++++++--------- .../{tmservice => cmtservice}/query.pb.gw.go | 4 +- .../grpc/{tmservice => cmtservice}/service.go | 8 +- .../grpc/{tmservice => cmtservice}/status.go | 2 +- .../grpc/{tmservice => cmtservice}/types.go | 2 +- .../{tmservice => cmtservice}/types.pb.go | 82 ++++----- client/grpc/{tmservice => cmtservice}/util.go | 12 +- client/grpc_query.go | 2 +- client/keys/root.go | 2 +- client/rpc/status.go | 6 +- client/rpc/validators.go | 9 +- client/tx/tx.go | 2 +- client/utils.go | 2 +- codec/amino.go | 2 +- codec/legacy/codec.go | 2 +- crypto/codec/cmt.go | 47 +++-- crypto/keys/ed25519/ed25519_test.go | 2 +- docs/architecture/adr-032-typed-events.md | 2 +- .../base/tendermint/v1beta1/query.proto | 2 +- .../base/tendermint/v1beta1/types.proto | 2 +- runtime/app.go | 8 +- server/api/server.go | 4 +- server/api/server_test.go | 6 +- server/cmt_cmds.go | 16 +- server/rollback.go | 2 +- server/start.go | 18 +- server/util.go | 2 +- server/util_test.go | 4 +- simapp/README.md | 6 +- simapp/app.go | 8 +- simapp/export.go | 2 +- simapp/simd/cmd/root.go | 6 +- simapp/simd/cmd/testnet_test.go | 2 +- simapp/state.go | 2 +- simapp/upgrades.go | 2 +- .../{tmservice => cmtservice}/service_test.go | 64 +++---- tests/e2e/genutil/migrate.go | 2 +- tests/e2e/genutil/validate_genesis.go | 2 +- .../staking/keeper/validator_test.go | 10 +- testutil/mock/privval.go | 2 +- testutil/network/doc.go | 8 +- testutil/network/network.go | 10 +- testutil/network/util.go | 2 +- testutil/sims/app_helpers.go | 4 +- tools/rosetta/config.go | 6 +- tools/rosetta/lib/errors/errors.go | 6 +- tools/rosetta/lib/internal/service/block.go | 2 +- tools/rosetta/lib/internal/service/online.go | 2 +- tools/rosetta/types.go | 2 +- types/events.go | 2 +- types/mempool/noop.go | 2 +- types/staking.go | 4 +- x/auth/client/cli/tips.go | 2 +- x/auth/tx/service.go | 8 +- x/bank/types/query.pb.go | 2 +- x/consensus/module.go | 4 +- x/evidence/abci.go | 2 +- x/evidence/keeper/infraction.go | 8 +- x/evidence/types/evidence.go | 2 +- x/genutil/client/cli/genaccount_test.go | 2 +- x/genutil/client/cli/init_test.go | 12 +- x/genutil/client/cli/migrate_test.go | 2 +- x/genutil/client/cli/validate_genesis.go | 4 +- x/genutil/client/cli/validate_genesis_test.go | 2 +- x/genutil/client/testutil/helpers.go | 4 +- x/genutil/doc.go | 2 +- x/genutil/utils.go | 2 +- x/gov/client/utils/query.go | 2 +- x/slashing/simulation/operations_test.go | 4 +- x/staking/genesis.go | 6 +- x/staking/keeper/genesis.go | 2 +- x/staking/keeper/validator_test.go | 4 +- x/staking/simulation/operations_test.go | 4 +- x/staking/testutil/cmt.go | 2 +- x/staking/types/historical_info.go | 2 +- x/staking/types/validator.go | 12 +- x/staking/types/validator_test.go | 6 +- 82 files changed, 384 insertions(+), 331 deletions(-) rename client/grpc/{tmservice => cmtservice}/block.go (97%) rename client/grpc/{tmservice => cmtservice}/query.pb.go (94%) rename client/grpc/{tmservice => cmtservice}/query.pb.gw.go (99%) rename client/grpc/{tmservice => cmtservice}/service.go (96%) rename client/grpc/{tmservice => cmtservice}/status.go (94%) rename client/grpc/{tmservice => cmtservice}/types.go (98%) rename client/grpc/{tmservice => cmtservice}/types.pb.go (89%) rename client/grpc/{tmservice => cmtservice}/util.go (71%) rename tests/e2e/client/grpc/{tmservice => cmtservice}/service_test.go (82%) diff --git a/UPGRADING.md b/UPGRADING.md index f80b798deae2..5da664564148 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -7,11 +7,19 @@ This guide provides instructions for upgrading to specific versions of Cosmos SD ### Consensus Engine The Cosmos SDK has migrated to CometBFT as its default consensus engine. -This is a breaking changes that needs chains to re-generate their protos. -Some functions has been renamed to reflect the naming change, following an exhaustive list: +CometBFT is an implementation of the Tendermint consensus algorithm, and the successor of Tendermint Core. +Due to the import changes, this is a breaking change that needs chains to re-generate their protos. +Some functions have been renamed to reflect the naming change, following an exhaustive list: * `client.TendermintRPC` -> `client.CometRPC` * `clitestutil.MockTendermintRPC` -> `clitestutil.MockCometRPC` +* `clitestutilgenutil.CreateDefaultTendermintConfig` -> `clitestutilgenutil.CreateDefaultCometConfig` +* Package `client/grpc/tmservice` -> `client/grpc/cmtservice` + +Additionally, the commands and flags mentionning `tendermint` have been renamed to `comet`. +However, these commands and flags is still supported for backward compatibility. + +For backward compatibility, the `**/tendermint/**` gRPC services are still supported. ### Configuration diff --git a/api/cosmos/bank/v1beta1/query.pulsar.go b/api/cosmos/bank/v1beta1/query.pulsar.go index b4c5069c17d6..21d552ace042 100644 --- a/api/cosmos/bank/v1beta1/query.pulsar.go +++ b/api/cosmos/bank/v1beta1/query.pulsar.go @@ -11387,7 +11387,7 @@ type QueryAllBalancesRequest struct { Pagination *v1beta11.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` // resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 ResolveDenom bool `protobuf:"varint,3,opt,name=resolve_denom,json=resolveDenom,proto3" json:"resolve_denom,omitempty"` } diff --git a/client/broadcast.go b/client/broadcast.go index 1f90579c3f92..cfc2e9a7689b 100644 --- a/client/broadcast.go +++ b/client/broadcast.go @@ -35,7 +35,12 @@ func (ctx Context) BroadcastTx(txBytes []byte) (res *sdk.TxResponse, err error) return res, err } -// CheckTendermintError checks if the error returned from BroadcastTx is a +// Deprecated: Use CheckCometError instead. +func CheckTendermintError(err error, tx cmttypes.Tx) *sdk.TxResponse { + return CheckCometError(err, tx) +} + +// CheckCometError checks if the error returned from BroadcastTx is a // CometBFT error that is returned before the tx is submitted due to // precondition checks that failed. If an CometBFT error is detected, this // function returns the correct code back in TxResponse. @@ -43,7 +48,7 @@ func (ctx Context) BroadcastTx(txBytes []byte) (res *sdk.TxResponse, err error) // TODO: Avoid brittle string matching in favor of error matching. This requires // a change to CometBFT's RPCError type to allow retrieval or matching against // a concrete error type. -func CheckTendermintError(err error, tx cmttypes.Tx) *sdk.TxResponse { +func CheckCometError(err error, tx cmttypes.Tx) *sdk.TxResponse { if err == nil { return nil } @@ -87,7 +92,7 @@ func (ctx Context) BroadcastTxSync(txBytes []byte) (*sdk.TxResponse, error) { } res, err := node.BroadcastTxSync(context.Background(), txBytes) - if errRes := CheckTendermintError(err, txBytes); errRes != nil { + if errRes := CheckCometError(err, txBytes); errRes != nil { return errRes, nil } @@ -103,7 +108,7 @@ func (ctx Context) BroadcastTxAsync(txBytes []byte) (*sdk.TxResponse, error) { } res, err := node.BroadcastTxAsync(context.Background(), txBytes) - if errRes := CheckTendermintError(err, txBytes); errRes != nil { + if errRes := CheckCometError(err, txBytes); errRes != nil { return errRes, nil } diff --git a/client/flags/flags.go b/client/flags/flags.go index 0814f853ee51..14240e1f0c9f 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -119,7 +119,7 @@ func AddTxFlagsToCmd(cmd *cobra.Command) { f.String(FlagNote, "", "Note to add a description to the transaction (previously --memo)") f.String(FlagFees, "", "Fees to pay along with transaction; eg: 10uatom") f.String(FlagGasPrices, "", "Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)") - f.String(FlagNode, "tcp://localhost:26657", ": to cometbft rpc interface for this chain") + f.String(FlagNode, "tcp://localhost:26657", ": to CometBFT rpc interface for this chain") f.Bool(FlagUseLedger, false, "Use a connected Ledger device") f.Float64(FlagGasAdjustment, DefaultGasAdjustment, "adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored ") f.StringP(FlagBroadcastMode, "b", BroadcastSync, "Transaction broadcasting mode (sync|async)") diff --git a/client/grpc/tmservice/block.go b/client/grpc/cmtservice/block.go similarity index 97% rename from client/grpc/tmservice/block.go rename to client/grpc/cmtservice/block.go index f01f1940e4ee..2880b3f2aaab 100644 --- a/client/grpc/tmservice/block.go +++ b/client/grpc/cmtservice/block.go @@ -1,4 +1,4 @@ -package tmservice +package cmtservice import ( "context" diff --git a/client/grpc/tmservice/query.pb.go b/client/grpc/cmtservice/query.pb.go similarity index 94% rename from client/grpc/tmservice/query.pb.go rename to client/grpc/cmtservice/query.pb.go index a94b274ac04a..d745dca1867e 100644 --- a/client/grpc/tmservice/query.pb.go +++ b/client/grpc/cmtservice/query.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: cosmos/base/tendermint/v1beta1/query.proto -package tmservice +package cmtservice import ( context "context" @@ -1194,95 +1194,95 @@ func init() { } var fileDescriptor_40c93fb3ef485c5d = []byte{ - // 1398 bytes of a gzipped FileDescriptorProto + // 1399 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0x4d, 0x6f, 0x1b, 0xc5, - 0x1b, 0xcf, 0xda, 0x69, 0x6c, 0x3f, 0xee, 0xff, 0x4f, 0x32, 0x0d, 0xad, 0x63, 0xa5, 0x6e, 0x59, - 0x89, 0x36, 0x7d, 0xc9, 0x2e, 0x76, 0x5f, 0x0f, 0xa5, 0xa8, 0x6e, 0x4a, 0x1a, 0x5a, 0x4a, 0xd8, - 0x20, 0x0e, 0x08, 0x69, 0xb5, 0xf6, 0x4e, 0x36, 0xab, 0xd8, 0x3b, 0xd3, 0x9d, 0xb1, 0xc1, 0x42, + 0x1b, 0xcf, 0xda, 0x69, 0x6c, 0x3f, 0xee, 0xff, 0x4f, 0x32, 0x0d, 0xad, 0x63, 0x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xff, + 0x6c, 0xb9, 0x16, 0x28, 0x3b, 0x24, 0x48, 0x50, 0x76, 0x48, 0x20, 0xac, 0xe4, 0xc6, 0x55, 0xbd, + 0x93, 0x6b, 0x91, 0x25, 0x8c, 0x7c, 0xfc, 0xb9, 0xec, 0x58, 0xde, 0x56, 0x1f, 0xc2, 0x57, 0xcc, + 0xec, 0x19, 0x09, 0x5d, 0x2c, 0x85, 0x5d, 0xdf, 0xed, 0xf4, 0x70, 0xa5, 0x20, 0x65, 0xea, 0x03, + 0xdd, 0x80, 0x12, 0x8d, 0x09, 0xd9, 0x74, 0x08, 0x65, 0xb2, 0xcc, 0xe5, 0xe6, 0xd2, 0xb8, 0xae, + 0xad, 0x0b, 0x87, 0x0f, 0x28, 0xb3, 0x8b, 0x54, 0xaf, 0x52, 0x25, 0x28, 0x65, 0x4a, 0xb0, 0x08, + 0x25, 0x41, 0x85, 0x51, 0xd7, 0xc3, 0x15, 0x50, 0x7b, 0x66, 0x28, 0x78, 0x6f, 0xba, 0x98, 0x9b, + 0xcd, 0xd7, 0xaf, 0x43, 0x41, 0x47, 0x14, 0xfc, 0xc4, 0xc8, 0x49, 0xba, 0x28, 0xd6, 0x09, 0x93, + 0xdc, 0x88, 0x49, 0xd2, 0x97, 0xfc, 0xa8, 0x2f, 0xf5, 0x75, 0x28, 0x26, 0xb0, 0xd0, 0x0a, 0xe4, + 0x05, 0x1b, 0x43, 0xee, 0xc1, 0x93, 0x13, 0xb2, 0x69, 0x95, 0x1e, 0xfe, 0x75, 0x6c, 0xea, 0xfe, + 0xbf, 0x3f, 0x9e, 0x36, 0x6c, 0xe1, 0xde, 0xfc, 0x01, 0xa0, 0xb0, 0x81, 0xe3, 0x7e, 0xe8, 0x61, + 0xf4, 0xbd, 0x01, 0xe5, 0xd4, 0x54, 0x41, 0xcd, 0x71, 0x41, 0x5f, 0x9c, 0x4c, 0xd5, 0x73, 0x7b, + 0xf2, 0x51, 0xdb, 0xa2, 0xde, 0xf8, 0xfa, 0x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, 0x2b, 0x03, 0xbd, 0x35, + 0x0e, 0xce, 0xf3, 0x17, 0x59, 0xb5, 0xb1, 0x07, 0x0f, 0x0d, 0xb9, 0x29, 0x21, 0x9f, 0x45, 0xa7, + 0xc7, 0x41, 0x76, 0xdb, 0x5e, 0xe8, 0xc8, 0x9f, 0x23, 0xad, 0xdb, 0x0f, 0x9f, 0xd6, 0x8c, 0x47, + 0x4f, 0x6b, 0xc6, 0xdf, 0x4f, 0x6b, 0xc6, 0xb7, 0xcf, 0x6a, 0x53, 0x8f, 0x9e, 0xd5, 0xa6, 0x9e, + 0x3c, 0xab, 0x4d, 0x7d, 0x72, 0x2e, 0x08, 0xf9, 0x56, 0xaf, 0x6d, 0x7a, 0xa4, 0x9b, 0xc4, 0x53, + 0xff, 0x96, 0x99, 0xbf, 0x6d, 0x79, 0x9d, 0x10, 0x47, 0xdc, 0x0a, 0x62, 0xea, 0x59, 0x5e, 0x97, + 0x33, 0x35, 0x74, 0xdb, 0x33, 0xf2, 0x17, 0xc6, 0xb9, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb1, + 0x95, 0x6a, 0x8c, 0xdd, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/client/grpc/tmservice/query.pb.gw.go b/client/grpc/cmtservice/query.pb.gw.go similarity index 99% rename from client/grpc/tmservice/query.pb.gw.go rename to client/grpc/cmtservice/query.pb.gw.go index 36727c4ca4e7..e169618c93c8 100644 --- a/client/grpc/tmservice/query.pb.gw.go +++ b/client/grpc/cmtservice/query.pb.gw.go @@ -2,11 +2,11 @@ // source: cosmos/base/tendermint/v1beta1/query.proto /* -Package tmservice is a reverse proxy. +Package cmtservice is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ -package tmservice +package cmtservice import ( "context" diff --git a/client/grpc/tmservice/service.go b/client/grpc/cmtservice/service.go similarity index 96% rename from client/grpc/tmservice/service.go rename to client/grpc/cmtservice/service.go index 68d1cf742e06..82b23d75ebe8 100644 --- a/client/grpc/tmservice/service.go +++ b/client/grpc/cmtservice/service.go @@ -1,4 +1,4 @@ -package tmservice +package cmtservice import ( "context" @@ -33,7 +33,7 @@ type ( } ) -// NewQueryServer creates a new tendermint query server. +// NewQueryServer creates a new CometBFT query server. func NewQueryServer( clientCtx client.Context, interfaceRegistry codectypes.InterfaceRegistry, @@ -245,7 +245,7 @@ func (s queryServer) ABCIQuery(ctx context.Context, req *ABCIQueryRequest) (*ABC return FromABCIResponseQuery(res), nil } -// RegisterTendermintService registers the tendermint queries on the gRPC router. +// RegisterTendermintService registers the CometBFT queries on the gRPC router. func RegisterTendermintService( clientCtx client.Context, server gogogrpc.Server, @@ -255,7 +255,7 @@ func RegisterTendermintService( RegisterServiceServer(server, NewQueryServer(clientCtx, iRegistry, queryFn)) } -// RegisterGRPCGatewayRoutes mounts the tendermint service's GRPC-gateway routes on the +// RegisterGRPCGatewayRoutes mounts the CometBFT service's GRPC-gateway routes on the // given Mux. func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux) { _ = RegisterServiceHandlerClient(context.Background(), mux, NewServiceClient(clientConn)) diff --git a/client/grpc/tmservice/status.go b/client/grpc/cmtservice/status.go similarity index 94% rename from client/grpc/tmservice/status.go rename to client/grpc/cmtservice/status.go index e72de35897fc..9f03a71a7672 100644 --- a/client/grpc/tmservice/status.go +++ b/client/grpc/cmtservice/status.go @@ -1,4 +1,4 @@ -package tmservice +package cmtservice import ( "context" diff --git a/client/grpc/tmservice/types.go b/client/grpc/cmtservice/types.go similarity index 98% rename from client/grpc/tmservice/types.go rename to client/grpc/cmtservice/types.go index 11d92f01a449..b47f55dae938 100644 --- a/client/grpc/tmservice/types.go +++ b/client/grpc/cmtservice/types.go @@ -1,4 +1,4 @@ -package tmservice +package cmtservice import ( abci "github.com/cometbft/cometbft/abci/types" diff --git a/client/grpc/tmservice/types.pb.go b/client/grpc/cmtservice/types.pb.go similarity index 89% rename from client/grpc/tmservice/types.pb.go rename to client/grpc/cmtservice/types.pb.go index 79e12e42b0b3..4ced0c8fd02a 100644 --- a/client/grpc/tmservice/types.pb.go +++ b/client/grpc/cmtservice/types.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: cosmos/base/tendermint/v1beta1/types.proto -package tmservice +package cmtservice import ( fmt "fmt" @@ -267,48 +267,48 @@ func init() { } var fileDescriptor_bb9931519c08e0d6 = []byte{ - // 645 bytes of a gzipped FileDescriptorProto + // 647 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0xcd, 0x6e, 0xd3, 0x4e, 0x14, 0xc5, 0xe3, 0x36, 0xcd, 0xc7, 0xa4, 0xe9, 0xc7, 0xa8, 0xaa, 0xdc, 0xfc, 0xff, 0x38, 0x55, - 0x11, 0xa5, 0x54, 0xc2, 0xa6, 0x45, 0x2c, 0x58, 0xb0, 0x20, 0x6d, 0xa5, 0x46, 0xea, 0xca, 0x42, - 0x2c, 0xd8, 0x44, 0x13, 0x7b, 0xb0, 0x47, 0xb5, 0x3d, 0x96, 0x67, 0x12, 0xc1, 0x33, 0xb0, 0xe9, - 0x63, 0xb0, 0xe4, 0x31, 0xba, 0xec, 0x92, 0x55, 0x41, 0xe9, 0x82, 0x27, 0x60, 0x8f, 0xe6, 0xce, - 0xb8, 0x75, 0x88, 0xc4, 0x26, 0xb1, 0xcf, 0xfd, 0xdd, 0x93, 0xb9, 0xe7, 0x8e, 0x82, 0x0e, 0x03, - 0x2e, 0x52, 0x2e, 0xbc, 0x31, 0x11, 0xd4, 0x93, 0x34, 0x0b, 0x69, 0x91, 0xb2, 0x4c, 0x7a, 0xd3, - 0xa3, 0x31, 0x95, 0xe4, 0xc8, 0x93, 0x9f, 0x73, 0x2a, 0xdc, 0xbc, 0xe0, 0x92, 0x63, 0x47, 0xb3, - 0xae, 0x62, 0xdd, 0x07, 0xd6, 0x35, 0x6c,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 0x4c, 0x7a, 0x51, 0x91, 0x07, 0x5e, 0x90, 0x4a, 0x41, + 0x8b, 0x29, 0x0b, 0xe8, 0xb8, 0x01, 0x37, 0xe4, 0xf8, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, + 0x0c, 0x32, 0xb7, 0xd2, 0x04, 0x00, 0x00, } func (m *Block) Marshal() (dAtA []byte, err error) { diff --git a/client/grpc/tmservice/util.go b/client/grpc/cmtservice/util.go similarity index 71% rename from client/grpc/tmservice/util.go rename to client/grpc/cmtservice/util.go index ef5083a3a364..cabde56b08ce 100644 --- a/client/grpc/tmservice/util.go +++ b/client/grpc/cmtservice/util.go @@ -1,12 +1,12 @@ -package tmservice +package cmtservice import ( - tmprototypes "github.com/cometbft/cometbft/proto/tendermint/types" + cmtprototypes "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" ) -// convertHeader converts tendermint header to sdk header -func convertHeader(h tmprototypes.Header) Header { +// convertHeader converts CometBFT header to sdk header +func convertHeader(h cmtprototypes.Header) Header { return Header{ Version: h.Version, ChainID: h.ChainID, @@ -25,8 +25,8 @@ func convertHeader(h tmprototypes.Header) Header { } } -// convertBlock converts tendermint block to sdk block -func convertBlock(tmblock *tmprototypes.Block) *Block { +// convertBlock converts CometBFT block to sdk block +func convertBlock(tmblock *cmtprototypes.Block) *Block { b := new(Block) b.Header = convertHeader(tmblock.Header) diff --git a/client/grpc_query.go b/client/grpc_query.go index 7617ced5517a..569eff03f48d 100644 --- a/client/grpc_query.go +++ b/client/grpc_query.go @@ -33,7 +33,7 @@ var fallBackCodec = codec.NewProtoCodec(failingInterfaceRegistry{}) // Invoke implements the grpc ClientConn.Invoke method func (ctx Context) Invoke(grpcCtx gocontext.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error) { // Two things can happen here: - // 1. either we're broadcasting a Tx, in which call we call Tendermint's broadcast endpoint directly, + // 1. either we're broadcasting a Tx, in which call we call CometBFT's broadcast endpoint directly, // 2-1. or we are querying for state, in which case we call grpc if grpc client set. // 2-2. or we are querying for state, in which case we call ABCI's Query if grpc client not set. diff --git a/client/keys/root.go b/client/keys/root.go index 6faf2f462ce2..855a50798168 100644 --- a/client/keys/root.go +++ b/client/keys/root.go @@ -14,7 +14,7 @@ func Commands(defaultNodeHome string) *cobra.Command { Use: "keys", Short: "Manage your application's keys", Long: `Keyring management commands. These keys may be in any format supported by the -Tendermint crypto library and can be used by light-clients, full nodes, or any other application +CometBFT crypto library and can be used by light-clients, full nodes, or any other application that needs to sign with a private key. The keyring supports the following backends: diff --git a/client/rpc/status.go b/client/rpc/status.go index 841cc78a7509..448ad8722543 100644 --- a/client/rpc/status.go +++ b/client/rpc/status.go @@ -15,7 +15,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) -// ValidatorInfo is info about the node's validator, same as Tendermint, +// ValidatorInfo is info about the node's validator, same as CometBFT, // except that we use our own PubKey. type validatorInfo struct { Address bytes.HexBytes @@ -23,7 +23,7 @@ type validatorInfo struct { VotingPower int64 } -// ResultStatus is node's info, same as Tendermint, except that we use our own +// ResultStatus is node's info, same as CometBFT, except that we use our own // PubKey. type resultStatus struct { NodeInfo p2p.DefaultNodeInfo @@ -50,7 +50,7 @@ func StatusCommand() *cobra.Command { var pk cryptotypes.PubKey // `status` has TM pubkeys, we need to convert them to our pubkeys. if status.ValidatorInfo.PubKey != nil { - pk, err = cryptocodec.FromTmPubKeyInterface(status.ValidatorInfo.PubKey) + pk, err = cryptocodec.FromCmtPubKeyInterface(status.ValidatorInfo.PubKey) if err != nil { return err } diff --git a/client/rpc/validators.go b/client/rpc/validators.go index c1ad49ab06e2..55c2262a8881 100644 --- a/client/rpc/validators.go +++ b/client/rpc/validators.go @@ -22,9 +22,10 @@ import ( // ValidatorCommand returns the validator set for a given height func ValidatorCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "tendermint-validator-set [height]", - Short: "Get the full tendermint validator set at given height", - Args: cobra.MaximumNArgs(1), + Use: "comet-validator-set [height]", + Aliases: []string{"cometbft-validator-set", "tendermint-validator-set"}, + Short: "Get the full CometBFT validator set at given height", + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -101,7 +102,7 @@ func (rvo ResultValidatorsOutput) String() string { } func validatorOutput(validator *cmttypes.Validator) (ValidatorOutput, error) { - pk, err := cryptocodec.FromTmPubKeyInterface(validator.PubKey) + pk, err := cryptocodec.FromCmtPubKeyInterface(validator.PubKey) if err != nil { return ValidatorOutput{}, err } diff --git a/client/tx/tx.go b/client/tx/tx.go index 420119cc7b07..9311bbd2908f 100644 --- a/client/tx/tx.go +++ b/client/tx/tx.go @@ -120,7 +120,7 @@ func BroadcastTx(clientCtx client.Context, txf Factory, msgs ...sdk.Msg) error { return err } - // broadcast to a Tendermint node + // broadcast to a CometBFT node res, err := clientCtx.BroadcastTx(txBytes) if err != nil { return err diff --git a/client/utils.go b/client/utils.go index 1c5ef0a33704..e2f3a2a4cfc8 100644 --- a/client/utils.go +++ b/client/utils.go @@ -73,7 +73,7 @@ func ReadPageRequest(flagSet *pflag.FlagSet) (*query.PageRequest, error) { }, nil } -// NewClientFromNode sets up Client implementation that communicates with a Tendermint node over +// NewClientFromNode sets up Client implementation that communicates with a CometBFT node over // JSON RPC and WebSockets func NewClientFromNode(nodeURI string) (*rpchttp.HTTP, error) { return rpchttp.New(nodeURI, "/websocket") diff --git a/codec/amino.go b/codec/amino.go index 0986df5e115f..f17dbcc4a43f 100644 --- a/codec/amino.go +++ b/codec/amino.go @@ -27,7 +27,7 @@ func NewLegacyAmino() *LegacyAmino { return &LegacyAmino{amino.NewCodec()} } -// RegisterEvidences registers Tendermint evidence types with the provided Amino +// RegisterEvidences registers CometBFT evidence types with the provided Amino // codec. func RegisterEvidences(cdc *LegacyAmino) { cdc.Amino.RegisterInterface((*cmttypes.Evidence)(nil), nil) diff --git a/codec/legacy/codec.go b/codec/legacy/codec.go index 0bc2e74993b8..b552dc7fb008 100644 --- a/codec/legacy/codec.go +++ b/codec/legacy/codec.go @@ -8,7 +8,7 @@ import ( ) // Cdc defines a global generic sealed Amino codec to be used throughout sdk. It -// has all Tendermint crypto and evidence types registered. +// has all CometBFT crypto and evidence types registered. // // TODO: Deprecated - remove this global. var Cdc = codec.NewLegacyAmino() diff --git a/crypto/codec/cmt.go b/crypto/codec/cmt.go index dfb3fe01cddb..bf11c8f47c3d 100644 --- a/crypto/codec/cmt.go +++ b/crypto/codec/cmt.go @@ -1,6 +1,7 @@ package codec import ( + "cosmossdk.io/errors" cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/cometbft/cometbft/crypto/encoding" cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" @@ -11,8 +12,8 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// FromTmProtoPublicKey converts a TM's cmtprotocrypto.PublicKey into our own PubKey. -func FromTmProtoPublicKey(protoPk cmtprotocrypto.PublicKey) (cryptotypes.PubKey, error) { +// FromCmtProtoPublicKey converts a CMT's cmtprotocrypto.PublicKey into our own PubKey. +func FromCmtProtoPublicKey(protoPk cmtprotocrypto.PublicKey) (cryptotypes.PubKey, error) { switch protoPk := protoPk.Sum.(type) { case *cmtprotocrypto.PublicKey_Ed25519: return &ed25519.PubKey{ @@ -23,12 +24,12 @@ func FromTmProtoPublicKey(protoPk cmtprotocrypto.PublicKey) (cryptotypes.PubKey, Key: protoPk.Secp256K1, }, nil default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot convert %v from Tendermint public key", protoPk) + return nil, errors.Wrapf(sdkerrors.ErrInvalidType, "cannot convert %v from Tendermint public key", protoPk) } } -// ToTmProtoPublicKey converts our own PubKey to TM's cmtprotocrypto.PublicKey. -func ToTmProtoPublicKey(pk cryptotypes.PubKey) (cmtprotocrypto.PublicKey, error) { +// ToCmtProtoPublicKey converts our own PubKey to Cmt's cmtprotocrypto.PublicKey. +func ToCmtProtoPublicKey(pk cryptotypes.PubKey) (cmtprotocrypto.PublicKey, error) { switch pk := pk.(type) { case *ed25519.PubKey: return cmtprotocrypto.PublicKey{ @@ -43,26 +44,48 @@ func ToTmProtoPublicKey(pk cryptotypes.PubKey) (cmtprotocrypto.PublicKey, error) }, }, nil default: - return cmtprotocrypto.PublicKey{}, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot convert %v to Tendermint public key", pk) + return cmtprotocrypto.PublicKey{}, errors.Wrapf(sdkerrors.ErrInvalidType, "cannot convert %v to Tendermint public key", pk) } } -// FromTmPubKeyInterface converts TM's cmtcrypto.PubKey to our own PubKey. -func FromTmPubKeyInterface(tmPk cmtcrypto.PubKey) (cryptotypes.PubKey, error) { +// FromCmtPubKeyInterface converts CMT's cmtcrypto.PubKey to our own PubKey. +func FromCmtPubKeyInterface(tmPk cmtcrypto.PubKey) (cryptotypes.PubKey, error) { tmProtoPk, err := encoding.PubKeyToProto(tmPk) if err != nil { return nil, err } - return FromTmProtoPublicKey(tmProtoPk) + return FromCmtProtoPublicKey(tmProtoPk) } -// ToTmPubKeyInterface converts our own PubKey to TM's cmtcrypto.PubKey. -func ToTmPubKeyInterface(pk cryptotypes.PubKey) (cmtcrypto.PubKey, error) { - tmProtoPk, err := ToTmProtoPublicKey(pk) +// ToCmtPubKeyInterface converts our own PubKey to CMT's cmtcrypto.PubKey. +func ToCmtPubKeyInterface(pk cryptotypes.PubKey) (cmtcrypto.PubKey, error) { + tmProtoPk, err := ToCmtProtoPublicKey(pk) if err != nil { return nil, err } return encoding.PubKeyFromProto(tmProtoPk) } + +// ---------------------- + +// Deprecated: use FromCmtProtoPublicKey instead. +func FromTmProtoPublicKey(protoPk cmtprotocrypto.PublicKey) (cryptotypes.PubKey, error) { + return FromCmtProtoPublicKey(protoPk) +} + +// Deprecated: use ToCmtProtoPublicKey instead. +func ToTmProtoPublicKey(pk cryptotypes.PubKey) (cmtprotocrypto.PublicKey, error) { + return ToCmtProtoPublicKey(pk) +} + +// Deprecated: use FromCmtPubKeyInterface instead. +func FromTmPubKeyInterface(tmPk cmtcrypto.PubKey) (cryptotypes.PubKey, error) { + return FromCmtPubKeyInterface(tmPk) +} + +// Deprecated: use ToCmtPubKeyInterface instead. +func ToTmPubKeyInterface(pk cryptotypes.PubKey) (cmtcrypto.PubKey, error) { + return ToCmtPubKeyInterface(pk) +} diff --git a/crypto/keys/ed25519/ed25519_test.go b/crypto/keys/ed25519/ed25519_test.go index 800f82840bbc..57c6f0563f3a 100644 --- a/crypto/keys/ed25519/ed25519_test.go +++ b/crypto/keys/ed25519/ed25519_test.go @@ -189,7 +189,7 @@ func TestMarshalAmino_BackwardsCompatibility(t *testing.T) { // Create Tendermint keys. tmPrivKey := tmed25519.GenPrivKey() tmPubKey := tmPrivKey.PubKey() - // Create our own keys, with the same private key as Tendermint's. + // Create our own keys, with the same private key as CometBFT's. privKey := &ed25519.PrivKey{Key: []byte(tmPrivKey)} pubKey := privKey.PubKey().(*ed25519.PubKey) diff --git a/docs/architecture/adr-032-typed-events.md b/docs/architecture/adr-032-typed-events.md index c218f9739e54..c1dd0a73c7ae 100644 --- a/docs/architecture/adr-032-typed-events.md +++ b/docs/architecture/adr-032-typed-events.md @@ -109,7 +109,7 @@ func ParseTypedEvent(event abci.Event) (proto.Message, error) { Here, the `EmitTypedEvent` is a method on `EventManager` which takes typed event as input and apply json serialization on it. Then it maps the JSON key/value pairs to `event.Attributes` and emits it in form of `sdk.Event`. `Event.Type` will be the type URL of the proto message. -When we subscribe to emitted events on the cometbft websocket, they are emitted in the form of an `abci.Event`. `ParseTypedEvent` parses the event back to it's original proto message. +When we subscribe to emitted events on the CometBFT websocket, they are emitted in the form of an `abci.Event`. `ParseTypedEvent` parses the event back to it's original proto message. **Step-2**: Add proto definitions for typed events for msgs in each module: diff --git a/proto/cosmos/base/tendermint/v1beta1/query.proto b/proto/cosmos/base/tendermint/v1beta1/query.proto index 1f17b0a6a376..6de6f2cdbc7d 100644 --- a/proto/cosmos/base/tendermint/v1beta1/query.proto +++ b/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -12,7 +12,7 @@ import "cosmos_proto/cosmos.proto"; import "tendermint/types/block.proto"; import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"; // Service defines the gRPC querier service for tendermint queries. service Service { diff --git a/proto/cosmos/base/tendermint/v1beta1/types.proto b/proto/cosmos/base/tendermint/v1beta1/types.proto index 6506997bda73..624ff414910b 100644 --- a/proto/cosmos/base/tendermint/v1beta1/types.proto +++ b/proto/cosmos/base/tendermint/v1beta1/types.proto @@ -8,7 +8,7 @@ import "tendermint/version/types.proto"; import "google/protobuf/timestamp.proto"; import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"; // Block is tendermint type Block, with the Header proposer address // field converted to bech32 string. diff --git a/runtime/app.go b/runtime/app.go index ca7301dcf4e2..7388ec9faa23 100644 --- a/runtime/app.go +++ b/runtime/app.go @@ -14,8 +14,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server/api" @@ -141,8 +141,8 @@ func (a *App) RegisterAPIRoutes(apiSvr *api.Server, _ config.APIConfig) { // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + // Register new CometBFT queries routes from grpc-gateway. + cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register node gRPC service for grpc-gateway. nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) @@ -158,7 +158,7 @@ func (a *App) RegisterTxService(clientCtx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (a *App) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( + cmtservice.RegisterTendermintService( clientCtx, a.GRPCQueryRouter(), a.interfaceRegistry, diff --git a/server/api/server.go b/server/api/server.go index 1ed2d0724f96..ff5a0e823bbe 100644 --- a/server/api/server.go +++ b/server/api/server.go @@ -86,9 +86,9 @@ func New(clientCtx client.Context, logger log.Logger, grpcSrv *grpc.Server) *Ser } } -// Start starts the API server. Internally, the API server leverages Tendermint's +// Start starts the API server. Internally, the API server leverages CometBFT's // JSON RPC server. Configuration options are provided via config.APIConfig -// and are delegated to the Tendermint JSON RPC server. The process is +// and are delegated to the CometBFT JSON RPC server. The process is // non-blocking, so an external signal handler must be used. func (s *Server) Start(cfg config.Config) error { s.mtx.Lock() diff --git a/server/api/server_test.go b/server/api/server_test.go index 0c792595aa22..ca906dccdd48 100644 --- a/server/api/server_test.go +++ b/server/api/server_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/suite" "google.golang.org/grpc/codes" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/testutil/network" @@ -73,13 +73,13 @@ func (s *GRPCWebTestSuite) Test_Latest_Validators() { headers, trailers, responses, err := s.makeGrpcRequest( "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet", headerWithFlag(), - serializeProtoMessages([]proto.Message{&tmservice.GetLatestValidatorSetRequest{}}), false) + serializeProtoMessages([]proto.Message{&cmtservice.GetLatestValidatorSetRequest{}}), false) s.Require().NoError(err) s.Require().Equal(1, len(responses)) s.assertTrailerGrpcCode(trailers, codes.OK, "") s.assertContentTypeSet(headers, contentType) - var valsSet tmservice.GetLatestValidatorSetResponse + var valsSet cmtservice.GetLatestValidatorSetResponse err = s.protoCdc.Unmarshal(responses[0], &valsSet) s.Require().NoError(err) pubKey, ok := valsSet.Validators[0].PubKey.GetCachedValue().(cryptotypes.PubKey) diff --git a/server/cmt_cmds.go b/server/cmt_cmds.go index ba7552405d3a..131444aa062e 100644 --- a/server/cmt_cmds.go +++ b/server/cmt_cmds.go @@ -5,7 +5,7 @@ import ( "github.com/cometbft/cometbft/p2p" pvm "github.com/cometbft/cometbft/privval" - tversion "github.com/cometbft/cometbft/version" + cmtversion "github.com/cometbft/cometbft/version" "github.com/spf13/cobra" "sigs.k8s.io/yaml" @@ -49,7 +49,7 @@ func ShowValidatorCmd() *cobra.Command { return err } - sdkPK, err := cryptocodec.FromTmPubKeyInterface(pk) + sdkPK, err := cryptocodec.FromCmtPubKeyInterface(pk) if err != nil { return err } @@ -96,21 +96,21 @@ func VersionCmd() *cobra.Command { Long: "Print protocols' and libraries' version numbers against which this app has been compiled.", RunE: func(cmd *cobra.Command, args []string) error { bs, err := yaml.Marshal(&struct { - Tendermint string + CometBFT string ABCI string BlockProtocol uint64 P2PProtocol uint64 }{ - Tendermint: tversion.TMCoreSemVer, - ABCI: tversion.ABCIVersion, - BlockProtocol: tversion.BlockProtocol, - P2PProtocol: tversion.P2PProtocol, + CometBFT: cmtversion.TMCoreSemVer, + ABCI: cmtversion.ABCIVersion, + BlockProtocol: cmtversion.BlockProtocol, + P2PProtocol: cmtversion.P2PProtocol, }) if err != nil { return err } - fmt.Println(string(bs)) + cmd.Print(string(bs)) return nil }, } diff --git a/server/rollback.go b/server/rollback.go index 36f1ec5c20d6..9be4dfa32c37 100644 --- a/server/rollback.go +++ b/server/rollback.go @@ -36,7 +36,7 @@ application. // rollback CometBFT state height, hash, err := cmtcmd.RollbackState(ctx.Config, removeBlock) if err != nil { - return fmt.Errorf("failed to rollback cometbft state: %w", err) + return fmt.Errorf("failed to rollback CometBFT state: %w", err) } // rollback the multistore diff --git a/server/start.go b/server/start.go index b23f8474e678..d0ebec393dd7 100644 --- a/server/start.go +++ b/server/start.go @@ -15,6 +15,7 @@ import ( "github.com/cometbft/cometbft/proxy" "github.com/cometbft/cometbft/rpc/client/local" "github.com/spf13/cobra" + "github.com/spf13/pflag" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -33,7 +34,7 @@ import ( const ( // CometBFT full-node start flags - flagWithTendermint = "with-tendermint" + flagWithComet = "with-comet" flagAddress = "address" flagTransport = "transport" flagTraceStore = "trace-store" @@ -131,8 +132,8 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. return err } - withTM, _ := cmd.Flags().GetBool(flagWithTendermint) - if !withTM { + withCMT, _ := cmd.Flags().GetBool(flagWithComet) + if !withCMT { serverCtx.Logger.Info("starting ABCI without CometBFT") return startStandAlone(serverCtx, appCreator) } @@ -150,7 +151,7 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. } cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") - cmd.Flags().Bool(flagWithTendermint, true, "Run abci app embedded in-process with CometBFT") + cmd.Flags().Bool(flagWithComet, true, "Run abci app embedded in-process with CometBFT") cmd.Flags().String(flagAddress, "tcp://0.0.0.0:26658", "Listen address") cmd.Flags().String(flagTransport, "socket", "Transport protocol: socket, grpc") cmd.Flags().String(flagTraceStore, "", "Enable KVStore tracing to an output file") @@ -189,6 +190,15 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. cmd.Flags().Int(FlagMempoolMaxTxs, mempool.DefaultMaxTx, "Sets MaxTx value for the app-side mempool") + // support old flags name for backwards compatibility + cmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { + if name == "with-tendermint" { + name = flagWithComet + } + + return pflag.NormalizedName(name) + }) + // add support for all CometBFT-specific command line options tcmd.AddNodeFlags(cmd) return cmd diff --git a/server/util.go b/server/util.go index efabbb3e00de..712eec749276 100644 --- a/server/util.go +++ b/server/util.go @@ -282,7 +282,7 @@ func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customCo func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator types.AppCreator, appExport types.AppExporter, addStartFlags types.ModuleInitFlags) { cometCmd := &cobra.Command{ Use: "comet", - Aliases: []string{"cmt", "cometbft", "tendermint"}, + Aliases: []string{"cometbft", "tendermint"}, Short: "CometBFT subcommands", } diff --git a/server/util_test.go b/server/util_test.go index d8f34487af9d..d60446f6b386 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -68,9 +68,9 @@ func TestInterceptConfigsPreRunHandlerCreatesConfigFilesWhenMissing(t *testing.T t.Fatal("config.toml created as empty file") } - // Test that tendermint config is initialized + // Test that CometBFT config is initialized if serverCtx.Config == nil { - t.Fatal("tendermint config not created") + t.Fatal("CometBFT config not created") } // Test that app.toml is created diff --git a/simapp/README.md b/simapp/README.md index a235d3ed33f5..08d476708e6a 100644 --- a/simapp/README.md +++ b/simapp/README.md @@ -16,7 +16,7 @@ in this testnet. `simd` binary inside a new `build` directory. The following instructions are run from inside the `build` directory. 2. If you've run `simd` before, you may need to reset your database before starting a new - testnet. You can reset your database with the following command: `$ ./simd tendermint unsafe-reset-all`. + testnet. You can reset your database with the following command: `$ ./simd comet unsafe-reset-all`. 3. `$ ./simd init [moniker] --chain-id [chain-id]`. This will initialize a new working directory at the default location `~/.simapp`. You need to provide a "moniker" and a "chain id". These two names can be anything, but you will need to use the same "chain id" in the following steps. @@ -42,11 +42,11 @@ in this testnet. persistent_peers = "[validator_address]@[ip_address]:[port],[validator_address]@[ip_address]:[port]" ``` - You can find `validator_address` by running `$ ./simd tendermint show-node-id`. The output will + You can find `validator_address` by running `$ ./simd comet show-node-id`. The output will be the hex-encoded `validator_address`. The default `port` is 26656. 10. Now you can start your nodes: `$ ./simd start`. -Now you have a small testnet that you can use to try out changes to the Cosmos SDK or Tendermint! +Now you have a small testnet that you can use to try out changes to the Cosmos SDK or CometBFT! NOTE: Sometimes creating the network through the `collect-gentxs` will fail, and validators will start in a funny state (and then panic). If this happens, you can try to create and start the network first diff --git a/simapp/app.go b/simapp/app.go index 81ae8f39a8d6..1c3ccb859828 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -37,8 +37,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -672,8 +672,8 @@ func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICon // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + // Register new CometBFT queries routes from grpc-gateway. + cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register node gRPC service for grpc-gateway. nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) @@ -694,7 +694,7 @@ func (app *SimApp) RegisterTxService(clientCtx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *SimApp) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( + cmtservice.RegisterTendermintService( clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, diff --git a/simapp/export.go b/simapp/export.go index dc87e718a1a5..eb2e94823149 100644 --- a/simapp/export.go +++ b/simapp/export.go @@ -22,7 +22,7 @@ func (app *SimApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAd ctx := app.NewContext(true, cmtproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which - // Tendermint will start InitChain. + // CometBFT will start InitChain. height := app.LastBlockHeight() + 1 if forZeroHeight { height = 0 diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index b38c9976fee9..c830137aceb4 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -97,7 +97,7 @@ func NewRootCmd() *cobra.Command { } customAppTemplate, customAppConfig := initAppConfig() - customCMTConfig := initTendermintConfig() + customCMTConfig := initCometBFTConfig() return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customCMTConfig) }, @@ -112,9 +112,9 @@ func NewRootCmd() *cobra.Command { return rootCmd } -// initTendermintConfig helps to override default Tendermint Config values. +// initCometBFTConfig helps to override default CometBFT Config values. // return cmtcfg.DefaultConfig if no custom configuration is required for the application. -func initTendermintConfig() *cmtcfg.Config { +func initCometBFTConfig() *cmtcfg.Config { cfg := cmtcfg.DefaultConfig() // these values put a higher strain on node memory diff --git a/simapp/simd/cmd/testnet_test.go b/simapp/simd/cmd/testnet_test.go index 12df0b23ca7f..4905d634ac7e 100644 --- a/simapp/simd/cmd/testnet_test.go +++ b/simapp/simd/cmd/testnet_test.go @@ -25,7 +25,7 @@ func Test_TestnetCmd(t *testing.T) { home := t.TempDir() encodingConfig := moduletestutil.MakeTestEncodingConfig(staking.AppModuleBasic{}, auth.AppModuleBasic{}) logger := log.NewNopLogger() - cfg, err := genutiltest.CreateDefaultTendermintConfig(home) + cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) err = genutiltest.ExecInitCmd(simapp.ModuleBasics, home, encodingConfig.Codec) diff --git a/simapp/state.go b/simapp/state.go index 99e00b7be118..ef3af1cee1d4 100644 --- a/simapp/state.go +++ b/simapp/state.go @@ -206,7 +206,7 @@ func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile str } var genesis cmttypes.GenesisDoc - // NOTE: CometNFT uses a custom JSON decoder for GenesisDoc + // NOTE: CometBFT uses a custom JSON decoder for GenesisDoc err = cmtjson.Unmarshal(bytes, &genesis) if err != nil { panic(err) diff --git a/simapp/upgrades.go b/simapp/upgrades.go index 9d3525976f3b..73b08747abce 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -24,7 +24,7 @@ func (app SimApp) RegisterUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler( UpgradeName, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - // Migrate Tendermint consensus parameters from x/params module to a + // Migrate CometBFT consensus parameters from x/params module to a // dedicated x/consensus module. baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) diff --git a/tests/e2e/client/grpc/tmservice/service_test.go b/tests/e2e/client/grpc/cmtservice/service_test.go similarity index 82% rename from tests/e2e/client/grpc/tmservice/service_test.go rename to tests/e2e/client/grpc/cmtservice/service_test.go index a3e6f2f9fb30..7f181cfb9ccc 100644 --- a/tests/e2e/client/grpc/tmservice/service_test.go +++ b/tests/e2e/client/grpc/cmtservice/service_test.go @@ -1,7 +1,7 @@ //go:build e2e // +build e2e -package tmservice_test +package cmtservice_test import ( "context" @@ -11,7 +11,7 @@ import ( "cosmossdk.io/simapp" "github.com/stretchr/testify/suite" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/testutil" @@ -28,7 +28,7 @@ type E2ETestSuite struct { cfg network.Config network *network.Network - queryClient tmservice.ServiceClient + queryClient cmtservice.ServiceClient } func TestE2ETestSuite(t *testing.T) { @@ -48,7 +48,7 @@ func (s *E2ETestSuite) SetupSuite() { s.Require().NoError(s.network.WaitForNextBlock()) - s.queryClient = tmservice.NewServiceClient(s.network.Validators[0].ClientCtx) + s.queryClient = cmtservice.NewServiceClient(s.network.Validators[0].ClientCtx) } func (s *E2ETestSuite) TearDownSuite() { @@ -59,13 +59,13 @@ func (s *E2ETestSuite) TearDownSuite() { func (s *E2ETestSuite) TestQueryNodeInfo() { val := s.network.Validators[0] - res, err := s.queryClient.GetNodeInfo(context.Background(), &tmservice.GetNodeInfoRequest{}) + res, err := s.queryClient.GetNodeInfo(context.Background(), &cmtservice.GetNodeInfoRequest{}) s.Require().NoError(err) s.Require().Equal(res.ApplicationVersion.AppName, version.NewInfo().AppName) restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/node_info", val.APIAddress)) s.Require().NoError(err) - var getInfoRes tmservice.GetNodeInfoResponse + var getInfoRes cmtservice.GetNodeInfoResponse s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &getInfoRes)) s.Require().Equal(getInfoRes.ApplicationVersion.AppName, version.NewInfo().AppName) } @@ -73,24 +73,24 @@ func (s *E2ETestSuite) TestQueryNodeInfo() { func (s *E2ETestSuite) TestQuerySyncing() { val := s.network.Validators[0] - _, err := s.queryClient.GetSyncing(context.Background(), &tmservice.GetSyncingRequest{}) + _, err := s.queryClient.GetSyncing(context.Background(), &cmtservice.GetSyncingRequest{}) s.Require().NoError(err) restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/syncing", val.APIAddress)) s.Require().NoError(err) - var syncingRes tmservice.GetSyncingResponse + var syncingRes cmtservice.GetSyncingResponse s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &syncingRes)) } func (s *E2ETestSuite) TestQueryLatestBlock() { val := s.network.Validators[0] - _, err := s.queryClient.GetLatestBlock(context.Background(), &tmservice.GetLatestBlockRequest{}) + _, err := s.queryClient.GetLatestBlock(context.Background(), &cmtservice.GetLatestBlockRequest{}) s.Require().NoError(err) restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/blocks/latest", val.APIAddress)) s.Require().NoError(err) - var blockInfoRes tmservice.GetLatestBlockResponse + var blockInfoRes cmtservice.GetLatestBlockResponse s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &blockInfoRes)) s.Require().Equal(types.ValAddress(blockInfoRes.Block.Header.ProposerAddress).String(), blockInfoRes.SdkBlock.Header.ProposerAddress) s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvaloper") @@ -98,12 +98,12 @@ func (s *E2ETestSuite) TestQueryLatestBlock() { func (s *E2ETestSuite) TestQueryBlockByHeight() { val := s.network.Validators[0] - _, err := s.queryClient.GetBlockByHeight(context.Background(), &tmservice.GetBlockByHeightRequest{Height: 1}) + _, err := s.queryClient.GetBlockByHeight(context.Background(), &cmtservice.GetBlockByHeightRequest{Height: 1}) s.Require().NoError(err) restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/blocks/%d", val.APIAddress, 1)) s.Require().NoError(err) - var blockInfoRes tmservice.GetBlockByHeightResponse + var blockInfoRes cmtservice.GetBlockByHeightResponse s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &blockInfoRes)) s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvaloper") } @@ -112,7 +112,7 @@ func (s *E2ETestSuite) TestQueryLatestValidatorSet() { val := s.network.Validators[0] // nil pagination - res, err := s.queryClient.GetLatestValidatorSet(context.Background(), &tmservice.GetLatestValidatorSetRequest{ + res, err := s.queryClient.GetLatestValidatorSet(context.Background(), &cmtservice.GetLatestValidatorSetRequest{ Pagination: nil, }) s.Require().NoError(err) @@ -122,7 +122,7 @@ func (s *E2ETestSuite) TestQueryLatestValidatorSet() { s.Require().Equal(content, val.PubKey) // with pagination - _, err = s.queryClient.GetLatestValidatorSet(context.Background(), &tmservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{ + _, err = s.queryClient.GetLatestValidatorSet(context.Background(), &cmtservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{ Offset: 0, Limit: 10, }}) @@ -135,7 +135,7 @@ func (s *E2ETestSuite) TestQueryLatestValidatorSet() { // rest request with pagination restRes, err := testutil.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=%d&pagination.limit=%d", val.APIAddress, 0, 1)) s.Require().NoError(err) - var validatorSetRes tmservice.GetLatestValidatorSetResponse + var validatorSetRes cmtservice.GetLatestValidatorSetResponse s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &validatorSetRes)) s.Require().Equal(1, len(validatorSetRes.Validators)) anyPub, err := codectypes.NewAnyWithValue(val.PubKey) @@ -147,13 +147,13 @@ func (s *E2ETestSuite) TestLatestValidatorSet_GRPC() { vals := s.network.Validators testCases := []struct { name string - req *tmservice.GetLatestValidatorSetRequest + req *cmtservice.GetLatestValidatorSetRequest expErr bool expErrMsg string }{ {"nil request", nil, true, "cannot be nil"}, - {"no pagination", &tmservice.GetLatestValidatorSetRequest{}, false, ""}, - {"with pagination", &tmservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{Offset: 0, Limit: uint64(len(vals))}}, false, ""}, + {"no pagination", &cmtservice.GetLatestValidatorSetRequest{}, false, ""}, + {"with pagination", &cmtservice.GetLatestValidatorSetRequest{Pagination: &qtypes.PageRequest{Offset: 0, Limit: uint64(len(vals))}}, false, ""}, } for _, tc := range testCases { tc := tc @@ -194,7 +194,7 @@ func (s *E2ETestSuite) TestLatestValidatorSet_GRPCGateway() { if tc.expErr { s.Require().Contains(string(res), tc.expErrMsg) } else { - var result tmservice.GetLatestValidatorSetResponse + var result cmtservice.GetLatestValidatorSetResponse err = vals[0].ClientCtx.Codec.UnmarshalJSON(res, &result) s.Require().NoError(err) s.Require().Equal(uint64(len(vals)), result.Pagination.Total) @@ -210,14 +210,14 @@ func (s *E2ETestSuite) TestValidatorSetByHeight_GRPC() { vals := s.network.Validators testCases := []struct { name string - req *tmservice.GetValidatorSetByHeightRequest + req *cmtservice.GetValidatorSetByHeightRequest expErr bool expErrMsg string }{ {"nil request", nil, true, "request cannot be nil"}, - {"empty request", &tmservice.GetValidatorSetByHeightRequest{}, true, "height must be greater than 0"}, - {"no pagination", &tmservice.GetValidatorSetByHeightRequest{Height: 1}, false, ""}, - {"with pagination", &tmservice.GetValidatorSetByHeightRequest{Height: 1, Pagination: &qtypes.PageRequest{Offset: 0, Limit: 1}}, false, ""}, + {"empty request", &cmtservice.GetValidatorSetByHeightRequest{}, true, "height must be greater than 0"}, + {"no pagination", &cmtservice.GetValidatorSetByHeightRequest{Height: 1}, false, ""}, + {"with pagination", &cmtservice.GetValidatorSetByHeightRequest{Height: 1, Pagination: &qtypes.PageRequest{Offset: 0, Limit: 1}}, false, ""}, } for _, tc := range testCases { tc := tc @@ -256,7 +256,7 @@ func (s *E2ETestSuite) TestValidatorSetByHeight_GRPCGateway() { if tc.expErr { s.Require().Contains(string(res), tc.expErrMsg) } else { - var result tmservice.GetValidatorSetByHeightResponse + var result cmtservice.GetValidatorSetByHeightResponse err = vals[0].ClientCtx.Codec.UnmarshalJSON(res, &result) s.Require().NoError(err) s.Require().Equal(uint64(len(vals)), result.Pagination.Total) @@ -268,14 +268,14 @@ func (s *E2ETestSuite) TestValidatorSetByHeight_GRPCGateway() { func (s *E2ETestSuite) TestABCIQuery() { testCases := []struct { name string - req *tmservice.ABCIQueryRequest + req *cmtservice.ABCIQueryRequest expectErr bool expectedCode uint32 validQuery bool }{ { name: "valid request with proof", - req: &tmservice.ABCIQueryRequest{ + req: &cmtservice.ABCIQueryRequest{ Path: "/store/gov/key", Data: []byte{0x03}, Prove: true, @@ -284,7 +284,7 @@ func (s *E2ETestSuite) TestABCIQuery() { }, { name: "valid request without proof", - req: &tmservice.ABCIQueryRequest{ + req: &cmtservice.ABCIQueryRequest{ Path: "/store/gov/key", Data: []byte{0x03}, Prove: false, @@ -293,7 +293,7 @@ func (s *E2ETestSuite) TestABCIQuery() { }, { name: "request with invalid path", - req: &tmservice.ABCIQueryRequest{ + req: &cmtservice.ABCIQueryRequest{ Path: "/foo/bar", Data: []byte{0x03}, }, @@ -301,9 +301,9 @@ func (s *E2ETestSuite) TestABCIQuery() { }, { name: "request with invalid path recursive", - req: &tmservice.ABCIQueryRequest{ + req: &cmtservice.ABCIQueryRequest{ Path: "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", - Data: s.cfg.Codec.MustMarshal(&tmservice.ABCIQueryRequest{ + Data: s.cfg.Codec.MustMarshal(&cmtservice.ABCIQueryRequest{ Path: "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", }), }, @@ -311,7 +311,7 @@ func (s *E2ETestSuite) TestABCIQuery() { }, { name: "request with invalid broadcast tx path", - req: &tmservice.ABCIQueryRequest{ + req: &cmtservice.ABCIQueryRequest{ Path: "/cosmos.tx.v1beta1.Service/BroadcastTx", Data: []byte{0x00}, }, @@ -319,7 +319,7 @@ func (s *E2ETestSuite) TestABCIQuery() { }, { name: "request with invalid data", - req: &tmservice.ABCIQueryRequest{ + req: &cmtservice.ABCIQueryRequest{ Path: "/store/gov/key", Data: []byte{0x0044, 0x00}, }, diff --git a/tests/e2e/genutil/migrate.go b/tests/e2e/genutil/migrate.go index fdc524dd66cd..4a2a7579b548 100644 --- a/tests/e2e/genutil/migrate.go +++ b/tests/e2e/genutil/migrate.go @@ -31,7 +31,7 @@ func (s *E2ETestSuite) TestMigrateGenesis() { "migrate 0.37 to 0.42", v037Exported, "v0.42", - true, "Make sure that you have correctly migrated all Tendermint consensus params", func(_ string) {}, + true, "Make sure that you have correctly migrated all CometBFT consensus params", func(_ string) {}, }, { "migrate 0.42 to 0.43", diff --git a/tests/e2e/genutil/validate_genesis.go b/tests/e2e/genutil/validate_genesis.go index b4a889a89470..5561b0b9d608 100644 --- a/tests/e2e/genutil/validate_genesis.go +++ b/tests/e2e/genutil/validate_genesis.go @@ -92,7 +92,7 @@ func (s *E2ETestSuite) TestValidateGenesis() { genesisFile := testutil.WriteToNewTempFile(s.T(), tc.genesis) _, err := clitestutil.ExecTestCLICmd(val0.ClientCtx, cli.ValidateGenesisCmd(nil), []string{genesisFile.Name()}) if tc.expErr { - s.Require().Contains(err.Error(), "Make sure that you have correctly migrated all Tendermint consensus params") + s.Require().Contains(err.Error(), "Make sure that you have correctly migrated all CometBFT consensus params") } else { s.Require().NoError(err) } diff --git a/tests/integration/staking/keeper/validator_test.go b/tests/integration/staking/keeper/validator_test.go index 978bfb6e29f3..7d41655fd65d 100644 --- a/tests/integration/staking/keeper/validator_test.go +++ b/tests/integration/staking/keeper/validator_test.go @@ -694,7 +694,7 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[i]) } - // verify initial Tendermint updates are correct + // verify initial CometBFT updates are correct updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, len(validators)) validators[0], _ = app.StakingKeeper.GetValidator(ctx, validators[0].GetOperator()) validators[1], _ = app.StakingKeeper.GetValidator(ctx, validators[1].GetOperator()) @@ -739,7 +739,7 @@ func TestApplyAndReturnValidatorSetUpdatesNewValidator(t *testing.T) { app.StakingKeeper.SetValidator(ctx, validator) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validator) - // verify initial Tendermint updates are correct + // verify initial CometBFT updates are correct updates = applyValidatorSetUpdates(t, ctx, app.StakingKeeper, len(validators)+1) validator, _ = app.StakingKeeper.GetValidator(ctx, validator.GetOperator()) validators[0], _ = app.StakingKeeper.GetValidator(ctx, validators[0].GetOperator()) @@ -772,7 +772,7 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[i]) } - // verify initial Tendermint updates are correct + // verify initial CometBFT updates are correct updates := applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) validators[2], _ = app.StakingKeeper.GetValidator(ctx, validators[2].GetOperator()) validators[1], _ = app.StakingKeeper.GetValidator(ctx, validators[1].GetOperator()) @@ -794,7 +794,7 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { app.StakingKeeper.SetValidator(ctx, validators[0]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[0]) - // verify initial Tendermint updates are correct + // verify initial CometBFT updates are correct applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 0) // create a series of events that will bond and unbond the validator with @@ -816,7 +816,7 @@ func TestApplyAndReturnValidatorSetUpdatesBondTransition(t *testing.T) { app.StakingKeeper.SetValidator(ctx, validators[1]) app.StakingKeeper.SetValidatorByPowerIndex(ctx, validators[1]) - // verify initial Tendermint updates are correct + // verify initial CometBFT updates are correct updates = applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) assert.DeepEqual(t, validators[1].ABCIValidatorUpdate(app.StakingKeeper.PowerReduction(ctx)), updates[0]) diff --git a/testutil/mock/privval.go b/testutil/mock/privval.go index eeef311e2a54..66a9859af8cf 100644 --- a/testutil/mock/privval.go +++ b/testutil/mock/privval.go @@ -24,7 +24,7 @@ func NewPV() PV { // GetPubKey implements PrivValidator interface func (pv PV) GetPubKey() (crypto.PubKey, error) { - return cryptocodec.ToTmPubKeyInterface(pv.PrivKey.PubKey()) + return cryptocodec.ToCmtPubKeyInterface(pv.PrivKey.PubKey()) } // SignVote implements PrivValidator interface diff --git a/testutil/network/doc.go b/testutil/network/doc.go index be15df7e03e0..bb92b93510cc 100644 --- a/testutil/network/doc.go +++ b/testutil/network/doc.go @@ -1,5 +1,5 @@ /* -Package network implements and exposes a fully operational in-process Tendermint +Package network implements and exposes a fully operational in-process CometBFT test network that consists of at least one or potentially many validators. This test network can be used primarily for integration tests or unit test suites. @@ -10,11 +10,11 @@ number of validators as well as account funds and even custom genesis state. When creating a test network, a series of Validator objects are returned. Each Validator object has useful information such as their address and public key. A Validator will also provide its RPC, P2P, and API addresses that can be useful -for integration testing. In addition, a Tendermint local RPC client is also provided -which can be handy for making direct RPC calls to Tendermint. +for integration testing. In addition, a CometBFT local RPC client is also provided +which can be handy for making direct RPC calls to CometBFT. Note, due to limitations in concurrency and the design of the RPC layer in -Tendermint, only the first Validator object will have an RPC and API client +CometBFT, only the first Validator object will have an RPC and API client exposed. Due to this exact same limitation, only a single test network can exist at a time. A caller must be certain it calls Cleanup after it no longer needs the network. diff --git a/testutil/network/network.go b/testutil/network/network.go index 0e93e140a94e..8b7f9703aa07 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -30,7 +30,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -631,14 +631,14 @@ func (n *Network) LatestHeight() (int64, error) { var latestHeight int64 val := n.Validators[0] - queryClient := tmservice.NewServiceClient(val.ClientCtx) + queryClient := cmtservice.NewServiceClient(val.ClientCtx) for { select { case <-timeout.C: return latestHeight, errors.New("timeout exceeded waiting for block") case <-ticker.C: - res, err := queryClient.GetLatestBlock(context.Background(), &tmservice.GetLatestBlockRequest{}) + res, err := queryClient.GetLatestBlock(context.Background(), &cmtservice.GetLatestBlockRequest{}) if err == nil && res != nil { return res.SdkBlock.Header.Height, nil } @@ -668,7 +668,7 @@ func (n *Network) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, err var latestHeight int64 val := n.Validators[0] - queryClient := tmservice.NewServiceClient(val.ClientCtx) + queryClient := cmtservice.NewServiceClient(val.ClientCtx) for { select { @@ -676,7 +676,7 @@ func (n *Network) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, err return latestHeight, errors.New("timeout exceeded waiting for block") case <-ticker.C: - res, err := queryClient.GetLatestBlock(context.Background(), &tmservice.GetLatestBlockRequest{}) + res, err := queryClient.GetLatestBlock(context.Background(), &cmtservice.GetLatestBlockRequest{}) if err == nil && res != nil { latestHeight = res.GetSdkBlock().Header.Height if latestHeight >= h { diff --git a/testutil/network/util.go b/testutil/network/util.go index 3efdfa0efdf1..7608e770da3b 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -198,7 +198,7 @@ func writeFile(name string, dir string, contents []byte) error { return nil } -// Get a free address for a test tendermint server +// Get a free address for a test CometBFT server // protocol is either tcp, http, etc func FreeTCPAddr() (addr, port string, closeFn func() error, err error) { l, err := net.Listen("tcp", "localhost:0") diff --git a/testutil/sims/app_helpers.go b/testutil/sims/app_helpers.go index 22cdef20ce1e..7c168719b62c 100644 --- a/testutil/sims/app_helpers.go +++ b/testutil/sims/app_helpers.go @@ -30,7 +30,7 @@ import ( const DefaultGenTxGas = 10000000 -// DefaultConsensusParams defines the default Tendermint consensus params used in +// DefaultConsensusParams defines the default CometBFT consensus params used in // SimApp testing. var DefaultConsensusParams = &cmtproto.ConsensusParams{ Block: &cmtproto.BlockParams{ @@ -199,7 +199,7 @@ func GenesisStateWithValSet( bondAmt := sdk.DefaultPowerReduction for _, val := range valSet.Validators { - pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) + pk, err := cryptocodec.FromCmtPubKeyInterface(val.PubKey) if err != nil { return nil, fmt.Errorf("failed to convert pubkey: %w", err) } diff --git a/tools/rosetta/config.go b/tools/rosetta/config.go index 98d6d93e10fc..a6c0d61a88e1 100644 --- a/tools/rosetta/config.go +++ b/tools/rosetta/config.go @@ -24,8 +24,8 @@ const ( DefaultAddr = ":8080" // DefaultRetries is the default number of retries DefaultRetries = 5 - // DefaultTendermintEndpoint is the default value for the tendermint endpoint - DefaultTendermintEndpoint = "localhost:26657" + // DefaultCometEndpoint is the default value for the CometBFT endpoint + DefaultCometEndpoint = "localhost:26657" // DefaultGRPCEndpoint is the default value for the gRPC endpoint DefaultGRPCEndpoint = "localhost:9090" // DefaultNetwork defines the default network name @@ -257,7 +257,7 @@ func ServerFromConfig(conf *Config) (crg.Server, error) { func SetFlags(flags *pflag.FlagSet) { flags.String(FlagBlockchain, DefaultBlockchain, "the blockchain type") flags.String(FlagNetwork, DefaultNetwork, "the network name") - flags.String(FlagTendermintEndpoint, DefaultTendermintEndpoint, "the cometbft rpc endpoint, without tcp://") + flags.String(FlagTendermintEndpoint, DefaultCometEndpoint, "the CometBFT rpc endpoint, without tcp://") flags.String(FlagGRPCEndpoint, DefaultGRPCEndpoint, "the app gRPC endpoint") flags.String(FlagAddr, DefaultAddr, "the address rosetta will bind to") flags.Int(FlagRetries, DefaultRetries, "the number of retries that will be done before quitting") diff --git a/tools/rosetta/lib/errors/errors.go b/tools/rosetta/lib/errors/errors.go index 81e939c8c9ba..3f03c31aeb98 100644 --- a/tools/rosetta/lib/errors/errors.go +++ b/tools/rosetta/lib/errors/errors.go @@ -74,15 +74,15 @@ func ToRosetta(err error) *types.Error { if rosErr == nil || !ok { tmErr, ok := err.(*cmttypes.RPCError) if tmErr != nil && ok { - return fromTendermintToRosettaError(tmErr).rosErr + return fromCometToRosettaError(tmErr).rosErr } return ToRosetta(WrapError(ErrUnknown, ErrUnknown.Error())) } return rosErr.rosErr } -// fromTendermintToRosettaError converts a tendermint jsonrpc error to rosetta error -func fromTendermintToRosettaError(err *cmttypes.RPCError) *Error { +// fromCometToRosettaError converts a CometBFT jsonrpc error to rosetta error +func fromCometToRosettaError(err *cmttypes.RPCError) *Error { return &Error{rosErr: &types.Error{ Code: http.StatusInternalServerError, Message: err.Message, diff --git a/tools/rosetta/lib/internal/service/block.go b/tools/rosetta/lib/internal/service/block.go index 48b96a4bc1c4..2e489dff74f5 100644 --- a/tools/rosetta/lib/internal/service/block.go +++ b/tools/rosetta/lib/internal/service/block.go @@ -65,7 +65,7 @@ func (on OnlineNetwork) Block(ctx context.Context, request *types.BlockRequest) } // BlockTransaction gets the given transaction in the specified block, we do not need to check the block itself too -// due to the fact that tendermint achieves instant finality +// due to the fact that CometBFT achieves instant finality func (on OnlineNetwork) BlockTransaction(ctx context.Context, request *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error) { tx, err := on.client.GetTx(ctx, request.TransactionIdentifier.Hash) if err != nil { diff --git a/tools/rosetta/lib/internal/service/online.go b/tools/rosetta/lib/internal/service/online.go index c2f03fe19a2e..3f8296bb30f6 100644 --- a/tools/rosetta/lib/internal/service/online.go +++ b/tools/rosetta/lib/internal/service/online.go @@ -37,7 +37,7 @@ func NewOnlineNetwork(network *types.NetworkIdentifier, client crgtypes.Client, // OnlineNetwork groups together all the components required for the full rosetta implementation type OnlineNetwork struct { - client crgtypes.Client // used to query cosmos app + tendermint + client crgtypes.Client // used to query Cosmos app + CometBFT network *types.NetworkIdentifier // identifies the network, it's static networkOptions *types.NetworkOptionsResponse // identifies the network options, it's static diff --git a/tools/rosetta/types.go b/tools/rosetta/types.go index 0d1eada89272..fbc7f13fa488 100644 --- a/tools/rosetta/types.go +++ b/tools/rosetta/types.go @@ -13,7 +13,7 @@ const ( ) // In rosetta all state transitions must be represented as transactions -// since in tendermint begin block and end block are state transitions +// since in CometBFT begin block and end block are state transitions // which are not represented as transactions we mock only the balance changes // happening at those levels as transactions. (check BeginBlockTxHash for more info) const ( diff --git a/types/events.go b/types/events.go index 181f2cb3b8ab..3f4b279ac73b 100644 --- a/types/events.go +++ b/types/events.go @@ -194,7 +194,7 @@ func (a Attribute) String() string { return fmt.Sprintf("%s: %s", a.Key, a.Value) } -// ToKVPair converts an Attribute object into a Tendermint key/value pair. +// ToKVPair converts an Attribute object into a CometBFT key/value pair. func (a Attribute) ToKVPair() abci.EventAttribute { return abci.EventAttribute{Key: a.Key, Value: a.Value} } diff --git a/types/mempool/noop.go b/types/mempool/noop.go index 802122c213b4..73c12639d1d6 100644 --- a/types/mempool/noop.go +++ b/types/mempool/noop.go @@ -12,7 +12,7 @@ var _ Mempool = (*NoOpMempool)(nil) // ignored when BaseApp interacts with the mempool. // // Note: When this mempool is used, it assumed that an application will rely -// on Tendermint's transaction ordering defined in `RequestPrepareProposal`, which +// on CometBFT's transaction ordering defined in `RequestPrepareProposal`, which // is FIFO-ordered by default. type NoOpMempool struct{} diff --git a/types/staking.go b/types/staking.go index 471515effc50..44053ca30fb5 100644 --- a/types/staking.go +++ b/types/staking.go @@ -11,8 +11,8 @@ import ( // validators are expected to sign blocks beginning at block 11+X. // // This value is constant as this should not change without a hard fork. -// For Tendermint this should be set to 1 block, for more details see: -// https://tendermint.com/docs/spec/abci/apps.html#endblock +// For CometBFT this should be set to 1 block, for more details see: +// https://github.com/cometbft/cometbft/blob/main/spec/abci/abci%2B%2B_basic_concepts.md#consensusblock-execution-methods const ValidatorUpdateDelay int64 = 1 var ( diff --git a/x/auth/client/cli/tips.go b/x/auth/client/cli/tips.go index fcf5a2cb28c8..ab4f8937f91c 100644 --- a/x/auth/client/cli/tips.go +++ b/x/auth/client/cli/tips.go @@ -65,7 +65,7 @@ func GetAuxToFeeCommand() *cobra.Command { return err } - // broadcast to a Tendermint node + // broadcast to a CometBFT node res, err := clientCtx.BroadcastTx(txBytes) if err != nil { return err diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index e06aab1d4676..bb0e16c8a14f 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -13,7 +13,7 @@ import ( "google.golang.org/grpc/status" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -59,7 +59,7 @@ func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventReque } page := int(req.Page) - // Tendermint node.TxSearch that is used for querying txs defines pages starting from 1, + // CometBFT node.TxSearch that is used for querying txs defines pages starting from 1, // so we default to 1 if not provided in the request. if page == 0 { page = 1 @@ -192,7 +192,7 @@ func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWith "or greater than the current height %d", req.Height, currentHeight) } - blockID, block, err := tmservice.GetProtoBlock(ctx, s.clientCtx, &req.Height) + blockID, block, err := cmtservice.GetProtoBlock(ctx, s.clientCtx, &req.Height) if err != nil { return nil, err } @@ -363,6 +363,6 @@ func parseOrderBy(orderBy txtypes.OrderBy) string { case txtypes.OrderBy_ORDER_BY_DESC: return "desc" default: - return "" // Defaults to Tendermint's default, which is `asc` now. + return "" // Defaults to CometBFT's default, which is `asc` now. } } diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 6d95e565dda8..beaa0ab624ab 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -129,7 +129,7 @@ type QueryAllBalancesRequest struct { Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` // resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. // - // Since: cosmos-sdk 0.47 + // Since: cosmos-sdk 0.48 ResolveDenom bool `protobuf:"varint,3,opt,name=resolve_denom,json=resolveDenom,proto3" json:"resolve_denom,omitempty"` } diff --git a/x/consensus/module.go b/x/consensus/module.go index 962e3d8437b5..60b30752e7d6 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -119,9 +119,9 @@ func (am AppModule) InitGenesis(sdk.Context, codec.JSONCodec, json.RawMessage) [ return nil } -// ExportGenesis is handled by tendermint export of genesis +// ExportGenesis is handled by CometBFT export of genesis func (am AppModule) ExportGenesis(sdk.Context, codec.JSONCodec) json.RawMessage { - // nil is returned since ExportGenesis of consensus params is handled by tendermint and baseapp + // nil is returned since ExportGenesis of consensus params is handled by CometBFT and baseapp return nil } diff --git a/x/evidence/abci.go b/x/evidence/abci.go index 3a818fadbd19..fcfeef37165a 100644 --- a/x/evidence/abci.go +++ b/x/evidence/abci.go @@ -13,7 +13,7 @@ import ( ) // BeginBlocker iterates through and handles any newly discovered evidence of -// misbehavior submitted by Tendermint. Currently, only equivocation is handled. +// misbehavior submitted by CometBFT. Currently, only equivocation is handled. func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) diff --git a/x/evidence/keeper/infraction.go b/x/evidence/keeper/infraction.go index c17d77ba3cc7..9859ba91a94b 100644 --- a/x/evidence/keeper/infraction.go +++ b/x/evidence/keeper/infraction.go @@ -32,7 +32,7 @@ func (k Keeper) HandleEquivocationEvidence(ctx sdk.Context, evidence *types.Equi // // NOTE: We used to panic with: // `panic(fmt.Sprintf("Validator consensus-address %v not found", consAddr))`, - // but this couples the expectations of the app to both Tendermint and + // but this couples the expectations of the app to both CometBFT and // the simulator. Both are expected to provide the full range of // allowable but none of the disallowed evidence types. Instead of // getting this coordination right, it is easier to relax the @@ -67,7 +67,7 @@ func (k Keeper) HandleEquivocationEvidence(ctx sdk.Context, evidence *types.Equi validator := k.stakingKeeper.ValidatorByConsAddr(ctx, consAddr) if validator == nil || validator.IsUnbonded() { // Defensive: Simulation doesn't take unbonding periods into account, and - // Tendermint might break this assumption at some point. + // CometBFT might break this assumption at some point. return } @@ -77,7 +77,7 @@ func (k Keeper) HandleEquivocationEvidence(ctx sdk.Context, evidence *types.Equi // // NOTE: We used to panic with: // `panic(fmt.Sprintf("Validator consensus-address %v not found", consAddr))`, - // but this couples the expectations of the app to both Tendermint and + // but this couples the expectations of the app to both CometBFT and // the simulator. Both are expected to provide the full range of // allowable but none of the disallowed evidence types. Instead of // getting this coordination right, it is easier to relax the @@ -117,7 +117,7 @@ func (k Keeper) HandleEquivocationEvidence(ctx sdk.Context, evidence *types.Equi distributionHeight := infractionHeight - sdk.ValidatorUpdateDelay // Slash validator. The `power` is the int64 power of the validator as provided - // to/by Tendermint. This value is validator.Tokens as sent to Tendermint via + // to/by CometBFT. This value is validator.Tokens as sent to CometBFT via // ABCI, and now received as evidence. The fraction is passed in to separately // to slash unbonding and rebonding delegations. k.slashingKeeper.SlashWithInfractionReason( diff --git a/x/evidence/types/evidence.go b/x/evidence/types/evidence.go index b74d310166f8..d69673397040 100644 --- a/x/evidence/types/evidence.go +++ b/x/evidence/types/evidence.go @@ -73,7 +73,7 @@ func (e Equivocation) GetValidatorPower() int64 { // GetTotalPower is a no-op for the Equivocation type. func (e Equivocation) GetTotalPower() int64 { return 0 } -// FromABCIEvidence converts a Tendermint concrete Evidence type to +// FromABCIEvidence converts a CometBFT concrete Evidence type to // SDK Evidence using Equivocation as the concrete type. func FromABCIEvidence(e abci.Misbehavior) exported.Evidence { bech32PrefixConsAddr := sdk.GetConfig().GetBech32ConsensusAddrPrefix() diff --git a/x/genutil/client/cli/genaccount_test.go b/x/genutil/client/cli/genaccount_test.go index 0ddeea03ee2a..13e83647de5b 100644 --- a/x/genutil/client/cli/genaccount_test.go +++ b/x/genutil/client/cli/genaccount_test.go @@ -66,7 +66,7 @@ func TestAddGenesisAccountCmd(t *testing.T) { t.Run(tc.name, func(t *testing.T) { home := t.TempDir() logger := log.NewNopLogger() - cfg, err := genutiltest.CreateDefaultTendermintConfig(home) + cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) appCodec := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}).Codec diff --git a/x/genutil/client/cli/init_test.go b/x/genutil/client/cli/init_test.go index a648b55388ab..af610bff0043 100644 --- a/x/genutil/client/cli/init_test.go +++ b/x/genutil/client/cli/init_test.go @@ -60,7 +60,7 @@ func TestInitCmd(t *testing.T) { t.Run(tt.name, func(t *testing.T) { home := t.TempDir() logger := log.NewNopLogger() - cfg, err := genutiltest.CreateDefaultTendermintConfig(home) + cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) serverCtx := server.NewContext(viper.New(), cfg, logger) @@ -93,7 +93,7 @@ func TestInitCmd(t *testing.T) { func TestInitRecover(t *testing.T) { home := t.TempDir() logger := log.NewNopLogger() - cfg, err := genutiltest.CreateDefaultTendermintConfig(home) + cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) serverCtx := server.NewContext(viper.New(), cfg, logger) @@ -124,7 +124,7 @@ func TestInitRecover(t *testing.T) { func TestInitDefaultBondDenom(t *testing.T) { home := t.TempDir() logger := log.NewNopLogger() - cfg, err := genutiltest.CreateDefaultTendermintConfig(home) + cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) serverCtx := server.NewContext(viper.New(), cfg, logger) @@ -152,7 +152,7 @@ func TestInitDefaultBondDenom(t *testing.T) { func TestEmptyState(t *testing.T) { home := t.TempDir() logger := log.NewNopLogger() - cfg, err := genutiltest.CreateDefaultTendermintConfig(home) + cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) serverCtx := server.NewContext(viper.New(), cfg, logger) @@ -230,7 +230,7 @@ func TestStartStandAlone(t *testing.T) { func TestInitNodeValidatorFiles(t *testing.T) { home := t.TempDir() - cfg, err := genutiltest.CreateDefaultTendermintConfig(home) + cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) nodeID, valPubKey, err := genutil.InitializeNodeValidatorFiles(cfg) @@ -243,7 +243,7 @@ func TestInitNodeValidatorFiles(t *testing.T) { func TestInitConfig(t *testing.T) { home := t.TempDir() logger := log.NewNopLogger() - cfg, err := genutiltest.CreateDefaultTendermintConfig(home) + cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) serverCtx := server.NewContext(viper.New(), cfg, logger) diff --git a/x/genutil/client/cli/migrate_test.go b/x/genutil/client/cli/migrate_test.go index cb873aaede77..fa60f80cd574 100644 --- a/x/genutil/client/cli/migrate_test.go +++ b/x/genutil/client/cli/migrate_test.go @@ -29,7 +29,7 @@ func (s *CLITestSuite) TestMigrateGenesis() { "migrate 0.37 to 0.42", v037Exported, "v0.42", - true, "Make sure that you have correctly migrated all Tendermint consensus params", func(_ string) {}, + true, "Make sure that you have correctly migrated all CometBFT consensus params", func(_ string) {}, }, { "migrate 0.42 to 0.43", diff --git a/x/genutil/client/cli/validate_genesis.go b/x/genutil/client/cli/validate_genesis.go index 7a3eae970f09..062e2304dadf 100644 --- a/x/genutil/client/cli/validate_genesis.go +++ b/x/genutil/client/cli/validate_genesis.go @@ -55,13 +55,13 @@ func ValidateGenesisCmd(mbm module.BasicManager) *cobra.Command { } // validateGenDoc reads a genesis file and validates that it is a correct -// Tendermint GenesisDoc. This function does not do any cosmos-related +// CometBFT GenesisDoc. This function does not do any cosmos-related // validation. func validateGenDoc(importGenesisFile string) (*cmttypes.GenesisDoc, error) { genDoc, err := cmttypes.GenesisDocFromFile(importGenesisFile) if err != nil { return nil, fmt.Errorf("%s. Make sure that"+ - " you have correctly migrated all Tendermint consensus params, please see the"+ + " you have correctly migrated all CometBFT consensus params, please see the"+ " chain migration guide at %s for more info", err.Error(), chainUpgradeGuide, ) diff --git a/x/genutil/client/cli/validate_genesis_test.go b/x/genutil/client/cli/validate_genesis_test.go index feec463f9d68..90223ea45f61 100644 --- a/x/genutil/client/cli/validate_genesis_test.go +++ b/x/genutil/client/cli/validate_genesis_test.go @@ -90,7 +90,7 @@ func (s *CLITestSuite) TestValidateGenesis() { genesisFile := testutil.WriteToNewTempFile(s.T(), tc.genesis) _, err := clitestutil.ExecTestCLICmd(s.clientCtx, cli.ValidateGenesisCmd(nil), []string{genesisFile.Name()}) if tc.expErr { - s.Require().Contains(err.Error(), "Make sure that you have correctly migrated all Tendermint consensus params") + s.Require().Contains(err.Error(), "Make sure that you have correctly migrated all CometBFT consensus params") } else { s.Require().NoError(err) } diff --git a/x/genutil/client/testutil/helpers.go b/x/genutil/client/testutil/helpers.go index a27ecd29acd7..489404ae155f 100644 --- a/x/genutil/client/testutil/helpers.go +++ b/x/genutil/client/testutil/helpers.go @@ -19,7 +19,7 @@ import ( func ExecInitCmd(testMbm module.BasicManager, home string, cdc codec.Codec) error { logger := log.NewNopLogger() - cfg, err := CreateDefaultTendermintConfig(home) + cfg, err := CreateDefaultCometConfig(home) if err != nil { return err } @@ -40,7 +40,7 @@ func ExecInitCmd(testMbm module.BasicManager, home string, cdc codec.Codec) erro return cmd.ExecuteContext(ctx) } -func CreateDefaultTendermintConfig(rootDir string) (*cmtcfg.Config, error) { +func CreateDefaultCometConfig(rootDir string) (*cmtcfg.Config, error) { conf := cmtcfg.DefaultConfig() conf.SetRoot(rootDir) cmtcfg.EnsureRoot(rootDir) diff --git a/x/genutil/doc.go b/x/genutil/doc.go index 6aa85b97755b..43b713b145fe 100644 --- a/x/genutil/doc.go +++ b/x/genutil/doc.go @@ -5,6 +5,6 @@ for usage within a blockchain application. Namely: - commands for collection and creation of gentxs - initchain processing of gentxs - Genesis file validation - - Tendermint related initialization + - CometBFT related initialization */ package genutil diff --git a/x/genutil/utils.go b/x/genutil/utils.go index b65d958e24db..6c7617bda419 100644 --- a/x/genutil/utils.go +++ b/x/genutil/utils.go @@ -90,7 +90,7 @@ func InitializeNodeValidatorFilesFromMnemonic(config *cfg.Config, mnemonic strin return "", nil, err } - valPubKey, err = cryptocodec.FromTmPubKeyInterface(tmValPubKey) + valPubKey, err = cryptocodec.FromCmtPubKeyInterface(tmValPubKey) if err != nil { return "", nil, err } diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index 3ccf6b0cc926..5ced5704ab10 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -437,7 +437,7 @@ func QueryProposalByID(proposalID uint64, clientCtx client.Context, queryRoute s // combineEvents queries txs by events with all events from each event group, // and combines all those events together. // -// Tx are indexed in tendermint via their Msgs `Type()`, which can be: +// Tx are indexed in CometBFT via their Msgs `Type()`, which can be: // - via legacy Msgs (amino or proto), their `Type()` is a custom string, // - via ADR-031 proto msgs, their `Type()` is the protobuf FQ method name. // In searching for events, we search for both `Type()`s, and we use the diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index 8de60874c61f..de71e3153e95 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -62,12 +62,12 @@ func (suite *SimTestSuite) SetupTest() { // create validator (non random as using a seed) createValidator := func() (*cmttypes.ValidatorSet, error) { account := accounts[0] - tmPk, err := cryptocodec.ToTmPubKeyInterface(account.PubKey) + cmtPk, err := cryptocodec.ToCmtPubKeyInterface(account.PubKey) if err != nil { return nil, fmt.Errorf("failed to create pubkey: %w", err) } - validator := cmttypes.NewValidator(tmPk, 1) + validator := cmttypes.NewValidator(cmtPk, 1) return cmttypes.NewValidatorSet([]*cmttypes.Validator{validator}), nil } diff --git a/x/staking/genesis.go b/x/staking/genesis.go index 9cebe9e076ca..7e2cf1efe04a 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -19,15 +19,15 @@ func WriteValidators(ctx sdk.Context, keeper *keeper.Keeper) (vals []cmttypes.Ge returnErr = err return true } - tmPk, err := cryptocodec.ToTmPubKeyInterface(pk) + cmtPk, err := cryptocodec.ToCmtPubKeyInterface(pk) if err != nil { returnErr = err return true } vals = append(vals, cmttypes.GenesisValidator{ - Address: sdk.ConsAddress(tmPk.Address()).Bytes(), - PubKey: tmPk, + Address: sdk.ConsAddress(cmtPk.Address()).Bytes(), + PubKey: cmtPk, Power: validator.GetConsensusPower(keeper.PowerReduction(ctx)), Name: validator.GetMoniker(), }) diff --git a/x/staking/keeper/genesis.go b/x/staking/keeper/genesis.go index 371c8ea663c5..d8af3355f91c 100644 --- a/x/staking/keeper/genesis.go +++ b/x/staking/keeper/genesis.go @@ -137,7 +137,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []ab panic(fmt.Sprintf("not bonded pool balance is different from not bonded coins: %s <-> %s", notBondedBalance, notBondedCoins)) } - // don't need to run Tendermint updates if we exported + // don't need to run CometBFT updates if we exported if data.Exported { for _, lv := range data.LastValidatorPowers { valAddr, err := sdk.ValAddressFromBech32(lv.Address) diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index d4bc16778010..c820de0595e1 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -249,7 +249,7 @@ func (s *KeeperTestSuite) TestApplyAndReturnValidatorSetUpdatesPowerDecrease() { require.Equal(int64(100), validators[1].GetConsensusPower(keeper.PowerReduction(ctx))) // test multiple value change - // tendermintUpdate set: {c1, c3} -> {c1', c3'} + // tendermintUpdate set: {c1, c3} -> {c1', c3'} delTokens1 := keeper.TokensFromConsensusPower(ctx, 20) delTokens2 := keeper.TokensFromConsensusPower(ctx, 30) validators[0], _ = validators[0].RemoveDelShares(sdk.NewDecFromInt(delTokens1)) @@ -261,7 +261,7 @@ func (s *KeeperTestSuite) TestApplyAndReturnValidatorSetUpdatesPowerDecrease() { require.Equal(int64(80), validators[0].GetConsensusPower(keeper.PowerReduction(ctx))) require.Equal(int64(70), validators[1].GetConsensusPower(keeper.PowerReduction(ctx))) - // Tendermint updates should reflect power change + // CometBFT updates should reflect power change updates := s.applyValidatorSetUpdates(ctx, keeper, 2) require.Equal(validators[0].ABCIValidatorUpdate(keeper.PowerReduction(ctx)), updates[0]) require.Equal(validators[1].ABCIValidatorUpdate(keeper.PowerReduction(ctx)), updates[1]) diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index 530cd74bb684..2ccfe937d738 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -68,9 +68,9 @@ func (s *SimTestSuite) SetupTest() { // create validator set with single validator account := accounts[0] - tmPk, err := cryptocodec.ToTmPubKeyInterface(account.PubKey) + cmtPk, err := cryptocodec.ToCmtPubKeyInterface(account.PubKey) require.NoError(s.T(), err) - validator := cmttypes.NewValidator(tmPk, 1) + validator := cmttypes.NewValidator(cmtPk, 1) startupCfg := simtestutil.DefaultStartUpConfig() startupCfg.GenesisAccounts = accs diff --git a/x/staking/testutil/cmt.go b/x/staking/testutil/cmt.go index 419c2671b40a..682471309fa7 100644 --- a/x/staking/testutil/cmt.go +++ b/x/staking/testutil/cmt.go @@ -16,7 +16,7 @@ func GetCmtConsPubKey(v types.Validator) (cmtcrypto.PubKey, error) { return nil, err } - return cryptocodec.ToTmPubKeyInterface(pk) + return cryptocodec.ToCmtPubKeyInterface(pk) } // ToCmtValidator casts an SDK validator to a CometBFT type Validator. diff --git a/x/staking/types/historical_info.go b/x/staking/types/historical_info.go index 76fe48e4665d..9abebdf86697 100644 --- a/x/staking/types/historical_info.go +++ b/x/staking/types/historical_info.go @@ -16,7 +16,7 @@ import ( // NewHistoricalInfo will create a historical information struct from header and valset // it will first sort valset before inclusion into historical info func NewHistoricalInfo(header cmtproto.Header, valSet Validators, powerReduction math.Int) HistoricalInfo { - // Must sort in the same way that tendermint does + // Must sort in the same way that CometBFT does sort.SliceStable(valSet, func(i, j int) bool { return ValidatorsByVotingPower(valSet).Less(i, j, powerReduction) }) diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index a164b9f0d394..9a87595e4933 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -7,6 +7,7 @@ import ( "strings" "time" + "cosmossdk.io/errors" "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" @@ -461,20 +462,25 @@ func (v Validator) GetOperator() sdk.ValAddress { func (v Validator) ConsPubKey() (cryptotypes.PubKey, error) { pk, ok := v.ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) if !ok { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", pk) + return nil, errors.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", pk) } return pk, nil } -// TmConsPublicKey casts Validator.ConsensusPubkey to cmtprotocrypto.PubKey. +// Deprecated: use CmtConsPublicKey instead func (v Validator) TmConsPublicKey() (cmtprotocrypto.PublicKey, error) { + return v.CmtConsPublicKey() +} + +// CmtConsPublicKey casts Validator.ConsensusPubkey to cmtprotocrypto.PubKey. +func (v Validator) CmtConsPublicKey() (cmtprotocrypto.PublicKey, error) { pk, err := v.ConsPubKey() if err != nil { return cmtprotocrypto.PublicKey{}, err } - tmPk, err := cryptocodec.ToTmProtoPublicKey(pk) + tmPk, err := cryptocodec.ToCmtProtoPublicKey(pk) if err != nil { return cmtprotocrypto.PublicKey{}, err } diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index 112f4d3c09e3..6a005cce7622 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -304,7 +304,7 @@ func TestValidatorsSortCometBFT(t *testing.T) { require.Equal(t, expectedVals, actualVals, "sorting in SDK is not the same as sorting in CometBFT") } -func TestValidatorToTm(t *testing.T) { +func TestValidatorToCmt(t *testing.T) { vals := make(types.Validators, 10) expected := make([]*cmttypes.Validator, 10) @@ -314,9 +314,9 @@ func TestValidatorToTm(t *testing.T) { val.Status = types.Bonded val.Tokens = sdk.NewInt(rand.Int63()) vals[i] = val - tmPk, err := cryptocodec.ToTmPubKeyInterface(pk) + cmtPk, err := cryptocodec.ToCmtPubKeyInterface(pk) require.NoError(t, err) - expected[i] = cmttypes.NewValidator(tmPk, val.ConsensusPower(sdk.DefaultPowerReduction)) + expected[i] = cmttypes.NewValidator(cmtPk, val.ConsensusPower(sdk.DefaultPowerReduction)) } vs, err := testutil.ToCmtValidators(vals, sdk.DefaultPowerReduction) require.NoError(t, err)