diff --git a/Makefile b/Makefile index 356aefb4a992..2be84b84860e 100644 --- a/Makefile +++ b/Makefile @@ -393,7 +393,7 @@ lint-fix: ### Protobuf ### ############################################################################### -protoVer=0.13.5 +protoVer=0.14.0 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) diff --git a/api/cosmos/autocli/v1/options.pulsar.go b/api/cosmos/autocli/v1/options.pulsar.go index a97a51701f77..9d2bb2efba3e 100644 --- a/api/cosmos/autocli/v1/options.pulsar.go +++ b/api/cosmos/autocli/v1/options.pulsar.go @@ -4326,6 +4326,13 @@ type ServiceCommandDescriptor struct { // different protobuf services. The map key is used as the name of the // sub-command. SubCommands map[string]*ServiceCommandDescriptor `protobuf:"bytes,3,rep,name=sub_commands,json=subCommands,proto3" json:"sub_commands,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +<<<<<<< HEAD +======= + // enhance_custom_commands specifies whether to skip the service when generating commands, if a custom command already + // exists, or enhance the existing command. If set to true, the custom command will be enhanced with the services from + // gRPC. otherwise when a custom command exists, no commands will be generated for the service. + EnhanceCustomCommand bool `protobuf:"varint,4,opt,name=enhance_custom_command,json=enhanceCustomCommand,proto3" json:"enhance_custom_command,omitempty"` +>>>>>>> 066f8a7a5 (chore: format proto files (#17445)) } func (x *ServiceCommandDescriptor) Reset() { diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index c5df20627418..175c72422ad4 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -7182,7 +7182,8 @@ type Proposal struct { // voting_end_time is the end time of voting on a proposal. VotingEndTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. - // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/gov#proposal-3 Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` // title is the title of the proposal // diff --git a/api/tendermint/abci/types.pulsar.go b/api/tendermint/abci/types.pulsar.go index 8f6206311cb0..5d4db06158f5 100644 --- a/api/tendermint/abci/types.pulsar.go +++ b/api/tendermint/abci/types.pulsar.go @@ -32681,7 +32681,8 @@ type ResponseFinalizeBlock struct { ValidatorUpdates []*ValidatorUpdate `protobuf:"bytes,3,rep,name=validator_updates,json=validatorUpdates,proto3" json:"validator_updates,omitempty"` // updates to the consensus params, if any. ConsensusParamUpdates *types.ConsensusParams `protobuf:"bytes,4,opt,name=consensus_param_updates,json=consensusParamUpdates,proto3" json:"consensus_param_updates,omitempty"` - // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was deterministic. It is up to the application to decide which algorithm to use. + // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was + // deterministic. It is up to the application to decide which algorithm to use. AppHash []byte `protobuf:"bytes,5,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` } diff --git a/baseapp/testutil/messages.proto b/baseapp/testutil/messages.proto index 1cce9dba5ded..d2b25d24c117 100644 --- a/baseapp/testutil/messages.proto +++ b/baseapp/testutil/messages.proto @@ -9,17 +9,17 @@ option go_package = "github.com/cosmos/cosmos-sdk/baseapp/testutil"; message MsgCounter { option (cosmos.msg.v1.signer) = "signer"; - int64 counter = 1; - bool fail_on_handler = 2; - string signer = 3; + int64 counter = 1; + bool fail_on_handler = 2; + string signer = 3; } message MsgCounter2 { option (cosmos.msg.v1.signer) = "signer"; - int64 counter = 1; - bool fail_on_handler = 2; - string signer = 3; + int64 counter = 1; + bool fail_on_handler = 2; + string signer = 3; } message MsgCreateCounterResponse {} diff --git a/client/v2/internal/testpb/msg.proto b/client/v2/internal/testpb/msg.proto index d0b0bde4503d..e73410a20e6c 100644 --- a/client/v2/internal/testpb/msg.proto +++ b/client/v2/internal/testpb/msg.proto @@ -44,7 +44,7 @@ message MsgRequest { string deprecated_field = 30; string shorthand_deprecated_field = 31; bool hidden_bool = 32; - string a_validator_address = 33 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string a_validator_address = 33 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } message MsgResponse { diff --git a/client/v2/internal/testpb/query.proto b/client/v2/internal/testpb/query.proto index 57cb1bc84dde..1d600b1df35c 100644 --- a/client/v2/internal/testpb/query.proto +++ b/client/v2/internal/testpb/query.proto @@ -40,12 +40,12 @@ message EchoRequest { string positional2 = 28; repeated cosmos.base.v1beta1.Coin positional3_varargs = 29; - string deprecated_field = 30; - string shorthand_deprecated_field = 31; - bool hidden_bool = 32; - map map_string_string = 33; - map map_string_uint32 = 34; - map map_string_coin = 35; + string deprecated_field = 30; + string shorthand_deprecated_field = 31; + bool hidden_bool = 32; + map map_string_string = 33; + map map_string_uint32 = 34; + map map_string_coin = 35; string a_validator_address = 36 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; string a_consensus_address = 37 [(cosmos_proto.scalar) = "cosmos.ConsensusAddressString"]; } diff --git a/orm/internal/testpb/bank_query.proto b/orm/internal/testpb/bank_query.proto index a204777bd4ba..6335d52eaf58 100644 --- a/orm/internal/testpb/bank_query.proto +++ b/orm/internal/testpb/bank_query.proto @@ -42,7 +42,7 @@ message ListBalanceRequest { // denom specifies the value of the Denom index key to use in the query. Denom denom = 2; } - + message AddressDenom { // address is the value of the address field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. @@ -51,14 +51,14 @@ message ListBalanceRequest { // It can be omitted to query for all valid values of that field in this segment of the index. optional string denom = 2; } - + message Denom { // denom is the value of the denom field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional string denom = 1; } } - + // query specifies the type of query - either a prefix or range query. oneof query { // prefix_query specifies the index key value to use for the prefix query. @@ -68,7 +68,7 @@ message ListBalanceRequest { } // pagination specifies optional pagination parameters. cosmos.base.query.v1beta1.PageRequest pagination = 3; - + // RangeQuery specifies the from/to index keys for a range query. message RangeQuery { // from is the index key to use for the start of the range query. @@ -110,14 +110,14 @@ message ListSupplyRequest { // denom specifies the value of the Denom index key to use in the query. Denom denom = 1; } - + message Denom { // denom is the value of the denom field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional string denom = 1; } } - + // query specifies the type of query - either a prefix or range query. oneof query { // prefix_query specifies the index key value to use for the prefix query. @@ -127,7 +127,7 @@ message ListSupplyRequest { } // pagination specifies optional pagination parameters. cosmos.base.query.v1beta1.PageRequest pagination = 3; - + // RangeQuery specifies the from/to index keys for a range query. message RangeQuery { // from is the index key to use for the start of the range query. @@ -147,4 +147,3 @@ message ListSupplyResponse { // pagination is the pagination response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } - diff --git a/orm/internal/testpb/test_schema_query.proto b/orm/internal/testpb/test_schema_query.proto index 8e07ccfcfe80..c3dbcfd5d885 100644 --- a/orm/internal/testpb/test_schema_query.proto +++ b/orm/internal/testpb/test_schema_query.proto @@ -16,11 +16,15 @@ service TestSchemaQueryService { // ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes. rpc ListExampleTable(ListExampleTableRequest) returns (ListExampleTableResponse) {} // Get queries the ExampleAutoIncrementTable table by its primary key. - rpc GetExampleAutoIncrementTable(GetExampleAutoIncrementTableRequest) returns (GetExampleAutoIncrementTableResponse) {} + rpc GetExampleAutoIncrementTable(GetExampleAutoIncrementTableRequest) returns (GetExampleAutoIncrementTableResponse) { + } // GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index - rpc GetExampleAutoIncrementTableByX(GetExampleAutoIncrementTableByXRequest) returns (GetExampleAutoIncrementTableByXResponse) {} - // ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against defined indexes. - rpc ListExampleAutoIncrementTable(ListExampleAutoIncrementTableRequest) returns (ListExampleAutoIncrementTableResponse) {} + rpc GetExampleAutoIncrementTableByX(GetExampleAutoIncrementTableByXRequest) + returns (GetExampleAutoIncrementTableByXResponse) {} + // ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against + // defined indexes. + rpc ListExampleAutoIncrementTable(ListExampleAutoIncrementTableRequest) + returns (ListExampleAutoIncrementTableResponse) {} // GetExampleSingleton queries the ExampleSingleton singleton. rpc GetExampleSingleton(GetExampleSingletonRequest) returns (GetExampleSingletonResponse) {} // Get queries the ExampleTimestamp table by its primary key. @@ -39,7 +43,8 @@ service TestSchemaQueryService { rpc ListSimpleExample(ListSimpleExampleRequest) returns (ListSimpleExampleResponse) {} // Get queries the ExampleAutoIncFieldName table by its primary key. rpc GetExampleAutoIncFieldName(GetExampleAutoIncFieldNameRequest) returns (GetExampleAutoIncFieldNameResponse) {} - // ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes. + // ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against + // defined indexes. rpc ListExampleAutoIncFieldName(ListExampleAutoIncFieldNameRequest) returns (ListExampleAutoIncFieldNameResponse) {} } @@ -85,7 +90,7 @@ message ListExampleTableRequest { // bz_str specifies the value of the BzStr index key to use in the query. BzStr bz_str = 4; } - + message U32I64Str { // u32 is the value of the u32 field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. @@ -97,7 +102,7 @@ message ListExampleTableRequest { // It can be omitted to query for all valid values of that field in this segment of the index. optional string str = 3; } - + message U64Str { // u64 is the value of the u64 field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. @@ -106,7 +111,7 @@ message ListExampleTableRequest { // It can be omitted to query for all valid values of that field in this segment of the index. optional string str = 2; } - + message StrU32 { // str is the value of the str field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. @@ -115,7 +120,7 @@ message ListExampleTableRequest { // It can be omitted to query for all valid values of that field in this segment of the index. optional uint32 u32 = 2; } - + message BzStr { // bz is the value of the bz field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. @@ -125,7 +130,7 @@ message ListExampleTableRequest { optional string str = 2; } } - + // query specifies the type of query - either a prefix or range query. oneof query { // prefix_query specifies the index key value to use for the prefix query. @@ -135,7 +140,7 @@ message ListExampleTableRequest { } // pagination specifies optional pagination parameters. cosmos.base.query.v1beta1.PageRequest pagination = 3; - + // RangeQuery specifies the from/to index keys for a range query. message RangeQuery { // from is the index key to use for the start of the range query. @@ -189,20 +194,20 @@ message ListExampleAutoIncrementTableRequest { // x specifies the value of the X index key to use in the query. X x = 2; } - + message Id { // id is the value of the id field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional uint64 id = 1; } - + message X { // x is the value of the x field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional string x = 1; } } - + // query specifies the type of query - either a prefix or range query. oneof query { // prefix_query specifies the index key value to use for the prefix query. @@ -212,7 +217,7 @@ message ListExampleAutoIncrementTableRequest { } // pagination specifies optional pagination parameters. cosmos.base.query.v1beta1.PageRequest pagination = 3; - + // RangeQuery specifies the from/to index keys for a range query. message RangeQuery { // from is the index key to use for the start of the range query. @@ -234,8 +239,7 @@ message ListExampleAutoIncrementTableResponse { } // GetExampleSingletonRequest is the TestSchemaQuery/GetExampleSingletonRequest request type. -message GetExampleSingletonRequest { -} +message GetExampleSingletonRequest {} // GetExampleSingletonResponse is the TestSchemaQuery/GetExampleSingletonResponse request type. message GetExampleSingletonResponse { @@ -265,20 +269,20 @@ message ListExampleTimestampRequest { // ts specifies the value of the Ts index key to use in the query. Ts ts = 2; } - + message Id { // id is the value of the id field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional uint64 id = 1; } - + message Ts { // ts is the value of the ts field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional google.protobuf.Timestamp ts = 1; } } - + // query specifies the type of query - either a prefix or range query. oneof query { // prefix_query specifies the index key value to use for the prefix query. @@ -288,7 +292,7 @@ message ListExampleTimestampRequest { } // pagination specifies optional pagination parameters. cosmos.base.query.v1beta1.PageRequest pagination = 3; - + // RangeQuery specifies the from/to index keys for a range query. message RangeQuery { // from is the index key to use for the start of the range query. @@ -332,20 +336,20 @@ message ListExampleDurationRequest { // dur specifies the value of the Dur index key to use in the query. Dur dur = 2; } - + message Id { // id is the value of the id field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional uint64 id = 1; } - + message Dur { // dur is the value of the dur field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional google.protobuf.Duration dur = 1; } } - + // query specifies the type of query - either a prefix or range query. oneof query { // prefix_query specifies the index key value to use for the prefix query. @@ -355,7 +359,7 @@ message ListExampleDurationRequest { } // pagination specifies optional pagination parameters. cosmos.base.query.v1beta1.PageRequest pagination = 3; - + // RangeQuery specifies the from/to index keys for a range query. message RangeQuery { // from is the index key to use for the start of the range query. @@ -409,20 +413,20 @@ message ListSimpleExampleRequest { // unique specifies the value of the Unique index key to use in the query. Unique unique = 2; } - + message Name { // name is the value of the name field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional string name = 1; } - + message Unique { // unique is the value of the unique field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional string unique = 1; } } - + // query specifies the type of query - either a prefix or range query. oneof query { // prefix_query specifies the index key value to use for the prefix query. @@ -432,7 +436,7 @@ message ListSimpleExampleRequest { } // pagination specifies optional pagination parameters. cosmos.base.query.v1beta1.PageRequest pagination = 3; - + // RangeQuery specifies the from/to index keys for a range query. message RangeQuery { // from is the index key to use for the start of the range query. @@ -474,14 +478,14 @@ message ListExampleAutoIncFieldNameRequest { // foo specifies the value of the Foo index key to use in the query. Foo foo = 1; } - + message Foo { // foo is the value of the foo field in the index. // It can be omitted to query for all valid values of that field in this segment of the index. optional uint64 foo = 1; } } - + // query specifies the type of query - either a prefix or range query. oneof query { // prefix_query specifies the index key value to use for the prefix query. @@ -491,7 +495,7 @@ message ListExampleAutoIncFieldNameRequest { } // pagination specifies optional pagination parameters. cosmos.base.query.v1beta1.PageRequest pagination = 3; - + // RangeQuery specifies the from/to index keys for a range query. message RangeQuery { // from is the index key to use for the start of the range query. @@ -511,4 +515,3 @@ message ListExampleAutoIncFieldNameResponse { // pagination is the pagination response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } - diff --git a/proto/cosmos/auth/v1beta1/auth.proto b/proto/cosmos/auth/v1beta1/auth.proto index bcac98314597..ebc18b69f052 100644 --- a/proto/cosmos/auth/v1beta1/auth.proto +++ b/proto/cosmos/auth/v1beta1/auth.proto @@ -18,15 +18,12 @@ message BaseAccount { option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; - string address = 1 [ - (cosmos_proto.scalar) = "cosmos.AddressString"]; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any pub_key = 2 [ - (gogoproto.jsontag) = "public_key,omitempty", - (amino.field_name) = "public_key"]; + google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (amino.field_name) = "public_key"]; - uint64 account_number = 3; - uint64 sequence = 4; + uint64 account_number = 3; + uint64 sequence = 4; } // ModuleAccount defines an account for modules that holds coins on a pool. diff --git a/proto/cosmos/autocli/v1/options.proto b/proto/cosmos/autocli/v1/options.proto index b023490c9709..bbd8583ccea5 100644 --- a/proto/cosmos/autocli/v1/options.proto +++ b/proto/cosmos/autocli/v1/options.proto @@ -30,6 +30,14 @@ message ServiceCommandDescriptor { // different protobuf services. The map key is used as the name of the // sub-command. map sub_commands = 3; +<<<<<<< HEAD +======= + + // enhance_custom_commands specifies whether to skip the service when generating commands, if a custom command already + // exists, or enhance the existing command. If set to true, the custom command will be enhanced with the services from + // gRPC. otherwise when a custom command exists, no commands will be generated for the service. + bool enhance_custom_command = 4; +>>>>>>> 066f8a7a5 (chore: format proto files (#17445)) } // RpcCommandOptions specifies options for commands generated from protobuf @@ -121,4 +129,11 @@ message PositionalArgDescriptor { // applied to last positional parameter and the proto_field must a repeated // field. bool varargs = 2; +<<<<<<< HEAD +======= + + // optional makes the last positional parameter optional. + // Note: It is mutually exclusive with varargs. + bool optional = 3; +>>>>>>> 066f8a7a5 (chore: format proto files (#17445)) } diff --git a/proto/cosmos/bank/module/v1/module.proto b/proto/cosmos/bank/module/v1/module.proto index eb26a80c9df9..2849dbf08972 100644 --- a/proto/cosmos/bank/module/v1/module.proto +++ b/proto/cosmos/bank/module/v1/module.proto @@ -10,8 +10,8 @@ message Module { go_import: "github.com/cosmos/cosmos-sdk/x/bank" }; - // blocked_module_accounts_override configures exceptional module accounts which should be blocked from receiving funds. - // If left empty it defaults to the list of account names supplied in the auth module configuration as + // blocked_module_accounts_override configures exceptional module accounts which should be blocked from receiving + // funds. If left empty it defaults to the list of account names supplied in the auth module configuration as // module_account_permissions repeated string blocked_module_accounts_override = 1; diff --git a/proto/cosmos/base/abci/v1beta1/abci.proto b/proto/cosmos/base/abci/v1beta1/abci.proto index fc3c0c6da503..9e3b4e55dbc7 100644 --- a/proto/cosmos/base/abci/v1beta1/abci.proto +++ b/proto/cosmos/base/abci/v1beta1/abci.proto @@ -27,10 +27,7 @@ message TxResponse { // non-deterministic. string raw_log = 6; // The output of the application's logger (typed). May be non-deterministic. - repeated ABCIMessageLog logs = 7 [ - (gogoproto.castrepeated) = "ABCIMessageLogs", - (gogoproto.nullable) = false - ]; + repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; // Additional information. May be non-deterministic. string info = 8; // Amount of gas requested for transaction. @@ -61,8 +58,7 @@ message ABCIMessageLog { // Events contains a slice of Event objects that were emitted during some // execution. - repeated StringEvent events = 3 - [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; + repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; } // StringEvent defines en Event object wrapper where all the attributes diff --git a/proto/cosmos/base/node/v1beta1/query.proto b/proto/cosmos/base/node/v1beta1/query.proto index 78fd9f6703a3..33dd9667ba32 100644 --- a/proto/cosmos/base/node/v1beta1/query.proto +++ b/proto/cosmos/base/node/v1beta1/query.proto @@ -35,9 +35,9 @@ message StatusRequest {} // StateResponse defines the response structure for the status of a node. message StatusResponse { - uint64 earliest_store_height = 1; // earliest block height available in the store - uint64 height = 2; // current block height - google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true]; // block height timestamp - bytes app_hash = 4; // app hash of the current block - bytes validator_hash = 5; // validator hash provided by the consensus header + uint64 earliest_store_height = 1; // earliest block height available in the store + uint64 height = 2; // current block height + google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true]; // block height timestamp + bytes app_hash = 4; // app hash of the current block + bytes validator_hash = 5; // validator hash provided by the consensus header } diff --git a/proto/cosmos/consensus/v1/tx.proto b/proto/cosmos/consensus/v1/tx.proto index 86ee7e245a6f..4323de703a5e 100644 --- a/proto/cosmos/consensus/v1/tx.proto +++ b/proto/cosmos/consensus/v1/tx.proto @@ -23,7 +23,7 @@ service Msg { // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "cosmos-sdk/x/consensus/MsgUpdateParams"; + option (amino.name) = "cosmos-sdk/x/consensus/MsgUpdateParams"; // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index fc14c5e10c53..32318bd81219 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -192,14 +192,14 @@ message MsgCommunityPoolSpendResponse {} // // Since: cosmos-sdk 0.50 message MsgDepositValidatorRewardsPool { - option (amino.name) = "cosmos-sdk/distr/MsgDepositValRewards"; + option (amino.name) = "cosmos-sdk/distr/MsgDepositValRewards"; option (cosmos.msg.v1.signer) = "depositor"; option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; repeated cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false, (amino.encoding) = "legacy_coins", diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 8b34e6f63032..c6ec98a41497 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -80,7 +80,8 @@ message Proposal { google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; // metadata is any arbitrary metadata attached to the proposal. - // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/gov#proposal-3 string metadata = 10; // title is the title of the proposal @@ -249,14 +250,15 @@ message Params { string expedited_threshold = 11 [(cosmos_proto.scalar) = "cosmos.Dec"]; // Minimum expedited deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin expedited_min_deposit = 12 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated cosmos.base.v1beta1.Coin expedited_min_deposit = 12 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // burn deposits if a proposal does not meet quorum bool burn_vote_quorum = 13; - + // burn deposits if the proposal does not enter voting period bool burn_proposal_deposit_prevote = 14; - + // burn deposits if quorum with vote type no_veto is met bool burn_vote_veto = 15; } diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index b8cdc7133dee..21920a5ffcf0 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -56,10 +56,10 @@ message MsgSubmitProposal { // initial_deposit is the deposit value that must be paid at proposal submission. repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (amino.dont_omitempty) = true, - (amino.encoding) = "legacy_coins" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" ]; // proposer is the account address of the proposer. @@ -196,7 +196,7 @@ message MsgCancelProposal { // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; // proposer is the account address of the proposer. - string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgCancelProposalResponse defines the response structure for executing a diff --git a/proto/cosmos/slashing/v1beta1/slashing.proto b/proto/cosmos/slashing/v1beta1/slashing.proto index ae2f2135f936..2347f34973cc 100644 --- a/proto/cosmos/slashing/v1beta1/slashing.proto +++ b/proto/cosmos/slashing/v1beta1/slashing.proto @@ -23,11 +23,8 @@ message ValidatorSigningInfo { // signed_blocks_window param determines the index in the missed block bitmap. int64 index_offset = 3; // Timestamp until which the validator is jailed due to liveness downtime. - google.protobuf.Timestamp jailed_until = 4 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; + google.protobuf.Timestamp jailed_until = 4 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // Whether or not a validator has been tombstoned (killed out of validator // set). It is set once the validator commits an equivocation or for any other // configured misbehavior. @@ -48,11 +45,8 @@ message Params { (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - google.protobuf.Duration downtime_jail_duration = 3 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (gogoproto.stdduration) = true - ]; + google.protobuf.Duration downtime_jail_duration = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; bytes slash_fraction_double_sign = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index 583f453b754f..24ec65d10202 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -220,7 +220,7 @@ message UnbondingDelegation { string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // entries are the unbonding delegation entries. repeated UnbondingDelegationEntry entries = 3 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding delegation entries + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding delegation entries } // UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -293,7 +293,7 @@ message Redelegation { string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // entries are the redelegation entries. repeated RedelegationEntry entries = 4 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegation entries + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegation entries } // Params defines the parameters for the x/staking module. diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index d3d0d8baa463..238645ba9232 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -159,7 +159,7 @@ message MsgUndelegateResponse { // amount returns the amount of undelegated coins // // Since: cosmos-sdk 0.50 - cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator diff --git a/proto/cosmos/store/v1beta1/commit_info.proto b/proto/cosmos/store/v1beta1/commit_info.proto index a931e3e7d762..37459a0d05a1 100644 --- a/proto/cosmos/store/v1beta1/commit_info.proto +++ b/proto/cosmos/store/v1beta1/commit_info.proto @@ -11,8 +11,7 @@ option go_package = "cosmossdk.io/store/types"; message CommitInfo { 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 diff --git a/proto/cosmos/store/v1beta1/listening.proto b/proto/cosmos/store/v1beta1/listening.proto index 24131a47df53..14bc2e7a78fd 100644 --- a/proto/cosmos/store/v1beta1/listening.proto +++ b/proto/cosmos/store/v1beta1/listening.proto @@ -11,8 +11,8 @@ option go_package = "cosmossdk.io/store/types"; // // Since: cosmos-sdk 0.43 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 + 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; } @@ -22,7 +22,7 @@ message StoreKVPair { 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? + 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/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto index 5cd848e09afc..7e19a1865259 100644 --- a/proto/cosmos/tx/v1beta1/service.proto +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -37,8 +37,7 @@ service Service { // GetBlockWithTxs fetches a block with decoded txs. // // Since: cosmos-sdk 0.45.2 - rpc GetBlockWithTxs(GetBlockWithTxsRequest) - returns (GetBlockWithTxsResponse) { + rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; } // TxDecode decodes the transaction. diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto index 04f98cf57f63..9ac0d932a3e1 100644 --- a/proto/cosmos/tx/v1beta1/tx.proto +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -207,10 +207,10 @@ message ModeInfo { message Fee { // amount is the amount of coins to be paid as a fee repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (amino.dont_omitempty) = true, - (amino.encoding) = "legacy_coins" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" ]; // gas_limit is the maximum gas that can be used in transaction processing @@ -234,10 +234,10 @@ message Fee { message Tip { // amount is the amount of the tip repeated cosmos.base.v1beta1.Coin amount = 1 [ - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (amino.dont_omitempty) = true, - (amino.encoding) = "legacy_coins" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" ]; // tipper is the address of the account paying for the tip string tipper = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index 73151984ff95..961ba321621c 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -25,10 +25,8 @@ service ABCI { rpc InitChain(RequestInitChain) returns (ResponseInitChain); rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); - rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) - returns (ResponseLoadSnapshotChunk); - rpc ApplySnapshotChunk(RequestApplySnapshotChunk) - returns (ResponseApplySnapshotChunk); + rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); rpc PrepareProposal(RequestPrepareProposal) returns (ResponsePrepareProposal); rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal); rpc ExtendVote(RequestExtendVote) returns (ResponseExtendVote); @@ -58,7 +56,7 @@ message Request { RequestVerifyVoteExtension verify_vote_extension = 19; RequestFinalizeBlock finalize_block = 20; } - reserved 4, 7, 9, 10; // SetOption, BeginBlock, DeliverTx, EndBlock + reserved 4, 7, 9, 10; // SetOption, BeginBlock, DeliverTx, EndBlock } message RequestEcho { @@ -75,8 +73,7 @@ message RequestInfo { } message RequestInitChain { - google.protobuf.Timestamp time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; string chain_id = 2; tendermint.types.ConsensusParams consensus_params = 3; repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; @@ -108,8 +105,8 @@ message RequestListSnapshots {} // offers a snapshot to the application message RequestOfferSnapshot { - Snapshot snapshot = 1; // snapshot offered by peers - bytes app_hash = 2; // light client-verified app hash for snapshot height + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height } // loads a snapshot chunk @@ -157,7 +154,7 @@ message RequestProcessProposal { // Extends a vote with application-injected data message RequestExtendVote { // the hash of the block that this vote may be referring to - bytes hash = 1; + bytes hash = 1; // the height of the extended vote int64 height = 2; } @@ -165,7 +162,7 @@ message RequestExtendVote { // Verify the vote extension message RequestVerifyVoteExtension { // the hash of the block that this received vote corresponds to - bytes hash = 1; + bytes hash = 1; // the validator that signed the vote extension bytes validator_address = 2; int64 height = 3; @@ -208,7 +205,7 @@ message Response { ResponseVerifyVoteExtension verify_vote_extension = 20; ResponseFinalizeBlock finalize_block = 21; } - reserved 5, 8, 10, 11; // SetOption, BeginBlock, DeliverTx, EndBlock + reserved 5, 8, 10, 11; // SetOption, BeginBlock, DeliverTx, EndBlock } // nondeterministic @@ -241,8 +238,8 @@ message ResponseInitChain { message ResponseQuery { uint32 code = 1; // bytes data = 2; // use "value" instead. - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 index = 5; bytes key = 6; bytes value = 7; @@ -254,13 +251,12 @@ message ResponseQuery { message ResponseCheckTx { uint32 code = 1; bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 gas_wanted = 5 [json_name = "gas_wanted"]; int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; - string codespace = 8; + repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; // These reserved fields were used until v0.37 by the priority mempool (now // removed). @@ -269,7 +265,7 @@ message ResponseCheckTx { } message ResponseCommit { - reserved 1, 2; // data was previously returned here + reserved 1, 2; // data was previously returned here int64 retain_height = 3; } @@ -281,12 +277,12 @@ message ResponseOfferSnapshot { Result result = 1; enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Snapshot accepted, apply chunks - ABORT = 2; // Abort all snapshot restoration - REJECT = 3; // Reject this specific snapshot, try others - REJECT_FORMAT = 4; // Reject all snapshots of this format, try others - REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Snapshot accepted, apply chunks + ABORT = 2; // Abort all snapshot restoration + REJECT = 3; // Reject this specific snapshot, try others + REJECT_FORMAT = 4; // Reject all snapshots of this format, try others + REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others } } @@ -296,16 +292,16 @@ message ResponseLoadSnapshotChunk { message ResponseApplySnapshotChunk { Result result = 1; - repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply - repeated string reject_senders = 3; // Chunk senders to reject and ban + repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply + repeated string reject_senders = 3; // Chunk senders to reject and ban enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Chunk successfully accepted - ABORT = 2; // Abort all snapshot restoration - RETRY = 3; // Retry chunk (combine with refetch and reject) - RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) - REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others } } @@ -337,14 +333,13 @@ message ResponseVerifyVoteExtension { // Incorrectly implementing this thus has liveness implications as it may affect // CometBFT's ability to receive 2/3+ valid votes to finalize the block. // Honest nodes should never be rejected. - REJECT = 2; + REJECT = 2; } } message ResponseFinalizeBlock { // set of block events emmitted as part of executing the block - repeated Event events = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // the result of executing each transaction including the events // the particular transction emitted. This should match the order // of the transactions delivered in the block itself @@ -353,7 +348,8 @@ message ResponseFinalizeBlock { repeated ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false]; // updates to the consensus params, if any. tendermint.types.ConsensusParams consensus_param_updates = 4; - // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was deterministic. It is up to the application to decide which algorithm to use. + // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was + // deterministic. It is up to the application to decide which algorithm to use. bytes app_hash = 5; } @@ -381,17 +377,14 @@ message ExtendedCommitInfo { // Later, transactions may be queried using these events. message Event { string type = 1; - repeated EventAttribute attributes = 2 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "attributes,omitempty" - ]; + repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"]; } // EventAttribute is a single key-value pair, associated with an event. message EventAttribute { string key = 1; string value = 2; - bool index = 3; // nondeterministic + bool index = 3; // nondeterministic } // ExecTxResult contains results of executing one individual transaction. @@ -400,12 +393,12 @@ message EventAttribute { message ExecTxResult { uint32 code = 1; bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 gas_wanted = 5; int64 gas_used = 6; repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic string codespace = 8; } @@ -423,9 +416,9 @@ message TxResult { // Blockchain Types message Validator { - bytes address = 1; // The first 20 bytes of SHA256(public key) + bytes address = 1; // The first 20 bytes of SHA256(public key) // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - int64 power = 3; // The voting power + int64 power = 3; // The voting power } message ValidatorUpdate { @@ -434,7 +427,7 @@ message ValidatorUpdate { } message VoteInfo { - Validator validator = 1 [(gogoproto.nullable) = false]; + Validator validator = 1 [(gogoproto.nullable) = false]; tendermint.types.BlockIDFlag block_id_flag = 3; reserved 2; // signed_last_block @@ -466,8 +459,7 @@ message Misbehavior { // The height when the offense occurred int64 height = 3; // The corresponding time where the offense occurred - google.protobuf.Timestamp time = 4 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // Total voting power of the validator set in case the ABCI application does // not store historical validators. // https://github.com/tendermint/tendermint/issues/4581 @@ -478,9 +470,9 @@ message Misbehavior { // State Sync Types message Snapshot { - uint64 height = 1; // The height at which the snapshot was taken - uint32 format = 2; // The application-specific snapshot format - uint32 chunks = 3; // Number of chunks in the snapshot - bytes hash = 4; // Arbitrary snapshot hash, equal only if identical - bytes metadata = 5; // Arbitrary application metadata + uint64 height = 1; // The height at which the snapshot was taken + uint32 format = 2; // The application-specific snapshot format + uint32 chunks = 3; // Number of chunks in the snapshot + bytes hash = 4; // Arbitrary snapshot hash, equal only if identical + bytes metadata = 5; // Arbitrary application metadata } diff --git a/proto/tendermint/types/evidence.proto b/proto/tendermint/types/evidence.proto index 1f35049bdc4f..06f30ec2f5f3 100644 --- a/proto/tendermint/types/evidence.proto +++ b/proto/tendermint/types/evidence.proto @@ -30,7 +30,7 @@ message LightClientAttackEvidence { int64 common_height = 2; repeated tendermint.types.Validator byzantine_validators = 3; int64 total_voting_power = 4; - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } message EvidenceList { diff --git a/proto/tendermint/types/params.proto b/proto/tendermint/types/params.proto index f96a2e2f5726..6a42d5ef0da7 100644 --- a/proto/tendermint/types/params.proto +++ b/proto/tendermint/types/params.proto @@ -27,7 +27,7 @@ message BlockParams { // Note: must be greater or equal to -1 int64 max_gas = 2; - reserved 3; // was TimeIotaMs see https://github.com/tendermint/tendermint/pull/5792 + reserved 3; // was TimeIotaMs see https://github.com/tendermint/tendermint/pull/5792 } // EvidenceParams determine how we handle evidence of malfeasance. @@ -43,8 +43,7 @@ message EvidenceParams { // It should correspond with an app's "unbonding period" or other similar // mechanism for handling [Nothing-At-Stake // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - google.protobuf.Duration max_age_duration = 2 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // This sets the maximum size of total evidence in bytes that can be committed in a single block. // and should fall comfortably under the max block bytes. diff --git a/proto/tendermint/types/types.proto b/proto/tendermint/types/types.proto index a527e2ffb217..a0d545ad9ee7 100644 --- a/proto/tendermint/types/types.proto +++ b/proto/tendermint/types/types.proto @@ -55,19 +55,19 @@ message Header { BlockID last_block_id = 5 [(gogoproto.nullable) = false]; // hashes of block data - bytes last_commit_hash = 6; // commit from validators from the last block - bytes data_hash = 7; // transactions + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions // hashes from the app output from the prev block - bytes validators_hash = 8; // validators for the current block - bytes next_validators_hash = 9; // validators for the next block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block // consensus info - bytes evidence_hash = 13; // evidence included in the block - bytes proposer_address = 14; // original proposer of the block + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block } // Data contains the set of transactions included in the block @@ -84,12 +84,10 @@ message Vote { SignedMsgType type = 1; int64 height = 2; int32 round = 3; - BlockID block_id = 4 - [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. - google.protobuf.Timestamp timestamp = 5 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes validator_address = 6; - int32 validator_index = 7; + BlockID block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes validator_address = 6; + int32 validator_index = 7; // Vote signature by the validator if they participated in consensus for the // associated block. bytes signature = 8; @@ -114,16 +112,14 @@ message Commit { message CommitSig { tendermint.types.BlockIDFlag block_id_flag = 1; bytes validator_address = 2; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 4; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; } message ExtendedCommit { - int64 height = 1; - int32 round = 2; - BlockID block_id = 3 - [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + int64 height = 1; + int32 round = 2; + BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; repeated ExtendedCommitSig extended_signatures = 4 [(gogoproto.nullable) = false]; } @@ -133,9 +129,8 @@ message ExtendedCommit { message ExtendedCommitSig { tendermint.types.BlockIDFlag block_id_flag = 1; bytes validator_address = 2; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 4; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; // Vote extension data bytes extension = 5; // Vote extension signature @@ -148,9 +143,8 @@ message Proposal { int32 round = 3; int32 pol_round = 4; BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 6 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 7; + google.protobuf.Timestamp timestamp = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 7; } message SignedHeader { diff --git a/proto/tendermint/types/validator.proto b/proto/tendermint/types/validator.proto index 7b55956fcdd1..cd5105fac765 100644 --- a/proto/tendermint/types/validator.proto +++ b/proto/tendermint/types/validator.proto @@ -11,13 +11,13 @@ enum BlockIDFlag { option (gogoproto.goproto_enum_stringer) = true; option (gogoproto.goproto_enum_prefix) = false; - BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; // indicates an error condition - BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; // the vote was not received - BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; // voted for the block that received the majority - BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; // voted for nil + BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; // indicates an error condition + BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; // the vote was not received + BLOCK_ID_FLAG_COMMIT = 2 + [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; // voted for the block that received the majority + BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; // voted for nil } - message ValidatorSet { repeated Validator validators = 1; Validator proposer = 2; diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 83f34bf8f89e..bd4193388c4b 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -35,3 +35,6 @@ rm -rf github.com cosmossdk.io go mod tidy ./scripts/protocgen-pulsar.sh + +echo "Formatting protobuf files" +find ./ -name "*.proto" -exec clang-format -i {} \; diff --git a/testutil/testdata/testpb/tx.proto b/testutil/testdata/testpb/tx.proto index 13e48c7702a7..d3b97193acf7 100644 --- a/testutil/testdata/testpb/tx.proto +++ b/testutil/testdata/testpb/tx.proto @@ -19,8 +19,8 @@ service Msg { message MsgCreateDog { option (cosmos.msg.v1.signer) = "owner"; - testpb.Dog dog = 1; - string owner = 2; + testpb.Dog dog = 1; + string owner = 2; } message MsgCreateDogResponse { @@ -30,9 +30,9 @@ message MsgCreateDogResponse { // TestMsg is msg type for testing protobuf message using any, as defined in // https://github.com/cosmos/cosmos-sdk/issues/6213. message TestMsg { - option (cosmos.msg.v1.signer) = "signers"; + option (cosmos.msg.v1.signer) = "signers"; option (gogoproto.goproto_getters) = false; - option (amino.name) = "testpb/TestMsg"; + option (amino.name) = "testpb/TestMsg"; - repeated string signers = 1; + repeated string signers = 1; } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index c4dcc507c9de..3929e47c9d79 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -264,7 +264,8 @@ type Proposal struct { // voting_end_time is the end time of voting on a proposal. VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` // metadata is any arbitrary metadata attached to the proposal. - // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/gov#proposal-3 Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` // title is the title of the proposal // diff --git a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto index 42566486be21..d28008c87dcf 100644 --- a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto +++ b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto @@ -10,22 +10,22 @@ import "cosmos/tx/v1beta1/tx.proto"; // by the name of the Gas field (GasLimit in txv1beta.Fee). // Note: this is only used for signing, see x/tx/signing/aminojson.go for more details. message AminoSignFee { - repeated cosmos.base.v1beta1.Coin amount = 1 [(amino.dont_omitempty) = true, (amino.encoding) = "legacy_coins"]; - uint64 gas = 2 [(amino.dont_omitempty) = true]; - string payer = 3; - string granter = 4; + repeated cosmos.base.v1beta1.Coin amount = 1 [(amino.dont_omitempty) = true, (amino.encoding) = "legacy_coins"]; + uint64 gas = 2 [(amino.dont_omitempty) = true]; + string payer = 3; + string granter = 4; } // AminoSignDoc is a message container used to generate the SIGN_MODE_LEGACY_AMINO_JSON sign bytes with proto3 API. // Note: This is only used for generated JSON in signing, see x/tx/signing/aminojson.go for more details. // We allow omitempty based on what is already defined in the legacy StdSignDoc. message AminoSignDoc { - uint64 account_number = 1 [(amino.dont_omitempty) = true]; - uint64 sequence = 2 [(amino.dont_omitempty) = true]; - uint64 timeout_height = 3; - string chain_id = 4 [(amino.dont_omitempty) = true]; - string memo = 5 [(amino.dont_omitempty) = true]; - AminoSignFee fee = 6 [(amino.dont_omitempty) = true]; + uint64 account_number = 1 [(amino.dont_omitempty) = true]; + uint64 sequence = 2 [(amino.dont_omitempty) = true]; + uint64 timeout_height = 3; + string chain_id = 4 [(amino.dont_omitempty) = true]; + string memo = 5 [(amino.dont_omitempty) = true]; + AminoSignFee fee = 6 [(amino.dont_omitempty) = true]; repeated google.protobuf.Any msgs = 7 [(amino.dont_omitempty) = true]; - cosmos.tx.v1beta1.Tip tip = 8; + cosmos.tx.v1beta1.Tip tip = 8; } \ No newline at end of file