From 459ee59e461fe201cdc3b66fa5423a3037f1c1c3 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 20 May 2018 16:15:58 -0400 Subject: [PATCH] Request/ResponseValidator, update Header --- types/types.proto | 51 ++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/types/types.proto b/types/types.proto index 00777dcfb..2fe8ea7b4 100644 --- a/types/types.proto +++ b/types/types.proto @@ -47,7 +47,7 @@ message RequestSetOption { } message RequestInitChain { - repeated Validator validators = 1 [(gogoproto.nullable)=false]; + repeated RequestValidator validators = 1 [(gogoproto.nullable)=false]; bytes genesis_bytes = 2; } @@ -61,8 +61,9 @@ message RequestQuery { message RequestBeginBlock { bytes hash = 1; Header header = 2 [(gogoproto.nullable)=false]; - repeated bytes absent_validators = 3; - repeated Evidence byzantine_validators = 4 [(gogoproto.nullable)=false]; + repeated RequestValidator present_validators = 3; + repeated RequestValidator absent_validators = 4; + repeated Evidence byzantine_validators = 5 [(gogoproto.nullable)=false]; } message RequestCheckTx { @@ -128,7 +129,7 @@ message ResponseSetOption { } message ResponseInitChain { - repeated Validator validators = 1 [(gogoproto.nullable)=false]; + repeated ResponseValidator validators = 1 [(gogoproto.nullable)=false]; } message ResponseQuery { @@ -170,7 +171,7 @@ message ResponseDeliverTx { } message ResponseEndBlock { - repeated Validator validator_updates = 1 [(gogoproto.nullable)=false]; + repeated ResponseValidator validator_updates = 1 [(gogoproto.nullable)=false]; ConsensusParams consensus_param_updates = 2; repeated common.KVPair tags = 3 [(gogoproto.nullable)=false, (gogoproto.jsontag)="tags,omitempty"]; } @@ -214,36 +215,44 @@ message BlockGossip { //---------------------------------------- // Blockchain Types +// just the minimum the app might need message Header { + // basics string chain_id = 1 [(gogoproto.customname)="ChainID"]; int64 height = 2; int64 time = 3; + + // txs int32 num_txs = 4; - BlockID last_block_id = 5 [(gogoproto.customname)="LastBlockID", (gogoproto.nullable)=false]; - bytes last_commit_hash = 6; - bytes data_hash = 7; - bytes validators_hash = 8; - bytes app_hash = 9; + int64 total_txs = 5; + + // hashes + bytes last_block_hash = 6; + bytes app_hash = 7; } -message BlockID { - bytes hash = 1; - PartSetHeader parts = 2 [(gogoproto.nullable)=false]; +// Validator for use in responses +message ResponseValidator { + PubKey pub_key = 1; + int64 power = 2; } -message PartSetHeader { - int32 total = 1; - bytes hash = 2; +// Validator for use in requests +message RequestValidator { + bytes address = 1; + int32 index = 2; + PubKey pub_key = 3; + int64 power = 4; } -message Validator { - bytes pub_key = 1; - int64 power = 2; +message PubKey { + string type = 1; + bytes data = 2; } message Evidence { - bytes type = 1; - bytes pub_key = 2; + string type = 1; + RequestValidator validator = 2; int64 height = 3; int64 time = 4; }