From 2f23e8a95cc6886d1b7de35d8c42884a28584f9b Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 24 Oct 2023 11:35:33 -0400 Subject: [PATCH] chore: ignore store v1 proto generation (#18224) Co-authored-by: Marko --- api/cosmos/gov/module/v1/module.pulsar.go | 9 ++--- .../cosmos/store/internal/kv/v1beta1/kv.proto | 13 ++++++- .../cosmos/store/snapshots/v1/snapshot.proto | 10 ++--- proto/cosmos/store/streaming/abci/grpc.proto | 38 ++++++++++++++++--- proto/cosmos/store/v1beta1/commit_info.proto | 17 ++++++++- proto/cosmos/store/v1beta1/listening.proto | 33 ++++++++++------ scripts/protocgen.sh | 3 +- 7 files changed, 93 insertions(+), 30 deletions(-) diff --git a/api/cosmos/gov/module/v1/module.pulsar.go b/api/cosmos/gov/module/v1/module.pulsar.go index 43e32585116..5785941ffa9 100644 --- a/api/cosmos/gov/module/v1/module.pulsar.go +++ b/api/cosmos/gov/module/v1/module.pulsar.go @@ -549,15 +549,14 @@ var file_cosmos_gov_module_v1_module_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x06, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6c, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4c, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x2a, 0xba, - 0xc0, 0x96, 0xda, 0x01, 0x24, 0x0a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x42, 0xca, 0x01, 0x0a, 0x18, 0x63, 0x6f, + 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x1a, 0xba, + 0xc0, 0x96, 0xda, 0x01, 0x14, 0x0a, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x42, 0xca, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, diff --git a/proto/cosmos/store/internal/kv/v1beta1/kv.proto b/proto/cosmos/store/internal/kv/v1beta1/kv.proto index 4243444acc7..cccb47b6c1a 100644 --- a/proto/cosmos/store/internal/kv/v1beta1/kv.proto +++ b/proto/cosmos/store/internal/kv/v1beta1/kv.proto @@ -5,15 +5,26 @@ import "gogoproto/gogo.proto"; option go_package = "cosmossdk.io/store/internal/kv"; -// This is duplicated from the base kv directory to avoid a circular dependency with the cosmos-sdk +// This is duplicated from the base kv directory to avoid a circular dependency +// with the cosmos-sdk // Pairs defines a repeated slice of Pair objects. +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. message Pairs { + option deprecated = true; + repeated Pair pairs = 1 [(gogoproto.nullable) = false]; } // Pair defines a key/value bytes tuple. +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. message Pair { + option deprecated = true; + bytes key = 1; bytes value = 2; } diff --git a/proto/cosmos/store/snapshots/v1/snapshot.proto b/proto/cosmos/store/snapshots/v1/snapshot.proto index af49bdaa531..398a7db04bd 100644 --- a/proto/cosmos/store/snapshots/v1/snapshot.proto +++ b/proto/cosmos/store/snapshots/v1/snapshot.proto @@ -16,7 +16,7 @@ message Snapshot { // Metadata contains SDK-specific snapshot metadata. message Metadata { - repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes + repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes } // SnapshotItem is an item contained in a rootmulti.Store snapshot. @@ -25,9 +25,9 @@ message Metadata { message SnapshotItem { // item is the specific type of snapshot item. oneof item { - SnapshotStoreItem store = 1; - SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; - SnapshotExtensionMeta extension = 3; + SnapshotStoreItem store = 1; + SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; + SnapshotExtensionMeta extension = 3; SnapshotExtensionPayload extension_payload = 4; } } @@ -64,4 +64,4 @@ message SnapshotExtensionMeta { // Since: cosmos-sdk 0.46 message SnapshotExtensionPayload { bytes payload = 1; -} \ No newline at end of file +} diff --git a/proto/cosmos/store/streaming/abci/grpc.proto b/proto/cosmos/store/streaming/abci/grpc.proto index 25366cdbdcd..e3c870d1eac 100644 --- a/proto/cosmos/store/streaming/abci/grpc.proto +++ b/proto/cosmos/store/streaming/abci/grpc.proto @@ -8,29 +8,57 @@ import "cosmos/store/v1beta1/listening.proto"; option go_package = "cosmossdk.io/store/streaming/abci"; // ListenEndBlockRequest is the request type for the ListenEndBlock RPC method +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. message ListenFinalizeBlockRequest { + option deprecated = true; + tendermint.abci.RequestFinalizeBlock req = 1; tendermint.abci.ResponseFinalizeBlock res = 2; } // ListenEndBlockResponse is the response type for the ListenEndBlock RPC method -message ListenFinalizeBlockResponse {} +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. +message ListenFinalizeBlockResponse { + option deprecated = true; +} // ListenCommitRequest is the request type for the ListenCommit RPC method +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. message ListenCommitRequest { - // explicitly pass in block height as ResponseCommit does not contain this info + option deprecated = true; + + // explicitly pass in block height as ResponseCommit does not contain this + // info int64 block_height = 1; tendermint.abci.ResponseCommit res = 2; repeated cosmos.store.v1beta1.StoreKVPair change_set = 3; } // ListenCommitResponse is the response type for the ListenCommit RPC method -message ListenCommitResponse {} +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. +message ListenCommitResponse { + option deprecated = true; +} // ABCIListenerService is the service for the BaseApp ABCIListener interface +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. service ABCIListenerService { - // ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock - rpc ListenFinalizeBlock(ListenFinalizeBlockRequest) returns (ListenFinalizeBlockResponse); + option deprecated = true; + + // ListenFinalizeBlock is the corresponding endpoint for + // ABCIListener.ListenEndBlock + rpc ListenFinalizeBlock(ListenFinalizeBlockRequest) + returns (ListenFinalizeBlockResponse); // ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit rpc ListenCommit(ListenCommitRequest) returns (ListenCommitResponse); } diff --git a/proto/cosmos/store/v1beta1/commit_info.proto b/proto/cosmos/store/v1beta1/commit_info.proto index 37459a0d05a..05334b6f68b 100644 --- a/proto/cosmos/store/v1beta1/commit_info.proto +++ b/proto/cosmos/store/v1beta1/commit_info.proto @@ -8,22 +8,37 @@ option go_package = "cosmossdk.io/store/types"; // CommitInfo defines commit information used by the multi-store when committing // a version/height. +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. message CommitInfo { + option deprecated = true; + int64 version = 1; repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp timestamp = 3 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // StoreInfo defines store-specific commit information. It contains a reference // between a store name and the commit ID. +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. message StoreInfo { + option deprecated = true; + string name = 1; CommitID commit_id = 2 [(gogoproto.nullable) = false]; } // CommitID defines the commitment information when a specific store is // committed. +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. message CommitID { + option deprecated = true; option (gogoproto.goproto_stringer) = false; int64 version = 1; diff --git a/proto/cosmos/store/v1beta1/listening.proto b/proto/cosmos/store/v1beta1/listening.proto index 14bc2e7a78f..b96af350651 100644 --- a/proto/cosmos/store/v1beta1/listening.proto +++ b/proto/cosmos/store/v1beta1/listening.proto @@ -5,24 +5,35 @@ import "tendermint/abci/types.proto"; option go_package = "cosmossdk.io/store/types"; -// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) -// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and -// Deletes +// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and +// Deletes) It optionally includes the StoreKey for the originating KVStore and +// a Boolean flag to distinguish between Sets and Deletes // // Since: cosmos-sdk 0.43 +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. message StoreKVPair { - string store_key = 1; // the store key for the KVStore this pair originates from - bool delete = 2; // true indicates a delete operation, false indicates a set operation - bytes key = 3; - bytes value = 4; + option deprecated = true; + + string store_key = 1; // the store key for the KVStore this pair originates from + bool delete = 2; // true indicates a delete operation, false indicates a set operation + bytes key = 3; + bytes value = 4; } // BlockMetadata contains all the abci event data of a block // the file streamer dump them into files together with the state changes. +// +// Deprecated: Store v1 is deprecated as of v0.50.x, please use Store v2 types +// instead. message BlockMetadata { - tendermint.abci.ResponseCommit response_commit = 6; - tendermint.abci.RequestFinalizeBlock request_finalize_block = 7; - tendermint.abci.ResponseFinalizeBlock response_finalize_block = 8; // TODO: should we renumber this? + option deprecated = true; + + tendermint.abci.ResponseCommit response_commit = 6; + tendermint.abci.RequestFinalizeBlock request_finalize_block = 7; + tendermint.abci.ResponseFinalizeBlock response_finalize_block = + 8; // TODO: should we renumber this? - reserved 1, 2, 3, 4, 5; // reserved for from previous use in comet <= 0.37 + reserved 1, 2, 3, 4, 5; // reserved for from previous use in comet <= 0.37 } diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 5ed5f7da89a..60b4f03c0cb 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -11,7 +11,7 @@ set -e echo "Generating gogo proto code" cd proto -proto_dirs=$(find ./cosmos ./amino -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +proto_dirs=$(find ./cosmos ./amino -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq | grep -v '^./cosmos/store/') for dir in $proto_dirs; do for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do # this regex checks if a proto file has its go_package set to cosmossdk.io/api/... @@ -38,4 +38,3 @@ rm -rf github.com cosmossdk.io go mod tidy ./scripts/protocgen-pulsar.sh -