From 81d5218f179bfc996f9e7f5db16f09790db225e1 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Wed, 6 Apr 2022 22:12:50 -0400 Subject: [PATCH] proto fixup --- proto/tendermint/abci/types.proto | 101 +++++++++++++++--------------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index 65ef00fd7..354c68fce 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -3,6 +3,8 @@ package tendermint.abci; option go_package = "github.com/tendermint/tendermint/abci/types"; +// For more information on gogo.proto, see: +// https://github.com/gogo/protobuf/blob/master/extensions.md import "tendermint/crypto/proof.proto"; import "tendermint/types/types.proto"; import "tendermint/crypto/keys.proto"; @@ -10,14 +12,9 @@ import "tendermint/types/params.proto"; import "google/protobuf/timestamp.proto"; import "gogoproto/gogo.proto"; -// This file is a temporary workaround to enable development during the ABCI++ -// project. This file should be deleted and any references to it removed when -// the ongoing work on ABCI++ is completed. -// -// For the duration of ABCI++, this file should be able to build the `abci/types/types.pb.go` -// file. Any changes that update that file must come as a result of a change in -// this .proto file. -// For more information, see https://github.com/tendermint/tendermint/issues/8066 +// This file is copied from http://github.com/tendermint/abci +// NOTE: When using custom types, mind the warnings. +// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues //---------------------------------------- // Request types @@ -139,32 +136,10 @@ message RequestPrepareProposal { bytes proposer_address = 7; bytes next_validators_hash = 8; // the modified transactions cannot exceed this size. - int64 max_tx_bytes = 8; + int64 max_tx_bytes = 9; } message RequestProcessProposal { - bytes hash = 1; - int64 height = 2; - google.protobuf.Timestamp time = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - repeated bytes txs = 4; - CommitInfo proposed_last_commit = 5 [(gogoproto.nullable) = false]; - repeated Evidence byzantine_validators = 6 [(gogoproto.nullable) = false]; - // address of the public key of the original proposer of the block. - bytes proposer_address = 7; - bytes next_validators_hash = 8; -} - -// Extends a vote with application-side injection -message RequestExtendVote { - types.Vote vote = 1; -} - -// Verify the vote extension -message RequestVerifyVoteExtension { - types.Vote vote = 1; -} - -message RequestFinalizeBlock { bytes hash = 1; int64 height = 2; google.protobuf.Timestamp time = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; @@ -176,6 +151,28 @@ message RequestFinalizeBlock { bytes next_validators_hash = 8; } +// Extends a vote with application-side injection +message RequestExtendVote { + bytes hash = 1; + int64 height = 2; +} + +// Verify the vote extension +message RequestVerifyVoteExtension { + bytes hash = 1; + bytes validator_address = 2; + int64 height = 3; + bytes vote_extension = 4; +} + +message RequestFinalizeBlock { + bytes hash = 1; + tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; + repeated bytes txs = 3; + CommitInfo decided_last_commit = 4 [(gogoproto.nullable) = false]; + repeated Evidence byzantine_validators = 5 [(gogoproto.nullable) = false]; +} + //---------------------------------------- // Response types @@ -328,18 +325,11 @@ message ResponseApplySnapshotChunk { } message ResponsePrepareProposal { - ModifiedTxStatus modified_tx_status = 1; - repeated TxRecord tx_records = 2; - bytes app_hash = 3; - repeated ExecTxResult tx_results = 4; - repeated ValidatorUpdate validator_updates = 5; - tendermint.types.ConsensusParams consensus_param_updates = 6; - - enum ModifiedTxStatus { - UNKNOWN = 0; - UNMODIFIED = 1; - MODIFIED = 2; - } + repeated TxRecord tx_records = 1; + bytes app_hash = 2; + repeated ExecTxResult tx_results = 3; + repeated ValidatorUpdate validator_updates = 4; + tendermint.types.ConsensusParams consensus_param_updates = 5; } message ResponseProcessProposal { @@ -357,7 +347,7 @@ message ResponseProcessProposal { } message ResponseExtendVote { - tendermint.types.VoteExtension vote_extension = 1; + bytes vote_extension = 1; } message ResponseVerifyVoteExtension { @@ -374,7 +364,7 @@ message ResponseFinalizeBlock { repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; repeated ExecTxResult tx_results = 2; - repeated ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false]; + repeated ValidatorUpdate validator_updates = 3; tendermint.types.ConsensusParams consensus_param_updates = 4; bytes app_hash = 5; int64 retain_height = 6; @@ -427,10 +417,10 @@ message ExecTxResult { // // One usage is indexing transaction results. message TxResult { - int64 height = 1; - uint32 index = 2; - bytes tx = 3; - ExecTxResult result = 4 [(gogoproto.nullable) = false]; + int64 height = 1; + uint32 index = 2; + bytes tx = 3; + ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; } message TxRecord { @@ -466,16 +456,25 @@ message ValidatorUpdate { message VoteInfo { Validator validator = 1 [(gogoproto.nullable) = false]; bool signed_last_block = 2; - reserved 3; // Placeholder for tendermint_signed_extension in v0.37 - reserved 4; // Placeholder for app_signed_extension in v0.37 } +// ExtendedVoteInfo message ExtendedVoteInfo { Validator validator = 1 [(gogoproto.nullable) = false]; bool signed_last_block = 2; bytes vote_extension = 3; } +// CanonicalVoteExtension +// TODO: move this to core Tendermint data structures +message CanonicalVoteExtension { + bytes extension = 1; + int64 height = 2; + int32 round = 3; + string chain_id = 4; + bytes address = 5; +} + enum EvidenceType { UNKNOWN = 0; DUPLICATE_VOTE = 1;