Skip to content

Commit

Permalink
(fixup) Sync thrid_party(Tendermint/Ostracon) proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
tnasu committed Jul 31, 2023
1 parent d3439fe commit 24d4a5b
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 32 deletions.
4 changes: 0 additions & 4 deletions third_party/proto/ostracon/abci/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ option go_package = "github.com/Finschia/ostracon/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/params.proto";
import "tendermint/abci/types.proto";
import "tendermint/types/types.proto";
import "ostracon/types/types.proto";
import "tendermint/crypto/keys.proto";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";

// This file is copied from http://github.com/tendermint/abci
Expand Down
22 changes: 22 additions & 0 deletions third_party/proto/ostracon/blockchain/types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";
package ostracon.blockchain;

option go_package = "github.com/Finschia/ostracon/proto/ostracon/blockchain";

import "ostracon/types/block.proto";
import "tendermint/blockchain/types.proto";

// BlockResponse returns block to the requested
message BlockResponse {
ostracon.types.Block block = 1;
}

message Message {
oneof sum {
tendermint.blockchain.BlockRequest block_request = 1;
tendermint.blockchain.NoBlockResponse no_block_response = 2;
BlockResponse block_response = 3;
tendermint.blockchain.StatusRequest status_request = 4;
tendermint.blockchain.StatusResponse status_response = 5;
}
}
32 changes: 32 additions & 0 deletions third_party/proto/ostracon/privval/types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
syntax = "proto3";
package ostracon.privval;

import "tendermint/privval/types.proto";

option go_package = "github.com/Finschia/ostracon/proto/ostracon/privval";

// VRFProofRequest is a PrivValidatorSocket message containing a message to generate proof.
message VRFProofRequest {
bytes message = 1;
}

// VRFProofResponse is a PrivValidatorSocket message containing a Proof.
message VRFProofResponse {
bytes proof = 1;
tendermint.privval.RemoteSignerError error = 2;
}

message Message {
oneof sum {
tendermint.privval.PubKeyRequest pub_key_request = 1;
tendermint.privval.PubKeyResponse pub_key_response = 2;
tendermint.privval.SignVoteRequest sign_vote_request = 3;
tendermint.privval.SignedVoteResponse signed_vote_response = 4;
tendermint.privval.SignProposalRequest sign_proposal_request = 5;
tendermint.privval.SignedProposalResponse signed_proposal_response = 6;
tendermint.privval.PingRequest ping_request = 7;
tendermint.privval.PingResponse ping_response = 8;
VRFProofRequest vrf_proof_request = 1000;
VRFProofResponse vrf_proof_response = 1001;
}
}
33 changes: 33 additions & 0 deletions third_party/proto/ostracon/rpc/grpc/types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
syntax = "proto3";
package ostracon.rpc.grpc;
option go_package = "github.com/Finschia/ostracon/rpc/grpc;coregrpc";

import "ostracon/abci/types.proto";
import "tendermint/abci/types.proto";

//----------------------------------------
// Request types

message RequestPing {}

message RequestBroadcastTx {
bytes tx = 1;
}

//----------------------------------------
// Response types

message ResponsePing {}

message ResponseBroadcastTx {
ostracon.abci.ResponseCheckTx check_tx = 1;
tendermint.abci.ResponseDeliverTx deliver_tx = 2;
}

//----------------------------------------
// Service Definition

service BroadcastAPI {
rpc Ping(RequestPing) returns (ResponsePing);
rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx);
}
53 changes: 53 additions & 0 deletions third_party/proto/ostracon/state/types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
syntax = "proto3";
package ostracon.state;

option go_package = "github.com/Finschia/ostracon/proto/ostracon/state";

import "gogoproto/gogo.proto";
import "tendermint/types/validator.proto";
import "tendermint/types/params.proto";
import "tendermint/types/types.proto";
import "google/protobuf/timestamp.proto";
import "tendermint/state/types.proto";

message State {
tendermint.state.Version version = 1 [(gogoproto.nullable) = false];

// immutable
string chain_id = 2 [(gogoproto.customname) = "ChainID"];
int64 initial_height = 14;

// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist)
int64 last_block_height = 3;
tendermint.types.BlockID last_block_id = 4
[(gogoproto.nullable) = false, (gogoproto.customname) = "LastBlockID"];
google.protobuf.Timestamp last_block_time = 5
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];

// LastValidators is used to validate block.LastCommit.
// Validators are persisted to the database separately every time they change,
// so we can query for historical validator sets.
// Note that if s.LastBlockHeight causes a valset change,
// we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1
// Extra +1 due to nextValSet delay.
tendermint.types.ValidatorSet next_validators = 6;
tendermint.types.ValidatorSet validators = 7;
tendermint.types.ValidatorSet last_validators = 8;
int64 last_height_validators_changed = 9;

// Consensus parameters used for validating blocks.
// Changes returned by EndBlock and updated after Commit.
tendermint.types.ConsensusParams consensus_params = 10 [(gogoproto.nullable) = false];
int64 last_height_consensus_params_changed = 11;

// Merkle root of the results from executing prev block
bytes last_results_hash = 12;

// the latest AppHash we've received from calling abci.Commit()
bytes app_hash = 13;

// *** Ostracon Extended Fields ***

// the VRF Proof value generated by the last Proposer
bytes last_proof_hash = 1000;
}
34 changes: 20 additions & 14 deletions third_party/proto/tendermint/abci/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ message RequestEndBlock {
message RequestCommit {}

// lists available snapshots
message RequestListSnapshots {
}
message RequestListSnapshots {}

// offers a snapshot to the application
message RequestOfferSnapshot {
Expand Down Expand Up @@ -212,6 +211,12 @@ message ResponseCheckTx {
repeated Event events = 7
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
string codespace = 8;
string sender = 9;
int64 priority = 10;

// mempool_error is set by Tendermint.
// ABCI applictions creating a ResponseCheckTX should not set mempool_error.
string mempool_error = 11;
}

message ResponseDeliverTx {
Expand All @@ -221,16 +226,17 @@ message ResponseDeliverTx {
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"]; // nondeterministic
repeated Event events = 7 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "events,omitempty"
]; // nondeterministic
string codespace = 8;
}

message ResponseEndBlock {
repeated ValidatorUpdate validator_updates = 1
[(gogoproto.nullable) = false];
ConsensusParams consensus_param_updates = 2;
repeated Event events = 3
repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false];
ConsensusParams consensus_param_updates = 2;
repeated Event events = 3
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
}

Expand Down Expand Up @@ -364,10 +370,8 @@ message Evidence {
// 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
Expand Down Expand Up @@ -402,6 +406,8 @@ service ABCIApplication {
rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
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);
}
2 changes: 1 addition & 1 deletion third_party/proto/tendermint/consensus/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ message NewRoundStep {
}

// NewValidBlock is sent when a validator observes a valid block B in some round r,
//i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
// i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
// In case the block is also committed, then IsCommit flag is set to true.
message NewValidBlock {
int64 height = 1;
Expand Down
5 changes: 5 additions & 0 deletions third_party/proto/tendermint/state/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ message ConsensusParamsInfo {
int64 last_height_changed = 2;
}

message ABCIResponsesInfo {
ABCIResponses abci_responses = 1;
int64 height = 2;
}

message Version {
tendermint.version.Consensus consensus = 1 [(gogoproto.nullable) = false];
string software = 2;
Expand Down
18 changes: 9 additions & 9 deletions third_party/proto/tendermint/types/evidence.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ message Evidence {

// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes.
message DuplicateVoteEvidence {
tendermint.types.Vote vote_a = 1;
tendermint.types.Vote vote_b = 2;
int64 total_voting_power = 3;
int64 validator_power = 4;
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
tendermint.types.Vote vote_a = 1;
tendermint.types.Vote vote_b = 2;
int64 total_voting_power = 3;
int64 validator_power = 4;
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}

// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client.
message LightClientAttackEvidence {
tendermint.types.LightBlock conflicting_block = 1;
int64 common_height = 2;
tendermint.types.LightBlock conflicting_block = 1;
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];
int64 total_voting_power = 4;
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}

message EvidenceList {
Expand Down
8 changes: 4 additions & 4 deletions third_party/proto/tendermint/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ message Vote {

// Commit contains the evidence that a block was committed by a set of validators.
message Commit {
int64 height = 1;
int32 round = 2;
BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
repeated CommitSig signatures = 4 [(gogoproto.nullable) = false];
int64 height = 1;
int32 round = 2;
BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
repeated CommitSig signatures = 4 [(gogoproto.nullable) = false];
}

// CommitSig is a part of the Vote included in a Commit.
Expand Down

0 comments on commit 24d4a5b

Please sign in to comment.