From 480e4e4444842a4709c38e80729afe96f47df1ac Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 9 Nov 2017 16:19:59 -0500 Subject: [PATCH 01/80] install protoc --- Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6c99e3639..b9ef0b334 100644 --- a/Makefile +++ b/Makefile @@ -7,12 +7,22 @@ all: protoc install test PACKAGES=$(shell go list ./... | grep -v '/vendor/') -install-protoc: - # Download: https://github.com/google/protobuf/releases +install_protoc: + # https://github.com/google/protobuf/releases + curl -L https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz | tar xvz && \ + cd protobuf-cpp-3.4.1 && \ + DIST_LANG=cpp ./configure && \ + make && \ + make install && \ + cd .. && \ + rm -rf protobuf-cpp-3.4.1 go get github.com/golang/protobuf/protoc-gen-go protoc: - @ protoc --go_out=plugins=grpc:. types/*.proto + ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" + ## ldconfig (may require sudo) + ## https://stackoverflow.com/a/25518702 + protoc --go_out=plugins=grpc:. types/*.proto install: @ go install ./cmd/... @@ -79,4 +89,4 @@ metalinter_test: tools #--enable=unparam \ #--enable=vet \ -.PHONY: all build test fmt get_deps tools +.PHONY: all build test fmt get_deps tools protoc install_protoc From 87072d3810e2c69588ff646746654d3161656dde Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 9 Nov 2017 16:19:29 -0500 Subject: [PATCH 02/80] add Dockerfile for development --- Dockerfile.develop | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Dockerfile.develop diff --git a/Dockerfile.develop b/Dockerfile.develop new file mode 100644 index 000000000..daf6cb617 --- /dev/null +++ b/Dockerfile.develop @@ -0,0 +1,15 @@ +FROM golang:latest + +RUN mkdir -p /go/src/github.com/tendermint/abci +WORKDIR /go/src/github.com/tendermint/abci + +COPY Makefile /go/src/github.com/tendermint/abci/ + +RUN make install_protoc + +COPY glide.yaml /go/src/github.com/tendermint/abci/ +COPY glide.lock /go/src/github.com/tendermint/abci/ + +RUN make get_vendor_deps + +COPY . /go/src/github.com/tendermint/abci From f07c300c148ddad93a541e7b753b094ee26614e9 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 9 Nov 2017 16:49:06 -0500 Subject: [PATCH 03/80] add proto section to .editorconfig --- .editorconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.editorconfig b/.editorconfig index d587999e1..82f774362 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,7 @@ indent_style = tab [*.sh] indent_style = tab + +[*.proto] +indent_style = space +indent_size = 2 From bb0d7e95261243336cb2114dcf447d307a2edfb8 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 9 Nov 2017 16:52:52 -0500 Subject: [PATCH 04/80] add tags field to DeliverTx and CheckTx --- client/local_client.go | 4 +- server/socket_server.go | 4 +- types/application.go | 4 +- types/messages.go | 10 +- types/result.go | 3 + types/types.pb.go | 275 ++++++++++++++++++++++++---------------- types/types.proto | 17 ++- 7 files changed, 192 insertions(+), 125 deletions(-) diff --git a/client/local_client.go b/client/local_client.go index 8494a468f..13ebc0909 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -75,7 +75,7 @@ func (app *localClient) DeliverTxAsync(tx []byte) *ReqRes { app.mtx.Unlock() return app.callback( types.ToRequestDeliverTx(tx), - types.ToResponseDeliverTx(res.Code, res.Data, res.Log), + types.ToResponseDeliverTx(res.Code, res.Data, res.Log, res.Tags), ) } @@ -85,7 +85,7 @@ func (app *localClient) CheckTxAsync(tx []byte) *ReqRes { app.mtx.Unlock() return app.callback( types.ToRequestCheckTx(tx), - types.ToResponseCheckTx(res.Code, res.Data, res.Log), + types.ToResponseCheckTx(res.Code, res.Data, res.Log, res.Tags), ) } diff --git a/server/socket_server.go b/server/socket_server.go index 2396c556d..3e8ef942d 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -176,10 +176,10 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types responses <- types.ToResponseSetOption(logStr) case *types.Request_DeliverTx: res := s.app.DeliverTx(r.DeliverTx.Tx) - responses <- types.ToResponseDeliverTx(res.Code, res.Data, res.Log) + responses <- types.ToResponseDeliverTx(res.Code, res.Data, res.Log, res.Tags) case *types.Request_CheckTx: res := s.app.CheckTx(r.CheckTx.Tx) - responses <- types.ToResponseCheckTx(res.Code, res.Data, res.Log) + responses <- types.ToResponseCheckTx(res.Code, res.Data, res.Log, res.Tags) case *types.Request_Commit: res := s.app.Commit() responses <- types.ToResponseCommit(res.Code, res.Data, res.Log) diff --git a/types/application.go b/types/application.go index 3d9716b74..fcda5d95b 100644 --- a/types/application.go +++ b/types/application.go @@ -53,12 +53,12 @@ func (app *GRPCApplication) SetOption(ctx context.Context, req *RequestSetOption func (app *GRPCApplication) DeliverTx(ctx context.Context, req *RequestDeliverTx) (*ResponseDeliverTx, error) { r := app.app.DeliverTx(req.Tx) - return &ResponseDeliverTx{r.Code, r.Data, r.Log}, nil + return &ResponseDeliverTx{r.Code, r.Data, r.Log, r.Tags}, nil } func (app *GRPCApplication) CheckTx(ctx context.Context, req *RequestCheckTx) (*ResponseCheckTx, error) { r := app.app.CheckTx(req.Tx) - return &ResponseCheckTx{r.Code, r.Data, r.Log}, nil + return &ResponseCheckTx{r.Code, r.Data, r.Log, r.Tags}, nil } func (app *GRPCApplication) Query(ctx context.Context, req *RequestQuery) (*ResponseQuery, error) { diff --git a/types/messages.go b/types/messages.go index be272c387..d4a582964 100644 --- a/types/messages.go +++ b/types/messages.go @@ -4,7 +4,7 @@ import ( "io" "github.com/golang/protobuf/proto" - "github.com/tendermint/go-wire" + wire "github.com/tendermint/go-wire" ) func ToRequestEcho(message string) *Request { @@ -105,15 +105,15 @@ func ToResponseSetOption(log string) *Response { } } -func ToResponseDeliverTx(code CodeType, data []byte, log string) *Response { +func ToResponseDeliverTx(code CodeType, data []byte, log string, tags []*KVPair) *Response { return &Response{ - Value: &Response_DeliverTx{&ResponseDeliverTx{code, data, log}}, + Value: &Response_DeliverTx{&ResponseDeliverTx{code, data, log, tags}}, } } -func ToResponseCheckTx(code CodeType, data []byte, log string) *Response { +func ToResponseCheckTx(code CodeType, data []byte, log string, tags []*KVPair) *Response { return &Response{ - Value: &Response_CheckTx{&ResponseCheckTx{code, data, log}}, + Value: &Response_CheckTx{&ResponseCheckTx{code, data, log, tags}}, } } diff --git a/types/result.go b/types/result.go index abf1e964c..84f877dc8 100644 --- a/types/result.go +++ b/types/result.go @@ -12,6 +12,7 @@ type Result struct { Code CodeType `json:"code"` Data data.Bytes `json:"data"` Log string `json:"log"` // Can be non-deterministic + Tags []*KVPair `json:"tags"` } func NewResult(code CodeType, data []byte, log string) Result { @@ -102,6 +103,7 @@ func (r *ResponseCheckTx) Result() Result { Code: r.Code, Data: r.Data, Log: r.Log, + Tags: r.Tags, } } @@ -111,6 +113,7 @@ func (r *ResponseDeliverTx) Result() Result { Code: r.Code, Data: r.Data, Log: r.Log, + Tags: r.Tags, } } diff --git a/types/types.pb.go b/types/types.pb.go index 4ca304ac7..99396259b 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: types/types.proto -// DO NOT EDIT! /* Package types is a generated protocol buffer package. @@ -38,6 +37,7 @@ It has these top-level messages: BlockID PartSetHeader Validator + KVPair */ package types @@ -1297,9 +1297,10 @@ func (m *ResponseSetOption) GetLog() string { } type ResponseDeliverTx struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` } func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } @@ -1328,10 +1329,18 @@ func (m *ResponseDeliverTx) GetLog() string { return "" } +func (m *ResponseDeliverTx) GetTags() []*KVPair { + if m != nil { + return m.Tags + } + return nil +} + type ResponseCheckTx struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } @@ -1360,6 +1369,13 @@ func (m *ResponseCheckTx) GetLog() string { return "" } +func (m *ResponseCheckTx) GetTags() []*KVPair { + if m != nil { + return m.Tags + } + return nil +} + type ResponseQuery struct { Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` @@ -1640,6 +1656,38 @@ func (m *Validator) GetPower() uint64 { return 0 } +type KVPair struct { + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + ValueString string `protobuf:"bytes,2,opt,name=value_string,json=valueString" json:"value_string,omitempty"` + ValueInt int64 `protobuf:"varint,3,opt,name=value_int,json=valueInt" json:"value_int,omitempty"` +} + +func (m *KVPair) Reset() { *m = KVPair{} } +func (m *KVPair) String() string { return proto.CompactTextString(m) } +func (*KVPair) ProtoMessage() {} +func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } + +func (m *KVPair) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *KVPair) GetValueString() string { + if m != nil { + return m.ValueString + } + return "" +} + +func (m *KVPair) GetValueInt() int64 { + if m != nil { + return m.ValueInt + } + return 0 +} + func init() { proto.RegisterType((*Request)(nil), "types.Request") proto.RegisterType((*RequestEcho)(nil), "types.RequestEcho") @@ -1670,6 +1718,7 @@ func init() { proto.RegisterType((*BlockID)(nil), "types.BlockID") proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") proto.RegisterType((*Validator)(nil), "types.Validator") + proto.RegisterType((*KVPair)(nil), "types.KVPair") proto.RegisterEnum("types.CodeType", CodeType_name, CodeType_value) } @@ -2078,107 +2127,111 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1625 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x59, 0x6f, 0xdb, 0xc6, - 0x16, 0x36, 0xb5, 0xeb, 0xd8, 0x96, 0xe9, 0xb1, 0x6c, 0xcb, 0xba, 0xf7, 0x21, 0xe0, 0x45, 0x6e, - 0xec, 0xdc, 0xdc, 0xa4, 0x70, 0x90, 0x22, 0x6e, 0x8a, 0x02, 0xde, 0x62, 0x0b, 0x41, 0x13, 0x97, - 0x59, 0x5e, 0x5a, 0x54, 0xa0, 0xc9, 0x91, 0xc4, 0x5a, 0x9a, 0x61, 0xc8, 0xa1, 0x23, 0xf7, 0x37, - 0xe4, 0xbd, 0x3f, 0xa1, 0xef, 0x05, 0xfa, 0x17, 0x0a, 0x74, 0x5f, 0x7e, 0x51, 0x31, 0x0b, 0x57, - 0x93, 0x41, 0x1f, 0xf2, 0x22, 0xf0, 0x6c, 0x33, 0x73, 0xce, 0x9c, 0xf3, 0x9d, 0x33, 0x82, 0x55, - 0x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xed, 0x17, 0xce, 0x96, 0xe8, 0x01, 0x34, 0x54, 0xdb, 0x2b, 0x7c, 0x51, 0xf7, 0x8b, - 0x27, 0x58, 0xee, 0x64, 0xf2, 0x30, 0x2a, 0x7b, 0x2a, 0xf7, 0x4b, 0x67, 0x53, 0xb4, 0x0f, 0x90, - 0x7a, 0x12, 0x95, 0x3e, 0x98, 0xfb, 0xe5, 0x13, 0x2a, 0x7a, 0x04, 0xad, 0xe4, 0x15, 0x54, 0xfc, - 0x6c, 0xee, 0x97, 0x0d, 0xa9, 0xe7, 0x0d, 0xf1, 0x8f, 0xcc, 0xfd, 0xbf, 0x03, 0x00, 0x00, 0xff, - 0xff, 0xbd, 0xb6, 0xa5, 0xad, 0xa6, 0x11, 0x00, 0x00, + // 1691 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x49, 0x6f, 0x1b, 0xc9, + 0x15, 0x56, 0x73, 0xe7, 0x13, 0x45, 0xb5, 0x4a, 0x94, 0x44, 0x31, 0x39, 0xd8, 0x1d, 0x38, 0x96, + 0x1c, 0xc7, 0x0e, 0x64, 0x38, 0xb0, 0xe2, 0x20, 0x80, 0x36, 0x4b, 0x84, 0x11, 0x5b, 0x69, 0x2f, + 0x87, 0xe4, 0x40, 0xb4, 0xd8, 0x45, 0xb2, 0x22, 0xb2, 0xaa, 0xdd, 0x5d, 0x2d, 0x53, 0xb9, 0x04, + 0xb9, 0xfb, 0x9e, 0x9f, 0x30, 0xf7, 0x01, 0xe6, 0x2f, 0x0c, 0x30, 0xfb, 0xf2, 0x8b, 0x06, 0xb5, + 0xf4, 0xaa, 0xa6, 0x31, 0x87, 0xc1, 0x5c, 0x88, 0x7e, 0x5b, 0x55, 0xbd, 0x57, 0xef, 0x7d, 0xef, + 0x15, 0x61, 0x8d, 0x5f, 0x7b, 0x38, 0x78, 0x28, 0x7f, 0x1f, 0x78, 0x3e, 0xe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 0x4b, 0x61, 0xec, 0x6a, 0x29, 0x05, 0x8c, 0x7a, 0x83, 0x72, + 0xbc, 0x01, 0xba, 0x0d, 0x15, 0xee, 0x8c, 0x83, 0x6e, 0x45, 0xa2, 0x57, 0x04, 0x33, 0xcf, 0xdf, + 0x9e, 0x3b, 0xc4, 0xb7, 0xa5, 0xc8, 0xfa, 0xaf, 0x00, 0x99, 0x4c, 0x86, 0xff, 0xca, 0x07, 0xf8, + 0xd4, 0x48, 0xee, 0x55, 0x81, 0xfe, 0xcf, 0xda, 0xbf, 0x03, 0x55, 0x42, 0x5d, 0x3c, 0x97, 0x07, + 0x28, 0xdb, 0x8a, 0x88, 0xba, 0x55, 0x59, 0x1e, 0x2a, 0xdb, 0xad, 0xd4, 0x5d, 0x29, 0x42, 0xf7, + 0x05, 0x36, 0x92, 0xf8, 0xd2, 0xb2, 0x15, 0x91, 0x42, 0xd7, 0x5a, 0xa6, 0x8b, 0x68, 0xbf, 0xea, + 0xc9, 0xcd, 0xfd, 0x4b, 0x74, 0xb2, 0x74, 0x91, 0xff, 0x82, 0x41, 0xb3, 0xd6, 0x93, 0xac, 0x88, + 0xcb, 0xdb, 0xea, 0x00, 0xba, 0x59, 0xb7, 0xaa, 0x63, 0x67, 0x2b, 0x12, 0xfd, 0x1e, 0xaa, 0x2e, + 0x19, 0x8d, 0x16, 0xf7, 0x2c, 0x25, 0xb6, 0x3e, 0x29, 0x41, 0x4d, 0x75, 0x1c, 0xb4, 0x2d, 0xd0, + 0xcf, 0x21, 0x74, 0x40, 0xdc, 0xa8, 0xea, 0x24, 0xdd, 0x77, 0x53, 0x31, 0x29, 0x65, 0x62, 0x82, + 0xa0, 0xc2, 0xc9, 0x0c, 0xeb, 0x82, 0x91, 0xdf, 0x68, 0x0b, 0xea, 0x34, 0x9c, 0x0d, 0xf8, 0x3c, + 0x90, 0xd1, 0xae, 0xd8, 0x35, 0x1a, 0xce, 0x5e, 0xcf, 0x03, 0xb4, 0x07, 0x2b, 0xa9, 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, 0x7c, 0xa7, 0xf7, 0x8a, 0x26, 0x63, 0xf4, 0x37, 0x68, 0x26, 0x53, 0xc4, 0xa2, + 0xd7, 0x7a, 0x6f, 0xe1, 0x8c, 0x2c, 0xec, 0x93, 0xe9, 0x62, 0xd1, 0x9b, 0xbd, 0xb7, 0x70, 0x50, + 0x46, 0x4f, 0xa0, 0x1e, 0x8d, 0x06, 0xc5, 0x2f, 0xf7, 0xde, 0x82, 0x59, 0x59, 0x84, 0x47, 0xb5, + 0xf4, 0xa2, 0x07, 0x79, 0xaf, 0x70, 0xfc, 0x45, 0x8f, 0xa1, 0xa6, 0x5b, 0x6a, 0xe1, 0xa3, 0xbf, + 0x57, 0x3c, 0x64, 0x0b, 0x27, 0x93, 0xb7, 0xdb, 0xa2, 0xd7, 0x7c, 0x6f, 0xe1, 0xf8, 0x8c, 0x0e, + 0x00, 0x52, 0xaf, 0xb6, 0x85, 0x6f, 0xfa, 0xde, 0xe2, 0x21, 0x1a, 0x3d, 0x85, 0x46, 0xf2, 0x50, + 0x2b, 0x7e, 0xd9, 0xf7, 0x16, 0xcd, 0xd1, 0x17, 0x35, 0xf9, 0xa7, 0xd1, 0xa3, 0x9f, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x37, 0x8d, 0xa7, 0x8f, 0x49, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 802d8fc5c..6d19a8ed4 100644 --- a/types/types.proto +++ b/types/types.proto @@ -156,15 +156,17 @@ message ResponseSetOption{ } message ResponseDeliverTx{ - CodeType code = 1; - bytes data = 2; - string log = 3; + CodeType code = 1; + bytes data = 2; + string log = 3; + repeated KVPair tags = 4; } message ResponseCheckTx{ CodeType code = 1; bytes data = 2; string log = 3; + repeated KVPair tags = 4; } message ResponseQuery{ @@ -224,6 +226,15 @@ message Validator { uint64 power = 2; } +//---------------------------------------- +// Abstract types + +message KVPair { + string key = 1; + string value_string = 2; + int64 value_int = 3; +} + //---------------------------------------- // Service Definition From 33b51378f27c4aa8015c960f109295cd286f28a8 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 9 Nov 2017 16:56:24 -0500 Subject: [PATCH 05/80] reformat types.proto --- types/types.proto | 242 +++++++++++++++++++++++----------------------- 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/types/types.proto b/types/types.proto index 6d19a8ed4..09dcb1bd8 100644 --- a/types/types.proto +++ b/types/types.proto @@ -7,42 +7,42 @@ package types; // Code types enum CodeType { - OK = 0; + OK = 0; - // General response codes, 0 ~ 99 - InternalError = 1; - EncodingError = 2; - BadNonce = 3; - Unauthorized = 4; - InsufficientFunds = 5; - UnknownRequest = 6; + // General response codes, 0 ~ 99 + InternalError = 1; + EncodingError = 2; + BadNonce = 3; + Unauthorized = 4; + InsufficientFunds = 5; + UnknownRequest = 6; - // Reserved for basecoin, 100 ~ 199 - BaseDuplicateAddress = 101; - BaseEncodingError = 102; - BaseInsufficientFees = 103; - BaseInsufficientFunds = 104; - BaseInsufficientGasPrice = 105; - BaseInvalidInput = 106; - BaseInvalidOutput = 107; - BaseInvalidPubKey = 108; - BaseInvalidSequence = 109; - BaseInvalidSignature = 110; - BaseUnknownAddress = 111; - BaseUnknownPubKey = 112; - BaseUnknownPlugin = 113; + // Reserved for basecoin, 100 ~ 199 + BaseDuplicateAddress = 101; + BaseEncodingError = 102; + BaseInsufficientFees = 103; + BaseInsufficientFunds = 104; + BaseInsufficientGasPrice = 105; + BaseInvalidInput = 106; + BaseInvalidOutput = 107; + BaseInvalidPubKey = 108; + BaseInvalidSequence = 109; + BaseInvalidSignature = 110; + BaseUnknownAddress = 111; + BaseUnknownPubKey = 112; + BaseUnknownPlugin = 113; - // Reserved for governance, 200 ~ 299 - GovUnknownEntity = 201; - GovUnknownGroup = 202; - GovUnknownProposal = 203; - GovDuplicateGroup = 204; - GovDuplicateMember = 205; - GovDuplicateProposal = 206; - GovDuplicateVote = 207; - GovInvalidMember = 208; - GovInvalidVote = 209; - GovInvalidVotingPower = 210; + // Reserved for governance, 200 ~ 299 + GovUnknownEntity = 201; + GovUnknownGroup = 202; + GovUnknownProposal = 203; + GovDuplicateGroup = 204; + GovDuplicateMember = 205; + GovDuplicateProposal = 206; + GovDuplicateVote = 207; + GovInvalidMember = 208; + GovInvalidVote = 209; + GovInvalidVotingPower = 210; } @@ -50,66 +50,66 @@ enum CodeType { // Request types message Request { - oneof value{ - RequestEcho echo = 1; - RequestFlush flush = 2; - RequestInfo info = 3; - RequestSetOption set_option = 4; - RequestDeliverTx deliver_tx = 5; - RequestCheckTx check_tx = 6; - RequestCommit commit = 7; - RequestQuery query = 8; - RequestInitChain init_chain = 9; - RequestBeginBlock begin_block = 10; - RequestEndBlock end_block = 11; - } + oneof value{ + RequestEcho echo = 1; + RequestFlush flush = 2; + RequestInfo info = 3; + RequestSetOption set_option = 4; + RequestDeliverTx deliver_tx = 5; + RequestCheckTx check_tx = 6; + RequestCommit commit = 7; + RequestQuery query = 8; + RequestInitChain init_chain = 9; + RequestBeginBlock begin_block = 10; + RequestEndBlock end_block = 11; + } } message RequestEcho { - string message = 1; + string message = 1; } message RequestFlush { } message RequestInfo { - string version = 1; + string version = 1; } message RequestSetOption{ - string key = 1; - string value = 2; + string key = 1; + string value = 2; } message RequestDeliverTx{ - bytes tx = 1; + bytes tx = 1; } message RequestCheckTx{ - bytes tx = 1; + bytes tx = 1; } message RequestQuery{ - bytes data = 1; - string path = 2; - uint64 height = 3; - bool prove = 4; + bytes data = 1; + string path = 2; + uint64 height = 3; + bool prove = 4; } message RequestCommit{ } message RequestInitChain{ - repeated Validator validators = 1; + repeated Validator validators = 1; } message RequestBeginBlock{ - bytes hash = 1; - Header header = 2; + bytes hash = 1; + Header header = 2; } message RequestEndBlock{ - uint64 height = 1; + uint64 height = 1; } //---------------------------------------- @@ -117,42 +117,42 @@ message RequestEndBlock{ message Response { - oneof value{ - ResponseException exception = 1; - ResponseEcho echo = 2; - ResponseFlush flush = 3; - ResponseInfo info = 4; - ResponseSetOption set_option = 5; - ResponseDeliverTx deliver_tx = 6; - ResponseCheckTx check_tx = 7; - ResponseCommit commit = 8; - ResponseQuery query = 9; - ResponseInitChain init_chain = 10; - ResponseBeginBlock begin_block = 11; - ResponseEndBlock end_block = 12; - } + oneof value{ + ResponseException exception = 1; + ResponseEcho echo = 2; + ResponseFlush flush = 3; + ResponseInfo info = 4; + ResponseSetOption set_option = 5; + ResponseDeliverTx deliver_tx = 6; + ResponseCheckTx check_tx = 7; + ResponseCommit commit = 8; + ResponseQuery query = 9; + ResponseInitChain init_chain = 10; + ResponseBeginBlock begin_block = 11; + ResponseEndBlock end_block = 12; + } } message ResponseException{ - string error = 1; + string error = 1; } message ResponseEcho { - string message = 1; + string message = 1; } message ResponseFlush{ } message ResponseInfo { - string data = 1; - string version = 2; - uint64 last_block_height = 3; - bytes last_block_app_hash = 4; + string data = 1; + string version = 2; + uint64 last_block_height = 3; + bytes last_block_app_hash = 4; } message ResponseSetOption{ - string log = 1; + string log = 1; } message ResponseDeliverTx{ @@ -163,26 +163,26 @@ message ResponseDeliverTx{ } message ResponseCheckTx{ - CodeType code = 1; - bytes data = 2; - string log = 3; + CodeType code = 1; + bytes data = 2; + string log = 3; repeated KVPair tags = 4; } message ResponseQuery{ - CodeType code = 1; - int64 index = 2; - bytes key = 3; - bytes value = 4; - bytes proof = 5; - uint64 height = 6; - string log = 7; + CodeType code = 1; + int64 index = 2; + bytes key = 3; + bytes value = 4; + bytes proof = 5; + uint64 height = 6; + string log = 7; } message ResponseCommit{ - CodeType code = 1; - bytes data = 2; - string log = 3; + CodeType code = 1; + bytes data = 2; + string log = 3; } @@ -193,37 +193,37 @@ message ResponseBeginBlock{ } message ResponseEndBlock{ - repeated Validator diffs = 1; + repeated Validator diffs = 1; } //---------------------------------------- // Blockchain Types message Header { - string chain_id = 1; - uint64 height = 2; - uint64 time = 3; - uint64 num_txs = 4; - BlockID last_block_id = 5; - bytes last_commit_hash = 6; - bytes data_hash = 7; - bytes validators_hash = 8; - bytes app_hash = 9; + string chain_id = 1; + uint64 height = 2; + uint64 time = 3; + uint64 num_txs = 4; + BlockID last_block_id = 5; + bytes last_commit_hash = 6; + bytes data_hash = 7; + bytes validators_hash = 8; + bytes app_hash = 9; } message BlockID { - bytes hash = 1; - PartSetHeader parts = 2; + bytes hash = 1; + PartSetHeader parts = 2; } message PartSetHeader { - uint64 total = 1; - bytes hash = 2; + uint64 total = 1; + bytes hash = 2; } message Validator { - bytes pubKey = 1; - uint64 power = 2; + bytes pubKey = 1; + uint64 power = 2; } //---------------------------------------- @@ -239,15 +239,15 @@ message KVPair { // Service Definition service ABCIApplication { - rpc Echo(RequestEcho) returns (ResponseEcho) ; - rpc Flush(RequestFlush) returns (ResponseFlush); - rpc Info(RequestInfo) returns (ResponseInfo); - rpc SetOption(RequestSetOption) returns (ResponseSetOption); - rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); - rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); - rpc Query(RequestQuery) returns (ResponseQuery); - rpc Commit(RequestCommit) returns (ResponseCommit); - rpc InitChain(RequestInitChain) returns (ResponseInitChain); - rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); - rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); + rpc Echo(RequestEcho) returns (ResponseEcho) ; + rpc Flush(RequestFlush) returns (ResponseFlush); + rpc Info(RequestInfo) returns (ResponseInfo); + rpc SetOption(RequestSetOption) returns (ResponseSetOption); + rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); + rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); + rpc Query(RequestQuery) returns (ResponseQuery); + rpc Commit(RequestCommit) returns (ResponseCommit); + rpc InitChain(RequestInitChain) returns (ResponseInitChain); + rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); + rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); } From 76bd68f881af267ed31c85e6df8bea9575b4d2f9 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 9 Nov 2017 16:59:09 -0500 Subject: [PATCH 06/80] add docker commands to Makefile --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b9ef0b334..33553a286 100644 --- a/Makefile +++ b/Makefile @@ -89,4 +89,10 @@ metalinter_test: tools #--enable=unparam \ #--enable=vet \ -.PHONY: all build test fmt get_deps tools protoc install_protoc +build-docker: + docker build -t "tendermint/abci-dev" -f Dockerfile.develop . + +run-docker: + docker run -it --rm -v "$PWD:/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" "tendermint/abci-dev" /bin/bash + +.PHONY: all build test fmt get_deps tools protoc install_protoc build-docker run-docker From 8b71e47002311241b6a47b9680d573d1bec63d6b Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 9 Nov 2017 17:15:09 -0500 Subject: [PATCH 07/80] add linter for proto files (Fixes #128) --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 33553a286..c82e88540 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ GOTOOLS = \ github.com/mitchellh/gox \ github.com/Masterminds/glide \ - github.com/alecthomas/gometalinter + github.com/alecthomas/gometalinter \ + github.com/ckaznocha/protoc-gen-lint all: protoc install test @@ -57,10 +58,12 @@ get_vendor_deps: metalinter: tools @gometalinter --install + protoc --lint_out=. types/*.proto gometalinter --vendor --deadline=600s --enable-all --disable=lll ./... metalinter_test: tools @gometalinter --install + # protoc --lint_out=. types/*.proto gometalinter --vendor --deadline=600s --disable-all \ --enable=maligned \ --enable=deadcode \ From 3cbf44058db3a6f74b01db217937edd9a18c884f Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 9 Nov 2017 17:16:06 -0500 Subject: [PATCH 08/80] no need for protoc in make all since we have types.pb.go generated --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c82e88540..06efbf344 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ GOTOOLS = \ github.com/alecthomas/gometalinter \ github.com/ckaznocha/protoc-gen-lint -all: protoc install test +all: install test PACKAGES=$(shell go list ./... | grep -v '/vendor/') From 29c1cd03ea5402d3515d302b867b0e2b5d92d714 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 20 Nov 2017 17:09:18 -0600 Subject: [PATCH 09/80] [make install_protoc] fix folder name --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 06efbf344..aeb6d7160 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,12 @@ PACKAGES=$(shell go list ./... | grep -v '/vendor/') install_protoc: # https://github.com/google/protobuf/releases curl -L https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz | tar xvz && \ - cd protobuf-cpp-3.4.1 && \ + cd protobuf-3.4.1 && \ DIST_LANG=cpp ./configure && \ make && \ make install && \ cd .. && \ - rm -rf protobuf-cpp-3.4.1 + rm -rf protobuf-3.4.1 go get github.com/golang/protobuf/protoc-gen-go protoc: From 02399071ff8fa443a600c75b36baa5ef8b517282 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 20 Nov 2017 18:17:56 -0600 Subject: [PATCH 10/80] add ldconfig cmd to Dockerfile --- Dockerfile.develop | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.develop b/Dockerfile.develop index daf6cb617..e21350ce7 100644 --- a/Dockerfile.develop +++ b/Dockerfile.develop @@ -6,6 +6,8 @@ WORKDIR /go/src/github.com/tendermint/abci COPY Makefile /go/src/github.com/tendermint/abci/ RUN make install_protoc +# see make protoc for details +RUN ldconfig COPY glide.yaml /go/src/github.com/tendermint/abci/ COPY glide.lock /go/src/github.com/tendermint/abci/ From fc7db13fa8cf929a277843f7868089ea2237b0fe Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 20 Nov 2017 18:21:59 -0600 Subject: [PATCH 11/80] remove tags from CheckTx add value_type field to KVPair --- client/local_client.go | 2 +- server/socket_server.go | 2 +- types/application.go | 2 +- types/base_app.go | 24 ++-- types/messages.go | 4 +- types/result.go | 1 - types/types.pb.go | 267 ++++++++++++++++++++++------------------ types/types.proto | 10 +- 8 files changed, 170 insertions(+), 142 deletions(-) diff --git a/client/local_client.go b/client/local_client.go index 13ebc0909..539c1eef0 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -85,7 +85,7 @@ func (app *localClient) CheckTxAsync(tx []byte) *ReqRes { app.mtx.Unlock() return app.callback( types.ToRequestCheckTx(tx), - types.ToResponseCheckTx(res.Code, res.Data, res.Log, res.Tags), + types.ToResponseCheckTx(res.Code, res.Data, res.Log), ) } diff --git a/server/socket_server.go b/server/socket_server.go index 3e8ef942d..68a213225 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -179,7 +179,7 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types responses <- types.ToResponseDeliverTx(res.Code, res.Data, res.Log, res.Tags) case *types.Request_CheckTx: res := s.app.CheckTx(r.CheckTx.Tx) - responses <- types.ToResponseCheckTx(res.Code, res.Data, res.Log, res.Tags) + responses <- types.ToResponseCheckTx(res.Code, res.Data, res.Log) case *types.Request_Commit: res := s.app.Commit() responses <- types.ToResponseCommit(res.Code, res.Data, res.Log) diff --git a/types/application.go b/types/application.go index fcda5d95b..51a1869b0 100644 --- a/types/application.go +++ b/types/application.go @@ -58,7 +58,7 @@ func (app *GRPCApplication) DeliverTx(ctx context.Context, req *RequestDeliverTx func (app *GRPCApplication) CheckTx(ctx context.Context, req *RequestCheckTx) (*ResponseCheckTx, error) { r := app.app.CheckTx(req.Tx) - return &ResponseCheckTx{r.Code, r.Data, r.Log, r.Tags}, nil + return &ResponseCheckTx{r.Code, r.Data, r.Log}, nil } func (app *GRPCApplication) Query(ctx context.Context, req *RequestQuery) (*ResponseQuery, error) { diff --git a/types/base_app.go b/types/base_app.go index 94607e9ab..60bf43880 100644 --- a/types/base_app.go +++ b/types/base_app.go @@ -7,36 +7,36 @@ func NewBaseApplication() *BaseApplication { return &BaseApplication{} } -func (app *BaseApplication) Info(req RequestInfo) (resInfo ResponseInfo) { - return +func (BaseApplication) Info(req RequestInfo) ResponseInfo { + return ResponseInfo{} } -func (app *BaseApplication) SetOption(key string, value string) (log string) { +func (BaseApplication) SetOption(key string, value string) (log string) { return "" } -func (app *BaseApplication) DeliverTx(tx []byte) Result { +func (BaseApplication) DeliverTx(tx []byte) Result { return NewResultOK(nil, "") } -func (app *BaseApplication) CheckTx(tx []byte) Result { +func (BaseApplication) CheckTx(tx []byte) Result { return NewResultOK(nil, "") } -func (app *BaseApplication) Commit() Result { +func (BaseApplication) Commit() Result { return NewResultOK([]byte("nil"), "") } -func (app *BaseApplication) Query(req RequestQuery) (resQuery ResponseQuery) { - return +func (BaseApplication) Query(req RequestQuery) ResponseQuery { + return ResponseQuery{} } -func (app *BaseApplication) InitChain(req RequestInitChain) { +func (BaseApplication) InitChain(req RequestInitChain) { } -func (app *BaseApplication) BeginBlock(req RequestBeginBlock) { +func (BaseApplication) BeginBlock(req RequestBeginBlock) { } -func (app *BaseApplication) EndBlock(height uint64) (resEndBlock ResponseEndBlock) { - return +func (BaseApplication) EndBlock(height uint64) ResponseEndBlock { + return ResponseEndBlock{} } diff --git a/types/messages.go b/types/messages.go index d4a582964..298f17ba2 100644 --- a/types/messages.go +++ b/types/messages.go @@ -111,9 +111,9 @@ func ToResponseDeliverTx(code CodeType, data []byte, log string, tags []*KVPair) } } -func ToResponseCheckTx(code CodeType, data []byte, log string, tags []*KVPair) *Response { +func ToResponseCheckTx(code CodeType, data []byte, log string) *Response { return &Response{ - Value: &Response_CheckTx{&ResponseCheckTx{code, data, log, tags}}, + Value: &Response_CheckTx{&ResponseCheckTx{code, data, log}}, } } diff --git a/types/result.go b/types/result.go index 84f877dc8..96dd4e795 100644 --- a/types/result.go +++ b/types/result.go @@ -103,7 +103,6 @@ func (r *ResponseCheckTx) Result() Result { Code: r.Code, Data: r.Data, Log: r.Log, - Tags: r.Tags, } } diff --git a/types/types.pb.go b/types/types.pb.go index 99396259b..0cd976796 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -169,6 +169,27 @@ func (x CodeType) String() string { } func (CodeType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +type KVPair_Type int32 + +const ( + KVPair_STRING KVPair_Type = 0 + KVPair_INT KVPair_Type = 1 +) + +var KVPair_Type_name = map[int32]string{ + 0: "STRING", + 1: "INT", +} +var KVPair_Type_value = map[string]int32{ + "STRING": 0, + "INT": 1, +} + +func (x KVPair_Type) String() string { + return proto.EnumName(KVPair_Type_name, int32(x)) +} +func (KVPair_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{29, 0} } + type Request struct { // Types that are valid to be assigned to Value: // *Request_Echo @@ -1337,10 +1358,9 @@ func (m *ResponseDeliverTx) GetTags() []*KVPair { } type ResponseCheckTx struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` - Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` + Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } @@ -1369,13 +1389,6 @@ func (m *ResponseCheckTx) GetLog() string { return "" } -func (m *ResponseCheckTx) GetTags() []*KVPair { - if m != nil { - return m.Tags - } - return nil -} - type ResponseQuery struct { Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` @@ -1657,9 +1670,10 @@ func (m *Validator) GetPower() uint64 { } type KVPair struct { - Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - ValueString string `protobuf:"bytes,2,opt,name=value_string,json=valueString" json:"value_string,omitempty"` - ValueInt int64 `protobuf:"varint,3,opt,name=value_int,json=valueInt" json:"value_int,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + ValueType KVPair_Type `protobuf:"varint,2,opt,name=value_type,json=valueType,enum=types.KVPair_Type" json:"value_type,omitempty"` + ValueString string `protobuf:"bytes,3,opt,name=value_string,json=valueString" json:"value_string,omitempty"` + ValueInt int64 `protobuf:"varint,4,opt,name=value_int,json=valueInt" json:"value_int,omitempty"` } func (m *KVPair) Reset() { *m = KVPair{} } @@ -1674,6 +1688,13 @@ func (m *KVPair) GetKey() string { return "" } +func (m *KVPair) GetValueType() KVPair_Type { + if m != nil { + return m.ValueType + } + return KVPair_STRING +} + func (m *KVPair) GetValueString() string { if m != nil { return m.ValueString @@ -1720,6 +1741,7 @@ func init() { proto.RegisterType((*Validator)(nil), "types.Validator") proto.RegisterType((*KVPair)(nil), "types.KVPair") proto.RegisterEnum("types.CodeType", CodeType_name, CodeType_value) + proto.RegisterEnum("types.KVPair_Type", KVPair_Type_name, KVPair_Type_value) } // Reference imports to suppress errors if they are not otherwise used. @@ -2127,111 +2149,114 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1691 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x49, 0x6f, 0x1b, 0xc9, - 0x15, 0x56, 0x73, 0xe7, 0x13, 0x45, 0xb5, 0x4a, 0x94, 0x44, 0x31, 0x39, 0xd8, 0x1d, 0x38, 0x96, - 0x1c, 0xc7, 0x0e, 0x64, 0x38, 0xb0, 0xe2, 0x20, 0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0x37, 0x8d, 0xa7, 0x8f, 0x49, 0x12, 0x00, 0x00, + // 1736 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcb, 0x6e, 0xdb, 0xcc, + 0x15, 0x36, 0x25, 0xea, 0x76, 0x2c, 0xcb, 0xf4, 0x58, 0xb6, 0x65, 0xa5, 0x8b, 0x84, 0x45, 0x1a, + 0x3b, 0x4d, 0x9d, 0xd6, 0x41, 0x8a, 0xb8, 0x29, 0x0a, 0xf8, 0x16, 0x5b, 0x08, 0xea, 0xb8, 0xb4, + 0x93, 0x4d, 0x0b, 0x08, 0xb4, 0x38, 0x92, 0xa6, 0x96, 0x86, 0x0c, 0x39, 0x74, 0xe4, 0xee, 0xba, + 0xcf, 0xbe, 0x8f, 0x50, 0xa0, 0xcb, 0x02, 0x7d, 0x85, 0x02, 0xff, 0xfd, 0xf2, 0x44, 0x3f, 0xe6, + 0xc2, 0xab, 0xa9, 0xe0, 0x5f, 0x64, 0x23, 0xf0, 0x5c, 0xbe, 0x99, 0x33, 0x33, 0xe7, 0x7c, 0x73, + 0x46, 0xb0, 0xc2, 0x6e, 0x3d, 0x1c, 0x3c, 0x15, 0xbf, 0x3b, 0x9e, 0xef, 0x32, 0x17, 0x55, 0x84, + 0x60, 0xfe, 0x5f, 0x87, 0x9a, 0x85, 0xdf, 0x87, 0x38, 0x60, 0x68, 0x0b, 0x74, 0x3c, 0x18, 0xbb, + 0x1d, 0xed, 0xbe, 0xb6, 0xb5, 0xb8, 0x8b, 0x76, 0xa4, 0xbb, 0xb2, 0x1e, 0x0f, 0xc6, 0xee, 0xe9, + 0x82, 0x25, 0x3c, 0xd0, 0xaf, 0xa1, 0x32, 0x9c, 0x84, 0xc1, 0xb8, 0x53, 0x12, 0xae, 0xab, 0x59, + 0xd7, 0x57, 0xdc, 0x74, 0xba, 0x60, 0x49, 0x1f, 0x3e, 0x2c, 0xa1, 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xfb, 0xee, 0xdc, 0x8e, + 0x9a, 0xe3, 0x93, 0x5e, 0x64, 0xde, 0x0b, 0xbf, 0x3b, 0xb7, 0xad, 0x46, 0x2f, 0xa0, 0x16, 0x35, + 0x12, 0xc5, 0xef, 0xfc, 0xee, 0x9c, 0xce, 0x9a, 0x6f, 0x8f, 0xec, 0x11, 0x8a, 0x9e, 0xef, 0xdd, + 0xc2, 0x66, 0x19, 0x3d, 0x87, 0xaa, 0xba, 0xa3, 0x0b, 0xff, 0x22, 0xe8, 0x16, 0xb7, 0xe4, 0x7c, + 0x91, 0xc9, 0x4b, 0x6f, 0xde, 0xdb, 0xbf, 0x3b, 0xb7, 0xd9, 0x46, 0xfb, 0x00, 0xa9, 0x37, 0xde, + 0xdc, 0x7f, 0x00, 0xba, 0xf3, 0x5b, 0x6e, 0xf4, 0x12, 0xea, 0xc9, 0xb3, 0xae, 0xf8, 0x7f, 0x80, + 0xee, 0xbc, 0xae, 0xfb, 0xaa, 0x2a, 0xfe, 0x62, 0x7a, 0xf6, 0x53, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x59, 0xf7, 0xaf, 0xdb, 0x77, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 09dcb1bd8..e83df9851 100644 --- a/types/types.proto +++ b/types/types.proto @@ -166,7 +166,6 @@ message ResponseCheckTx{ CodeType code = 1; bytes data = 2; string log = 3; - repeated KVPair tags = 4; } message ResponseQuery{ @@ -231,8 +230,13 @@ message Validator { message KVPair { string key = 1; - string value_string = 2; - int64 value_int = 3; + enum Type { + STRING = 0; + INT = 1; + } + Type value_type = 2; + string value_string = 3; + int64 value_int = 4; } //---------------------------------------- From 92801dbd72fddc0521575f8666aa4582710157f0 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 20 Nov 2017 18:30:10 -0600 Subject: [PATCH 12/80] [dockerfile] install psmisc for tests --- Dockerfile.develop | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile.develop b/Dockerfile.develop index e21350ce7..d4643155a 100644 --- a/Dockerfile.develop +++ b/Dockerfile.develop @@ -5,9 +5,13 @@ WORKDIR /go/src/github.com/tendermint/abci COPY Makefile /go/src/github.com/tendermint/abci/ -RUN make install_protoc -# see make protoc for details -RUN ldconfig +# see make protoc for details on ldconfig +RUN make install_protoc && ldconfig + +# killall is used in tests +RUN apt-get update && apt-get install -y \ + psmisc \ + && rm -rf /var/lib/apt/lists/* COPY glide.yaml /go/src/github.com/tendermint/abci/ COPY glide.lock /go/src/github.com/tendermint/abci/ From 3a3d508e5c57112977e387d21106a9c601d93b3c Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 20 Nov 2017 20:26:37 -0600 Subject: [PATCH 13/80] CheckTx and DeliverTx return ResponseCheckTx and ResponseDeliverTx respectively Commit now returns ResponseCommit --- client/local_client.go | 6 ++--- example/counter/counter.go | 31 +++++++++++++++--------- example/dummy/dummy.go | 16 ++++++------- example/dummy/persistent_dummy.go | 39 ++++++++++++++++++++----------- types/application.go | 6 ++--- types/base_app.go | 12 +++++----- types/result.go | 8 +++++++ 7 files changed, 74 insertions(+), 44 deletions(-) diff --git a/client/local_client.go b/client/local_client.go index 539c1eef0..89f984184 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -164,14 +164,14 @@ func (app *localClient) SetOptionSync(key string, value string) (res types.Resul return types.OK.SetLog(log) } -func (app *localClient) DeliverTxSync(tx []byte) (res types.Result) { +func (app *localClient) DeliverTxSync(tx []byte) (res types.ResponseDeliverTx) { app.mtx.Lock() res = app.Application.DeliverTx(tx) app.mtx.Unlock() return res } -func (app *localClient) CheckTxSync(tx []byte) (res types.Result) { +func (app *localClient) CheckTxSync(tx []byte) (res types.ResponseCheckTx) { app.mtx.Lock() res = app.Application.CheckTx(tx) app.mtx.Unlock() @@ -185,7 +185,7 @@ func (app *localClient) QuerySync(reqQuery types.RequestQuery) (resQuery types.R return resQuery, nil } -func (app *localClient) CommitSync() (res types.Result) { +func (app *localClient) CommitSync() (res types.ResponseCommit) { app.mtx.Lock() res = app.Application.Commit() app.mtx.Unlock() diff --git a/example/counter/counter.go b/example/counter/counter.go index d2478ae28..65cac4a0e 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -2,6 +2,7 @@ package counter import ( "encoding/binary" + "fmt" "github.com/tendermint/abci/types" cmn "github.com/tendermint/tmlibs/common" @@ -30,45 +31,53 @@ func (app *CounterApplication) SetOption(key string, value string) (log string) return "" } -func (app *CounterApplication) DeliverTx(tx []byte) types.Result { +func (app *CounterApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { if app.serial { if len(tx) > 8 { - return types.ErrEncodingError.SetLog(cmn.Fmt("Max tx size is 8 bytes, got %d", len(tx))) + return types.ResponseDeliverTx{ + Code: types.CodeType_EncodingError, + Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))} } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { - return types.ErrBadNonce.SetLog(cmn.Fmt("Invalid nonce. Expected %v, got %v", app.txCount, txValue)) + return types.ResponseDeliverTx{ + Code: types.CodeType_BadNonce, + Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)} } } app.txCount++ - return types.OK + return types.ResponseDeliverTx{Code: types.CodeType_OK} } -func (app *CounterApplication) CheckTx(tx []byte) types.Result { +func (app *CounterApplication) CheckTx(tx []byte) types.ResponseCheckTx { if app.serial { if len(tx) > 8 { - return types.ErrEncodingError.SetLog(cmn.Fmt("Max tx size is 8 bytes, got %d", len(tx))) + return types.ResponseCheckTx{ + Code: types.CodeType_EncodingError, + Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))} } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { - return types.ErrBadNonce.SetLog(cmn.Fmt("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)) + return types.ResponseCheckTx{ + Code: types.CodeType_BadNonce, + Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)} } } - return types.OK + return types.ResponseCheckTx{Code: types.CodeType_OK} } -func (app *CounterApplication) Commit() types.Result { +func (app *CounterApplication) Commit() (resp types.ResponseCommit) { app.hashCount++ if app.txCount == 0 { - return types.OK + return types.ResponseCommit{Code: types.CodeType_OK} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return types.NewResultOK(hash, "") + return types.ResponseCommit{Code: types.CodeType_OK, Data: hash} } func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 7e95c859b..a4edacac4 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -1,12 +1,12 @@ package dummy import ( + "fmt" "strings" "github.com/tendermint/abci/types" wire "github.com/tendermint/go-wire" "github.com/tendermint/iavl" - cmn "github.com/tendermint/tmlibs/common" dbm "github.com/tendermint/tmlibs/db" ) @@ -22,25 +22,25 @@ func NewDummyApplication() *DummyApplication { } func (app *DummyApplication) Info(req types.RequestInfo) (resInfo types.ResponseInfo) { - return types.ResponseInfo{Data: cmn.Fmt("{\"size\":%v}", app.state.Size())} + return types.ResponseInfo{Data: fmt.Sprintf("{\"size\":%v}", app.state.Size())} } // tx is either "key=value" or just arbitrary bytes -func (app *DummyApplication) DeliverTx(tx []byte) types.Result { +func (app *DummyApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { parts := strings.Split(string(tx), "=") if len(parts) == 2 { app.state.Set([]byte(parts[0]), []byte(parts[1])) } else { app.state.Set(tx, tx) } - return types.OK + return types.ResponseDeliverTx{Code: types.CodeType_OK} } -func (app *DummyApplication) CheckTx(tx []byte) types.Result { - return types.OK +func (app *DummyApplication) CheckTx(tx []byte) types.ResponseCheckTx { + return types.ResponseCheckTx{Code: types.CodeType_OK} } -func (app *DummyApplication) Commit() types.Result { +func (app *DummyApplication) Commit() types.ResponseCommit { // Save a new version var hash []byte var err error @@ -55,7 +55,7 @@ func (app *DummyApplication) Commit() types.Result { } } - return types.NewResultOK(hash, "") + return types.ResponseCommit{Code: types.CodeType_OK, Data: hash} } func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 4c4801755..8fa112820 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -3,6 +3,7 @@ package dummy import ( "bytes" "encoding/hex" + "fmt" "strconv" "strings" @@ -61,7 +62,7 @@ func (app *PersistentDummyApplication) SetOption(key string, value string) (log } // tx is either "val:pubkey/power" or "key=value" or just arbitrary bytes -func (app *PersistentDummyApplication) DeliverTx(tx []byte) types.Result { +func (app *PersistentDummyApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { // if it starts with "val:", update the validator set // format is "val:pubkey/power" if isValidatorTx(tx) { @@ -74,12 +75,12 @@ func (app *PersistentDummyApplication) DeliverTx(tx []byte) types.Result { return app.app.DeliverTx(tx) } -func (app *PersistentDummyApplication) CheckTx(tx []byte) types.Result { +func (app *PersistentDummyApplication) CheckTx(tx []byte) types.ResponseCheckTx { return app.app.CheckTx(tx) } // Commit will panic if InitChain was not called -func (app *PersistentDummyApplication) Commit() types.Result { +func (app *PersistentDummyApplication) Commit() types.ResponseCommit { // Save a new version for next height height := app.app.state.LatestVersion() + 1 @@ -93,7 +94,7 @@ func (app *PersistentDummyApplication) Commit() types.Result { } app.logger.Info("Commit block", "height", height, "root", appHash) - return types.NewResultOK(appHash, "") + return types.ResponseCommit{Code: types.CodeType_OK, Data: appHash} } func (app *PersistentDummyApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { @@ -148,30 +149,38 @@ func isValidatorTx(tx []byte) bool { } // format is "val:pubkey1/power1,addr2/power2,addr3/power3"tx -func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Result { +func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.ResponseDeliverTx { tx = tx[len(ValidatorSetChangePrefix):] //get the pubkey and power pubKeyAndPower := strings.Split(string(tx), "/") if len(pubKeyAndPower) != 2 { - return types.ErrEncodingError.SetLog(cmn.Fmt("Expected 'pubkey/power'. Got %v", pubKeyAndPower)) + return types.ResponseDeliverTx{ + Code: types.CodeType_EncodingError, + Log: fmt.Sprintf("Expected 'pubkey/power'. Got %v", pubKeyAndPower)} } pubkeyS, powerS := pubKeyAndPower[0], pubKeyAndPower[1] // decode the pubkey, ensuring its go-crypto encoded pubkey, err := hex.DecodeString(pubkeyS) if err != nil { - return types.ErrEncodingError.SetLog(cmn.Fmt("Pubkey (%s) is invalid hex", pubkeyS)) + return types.ResponseDeliverTx{ + Code: types.CodeType_EncodingError, + Log: fmt.Sprintf("Pubkey (%s) is invalid hex", pubkeyS)} } _, err = crypto.PubKeyFromBytes(pubkey) if err != nil { - return types.ErrEncodingError.SetLog(cmn.Fmt("Pubkey (%X) is invalid go-crypto encoded", pubkey)) + return types.ResponseDeliverTx{ + Code: types.CodeType_EncodingError, + Log: fmt.Sprintf("Pubkey (%X) is invalid go-crypto encoded", pubkey)} } // decode the power power, err := strconv.Atoi(powerS) if err != nil { - return types.ErrEncodingError.SetLog(cmn.Fmt("Power (%s) is not an int", powerS)) + return types.ResponseDeliverTx{ + Code: types.CodeType_EncodingError, + Log: fmt.Sprintf("Power (%s) is not an int", powerS)} } // update @@ -179,19 +188,23 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Result { } // add, update, or remove a validator -func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types.Result { +func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types.ResponseDeliverTx { key := []byte("val:" + string(v.PubKey)) if v.Power == 0 { // remove validator if !app.app.state.Has(key) { - return types.ErrUnauthorized.SetLog(cmn.Fmt("Cannot remove non-existent validator %X", key)) + return types.ResponseDeliverTx{ + Code: types.CodeType_Unauthorized, + Log: fmt.Sprintf("Cannot remove non-existent validator %X", key)} } app.app.state.Remove(key) } else { // add or update validator value := bytes.NewBuffer(make([]byte, 0)) if err := types.WriteMessage(v, value); err != nil { - return types.ErrInternalError.SetLog(cmn.Fmt("Error encoding validator: %v", err)) + return types.ResponseDeliverTx{ + Code: types.CodeType_InternalError, + Log: fmt.Sprintf("Error encoding validator: %v", err)} } app.app.state.Set(key, value.Bytes()) } @@ -199,5 +212,5 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types // we only update the changes array if we successfully updated the tree app.changes = append(app.changes, v) - return types.OK + return types.ResponseDeliverTx{Code: types.CodeType_OK} } diff --git a/types/application.go b/types/application.go index 51a1869b0..ed9b0d20d 100644 --- a/types/application.go +++ b/types/application.go @@ -13,14 +13,14 @@ type Application interface { Query(RequestQuery) ResponseQuery // Query for state // Mempool Connection - CheckTx(tx []byte) Result // Validate a tx for the mempool + CheckTx(tx []byte) ResponseCheckTx // Validate a tx for the mempool // Consensus Connection InitChain(RequestInitChain) // Initialize blockchain with validators and other info from TendermintCore BeginBlock(RequestBeginBlock) // Signals the beginning of a block - DeliverTx(tx []byte) Result // Deliver a tx for full processing + DeliverTx(tx []byte) ResponseDeliverTx // Deliver a tx for full processing EndBlock(height uint64) ResponseEndBlock // Signals the end of a block, returns changes to the validator set - Commit() Result // Commit the state and return the application Merkle root hash + Commit() ResponseCommit // Commit the state and return the application Merkle root hash } //------------------------------------ diff --git a/types/base_app.go b/types/base_app.go index 60bf43880..75fdae8d7 100644 --- a/types/base_app.go +++ b/types/base_app.go @@ -15,16 +15,16 @@ func (BaseApplication) SetOption(key string, value string) (log string) { return "" } -func (BaseApplication) DeliverTx(tx []byte) Result { - return NewResultOK(nil, "") +func (BaseApplication) DeliverTx(tx []byte) ResponseDeliverTx { + return ResponseDeliverTx{} } -func (BaseApplication) CheckTx(tx []byte) Result { - return NewResultOK(nil, "") +func (BaseApplication) CheckTx(tx []byte) ResponseCheckTx { + return ResponseCheckTx{} } -func (BaseApplication) Commit() Result { - return NewResultOK([]byte("nil"), "") +func (BaseApplication) Commit() ResponseCommit { + return ResponseCommit{Code: CodeType_OK, Data: []byte("nil")} } func (BaseApplication) Query(req RequestQuery) ResponseQuery { diff --git a/types/result.go b/types/result.go index 96dd4e795..ffd8966a9 100644 --- a/types/result.go +++ b/types/result.go @@ -106,6 +106,10 @@ func (r *ResponseCheckTx) Result() Result { } } +func (r ResponseCheckTx) IsErr() bool { + return r.Code != CodeType_OK +} + // Convert ResponseDeliverTx to standard Result func (r *ResponseDeliverTx) Result() Result { return Result{ @@ -116,6 +120,10 @@ func (r *ResponseDeliverTx) Result() Result { } } +func (r ResponseDeliverTx) IsErr() bool { + return r.Code != CodeType_OK +} + type ResultQuery struct { Code CodeType `json:"code"` Index int64 `json:"index"` From 8e6269ce930f785cb8987cea3498ca7cff104ae5 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 21 Nov 2017 15:24:29 -0600 Subject: [PATCH 14/80] update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index aedebee60..4cfcce749 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ Here, we describe the requests and responses as function arguments and return va * `Code (uint32)`: Response code * `Data ([]byte)`: Result bytes, if any * `Log (string)`: Debug or error message + * `Tags ([]*KVPair)`: Optional tags for indexing * __Usage__:
Append and run a transaction. If the transaction is valid, returns CodeType.OK From fbe7234639d411ddd15aea039dc9532adaaa3f21 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 21 Nov 2017 17:33:34 -0600 Subject: [PATCH 15/80] remove Result from the client package plus make Client interface more consistent. All *Sync functions now return an error as a second return param. Deliver/Check/Commit use Code to indicate errors and have IsErr() func defined on ResponseXYZ structs. --- client/client.go | 20 ++++----- client/grpc_client.go | 95 +++++++++++++--------------------------- client/local_client.go | 58 ++++++++++++------------ client/socket_client.go | 84 ++++++++++++----------------------- cmd/abci-cli/abci-cli.go | 18 +++++--- tests/test_app/app.go | 47 ++++++++++---------- types/result.go | 7 +++ 7 files changed, 140 insertions(+), 189 deletions(-) diff --git a/client/client.go b/client/client.go index 51d04124b..b550dc926 100644 --- a/client/client.go +++ b/client/client.go @@ -24,21 +24,21 @@ type Client interface { CommitAsync() *ReqRes FlushSync() error - EchoSync(msg string) (res types.Result) - InfoSync(types.RequestInfo) (resInfo types.ResponseInfo, err error) - SetOptionSync(key string, value string) (res types.Result) - DeliverTxSync(tx []byte) (res types.Result) - CheckTxSync(tx []byte) (res types.Result) - QuerySync(types.RequestQuery) (resQuery types.ResponseQuery, err error) - CommitSync() (res types.Result) + EchoSync(msg string) (*types.ResponseEcho, error) + InfoSync(types.RequestInfo) (*types.ResponseInfo, error) + SetOptionSync(key string, value string) (log string, err error) + DeliverTxSync(tx []byte) *types.ResponseDeliverTx + CheckTxSync(tx []byte) *types.ResponseCheckTx + QuerySync(types.RequestQuery) (*types.ResponseQuery, error) + CommitSync() *types.ResponseCommit InitChainAsync(types.RequestInitChain) *ReqRes BeginBlockAsync(types.RequestBeginBlock) *ReqRes EndBlockAsync(height uint64) *ReqRes - InitChainSync(types.RequestInitChain) (err error) - BeginBlockSync(types.RequestBeginBlock) (err error) - EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) + InitChainSync(types.RequestInitChain) error + BeginBlockSync(types.RequestBeginBlock) error + EndBlockSync(height uint64) (*types.ResponseEndBlock, error) } //---------------------------------------- diff --git a/client/grpc_client.go b/client/grpc_client.go index 30f5d088a..524f1f7f9 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -240,104 +240,71 @@ func (cli *grpcClient) finishAsyncCall(req *types.Request, res *types.Response) return reqres } -func (cli *grpcClient) checkErrGetResult() types.Result { - if err := cli.Error(); err != nil { - // StopForError should already have been called if error is set - return types.ErrInternalError.SetLog(err.Error()) - } - return types.Result{} -} - //---------------------------------------- -func (cli *grpcClient) EchoSync(msg string) (res types.Result) { - reqres := cli.EchoAsync(msg) - if res := cli.checkErrGetResult(); res.IsErr() { - return res - } - resp := reqres.Response.GetEcho() - return types.NewResultOK([]byte(resp.Message), "") -} - func (cli *grpcClient) FlushSync() error { return nil } -func (cli *grpcClient) InfoSync(req types.RequestInfo) (resInfo types.ResponseInfo, err error) { +func (cli *grpcClient) EchoSync(msg string) (*types.ResponseEcho, error) { + reqres := cli.EchoAsync(msg) + // StopForError should already have been called if error is set + return reqres.Response.GetEcho(), cli.Error() +} + +func (cli *grpcClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { reqres := cli.InfoAsync(req) - if err = cli.Error(); err != nil { - return resInfo, err - } - if info := reqres.Response.GetInfo(); info != nil { - return *info, nil - } - return resInfo, nil + return reqres.Response.GetInfo(), cli.Error() } -func (cli *grpcClient) SetOptionSync(key string, value string) (res types.Result) { +func (cli *grpcClient) SetOptionSync(key string, value string) (log string, err error) { reqres := cli.SetOptionAsync(key, value) - if res := cli.checkErrGetResult(); res.IsErr() { - return res + if err := cli.Error(); err != nil { + return "", err } - resp := reqres.Response.GetSetOption() - return types.Result{Code: OK, Data: nil, Log: resp.Log} + return reqres.Response.GetSetOption().Log, nil } -func (cli *grpcClient) DeliverTxSync(tx []byte) (res types.Result) { +func (cli *grpcClient) DeliverTxSync(tx []byte) *types.ResponseDeliverTx { reqres := cli.DeliverTxAsync(tx) - if res := cli.checkErrGetResult(); res.IsErr() { - return res + if err := cli.Error(); err != nil { + return &types.ResponseDeliverTx{Code: types.CodeType_InternalError, Log: err.Error()} } - resp := reqres.Response.GetDeliverTx() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} + return reqres.Response.GetDeliverTx() } -func (cli *grpcClient) CheckTxSync(tx []byte) (res types.Result) { +func (cli *grpcClient) CheckTxSync(tx []byte) *types.ResponseCheckTx { reqres := cli.CheckTxAsync(tx) - if res := cli.checkErrGetResult(); res.IsErr() { - return res + if err := cli.Error(); err != nil { + return &types.ResponseCheckTx{Code: types.CodeType_InternalError, Log: err.Error()} } - resp := reqres.Response.GetCheckTx() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} + return reqres.Response.GetCheckTx() } -func (cli *grpcClient) QuerySync(reqQuery types.RequestQuery) (resQuery types.ResponseQuery, err error) { - reqres := cli.QueryAsync(reqQuery) - if err = cli.Error(); err != nil { - return resQuery, err - } - if resQuery_ := reqres.Response.GetQuery(); resQuery_ != nil { - return *resQuery_, nil - } - return resQuery, nil +func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { + reqres := cli.QueryAsync(req) + return reqres.Response.GetQuery(), cli.Error() } -func (cli *grpcClient) CommitSync() (res types.Result) { +func (cli *grpcClient) CommitSync() *types.ResponseCommit { reqres := cli.CommitAsync() - if res := cli.checkErrGetResult(); res.IsErr() { - return res + if err := cli.Error(); err != nil { + return &types.ResponseCommit{Code: types.CodeType_InternalError, Log: err.Error()} } - resp := reqres.Response.GetCommit() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} + return reqres.Response.GetCommit() } -func (cli *grpcClient) InitChainSync(params types.RequestInitChain) (err error) { +func (cli *grpcClient) InitChainSync(params types.RequestInitChain) error { cli.InitChainAsync(params) return cli.Error() } -func (cli *grpcClient) BeginBlockSync(params types.RequestBeginBlock) (err error) { +func (cli *grpcClient) BeginBlockSync(params types.RequestBeginBlock) error { cli.BeginBlockAsync(params) return cli.Error() } -func (cli *grpcClient) EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) { +func (cli *grpcClient) EndBlockSync(height uint64) (*types.ResponseEndBlock, error) { reqres := cli.EndBlockAsync(height) - if err := cli.Error(); err != nil { - return resEndBlock, err - } - if blk := reqres.Response.GetEndBlock(); blk != nil { - return *blk, nil - } - return resEndBlock, nil + return reqres.Response.GetEndBlock(), cli.Error() } diff --git a/client/local_client.go b/client/local_client.go index 89f984184..9081406af 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -146,71 +146,71 @@ func (app *localClient) FlushSync() error { return nil } -func (app *localClient) EchoSync(msg string) (res types.Result) { - return types.OK.SetData([]byte(msg)) +func (app *localClient) EchoSync(msg string) (*types.ResponseEcho, error) { + return &types.ResponseEcho{msg}, nil } -func (app *localClient) InfoSync(req types.RequestInfo) (resInfo types.ResponseInfo, err error) { +func (app *localClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { app.mtx.Lock() - defer app.mtx.Unlock() - resInfo = app.Application.Info(req) - return resInfo, nil -} - -func (app *localClient) SetOptionSync(key string, value string) (res types.Result) { - app.mtx.Lock() - log := app.Application.SetOption(key, value) + res := app.Application.Info(req) app.mtx.Unlock() - return types.OK.SetLog(log) + return &res, nil } -func (app *localClient) DeliverTxSync(tx []byte) (res types.ResponseDeliverTx) { +func (app *localClient) SetOptionSync(key string, value string) (log string, err error) { app.mtx.Lock() - res = app.Application.DeliverTx(tx) + log = app.Application.SetOption(key, value) app.mtx.Unlock() - return res + return log, nil } -func (app *localClient) CheckTxSync(tx []byte) (res types.ResponseCheckTx) { +func (app *localClient) DeliverTxSync(tx []byte) *types.ResponseDeliverTx { app.mtx.Lock() - res = app.Application.CheckTx(tx) + res := app.Application.DeliverTx(tx) app.mtx.Unlock() - return res + return &res } -func (app *localClient) QuerySync(reqQuery types.RequestQuery) (resQuery types.ResponseQuery, err error) { +func (app *localClient) CheckTxSync(tx []byte) *types.ResponseCheckTx { app.mtx.Lock() - resQuery = app.Application.Query(reqQuery) + res := app.Application.CheckTx(tx) app.mtx.Unlock() - return resQuery, nil + return &res } -func (app *localClient) CommitSync() (res types.ResponseCommit) { +func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { app.mtx.Lock() - res = app.Application.Commit() + res := app.Application.Query(req) app.mtx.Unlock() - return res + return &res, nil } -func (app *localClient) InitChainSync(params types.RequestInitChain) (err error) { +func (app *localClient) CommitSync() *types.ResponseCommit { + app.mtx.Lock() + res := app.Application.Commit() + app.mtx.Unlock() + return &res +} + +func (app *localClient) InitChainSync(params types.RequestInitChain) error { app.mtx.Lock() app.Application.InitChain(params) app.mtx.Unlock() return nil } -func (app *localClient) BeginBlockSync(params types.RequestBeginBlock) (err error) { +func (app *localClient) BeginBlockSync(params types.RequestBeginBlock) error { app.mtx.Lock() app.Application.BeginBlock(params) app.mtx.Unlock() return nil } -func (app *localClient) EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) { +func (app *localClient) EndBlockSync(height uint64) (*types.ResponseEndBlock, error) { app.mtx.Lock() - resEndBlock = app.Application.EndBlock(height) + res := app.Application.EndBlock(height) app.mtx.Unlock() - return resEndBlock, nil + return &res, nil } //------------------------------------------------------- diff --git a/client/socket_client.go b/client/socket_client.go index 1045dea78..ef0a6ecea 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -271,111 +271,85 @@ func (cli *socketClient) EndBlockAsync(height uint64) *ReqRes { //---------------------------------------- -func (cli *socketClient) EchoSync(msg string) (res types.Result) { - reqres := cli.queueRequest(types.ToRequestEcho(msg)) - cli.FlushSync() - if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()) - } - resp := reqres.Response.GetEcho() - return types.Result{Code: OK, Data: []byte(resp.Message)} -} - func (cli *socketClient) FlushSync() error { reqRes := cli.queueRequest(types.ToRequestFlush()) if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()) + return err } reqRes.Wait() // NOTE: if we don't flush the queue, its possible to get stuck here return cli.Error() } -func (cli *socketClient) InfoSync(req types.RequestInfo) (resInfo types.ResponseInfo, err error) { - reqres := cli.queueRequest(types.ToRequestInfo(req)) +func (cli *socketClient) EchoSync(msg string) (*types.ResponseEcho, error) { + reqres := cli.queueRequest(types.ToRequestEcho(msg)) cli.FlushSync() - if err := cli.Error(); err != nil { - return resInfo, err - } - if resInfo_ := reqres.Response.GetInfo(); resInfo_ != nil { - return *resInfo_, nil - } - return resInfo, nil + return reqres.Response.GetEcho(), cli.Error() } -func (cli *socketClient) SetOptionSync(key string, value string) (res types.Result) { +func (cli *socketClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) { + reqres := cli.queueRequest(types.ToRequestInfo(req)) + cli.FlushSync() + return reqres.Response.GetInfo(), cli.Error() +} + +func (cli *socketClient) SetOptionSync(key string, value string) (log string, err error) { reqres := cli.queueRequest(types.ToRequestSetOption(key, value)) cli.FlushSync() if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()) + return "", err } - resp := reqres.Response.GetSetOption() - return types.Result{Code: OK, Data: nil, Log: resp.Log} + return reqres.Response.GetSetOption().Log, nil } -func (cli *socketClient) DeliverTxSync(tx []byte) (res types.Result) { +func (cli *socketClient) DeliverTxSync(tx []byte) *types.ResponseDeliverTx { reqres := cli.queueRequest(types.ToRequestDeliverTx(tx)) cli.FlushSync() if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()) + return &types.ResponseDeliverTx{Code: types.CodeType_InternalError, Log: err.Error()} } - resp := reqres.Response.GetDeliverTx() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} + return reqres.Response.GetDeliverTx() } -func (cli *socketClient) CheckTxSync(tx []byte) (res types.Result) { +func (cli *socketClient) CheckTxSync(tx []byte) *types.ResponseCheckTx { reqres := cli.queueRequest(types.ToRequestCheckTx(tx)) cli.FlushSync() if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()) + return &types.ResponseCheckTx{Code: types.CodeType_InternalError, Log: err.Error()} } - resp := reqres.Response.GetCheckTx() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} + return reqres.Response.GetCheckTx() } -func (cli *socketClient) QuerySync(reqQuery types.RequestQuery) (resQuery types.ResponseQuery, err error) { - reqres := cli.queueRequest(types.ToRequestQuery(reqQuery)) +func (cli *socketClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { + reqres := cli.queueRequest(types.ToRequestQuery(req)) cli.FlushSync() - if err := cli.Error(); err != nil { - return resQuery, err - } - if resQuery_ := reqres.Response.GetQuery(); resQuery_ != nil { - return *resQuery_, nil - } - return resQuery, nil + return reqres.Response.GetQuery(), cli.Error() } -func (cli *socketClient) CommitSync() (res types.Result) { +func (cli *socketClient) CommitSync() *types.ResponseCommit { reqres := cli.queueRequest(types.ToRequestCommit()) cli.FlushSync() if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()) + return &types.ResponseCommit{Code: types.CodeType_InternalError, Log: err.Error()} } - resp := reqres.Response.GetCommit() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} + return reqres.Response.GetCommit() } -func (cli *socketClient) InitChainSync(params types.RequestInitChain) (err error) { +func (cli *socketClient) InitChainSync(params types.RequestInitChain) error { cli.queueRequest(types.ToRequestInitChain(params)) cli.FlushSync() return cli.Error() } -func (cli *socketClient) BeginBlockSync(params types.RequestBeginBlock) (err error) { +func (cli *socketClient) BeginBlockSync(params types.RequestBeginBlock) error { cli.queueRequest(types.ToRequestBeginBlock(params)) cli.FlushSync() return cli.Error() } -func (cli *socketClient) EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) { +func (cli *socketClient) EndBlockSync(height uint64) (*types.ResponseEndBlock, error) { reqres := cli.queueRequest(types.ToRequestEndBlock(height)) cli.FlushSync() - if err := cli.Error(); err != nil { - return resEndBlock, err - } - if blk := reqres.Response.GetEndBlock(); blk != nil { - return *blk, nil - } - return resEndBlock, nil + return reqres.Response.GetEndBlock(), cli.Error() } //---------------------------------------- diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 9962380b4..9c14aa4d6 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -327,9 +327,12 @@ func cmdConsole(cmd *cobra.Command, args []string) error { // Have the application echo a message func cmdEcho(cmd *cobra.Command, args []string) error { - resEcho := client.EchoSync(args[0]) + res, err := client.EchoSync(args[0]) + if err != nil { + return err + } printResponse(cmd, args, response{ - Data: resEcho.Data, + Data: []byte(res.Message), }) return nil } @@ -340,21 +343,24 @@ func cmdInfo(cmd *cobra.Command, args []string) error { if len(args) == 1 { version = args[0] } - resInfo, err := client.InfoSync(types.RequestInfo{version}) + res, err := client.InfoSync(types.RequestInfo{version}) if err != nil { return err } printResponse(cmd, args, response{ - Data: []byte(resInfo.Data), + Data: []byte(res.Data), }) return nil } // Set an option on the application func cmdSetOption(cmd *cobra.Command, args []string) error { - resSetOption := client.SetOptionSync(args[0], args[1]) + log, err := client.SetOptionSync(args[0], args[1]) + if err != nil { + return err + } printResponse(cmd, args, response{ - Log: resSetOption.Log, + Log: log, }) return nil } diff --git a/tests/test_app/app.go b/tests/test_app/app.go index 127ba78f7..67742b383 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -23,7 +23,7 @@ func startApp(abciApp string) *process.Process { os.Stdout, ) if err != nil { - panic("running abci_app: " + err.Error()) + panicf("running abci_app: %v", err) } // TODO a better way to handle this? @@ -41,57 +41,54 @@ func startClient(abciType string) abcicli.Client { logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) client.SetLogger(logger.With("module", "abcicli")) if _, err := client.Start(); err != nil { - panic("connecting to abci_app: " + err.Error()) + panicf("connecting to abci_app: %v", err.Error()) } return client } func setOption(client abcicli.Client, key, value string) { - res := client.SetOptionSync(key, value) - _, _, log := res.Code, res.Data, res.Log - if res.IsErr() { - panic(fmt.Sprintf("setting %v=%v: \nlog: %v", key, value, log)) + _, err := client.SetOptionSync(key, value) + if err != nil { + panicf("setting %v=%v: \nerr: %v", key, value, err) } } func commit(client abcicli.Client, hashExp []byte) { res := client.CommitSync() - _, data, _ := res.Code, res.Data, res.Log if res.IsErr() { - panic(fmt.Sprintf("committing err %v\n", res)) + panicf("committing err %v\n", res) } if !bytes.Equal(res.Data, hashExp) { - panic(fmt.Sprintf("Commit hash was unexpected. Got %X expected %X", - data, hashExp)) + panicf("Commit hash was unexpected. Got %X expected %X", res.Data, hashExp) } } func deliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { res := client.DeliverTxSync(txBytes) - code, data, log := res.Code, res.Data, res.Log - if code != codeExp { - panic(fmt.Sprintf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", - code, codeExp, log)) + if res.Code != codeExp { + panicf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", res.Code, codeExp, res.Log) } - if !bytes.Equal(data, dataExp) { - panic(fmt.Sprintf("DeliverTx response data was unexpected. Got %X expected %X", - data, dataExp)) + if !bytes.Equal(res.Data, dataExp) { + panicf("DeliverTx response data was unexpected. Got %X expected %X", res.Data, dataExp) } } /*func checkTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { res := client.CheckTxSync(txBytes) - code, data, log := res.Code, res.Data, res.Log if res.IsErr() { - panic(fmt.Sprintf("checking tx %X: %v\nlog: %v", txBytes, log)) + panicf("checking tx %X: %v\nlog: %v", txBytes, res.Log) } - if code != codeExp { - panic(fmt.Sprintf("CheckTx response code was unexpected. Got %v expected %v. Log: %v", - code, codeExp, log)) + if res.Code != codeExp { + panicf("CheckTx response code was unexpected. Got %v expected %v. Log: %v", + res.Code, codeExp, res.Log) } - if !bytes.Equal(data, dataExp) { - panic(fmt.Sprintf("CheckTx response data was unexpected. Got %X expected %X", - data, dataExp)) + if !bytes.Equal(res.Data, dataExp) { + panicf("CheckTx response data was unexpected. Got %X expected %X", + res.Data, dataExp) } }*/ + +func panicf(format string, a ...interface{}) { + panic(fmt.Sprintf(format, a)) +} diff --git a/types/result.go b/types/result.go index ffd8966a9..1cb96879a 100644 --- a/types/result.go +++ b/types/result.go @@ -106,6 +106,7 @@ func (r *ResponseCheckTx) Result() Result { } } +// IsErr returns true if Code is something other than OK. func (r ResponseCheckTx) IsErr() bool { return r.Code != CodeType_OK } @@ -120,6 +121,7 @@ func (r *ResponseDeliverTx) Result() Result { } } +// IsErr returns true if Code is something other than OK. func (r ResponseDeliverTx) IsErr() bool { return r.Code != CodeType_OK } @@ -145,3 +147,8 @@ func (r *ResponseQuery) Result() *ResultQuery { Log: r.Log, } } + +// IsErr returns true if Code is something other than OK. +func (r ResponseCommit) IsErr() bool { + return r.Code != CodeType_OK +} From e6fdc98aeb40421cde26d7f0a5fda1099f6aa80f Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 21 Nov 2017 17:44:22 -0600 Subject: [PATCH 16/80] update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cd5046c0..4f944d9f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.8.0 (TBD) + +BREAKING CHANGES: + - [client] more consistent interface + +IMPROVEMENTS: + - [types] added Tags field to ResponseDeliverTx + ## 0.7.1 (November 14, 2017) IMPROVEMENTS: From f6a79dd7c50c49a3e9ae39bde76af6d1ae773985 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 21 Nov 2017 17:50:06 -0600 Subject: [PATCH 17/80] add interface assertions for all clients --- client/grpc_client.go | 2 ++ client/local_client.go | 2 ++ client/socket_client.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/client/grpc_client.go b/client/grpc_client.go index 524f1f7f9..c7a4c2aed 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -13,6 +13,8 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) +var _ Client = (*grpcClient)(nil) + // A stripped copy of the remoteClient that makes // synchronous calls using grpc type grpcClient struct { diff --git a/client/local_client.go b/client/local_client.go index 9081406af..2a294f48a 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -7,6 +7,8 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) +var _ Client = (*localClient)(nil) + type localClient struct { cmn.BaseService mtx *sync.Mutex diff --git a/client/socket_client.go b/client/socket_client.go index ef0a6ecea..642119792 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -23,6 +23,8 @@ const reqQueueSize = 256 // TODO make configurable // const maxResponseSize = 1048576 // 1MB TODO make configurable const flushThrottleMS = 20 // Don't wait longer than... +var _ Client = (*socketClient)(nil) + // This is goroutine-safe, but users should beware that // the application in general is not meant to be interfaced // with concurrent callers. From 5be9c50b47d93a977c3eec19dd49e7c486d7e008 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 21 Nov 2017 17:53:48 -0600 Subject: [PATCH 18/80] fix megacheck warning --- cmd/abci-cli/abci-cli.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 9c14aa4d6..cd6f05f4f 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -355,12 +355,12 @@ func cmdInfo(cmd *cobra.Command, args []string) error { // Set an option on the application func cmdSetOption(cmd *cobra.Command, args []string) error { - log, err := client.SetOptionSync(args[0], args[1]) + resLog, err := client.SetOptionSync(args[0], args[1]) if err != nil { return err } printResponse(cmd, args, response{ - Log: log, + Log: resLog, }) return nil } From 52ec4efe275ec96d01d741415996d473c748b19e Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 21 Nov 2017 18:11:23 -0600 Subject: [PATCH 19/80] retire test_integrations in favor of just make test --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index aeb6d7160..57ab4052d 100644 --- a/Makefile +++ b/Makefile @@ -37,15 +37,15 @@ dist: # test.sh requires that we run the installed cmds, must not be out of date test: install - find . -path ./vendor -prune -o -name *.sock -exec rm {} \; + @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; + @ echo "==> Running unit tests" @ go test $(PACKAGES) + @ echo "==> Running integration tests (./tests)" @ bash tests/test.sh fmt: @ go fmt ./... -test_integrations: get_vendor_deps install test - get_deps: @ go get -d $(PACKAGES) From 7868a3358f8b31b090e2a60ce3d27145ca93bc5c Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 21 Nov 2017 18:12:12 -0600 Subject: [PATCH 20/80] gather test coverage --- circle.yml | 10 +++++----- test.sh | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 test.sh diff --git a/circle.yml b/circle.yml index daa4218e0..459873637 100644 --- a/circle.yml +++ b/circle.yml @@ -12,11 +12,11 @@ checkout: - rm -rf $REPO - mkdir -p $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME - mv $HOME/$CIRCLE_PROJECT_REPONAME $REPO - # - git submodule sync - # - git submodule update --init # use submodules + - go version test: override: - - "go version" - - "cd $REPO && make get_vendor_deps && make metalinter_test" - - "cd $REPO && make test_integrations" + - cd $REPO && make get_vendor_deps && make metalinter_test && bash ./test.sh + post: + - cd "$REPO" && bash <(curl -s https://codecov.io/bash) -f coverage.txt + - cd "$REPO" && mv coverage.txt "${CIRCLE_ARTIFACTS}" diff --git a/test.sh b/test.sh new file mode 100755 index 000000000..136f60e2a --- /dev/null +++ b/test.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e +echo "" > coverage.txt + +echo "==> Running unit tests" +for d in $(go list ./... | grep -v vendor); do + go test -race -coverprofile=profile.out -covermode=atomic "$d" + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done + +echo "==> Running integration tests (./tests)" +find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; +make install +bash tests/test.sh From 5fd83b3eeec162b7f1b34795a5a9ca19a9cca76a Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 16:17:34 -0600 Subject: [PATCH 21/80] implement error interface for ResponseDeliverTx/CheckTx/Commit --- types/errors.go | 23 +++++++++++++++++++++++ types/result.go | 24 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/types/errors.go b/types/errors.go index 7fa1f0090..03d14578f 100644 --- a/types/errors.go +++ b/types/errors.go @@ -23,4 +23,27 @@ var ( ErrBaseUnknownAddress = NewError(CodeType_BaseUnknownAddress, "Error (base) unknown address") ErrBaseUnknownPlugin = NewError(CodeType_BaseUnknownPlugin, "Error (base) unknown plugin") ErrBaseUnknownPubKey = NewError(CodeType_BaseUnknownPubKey, "Error (base) unknown pubkey") + + code2string = map[CodeType]string{ + CodeType_InternalError: "Internal error", + CodeType_EncodingError: "Encoding error", + CodeType_BadNonce: "Error bad nonce", + CodeType_Unauthorized: "Unauthorized", + CodeType_InsufficientFunds: "Insufficient funds", + CodeType_UnknownRequest: "Unknown request", + + CodeType_BaseDuplicateAddress: "Error (base) duplicate address", + CodeType_BaseEncodingError: "Error (base) encoding error", + CodeType_BaseInsufficientFees: "Error (base) insufficient fees", + CodeType_BaseInsufficientFunds: "Error (base) insufficient funds", + CodeType_BaseInsufficientGasPrice: "Error (base) insufficient gas price", + CodeType_BaseInvalidInput: "Error (base) invalid input", + CodeType_BaseInvalidOutput: "Error (base) invalid output", + CodeType_BaseInvalidPubKey: "Error (base) invalid pubkey", + CodeType_BaseInvalidSequence: "Error (base) invalid sequence", + CodeType_BaseInvalidSignature: "Error (base) invalid signature", + CodeType_BaseUnknownAddress: "Error (base) unknown address", + CodeType_BaseUnknownPlugin: "Error (base) unknown plugin", + CodeType_BaseUnknownPubKey: "Error (base) unknown pubkey", + } ) diff --git a/types/result.go b/types/result.go index 1cb96879a..8dba24486 100644 --- a/types/result.go +++ b/types/result.go @@ -111,6 +111,11 @@ func (r ResponseCheckTx) IsErr() bool { return r.Code != CodeType_OK } +// Error implements error interface by formatting response as string. +func (r ResponseCheckTx) Error() string { + return fmtError(r.Code, r.Log) +} + // Convert ResponseDeliverTx to standard Result func (r *ResponseDeliverTx) Result() Result { return Result{ @@ -126,6 +131,11 @@ func (r ResponseDeliverTx) IsErr() bool { return r.Code != CodeType_OK } +// Error implements error interface by formatting response as string. +func (r ResponseDeliverTx) Error() string { + return fmtError(r.Code, r.Log) +} + type ResultQuery struct { Code CodeType `json:"code"` Index int64 `json:"index"` @@ -152,3 +162,17 @@ func (r *ResponseQuery) Result() *ResultQuery { func (r ResponseCommit) IsErr() bool { return r.Code != CodeType_OK } + +// Error implements error interface by formatting response as string. +func (r ResponseCommit) Error() string { + return fmtError(r.Code, r.Log) +} + +func fmtError(code CodeType, log string) string { + codeAsStr, ok := code2string[code] + if ok { + return fmt.Sprintf("%s (%v): %s", codeAsStr, code, log) + } else { + return fmt.Sprintf("Unknown error (%v): %s", code, log) + } +} From 01252e8cc84229ad0f47921e1b2a74592de72ffc Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 16:18:06 -0600 Subject: [PATCH 22/80] mark Result as deprecated --- types/result.go | 1 + 1 file changed, 1 insertion(+) diff --git a/types/result.go b/types/result.go index 8dba24486..e37f6f497 100644 --- a/types/result.go +++ b/types/result.go @@ -8,6 +8,7 @@ import ( // Result is a common result object for ABCI calls. // CONTRACT: a zero Result is OK. +// DEPRECATED: prefer raw types instead. type Result struct { Code CodeType `json:"code"` Data data.Bytes `json:"data"` From f01f2bbf3a52c395c22a96c5cff442cd433bcb84 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 17:34:00 -0600 Subject: [PATCH 23/80] DeliverTxSync/CheckTxSync/CommitSync now return error as well --- client/client.go | 6 +++--- client/grpc_client.go | 19 ++++++++++--------- client/local_client.go | 12 ++++++------ client/socket_client.go | 20 ++++++++++---------- cmd/abci-cli/abci-cli.go | 15 ++++++++++++--- example/dummy/dummy_test.go | 6 ++++-- tests/test_app/app.go | 15 ++++++++++++--- types/errors.go | 9 +++++++++ 8 files changed, 66 insertions(+), 36 deletions(-) diff --git a/client/client.go b/client/client.go index b550dc926..5878b6197 100644 --- a/client/client.go +++ b/client/client.go @@ -27,10 +27,10 @@ type Client interface { EchoSync(msg string) (*types.ResponseEcho, error) InfoSync(types.RequestInfo) (*types.ResponseInfo, error) SetOptionSync(key string, value string) (log string, err error) - DeliverTxSync(tx []byte) *types.ResponseDeliverTx - CheckTxSync(tx []byte) *types.ResponseCheckTx + DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) + CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) QuerySync(types.RequestQuery) (*types.ResponseQuery, error) - CommitSync() *types.ResponseCommit + CommitSync() (*types.ResponseCommit, error) InitChainAsync(types.RequestInitChain) *ReqRes BeginBlockAsync(types.RequestBeginBlock) *ReqRes diff --git a/client/grpc_client.go b/client/grpc_client.go index c7a4c2aed..6a53cb21a 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -6,6 +6,7 @@ import ( "sync" "time" + "github.com/pkg/errors" context "golang.org/x/net/context" grpc "google.golang.org/grpc" @@ -267,20 +268,20 @@ func (cli *grpcClient) SetOptionSync(key string, value string) (log string, err return reqres.Response.GetSetOption().Log, nil } -func (cli *grpcClient) DeliverTxSync(tx []byte) *types.ResponseDeliverTx { +func (cli *grpcClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) { reqres := cli.DeliverTxAsync(tx) if err := cli.Error(); err != nil { - return &types.ResponseDeliverTx{Code: types.CodeType_InternalError, Log: err.Error()} + return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) } - return reqres.Response.GetDeliverTx() + return reqres.Response.GetDeliverTx(), nil } -func (cli *grpcClient) CheckTxSync(tx []byte) *types.ResponseCheckTx { +func (cli *grpcClient) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) { reqres := cli.CheckTxAsync(tx) if err := cli.Error(); err != nil { - return &types.ResponseCheckTx{Code: types.CodeType_InternalError, Log: err.Error()} + return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) } - return reqres.Response.GetCheckTx() + return reqres.Response.GetCheckTx(), nil } func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { @@ -288,12 +289,12 @@ func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, return reqres.Response.GetQuery(), cli.Error() } -func (cli *grpcClient) CommitSync() *types.ResponseCommit { +func (cli *grpcClient) CommitSync() (*types.ResponseCommit, error) { reqres := cli.CommitAsync() if err := cli.Error(); err != nil { - return &types.ResponseCommit{Code: types.CodeType_InternalError, Log: err.Error()} + return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) } - return reqres.Response.GetCommit() + return reqres.Response.GetCommit(), nil } func (cli *grpcClient) InitChainSync(params types.RequestInitChain) error { diff --git a/client/local_client.go b/client/local_client.go index 2a294f48a..15dda8e6a 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -166,18 +166,18 @@ func (app *localClient) SetOptionSync(key string, value string) (log string, err return log, nil } -func (app *localClient) DeliverTxSync(tx []byte) *types.ResponseDeliverTx { +func (app *localClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) { app.mtx.Lock() res := app.Application.DeliverTx(tx) app.mtx.Unlock() - return &res + return &res, nil } -func (app *localClient) CheckTxSync(tx []byte) *types.ResponseCheckTx { +func (app *localClient) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) { app.mtx.Lock() res := app.Application.CheckTx(tx) app.mtx.Unlock() - return &res + return &res, nil } func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { @@ -187,11 +187,11 @@ func (app *localClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, return &res, nil } -func (app *localClient) CommitSync() *types.ResponseCommit { +func (app *localClient) CommitSync() (*types.ResponseCommit, error) { app.mtx.Lock() res := app.Application.Commit() app.mtx.Unlock() - return &res + return &res, nil } func (app *localClient) InitChainSync(params types.RequestInitChain) error { diff --git a/client/socket_client.go b/client/socket_client.go index 642119792..7e117d228 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -3,13 +3,13 @@ package abcicli import ( "bufio" "container/list" - "errors" "fmt" "net" "reflect" "sync" "time" + "github.com/pkg/errors" "github.com/tendermint/abci/types" cmn "github.com/tendermint/tmlibs/common" ) @@ -303,22 +303,22 @@ func (cli *socketClient) SetOptionSync(key string, value string) (log string, er return reqres.Response.GetSetOption().Log, nil } -func (cli *socketClient) DeliverTxSync(tx []byte) *types.ResponseDeliverTx { +func (cli *socketClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) { reqres := cli.queueRequest(types.ToRequestDeliverTx(tx)) cli.FlushSync() if err := cli.Error(); err != nil { - return &types.ResponseDeliverTx{Code: types.CodeType_InternalError, Log: err.Error()} + return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) } - return reqres.Response.GetDeliverTx() + return reqres.Response.GetDeliverTx(), nil } -func (cli *socketClient) CheckTxSync(tx []byte) *types.ResponseCheckTx { +func (cli *socketClient) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) { reqres := cli.queueRequest(types.ToRequestCheckTx(tx)) cli.FlushSync() if err := cli.Error(); err != nil { - return &types.ResponseCheckTx{Code: types.CodeType_InternalError, Log: err.Error()} + return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) } - return reqres.Response.GetCheckTx() + return reqres.Response.GetCheckTx(), nil } func (cli *socketClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { @@ -327,13 +327,13 @@ func (cli *socketClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery return reqres.Response.GetQuery(), cli.Error() } -func (cli *socketClient) CommitSync() *types.ResponseCommit { +func (cli *socketClient) CommitSync() (*types.ResponseCommit, error) { reqres := cli.queueRequest(types.ToRequestCommit()) cli.FlushSync() if err := cli.Error(); err != nil { - return &types.ResponseCommit{Code: types.CodeType_InternalError, Log: err.Error()} + return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) } - return reqres.Response.GetCommit() + return reqres.Response.GetCommit(), nil } func (cli *socketClient) InitChainSync(params types.RequestInitChain) error { diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index cd6f05f4f..e3f0daec8 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -371,7 +371,10 @@ func cmdDeliverTx(cmd *cobra.Command, args []string) error { if err != nil { return err } - res := client.DeliverTxSync(txBytes) + res, err := client.DeliverTxSync(txBytes) + if err != nil { + return err + } printResponse(cmd, args, response{ Code: res.Code, Data: res.Data, @@ -386,7 +389,10 @@ func cmdCheckTx(cmd *cobra.Command, args []string) error { if err != nil { return err } - res := client.CheckTxSync(txBytes) + res, err := client.CheckTxSync(txBytes) + if err != nil { + return err + } printResponse(cmd, args, response{ Code: res.Code, Data: res.Data, @@ -397,7 +403,10 @@ func cmdCheckTx(cmd *cobra.Command, args []string) error { // Get application Merkle root hash func cmdCommit(cmd *cobra.Command, args []string) error { - res := client.CommitSync() + res, err := client.CommitSync() + if err != nil { + return err + } printResponse(cmd, args, response{ Code: res.Code, Data: res.Data, diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index efbc5af77..798da7200 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -281,10 +281,12 @@ func runClientTests(t *testing.T, client abcicli.Client) { } func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) { - ar := app.DeliverTxSync(tx) + ar, err := app.DeliverTxSync(tx) + require.NoError(t, err) require.False(t, ar.IsErr(), ar) // repeating tx doesn't raise error - ar = app.DeliverTxSync(tx) + ar, err = app.DeliverTxSync(tx) + require.NoError(t, err) require.False(t, ar.IsErr(), ar) // make sure query is fine diff --git a/tests/test_app/app.go b/tests/test_app/app.go index 67742b383..c3e9d14fc 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -55,7 +55,10 @@ func setOption(client abcicli.Client, key, value string) { } func commit(client abcicli.Client, hashExp []byte) { - res := client.CommitSync() + res, err := client.CommitSync() + if err != nil { + panicf("client error: %v", err) + } if res.IsErr() { panicf("committing err %v\n", res) } @@ -65,7 +68,10 @@ func commit(client abcicli.Client, hashExp []byte) { } func deliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { - res := client.DeliverTxSync(txBytes) + res, err := client.DeliverTxSync(txBytes) + if err != nil { + panicf("client error: %v", err) + } if res.Code != codeExp { panicf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", res.Code, codeExp, res.Log) } @@ -75,7 +81,10 @@ func deliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, da } /*func checkTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { - res := client.CheckTxSync(txBytes) + res, err := client.CheckTxSync(txBytes) + if err != nil { + panicf("client error: %v", err) + } if res.IsErr() { panicf("checking tx %X: %v\nlog: %v", txBytes, res.Log) } diff --git a/types/errors.go b/types/errors.go index 03d14578f..f63d2470f 100644 --- a/types/errors.go +++ b/types/errors.go @@ -47,3 +47,12 @@ var ( CodeType_BaseUnknownPubKey: "Error (base) unknown pubkey", } ) + +// HumanCode transforms code into a more humane format, such as "Internal error" instead of 0. +func HumanCode(code CodeType) string { + s, ok := code2string[code] + if !ok { + return "Unknown code" + } + return s +} From 91efacfabc086f14a9d4fe4f2d661a0e647915c2 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 17:44:39 -0600 Subject: [PATCH 24/80] remove types.Result --- types/code.go | 34 +++++++++++ types/errors.go | 58 ------------------ types/result.go | 158 ++++++++---------------------------------------- 3 files changed, 59 insertions(+), 191 deletions(-) delete mode 100644 types/errors.go diff --git a/types/code.go b/types/code.go index c99a0bbe1..613c4cda3 100644 --- a/types/code.go +++ b/types/code.go @@ -1,3 +1,37 @@ package types +var ( + code2string = map[CodeType]string{ + CodeType_InternalError: "Internal error", + CodeType_EncodingError: "Encoding error", + CodeType_BadNonce: "Error bad nonce", + CodeType_Unauthorized: "Unauthorized", + CodeType_InsufficientFunds: "Insufficient funds", + CodeType_UnknownRequest: "Unknown request", + + CodeType_BaseDuplicateAddress: "Error (base) duplicate address", + CodeType_BaseEncodingError: "Error (base) encoding error", + CodeType_BaseInsufficientFees: "Error (base) insufficient fees", + CodeType_BaseInsufficientFunds: "Error (base) insufficient funds", + CodeType_BaseInsufficientGasPrice: "Error (base) insufficient gas price", + CodeType_BaseInvalidInput: "Error (base) invalid input", + CodeType_BaseInvalidOutput: "Error (base) invalid output", + CodeType_BaseInvalidPubKey: "Error (base) invalid pubkey", + CodeType_BaseInvalidSequence: "Error (base) invalid sequence", + CodeType_BaseInvalidSignature: "Error (base) invalid signature", + CodeType_BaseUnknownAddress: "Error (base) unknown address", + CodeType_BaseUnknownPlugin: "Error (base) unknown plugin", + CodeType_BaseUnknownPubKey: "Error (base) unknown pubkey", + } +) + func (c CodeType) IsOK() bool { return c == CodeType_OK } + +// HumanCode transforms code into a more humane format, such as "Internal error" instead of 0. +func HumanCode(code CodeType) string { + s, ok := code2string[code] + if !ok { + return "Unknown code" + } + return s +} diff --git a/types/errors.go b/types/errors.go deleted file mode 100644 index f63d2470f..000000000 --- a/types/errors.go +++ /dev/null @@ -1,58 +0,0 @@ -package types - -var ( - OK = NewResultOK(nil, "") - - ErrInternalError = NewError(CodeType_InternalError, "Internal error") - ErrEncodingError = NewError(CodeType_EncodingError, "Encoding error") - ErrBadNonce = NewError(CodeType_BadNonce, "Error bad nonce") - ErrUnauthorized = NewError(CodeType_Unauthorized, "Unauthorized") - ErrInsufficientFunds = NewError(CodeType_InsufficientFunds, "Insufficient funds") - ErrUnknownRequest = NewError(CodeType_UnknownRequest, "Unknown request") - - ErrBaseDuplicateAddress = NewError(CodeType_BaseDuplicateAddress, "Error (base) duplicate address") - ErrBaseEncodingError = NewError(CodeType_BaseEncodingError, "Error (base) encoding error") - ErrBaseInsufficientFees = NewError(CodeType_BaseInsufficientFees, "Error (base) insufficient fees") - ErrBaseInsufficientFunds = NewError(CodeType_BaseInsufficientFunds, "Error (base) insufficient funds") - ErrBaseInsufficientGasPrice = NewError(CodeType_BaseInsufficientGasPrice, "Error (base) insufficient gas price") - ErrBaseInvalidInput = NewError(CodeType_BaseInvalidInput, "Error (base) invalid input") - ErrBaseInvalidOutput = NewError(CodeType_BaseInvalidOutput, "Error (base) invalid output") - ErrBaseInvalidPubKey = NewError(CodeType_BaseInvalidPubKey, "Error (base) invalid pubkey") - ErrBaseInvalidSequence = NewError(CodeType_BaseInvalidSequence, "Error (base) invalid sequence") - ErrBaseInvalidSignature = NewError(CodeType_BaseInvalidSignature, "Error (base) invalid signature") - ErrBaseUnknownAddress = NewError(CodeType_BaseUnknownAddress, "Error (base) unknown address") - ErrBaseUnknownPlugin = NewError(CodeType_BaseUnknownPlugin, "Error (base) unknown plugin") - ErrBaseUnknownPubKey = NewError(CodeType_BaseUnknownPubKey, "Error (base) unknown pubkey") - - code2string = map[CodeType]string{ - CodeType_InternalError: "Internal error", - CodeType_EncodingError: "Encoding error", - CodeType_BadNonce: "Error bad nonce", - CodeType_Unauthorized: "Unauthorized", - CodeType_InsufficientFunds: "Insufficient funds", - CodeType_UnknownRequest: "Unknown request", - - CodeType_BaseDuplicateAddress: "Error (base) duplicate address", - CodeType_BaseEncodingError: "Error (base) encoding error", - CodeType_BaseInsufficientFees: "Error (base) insufficient fees", - CodeType_BaseInsufficientFunds: "Error (base) insufficient funds", - CodeType_BaseInsufficientGasPrice: "Error (base) insufficient gas price", - CodeType_BaseInvalidInput: "Error (base) invalid input", - CodeType_BaseInvalidOutput: "Error (base) invalid output", - CodeType_BaseInvalidPubKey: "Error (base) invalid pubkey", - CodeType_BaseInvalidSequence: "Error (base) invalid sequence", - CodeType_BaseInvalidSignature: "Error (base) invalid signature", - CodeType_BaseUnknownAddress: "Error (base) unknown address", - CodeType_BaseUnknownPlugin: "Error (base) unknown plugin", - CodeType_BaseUnknownPubKey: "Error (base) unknown pubkey", - } -) - -// HumanCode transforms code into a more humane format, such as "Internal error" instead of 0. -func HumanCode(code CodeType) string { - s, ok := code2string[code] - if !ok { - return "Unknown code" - } - return s -} diff --git a/types/result.go b/types/result.go index e37f6f497..78cea710c 100644 --- a/types/result.go +++ b/types/result.go @@ -6,107 +6,6 @@ import ( "github.com/tendermint/go-wire/data" ) -// Result is a common result object for ABCI calls. -// CONTRACT: a zero Result is OK. -// DEPRECATED: prefer raw types instead. -type Result struct { - Code CodeType `json:"code"` - Data data.Bytes `json:"data"` - Log string `json:"log"` // Can be non-deterministic - Tags []*KVPair `json:"tags"` -} - -func NewResult(code CodeType, data []byte, log string) Result { - return Result{ - Code: code, - Data: data, - Log: log, - } -} - -func (res Result) IsOK() bool { - return res.Code == CodeType_OK -} - -func (res Result) IsErr() bool { - return res.Code != CodeType_OK -} - -func (res Result) IsSameCode(compare Result) bool { - return res.Code == compare.Code -} - -func (res Result) Error() string { - return fmt.Sprintf("ABCI{code:%v, data:%X, log:%v}", res.Code, res.Data, res.Log) -} - -func (res Result) String() string { - return fmt.Sprintf("ABCI{code:%v, data:%X, log:%v}", res.Code, res.Data, res.Log) -} - -func (res Result) PrependLog(log string) Result { - return Result{ - Code: res.Code, - Data: res.Data, - Log: log + ";" + res.Log, - } -} - -func (res Result) AppendLog(log string) Result { - return Result{ - Code: res.Code, - Data: res.Data, - Log: res.Log + ";" + log, - } -} - -func (res Result) SetLog(log string) Result { - return Result{ - Code: res.Code, - Data: res.Data, - Log: log, - } -} - -func (res Result) SetData(data []byte) Result { - return Result{ - Code: res.Code, - Data: data, - Log: res.Log, - } -} - -//---------------------------------------- - -// NOTE: if data == nil and log == "", same as zero Result. -func NewResultOK(data []byte, log string) Result { - return Result{ - Code: CodeType_OK, - Data: data, - Log: log, - } -} - -func NewError(code CodeType, log string) Result { - return Result{ - Code: code, - Log: log, - } -} - -//---------------------------------------- -// Convenience methods for turning the -// pb type into one using data.Bytes - -// Convert ResponseCheckTx to standard Result -func (r *ResponseCheckTx) Result() Result { - return Result{ - Code: r.Code, - Data: r.Data, - Log: r.Log, - } -} - // IsErr returns true if Code is something other than OK. func (r ResponseCheckTx) IsErr() bool { return r.Code != CodeType_OK @@ -117,16 +16,6 @@ func (r ResponseCheckTx) Error() string { return fmtError(r.Code, r.Log) } -// Convert ResponseDeliverTx to standard Result -func (r *ResponseDeliverTx) Result() Result { - return Result{ - Code: r.Code, - Data: r.Data, - Log: r.Log, - Tags: r.Tags, - } -} - // IsErr returns true if Code is something other than OK. func (r ResponseDeliverTx) IsErr() bool { return r.Code != CodeType_OK @@ -137,28 +26,6 @@ func (r ResponseDeliverTx) Error() string { return fmtError(r.Code, r.Log) } -type ResultQuery struct { - Code CodeType `json:"code"` - Index int64 `json:"index"` - Key data.Bytes `json:"key"` - Value data.Bytes `json:"value"` - Proof data.Bytes `json:"proof"` - Height uint64 `json:"height"` - Log string `json:"log"` -} - -func (r *ResponseQuery) Result() *ResultQuery { - return &ResultQuery{ - Code: r.Code, - Index: r.Index, - Key: r.Key, - Value: r.Value, - Proof: r.Proof, - Height: r.Height, - Log: r.Log, - } -} - // IsErr returns true if Code is something other than OK. func (r ResponseCommit) IsErr() bool { return r.Code != CodeType_OK @@ -177,3 +44,28 @@ func fmtError(code CodeType, log string) string { return fmt.Sprintf("Unknown error (%v): %s", code, log) } } + +// ResultQuery is a wrapper around ResponseQuery using data.Bytes instead of +// raw byte slices. +type ResultQuery struct { + Code CodeType `json:"code"` + Index int64 `json:"index"` + Key data.Bytes `json:"key"` + Value data.Bytes `json:"value"` + Proof data.Bytes `json:"proof"` + Height uint64 `json:"height"` + Log string `json:"log"` +} + +// Result converts response query to ResultQuery. +func (r *ResponseQuery) Result() *ResultQuery { + return &ResultQuery{ + Code: r.Code, + Index: r.Index, + Key: r.Key, + Value: r.Value, + Proof: r.Proof, + Height: r.Height, + Log: r.Log, + } +} From afb7feeea20b2255be7f808caa227e67dfb1fe8e Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 17:51:36 -0600 Subject: [PATCH 25/80] update CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f944d9f5..9db1817c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## 0.8.0 (TBD) BREAKING CHANGES: - - [client] more consistent interface + - [client] all {X}Sync methods now return an error + - [types] removed Result + - [client] all {X}Sync methods now return Response{X} as first return value IMPROVEMENTS: - [types] added Tags field to ResponseDeliverTx From 1726e828655000f09804046e8a2e1cab5799c8a9 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 18:19:41 -0600 Subject: [PATCH 26/80] add IsErr and Error method for ResultQuery --- types/result.go | 14 ++++++-- types/result_test.go | 76 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 types/result_test.go diff --git a/types/result.go b/types/result.go index 78cea710c..6ebad8ab2 100644 --- a/types/result.go +++ b/types/result.go @@ -39,9 +39,9 @@ func (r ResponseCommit) Error() string { func fmtError(code CodeType, log string) string { codeAsStr, ok := code2string[code] if ok { - return fmt.Sprintf("%s (%v): %s", codeAsStr, code, log) + return fmt.Sprintf("%s (%d): %s", codeAsStr, code, log) } else { - return fmt.Sprintf("Unknown error (%v): %s", code, log) + return fmt.Sprintf("Unknown error (%d): %s", code, log) } } @@ -69,3 +69,13 @@ func (r *ResponseQuery) Result() *ResultQuery { Log: r.Log, } } + +// IsErr returns true if Code is something other than OK. +func (r *ResultQuery) IsErr() bool { + return r.Code != CodeType_OK +} + +// Error implements error interface by formatting result as string. +func (r *ResultQuery) Error() string { + return fmtError(r.Code, r.Log) +} diff --git a/types/result_test.go b/types/result_test.go new file mode 100644 index 000000000..14f334c49 --- /dev/null +++ b/types/result_test.go @@ -0,0 +1,76 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestResultQuery(t *testing.T) { + orig := &ResponseQuery{ + Code: CodeType_OK, + Index: 0, + Key: []byte("hello"), + Value: []byte("world"), + Height: 1, + } + res := orig.Result() + assert.False(t, res.IsErr()) + + orig = &ResponseQuery{ + Code: CodeType_BadNonce, + Index: 0, + Key: []byte("hello"), + Value: []byte("world"), + Height: 1, + Log: "bad", + } + res = orig.Result() + assert.True(t, res.IsErr()) + assert.Equal(t, "Error bad nonce (3): bad", res.Error()) +} + +func TestResponseDeliverTx(t *testing.T) { + res := ResponseDeliverTx{ + Code: CodeType_OK, + Data: []byte("Victor Mancha"), + } + assert.False(t, res.IsErr()) + + res = ResponseDeliverTx{ + Code: CodeType_InternalError, + Log: "bad", + } + assert.True(t, res.IsErr()) + assert.Equal(t, "Internal error (1): bad", res.Error()) +} + +func TestResponseCheckTx(t *testing.T) { + res := ResponseCheckTx{ + Code: CodeType_OK, + Data: []byte("Talos"), + } + assert.False(t, res.IsErr()) + + res = ResponseCheckTx{ + Code: CodeType_InternalError, + Log: "bad", + } + assert.True(t, res.IsErr()) + assert.Equal(t, "Internal error (1): bad", res.Error()) +} + +func TestResponseCommit(t *testing.T) { + res := ResponseCommit{ + Code: CodeType_OK, + Data: []byte("Old Lace"), + } + assert.False(t, res.IsErr()) + + res = ResponseCommit{ + Code: CodeType_Unauthorized, + Log: "bad", + } + assert.True(t, res.IsErr()) + assert.Equal(t, "Unauthorized (4): bad", res.Error()) +} From 2cfad8523a54d64271d7cbc69a39433eab918aa0 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 18:24:53 -0600 Subject: [PATCH 27/80] test HumanCode --- types/code_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 types/code_test.go diff --git a/types/code_test.go b/types/code_test.go new file mode 100644 index 000000000..d9032d3c5 --- /dev/null +++ b/types/code_test.go @@ -0,0 +1,12 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestHumanCode(t *testing.T) { + assert.Equal(t, "Internal error", HumanCode(CodeType_InternalError)) + assert.Equal(t, "Unknown code", HumanCode(-1)) +} From cbf347e2aabbb06e84eba7f0debcc92dedce4aa0 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 19:07:36 -0600 Subject: [PATCH 28/80] add comment for Client interface [ci skip] --- client/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/client.go b/client/client.go index 5878b6197..092c479ab 100644 --- a/client/client.go +++ b/client/client.go @@ -8,6 +8,10 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) +// Client defines an interface for an ABCI client. Client-related errors (e.g. +// network errors) are returned as a second return value for most calls +// (sometimes there is no response). Application-related errors are reflected +// in response via ABCI error codes and logs. type Client interface { cmn.Service From 0176a834d197a3718808cd04e6407fee1631298a Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 19:37:51 -0600 Subject: [PATCH 29/80] refactor code --- client/grpc_client.go | 17 ++++------------- client/socket_client.go | 17 ++++------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/client/grpc_client.go b/client/grpc_client.go index 6a53cb21a..f7889d69a 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -104,7 +104,7 @@ func (cli *grpcClient) StopForError(err error) { func (cli *grpcClient) Error() error { cli.mtx.Lock() defer cli.mtx.Unlock() - return cli.err + return errors.Wrap(cli.err, types.HumanCode(types.CodeType_InternalError)) } // Set listener for all responses @@ -270,18 +270,12 @@ func (cli *grpcClient) SetOptionSync(key string, value string) (log string, err func (cli *grpcClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) { reqres := cli.DeliverTxAsync(tx) - if err := cli.Error(); err != nil { - return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) - } - return reqres.Response.GetDeliverTx(), nil + return reqres.Response.GetDeliverTx(), cli.Error() } func (cli *grpcClient) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) { reqres := cli.CheckTxAsync(tx) - if err := cli.Error(); err != nil { - return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) - } - return reqres.Response.GetCheckTx(), nil + return reqres.Response.GetCheckTx(), cli.Error() } func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { @@ -291,10 +285,7 @@ func (cli *grpcClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, func (cli *grpcClient) CommitSync() (*types.ResponseCommit, error) { reqres := cli.CommitAsync() - if err := cli.Error(); err != nil { - return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) - } - return reqres.Response.GetCommit(), nil + return reqres.Response.GetCommit(), cli.Error() } func (cli *grpcClient) InitChainSync(params types.RequestInitChain) error { diff --git a/client/socket_client.go b/client/socket_client.go index 7e117d228..716ef4510 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -116,7 +116,7 @@ func (cli *socketClient) StopForError(err error) { func (cli *socketClient) Error() error { cli.mtx.Lock() defer cli.mtx.Unlock() - return cli.err + return errors.Wrap(cli.err, types.HumanCode(types.CodeType_InternalError)) } // Set listener for all responses @@ -306,19 +306,13 @@ func (cli *socketClient) SetOptionSync(key string, value string) (log string, er func (cli *socketClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) { reqres := cli.queueRequest(types.ToRequestDeliverTx(tx)) cli.FlushSync() - if err := cli.Error(); err != nil { - return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) - } - return reqres.Response.GetDeliverTx(), nil + return reqres.Response.GetDeliverTx(), cli.Error() } func (cli *socketClient) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) { reqres := cli.queueRequest(types.ToRequestCheckTx(tx)) cli.FlushSync() - if err := cli.Error(); err != nil { - return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) - } - return reqres.Response.GetCheckTx(), nil + return reqres.Response.GetCheckTx(), cli.Error() } func (cli *socketClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery, error) { @@ -330,10 +324,7 @@ func (cli *socketClient) QuerySync(req types.RequestQuery) (*types.ResponseQuery func (cli *socketClient) CommitSync() (*types.ResponseCommit, error) { reqres := cli.queueRequest(types.ToRequestCommit()) cli.FlushSync() - if err := cli.Error(); err != nil { - return nil, errors.Wrap(err, types.HumanCode(types.CodeType_InternalError)) - } - return reqres.Response.GetCommit(), nil + return reqres.Response.GetCommit(), cli.Error() } func (cli *socketClient) InitChainSync(params types.RequestInitChain) error { From 03fafeec2fc8fd95e30f4a9af31472b4a5e5718b Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 19:38:04 -0600 Subject: [PATCH 30/80] fix formatting of panicf function --- tests/test_app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_app/app.go b/tests/test_app/app.go index c3e9d14fc..c869fe83a 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -99,5 +99,5 @@ func deliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, da }*/ func panicf(format string, a ...interface{}) { - panic(fmt.Sprintf(format, a)) + panic(fmt.Sprintf(format, a...)) } From 9b30fab4fc5ab59f34fc8ad72b7288178246bd27 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 22 Nov 2017 19:38:28 -0600 Subject: [PATCH 31/80] preserve behaviour of BaseApplication --- types/base_app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/base_app.go b/types/base_app.go index 75fdae8d7..5432a5310 100644 --- a/types/base_app.go +++ b/types/base_app.go @@ -16,11 +16,11 @@ func (BaseApplication) SetOption(key string, value string) (log string) { } func (BaseApplication) DeliverTx(tx []byte) ResponseDeliverTx { - return ResponseDeliverTx{} + return ResponseDeliverTx{Code: CodeType_OK} } func (BaseApplication) CheckTx(tx []byte) ResponseCheckTx { - return ResponseCheckTx{} + return ResponseCheckTx{Code: CodeType_OK} } func (BaseApplication) Commit() ResponseCommit { From 67d2a5f66d958f881ca6957eb4b3a9268dc00b41 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 24 Nov 2017 16:45:36 -0600 Subject: [PATCH 32/80] set Code to OK in ResponseQuery in BaseApplication See https://github.com/tendermint/abci/pull/130#discussion_r152713220 --- types/base_app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/base_app.go b/types/base_app.go index 5432a5310..0086685b8 100644 --- a/types/base_app.go +++ b/types/base_app.go @@ -28,7 +28,7 @@ func (BaseApplication) Commit() ResponseCommit { } func (BaseApplication) Query(req RequestQuery) ResponseQuery { - return ResponseQuery{} + return ResponseQuery{Code: CodeType_OK} } func (BaseApplication) InitChain(req RequestInitChain) { From c7f54fb56cbc2f896e24f2f25d54aeccbb1e2dcd Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 27 Nov 2017 19:04:21 +0000 Subject: [PATCH 33/80] everything takes Request, returns Response; expect DeliverTx/CheckTx/Commit --- client/client.go | 27 +++++----- client/grpc_client.go | 33 ++++++------ client/local_client.go | 72 ++++++++++++------------- client/socket_client.go | 41 +++++++------- cmd/abci-cli/abci-cli.go | 5 +- example/block_aware/block_aware_app.go | 65 ---------------------- example/block_aware/block_aware_test.go | 57 -------------------- example/counter/counter.go | 5 +- example/dummy/dummy.go | 2 + example/dummy/dummy_test.go | 4 +- example/dummy/persistent_dummy.go | 26 +++++---- server/socket_server.go | 31 ++++++----- types/application.go | 33 ++++++------ types/base_app.go | 12 +++-- types/messages.go | 52 +++++++++--------- 15 files changed, 174 insertions(+), 291 deletions(-) delete mode 100644 example/block_aware/block_aware_app.go delete mode 100644 example/block_aware/block_aware_test.go diff --git a/client/client.go b/client/client.go index 092c479ab..ddb589a40 100644 --- a/client/client.go +++ b/client/client.go @@ -8,10 +8,11 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) -// Client defines an interface for an ABCI client. Client-related errors (e.g. -// network errors) are returned as a second return value for most calls -// (sometimes there is no response). Application-related errors are reflected -// in response via ABCI error codes and logs. +// Client defines an interface for an ABCI client. +// All `Async` methods return a `ReqRes` object. +// All `Sync` methods return the appropriate protobuf ResponseXxx struct and an error. +// Note these are client errors, eg. ABCI socket connectivity issues. +// Application-related errors are reflected in response via ABCI error codes and logs. type Client interface { cmn.Service @@ -21,28 +22,26 @@ type Client interface { FlushAsync() *ReqRes EchoAsync(msg string) *ReqRes InfoAsync(types.RequestInfo) *ReqRes - SetOptionAsync(key string, value string) *ReqRes + SetOptionAsync(types.RequestSetOption) *ReqRes DeliverTxAsync(tx []byte) *ReqRes CheckTxAsync(tx []byte) *ReqRes QueryAsync(types.RequestQuery) *ReqRes CommitAsync() *ReqRes + InitChainAsync(types.RequestInitChain) *ReqRes + BeginBlockAsync(types.RequestBeginBlock) *ReqRes + EndBlockAsync(types.RequestEndBlock) *ReqRes FlushSync() error EchoSync(msg string) (*types.ResponseEcho, error) InfoSync(types.RequestInfo) (*types.ResponseInfo, error) - SetOptionSync(key string, value string) (log string, err error) + SetOptionSync(types.RequestSetOption) (*types.ResponseSetOption, error) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) CheckTxSync(tx []byte) (*types.ResponseCheckTx, error) QuerySync(types.RequestQuery) (*types.ResponseQuery, error) CommitSync() (*types.ResponseCommit, error) - - InitChainAsync(types.RequestInitChain) *ReqRes - BeginBlockAsync(types.RequestBeginBlock) *ReqRes - EndBlockAsync(height uint64) *ReqRes - - InitChainSync(types.RequestInitChain) error - BeginBlockSync(types.RequestBeginBlock) error - EndBlockSync(height uint64) (*types.ResponseEndBlock, error) + InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error) + BeginBlockSync(types.RequestBeginBlock) (*types.ResponseBeginBlock, error) + EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, error) } //---------------------------------------- diff --git a/client/grpc_client.go b/client/grpc_client.go index f7889d69a..6079c90ce 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -150,8 +150,8 @@ func (cli *grpcClient) InfoAsync(params types.RequestInfo) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_Info{res}}) } -func (cli *grpcClient) SetOptionAsync(key string, value string) *ReqRes { - req := types.ToRequestSetOption(key, value) +func (cli *grpcClient) SetOptionAsync(params types.RequestSetOption) *ReqRes { + req := types.ToRequestSetOption(params) res, err := cli.client.SetOption(context.Background(), req.GetSetOption(), grpc.FailFast(true)) if err != nil { cli.StopForError(err) @@ -213,8 +213,8 @@ func (cli *grpcClient) BeginBlockAsync(params types.RequestBeginBlock) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_BeginBlock{res}}) } -func (cli *grpcClient) EndBlockAsync(height uint64) *ReqRes { - req := types.ToRequestEndBlock(height) +func (cli *grpcClient) EndBlockAsync(params types.RequestEndBlock) *ReqRes { + req := types.ToRequestEndBlock(params) res, err := cli.client.EndBlock(context.Background(), req.GetEndBlock(), grpc.FailFast(true)) if err != nil { cli.StopForError(err) @@ -260,12 +260,9 @@ func (cli *grpcClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, err return reqres.Response.GetInfo(), cli.Error() } -func (cli *grpcClient) SetOptionSync(key string, value string) (log string, err error) { - reqres := cli.SetOptionAsync(key, value) - if err := cli.Error(); err != nil { - return "", err - } - return reqres.Response.GetSetOption().Log, nil +func (cli *grpcClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) { + reqres := cli.SetOptionAsync(req) + return reqres.Response.GetSetOption(), cli.Error() } func (cli *grpcClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) { @@ -288,17 +285,17 @@ func (cli *grpcClient) CommitSync() (*types.ResponseCommit, error) { return reqres.Response.GetCommit(), cli.Error() } -func (cli *grpcClient) InitChainSync(params types.RequestInitChain) error { - cli.InitChainAsync(params) - return cli.Error() +func (cli *grpcClient) InitChainSync(params types.RequestInitChain) (*types.ResponseInitChain, error) { + reqres := cli.InitChainAsync(params) + return reqres.Response.GetInitChain(), cli.Error() } -func (cli *grpcClient) BeginBlockSync(params types.RequestBeginBlock) error { - cli.BeginBlockAsync(params) - return cli.Error() +func (cli *grpcClient) BeginBlockSync(params types.RequestBeginBlock) (*types.ResponseBeginBlock, error) { + reqres := cli.BeginBlockAsync(params) + return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *grpcClient) EndBlockSync(height uint64) (*types.ResponseEndBlock, error) { - reqres := cli.EndBlockAsync(height) +func (cli *grpcClient) EndBlockSync(params types.RequestEndBlock) (*types.ResponseEndBlock, error) { + reqres := cli.EndBlockAsync(params) return reqres.Response.GetEndBlock(), cli.Error() } diff --git a/client/local_client.go b/client/local_client.go index 15dda8e6a..64bf5fe08 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -53,21 +53,21 @@ func (app *localClient) EchoAsync(msg string) *ReqRes { func (app *localClient) InfoAsync(req types.RequestInfo) *ReqRes { app.mtx.Lock() - resInfo := app.Application.Info(req) + res := app.Application.Info(req) app.mtx.Unlock() return app.callback( types.ToRequestInfo(req), - types.ToResponseInfo(resInfo), + types.ToResponseInfo(res), ) } -func (app *localClient) SetOptionAsync(key string, value string) *ReqRes { +func (app *localClient) SetOptionAsync(req types.RequestSetOption) *ReqRes { app.mtx.Lock() - log := app.Application.SetOption(key, value) + res := app.Application.SetOption(req) app.mtx.Unlock() return app.callback( - types.ToRequestSetOption(key, value), - types.ToResponseSetOption(log), + types.ToRequestSetOption(req), + types.ToResponseSetOption(res), ) } @@ -77,7 +77,7 @@ func (app *localClient) DeliverTxAsync(tx []byte) *ReqRes { app.mtx.Unlock() return app.callback( types.ToRequestDeliverTx(tx), - types.ToResponseDeliverTx(res.Code, res.Data, res.Log, res.Tags), + types.ToResponseDeliverTx(res), ) } @@ -87,17 +87,17 @@ func (app *localClient) CheckTxAsync(tx []byte) *ReqRes { app.mtx.Unlock() return app.callback( types.ToRequestCheckTx(tx), - types.ToResponseCheckTx(res.Code, res.Data, res.Log), + types.ToResponseCheckTx(res), ) } -func (app *localClient) QueryAsync(reqQuery types.RequestQuery) *ReqRes { +func (app *localClient) QueryAsync(req types.RequestQuery) *ReqRes { app.mtx.Lock() - resQuery := app.Application.Query(reqQuery) + res := app.Application.Query(req) app.mtx.Unlock() return app.callback( - types.ToRequestQuery(reqQuery), - types.ToResponseQuery(resQuery), + types.ToRequestQuery(req), + types.ToResponseQuery(res), ) } @@ -107,38 +107,38 @@ func (app *localClient) CommitAsync() *ReqRes { app.mtx.Unlock() return app.callback( types.ToRequestCommit(), - types.ToResponseCommit(res.Code, res.Data, res.Log), + types.ToResponseCommit(res), ) } -func (app *localClient) InitChainAsync(params types.RequestInitChain) *ReqRes { +func (app *localClient) InitChainAsync(req types.RequestInitChain) *ReqRes { app.mtx.Lock() - app.Application.InitChain(params) + res := app.Application.InitChain(req) reqRes := app.callback( - types.ToRequestInitChain(params), - types.ToResponseInitChain(), + types.ToRequestInitChain(req), + types.ToResponseInitChain(res), ) app.mtx.Unlock() return reqRes } -func (app *localClient) BeginBlockAsync(params types.RequestBeginBlock) *ReqRes { +func (app *localClient) BeginBlockAsync(req types.RequestBeginBlock) *ReqRes { app.mtx.Lock() - app.Application.BeginBlock(params) + res := app.Application.BeginBlock(req) app.mtx.Unlock() return app.callback( - types.ToRequestBeginBlock(params), - types.ToResponseBeginBlock(), + types.ToRequestBeginBlock(req), + types.ToResponseBeginBlock(res), ) } -func (app *localClient) EndBlockAsync(height uint64) *ReqRes { +func (app *localClient) EndBlockAsync(req types.RequestEndBlock) *ReqRes { app.mtx.Lock() - resEndBlock := app.Application.EndBlock(height) + res := app.Application.EndBlock(req) app.mtx.Unlock() return app.callback( - types.ToRequestEndBlock(height), - types.ToResponseEndBlock(resEndBlock), + types.ToRequestEndBlock(req), + types.ToResponseEndBlock(res), ) } @@ -159,11 +159,11 @@ func (app *localClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, er return &res, nil } -func (app *localClient) SetOptionSync(key string, value string) (log string, err error) { +func (app *localClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) { app.mtx.Lock() - log = app.Application.SetOption(key, value) + res := app.Application.SetOption(req) app.mtx.Unlock() - return log, nil + return &res, nil } func (app *localClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) { @@ -194,23 +194,23 @@ func (app *localClient) CommitSync() (*types.ResponseCommit, error) { return &res, nil } -func (app *localClient) InitChainSync(params types.RequestInitChain) error { +func (app *localClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) { app.mtx.Lock() - app.Application.InitChain(params) + res := app.Application.InitChain(req) app.mtx.Unlock() - return nil + return &res, nil } -func (app *localClient) BeginBlockSync(params types.RequestBeginBlock) error { +func (app *localClient) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) { app.mtx.Lock() - app.Application.BeginBlock(params) + res := app.Application.BeginBlock(req) app.mtx.Unlock() - return nil + return &res, nil } -func (app *localClient) EndBlockSync(height uint64) (*types.ResponseEndBlock, error) { +func (app *localClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) { app.mtx.Lock() - res := app.Application.EndBlock(height) + res := app.Application.EndBlock(req) app.mtx.Unlock() return &res, nil } diff --git a/client/socket_client.go b/client/socket_client.go index 716ef4510..84377a055 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -239,8 +239,8 @@ func (cli *socketClient) InfoAsync(req types.RequestInfo) *ReqRes { return cli.queueRequest(types.ToRequestInfo(req)) } -func (cli *socketClient) SetOptionAsync(key string, value string) *ReqRes { - return cli.queueRequest(types.ToRequestSetOption(key, value)) +func (cli *socketClient) SetOptionAsync(req types.RequestSetOption) *ReqRes { + return cli.queueRequest(types.ToRequestSetOption(req)) } func (cli *socketClient) DeliverTxAsync(tx []byte) *ReqRes { @@ -259,16 +259,16 @@ func (cli *socketClient) CommitAsync() *ReqRes { return cli.queueRequest(types.ToRequestCommit()) } -func (cli *socketClient) InitChainAsync(params types.RequestInitChain) *ReqRes { - return cli.queueRequest(types.ToRequestInitChain(params)) +func (cli *socketClient) InitChainAsync(req types.RequestInitChain) *ReqRes { + return cli.queueRequest(types.ToRequestInitChain(req)) } -func (cli *socketClient) BeginBlockAsync(params types.RequestBeginBlock) *ReqRes { - return cli.queueRequest(types.ToRequestBeginBlock(params)) +func (cli *socketClient) BeginBlockAsync(req types.RequestBeginBlock) *ReqRes { + return cli.queueRequest(types.ToRequestBeginBlock(req)) } -func (cli *socketClient) EndBlockAsync(height uint64) *ReqRes { - return cli.queueRequest(types.ToRequestEndBlock(height)) +func (cli *socketClient) EndBlockAsync(req types.RequestEndBlock) *ReqRes { + return cli.queueRequest(types.ToRequestEndBlock(req)) } //---------------------------------------- @@ -294,13 +294,10 @@ func (cli *socketClient) InfoSync(req types.RequestInfo) (*types.ResponseInfo, e return reqres.Response.GetInfo(), cli.Error() } -func (cli *socketClient) SetOptionSync(key string, value string) (log string, err error) { - reqres := cli.queueRequest(types.ToRequestSetOption(key, value)) +func (cli *socketClient) SetOptionSync(req types.RequestSetOption) (*types.ResponseSetOption, error) { + reqres := cli.queueRequest(types.ToRequestSetOption(req)) cli.FlushSync() - if err := cli.Error(); err != nil { - return "", err - } - return reqres.Response.GetSetOption().Log, nil + return reqres.Response.GetSetOption(), cli.Error() } func (cli *socketClient) DeliverTxSync(tx []byte) (*types.ResponseDeliverTx, error) { @@ -327,20 +324,20 @@ func (cli *socketClient) CommitSync() (*types.ResponseCommit, error) { return reqres.Response.GetCommit(), cli.Error() } -func (cli *socketClient) InitChainSync(params types.RequestInitChain) error { - cli.queueRequest(types.ToRequestInitChain(params)) +func (cli *socketClient) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) { + reqres := cli.queueRequest(types.ToRequestInitChain(req)) cli.FlushSync() - return cli.Error() + return reqres.Response.GetInitChain(), cli.Error() } -func (cli *socketClient) BeginBlockSync(params types.RequestBeginBlock) error { - cli.queueRequest(types.ToRequestBeginBlock(params)) +func (cli *socketClient) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) { + reqres := cli.queueRequest(types.ToRequestBeginBlock(req)) cli.FlushSync() - return cli.Error() + return reqres.Response.GetBeginBlock(), cli.Error() } -func (cli *socketClient) EndBlockSync(height uint64) (*types.ResponseEndBlock, error) { - reqres := cli.queueRequest(types.ToRequestEndBlock(height)) +func (cli *socketClient) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) { + reqres := cli.queueRequest(types.ToRequestEndBlock(req)) cli.FlushSync() return reqres.Response.GetEndBlock(), cli.Error() } diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index e3f0daec8..d27bf24bc 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -355,12 +355,13 @@ func cmdInfo(cmd *cobra.Command, args []string) error { // Set an option on the application func cmdSetOption(cmd *cobra.Command, args []string) error { - resLog, err := client.SetOptionSync(args[0], args[1]) + key, val := args[0], args[1] + res, err := client.SetOptionSync(types.RequestSetOption{key, val}) if err != nil { return err } printResponse(cmd, args, response{ - Log: resLog, + Log: res.Log, }) return nil } diff --git a/example/block_aware/block_aware_app.go b/example/block_aware/block_aware_app.go deleted file mode 100644 index 8a031da2f..000000000 --- a/example/block_aware/block_aware_app.go +++ /dev/null @@ -1,65 +0,0 @@ -package main - -import ( - "flag" - "os" - - "github.com/tendermint/abci/server" - "github.com/tendermint/abci/types" - cmn "github.com/tendermint/tmlibs/common" - "github.com/tendermint/tmlibs/log" -) - -func main() { - - addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address") - abciPtr := flag.String("abci", "socket", "socket | grpc") - flag.Parse() - - logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) - - // Start the listener - srv, err := server.NewServer(*addrPtr, *abciPtr, NewChainAwareApplication()) - if err != nil { - logger.Error(err.Error()) - os.Exit(1) - } - srv.SetLogger(logger.With("module", "abci-server")) - if _, err := srv.Start(); err != nil { - logger.Error(err.Error()) - os.Exit(1) - } - - // Wait forever - cmn.TrapSignal(func() { - // Cleanup - srv.Stop() - }) - -} - -type ChainAwareApplication struct { - types.BaseApplication - - beginCount int - endCount int -} - -func NewChainAwareApplication() *ChainAwareApplication { - return &ChainAwareApplication{} -} - -func (app *ChainAwareApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { - return types.ResponseQuery{ - Value: []byte(cmn.Fmt("%d,%d", app.beginCount, app.endCount)), - } -} - -func (app *ChainAwareApplication) BeginBlock(reqBeginBlock types.RequestBeginBlock) { - app.beginCount++ -} - -func (app *ChainAwareApplication) EndBlock(height uint64) (resEndBlock types.ResponseEndBlock) { - app.endCount++ - return -} diff --git a/example/block_aware/block_aware_test.go b/example/block_aware/block_aware_test.go deleted file mode 100644 index 2777ce1a2..000000000 --- a/example/block_aware/block_aware_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package main - -import ( - "strconv" - "strings" - "testing" - - abcicli "github.com/tendermint/abci/client" - "github.com/tendermint/abci/server" - "github.com/tendermint/abci/types" - "github.com/tendermint/tmlibs/log" -) - -func TestChainAware(t *testing.T) { - app := NewChainAwareApplication() - - // Start the listener - srv, err := server.NewServer("unix://test.sock", "socket", app) - if err != nil { - t.Fatal(err) - } - srv.SetLogger(log.TestingLogger().With("module", "abci-server")) - if _, err := srv.Start(); err != nil { - t.Fatal(err.Error()) - } - defer srv.Stop() - - // Connect to the socket - client := abcicli.NewSocketClient("unix://test.sock", false) - client.SetLogger(log.TestingLogger().With("module", "abci-client")) - if _, err := client.Start(); err != nil { - t.Fatalf("Error starting socket client: %v", err.Error()) - } - defer client.Stop() - - n := uint64(5) - hash := []byte("fake block hash") - header := &types.Header{} - for i := uint64(0); i < n; i++ { - client.BeginBlockSync(types.RequestBeginBlock{hash, header}) - client.EndBlockSync(i) - client.CommitSync() - } - - r := app.Query(types.RequestQuery{}) - spl := strings.Split(string(r.Value), ",") - if len(spl) != 2 { - t.Fatal("expected %d,%d ; got %s", n, n, string(r.Value)) - } - beginCount, _ := strconv.Atoi(spl[0]) - endCount, _ := strconv.Atoi(spl[1]) - if uint64(beginCount) != n { - t.Fatalf("expected beginCount of %d, got %d", n, beginCount) - } else if uint64(endCount) != n { - t.Fatalf("expected endCount of %d, got %d", n, endCount) - } -} diff --git a/example/counter/counter.go b/example/counter/counter.go index 65cac4a0e..a7b090275 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -24,11 +24,12 @@ func (app *CounterApplication) Info(req types.RequestInfo) types.ResponseInfo { return types.ResponseInfo{Data: cmn.Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} } -func (app *CounterApplication) SetOption(key string, value string) (log string) { +func (app *CounterApplication) SetOption(req types.RequestSetOption) types.ResponseSetOption { + key, value := req.Key, req.Value if key == "serial" && value == "on" { app.serial = true } - return "" + return types.ResponseSetOption{} } func (app *CounterApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index a4edacac4..65d524cfe 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -10,6 +10,8 @@ import ( dbm "github.com/tendermint/tmlibs/db" ) +var _ types.Application = (*DummyApplication)(nil) + type DummyApplication struct { types.BaseApplication diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 798da7200..b7aef6a8b 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -93,7 +93,7 @@ func TestPersistentDummyInfo(t *testing.T) { Height: uint64(height), } dummy.BeginBlock(types.RequestBeginBlock{hash, header}) - dummy.EndBlock(height) + dummy.EndBlock(types.RequestEndBlock{header.Height}) dummy.Commit() resInfo = dummy.Info(types.RequestInfo{}) @@ -182,7 +182,7 @@ func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff [ t.Fatal(r) } } - resEndBlock := dummy.EndBlock(height) + resEndBlock := dummy.EndBlock(types.RequestEndBlock{header.Height}) dummy.Commit() valsEqual(t, diff, resEndBlock.Diffs) diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 8fa112820..ed2845296 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -21,6 +21,8 @@ const ( //----------------------------------------- +var _ types.Application = (*PersistentDummyApplication)(nil) + type PersistentDummyApplication struct { app *DummyApplication @@ -50,15 +52,15 @@ func (app *PersistentDummyApplication) SetLogger(l log.Logger) { app.logger = l } -func (app *PersistentDummyApplication) Info(req types.RequestInfo) (resInfo types.ResponseInfo) { - resInfo = app.app.Info(req) - resInfo.LastBlockHeight = app.app.state.LatestVersion() - resInfo.LastBlockAppHash = app.app.state.Hash() - return resInfo +func (app *PersistentDummyApplication) Info(req types.RequestInfo) types.ResponseInfo { + res := app.app.Info(req) + res.LastBlockHeight = app.app.state.LatestVersion() + res.LastBlockAppHash = app.app.state.Hash() + return res } -func (app *PersistentDummyApplication) SetOption(key string, value string) (log string) { - return app.app.SetOption(key, value) +func (app *PersistentDummyApplication) SetOption(req types.RequestSetOption) types.ResponseSetOption { + return app.app.SetOption(req) } // tx is either "val:pubkey/power" or "key=value" or just arbitrary bytes @@ -102,23 +104,25 @@ func (app *PersistentDummyApplication) Query(reqQuery types.RequestQuery) types. } // Save the validators in the merkle tree -func (app *PersistentDummyApplication) InitChain(params types.RequestInitChain) { - for _, v := range params.Validators { +func (app *PersistentDummyApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain { + for _, v := range req.Validators { r := app.updateValidator(v) if r.IsErr() { app.logger.Error("Error updating validators", "r", r) } } + return types.ResponseInitChain{} } // Track the block hash and header information -func (app *PersistentDummyApplication) BeginBlock(params types.RequestBeginBlock) { +func (app *PersistentDummyApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock { // reset valset changes app.changes = make([]*types.Validator, 0) + return types.ResponseBeginBlock{} } // Update the validator set -func (app *PersistentDummyApplication) EndBlock(height uint64) (resEndBlock types.ResponseEndBlock) { +func (app *PersistentDummyApplication) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock { return types.ResponseEndBlock{Diffs: app.changes} } diff --git a/server/socket_server.go b/server/socket_server.go index 68a213225..c88180d43 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -168,33 +168,32 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types case *types.Request_Flush: responses <- types.ToResponseFlush() case *types.Request_Info: - resInfo := s.app.Info(*r.Info) - responses <- types.ToResponseInfo(resInfo) + res := s.app.Info(*r.Info) + responses <- types.ToResponseInfo(res) case *types.Request_SetOption: - so := r.SetOption - logStr := s.app.SetOption(so.Key, so.Value) - responses <- types.ToResponseSetOption(logStr) + res := s.app.SetOption(*r.SetOption) + responses <- types.ToResponseSetOption(res) case *types.Request_DeliverTx: res := s.app.DeliverTx(r.DeliverTx.Tx) - responses <- types.ToResponseDeliverTx(res.Code, res.Data, res.Log, res.Tags) + responses <- types.ToResponseDeliverTx(res) case *types.Request_CheckTx: res := s.app.CheckTx(r.CheckTx.Tx) - responses <- types.ToResponseCheckTx(res.Code, res.Data, res.Log) + responses <- types.ToResponseCheckTx(res) case *types.Request_Commit: res := s.app.Commit() - responses <- types.ToResponseCommit(res.Code, res.Data, res.Log) + responses <- types.ToResponseCommit(res) case *types.Request_Query: - resQuery := s.app.Query(*r.Query) - responses <- types.ToResponseQuery(resQuery) + res := s.app.Query(*r.Query) + responses <- types.ToResponseQuery(res) case *types.Request_InitChain: - s.app.InitChain(*r.InitChain) - responses <- types.ToResponseInitChain() + res := s.app.InitChain(*r.InitChain) + responses <- types.ToResponseInitChain(res) case *types.Request_BeginBlock: - s.app.BeginBlock(*r.BeginBlock) - responses <- types.ToResponseBeginBlock() + res := s.app.BeginBlock(*r.BeginBlock) + responses <- types.ToResponseBeginBlock(res) case *types.Request_EndBlock: - resEndBlock := s.app.EndBlock(r.EndBlock.Height) - responses <- types.ToResponseEndBlock(resEndBlock) + res := s.app.EndBlock(*r.EndBlock) + responses <- types.ToResponseEndBlock(res) default: responses <- types.ToResponseException("Unknown request") } diff --git a/types/application.go b/types/application.go index ed9b0d20d..c36e58f09 100644 --- a/types/application.go +++ b/types/application.go @@ -5,22 +5,24 @@ import ( ) // Application is an interface that enables any finite, deterministic state machine -// to be driven by a blockchain-based replication engine via the ABCI +// to be driven by a blockchain-based replication engine via the ABCI. +// All methods take a RequestXxx argument and return a ResponseXxx argument, +// except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing. type Application interface { // Info/Query Connection - Info(RequestInfo) ResponseInfo // Return application info - SetOption(key string, value string) (log string) // Set application option - Query(RequestQuery) ResponseQuery // Query for state + Info(RequestInfo) ResponseInfo // Return application info + SetOption(RequestSetOption) ResponseSetOption // Set application option + Query(RequestQuery) ResponseQuery // Query for state // Mempool Connection CheckTx(tx []byte) ResponseCheckTx // Validate a tx for the mempool // Consensus Connection - InitChain(RequestInitChain) // Initialize blockchain with validators and other info from TendermintCore - BeginBlock(RequestBeginBlock) // Signals the beginning of a block - DeliverTx(tx []byte) ResponseDeliverTx // Deliver a tx for full processing - EndBlock(height uint64) ResponseEndBlock // Signals the end of a block, returns changes to the validator set - Commit() ResponseCommit // Commit the state and return the application Merkle root hash + InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain with validators and other info from TendermintCore + BeginBlock(RequestBeginBlock) ResponseBeginBlock // Signals the beginning of a block + DeliverTx(tx []byte) ResponseDeliverTx // Deliver a tx for full processing + EndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set + Commit() ResponseCommit // Commit the state and return the application Merkle root hash } //------------------------------------ @@ -48,7 +50,8 @@ func (app *GRPCApplication) Info(ctx context.Context, req *RequestInfo) (*Respon } func (app *GRPCApplication) SetOption(ctx context.Context, req *RequestSetOption) (*ResponseSetOption, error) { - return &ResponseSetOption{app.app.SetOption(req.Key, req.Value)}, nil + resSetOption := app.app.SetOption(*req) + return &resSetOption, nil } func (app *GRPCApplication) DeliverTx(ctx context.Context, req *RequestDeliverTx) (*ResponseDeliverTx, error) { @@ -72,16 +75,16 @@ func (app *GRPCApplication) Commit(ctx context.Context, req *RequestCommit) (*Re } func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) { - app.app.InitChain(*req) - return &ResponseInitChain{}, nil // NOTE: empty return + resInitChain := app.app.InitChain(*req) + return &resInitChain, nil } func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*ResponseBeginBlock, error) { - app.app.BeginBlock(*req) - return &ResponseBeginBlock{}, nil // NOTE: empty return + resBeginBlock := app.app.BeginBlock(*req) + return &resBeginBlock, nil } func (app *GRPCApplication) EndBlock(ctx context.Context, req *RequestEndBlock) (*ResponseEndBlock, error) { - resEndBlock := app.app.EndBlock(req.Height) + resEndBlock := app.app.EndBlock(*req) return &resEndBlock, nil } diff --git a/types/base_app.go b/types/base_app.go index 0086685b8..404678e95 100644 --- a/types/base_app.go +++ b/types/base_app.go @@ -11,8 +11,8 @@ func (BaseApplication) Info(req RequestInfo) ResponseInfo { return ResponseInfo{} } -func (BaseApplication) SetOption(key string, value string) (log string) { - return "" +func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption { + return ResponseSetOption{} } func (BaseApplication) DeliverTx(tx []byte) ResponseDeliverTx { @@ -31,12 +31,14 @@ func (BaseApplication) Query(req RequestQuery) ResponseQuery { return ResponseQuery{Code: CodeType_OK} } -func (BaseApplication) InitChain(req RequestInitChain) { +func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain { + return ResponseInitChain{} } -func (BaseApplication) BeginBlock(req RequestBeginBlock) { +func (BaseApplication) BeginBlock(req RequestBeginBlock) ResponseBeginBlock { + return ResponseBeginBlock{} } -func (BaseApplication) EndBlock(height uint64) ResponseEndBlock { +func (BaseApplication) EndBlock(req RequestEndBlock) ResponseEndBlock { return ResponseEndBlock{} } diff --git a/types/messages.go b/types/messages.go index 298f17ba2..77ad538ed 100644 --- a/types/messages.go +++ b/types/messages.go @@ -25,21 +25,21 @@ func ToRequestInfo(req RequestInfo) *Request { } } -func ToRequestSetOption(key string, value string) *Request { +func ToRequestSetOption(req RequestSetOption) *Request { return &Request{ - Value: &Request_SetOption{&RequestSetOption{key, value}}, + Value: &Request_SetOption{&req}, } } -func ToRequestDeliverTx(txBytes []byte) *Request { +func ToRequestDeliverTx(tx []byte) *Request { return &Request{ - Value: &Request_DeliverTx{&RequestDeliverTx{txBytes}}, + Value: &Request_DeliverTx{&RequestDeliverTx{tx}}, } } -func ToRequestCheckTx(txBytes []byte) *Request { +func ToRequestCheckTx(tx []byte) *Request { return &Request{ - Value: &Request_CheckTx{&RequestCheckTx{txBytes}}, + Value: &Request_CheckTx{&RequestCheckTx{tx}}, } } @@ -67,9 +67,9 @@ func ToRequestBeginBlock(req RequestBeginBlock) *Request { } } -func ToRequestEndBlock(height uint64) *Request { +func ToRequestEndBlock(req RequestEndBlock) *Request { return &Request{ - Value: &Request_EndBlock{&RequestEndBlock{height}}, + Value: &Request_EndBlock{&req}, } } @@ -93,57 +93,57 @@ func ToResponseFlush() *Response { } } -func ToResponseInfo(resInfo ResponseInfo) *Response { +func ToResponseInfo(res ResponseInfo) *Response { return &Response{ - Value: &Response_Info{&resInfo}, + Value: &Response_Info{&res}, } } -func ToResponseSetOption(log string) *Response { +func ToResponseSetOption(res ResponseSetOption) *Response { return &Response{ - Value: &Response_SetOption{&ResponseSetOption{log}}, + Value: &Response_SetOption{&res}, } } -func ToResponseDeliverTx(code CodeType, data []byte, log string, tags []*KVPair) *Response { +func ToResponseDeliverTx(res ResponseDeliverTx) *Response { return &Response{ - Value: &Response_DeliverTx{&ResponseDeliverTx{code, data, log, tags}}, + Value: &Response_DeliverTx{&res}, } } -func ToResponseCheckTx(code CodeType, data []byte, log string) *Response { +func ToResponseCheckTx(res ResponseCheckTx) *Response { return &Response{ - Value: &Response_CheckTx{&ResponseCheckTx{code, data, log}}, + Value: &Response_CheckTx{&res}, } } -func ToResponseCommit(code CodeType, data []byte, log string) *Response { +func ToResponseCommit(res ResponseCommit) *Response { return &Response{ - Value: &Response_Commit{&ResponseCommit{code, data, log}}, + Value: &Response_Commit{&res}, } } -func ToResponseQuery(resQuery ResponseQuery) *Response { +func ToResponseQuery(res ResponseQuery) *Response { return &Response{ - Value: &Response_Query{&resQuery}, + Value: &Response_Query{&res}, } } -func ToResponseInitChain() *Response { +func ToResponseInitChain(res ResponseInitChain) *Response { return &Response{ - Value: &Response_InitChain{&ResponseInitChain{}}, + Value: &Response_InitChain{&res}, } } -func ToResponseBeginBlock() *Response { +func ToResponseBeginBlock(res ResponseBeginBlock) *Response { return &Response{ - Value: &Response_BeginBlock{&ResponseBeginBlock{}}, + Value: &Response_BeginBlock{&res}, } } -func ToResponseEndBlock(resEndBlock ResponseEndBlock) *Response { +func ToResponseEndBlock(res ResponseEndBlock) *Response { return &Response{ - Value: &Response_EndBlock{&resEndBlock}, + Value: &Response_EndBlock{&res}, } } From fb612e5a7b83b8a008ed813974c452726b4a1da9 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 27 Nov 2017 19:52:06 +0000 Subject: [PATCH 34/80] fixup tests --- Makefile | 14 ++++++++++---- circle.yml | 2 +- cmd/abci-cli/abci-cli.go | 4 ++-- cmd/abci-cli/main.go | 11 ++++++++++- test.sh | 10 +++++----- tests/test_app/app.go | 2 +- 6 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 57ab4052d..ab9223f61 100644 --- a/Makefile +++ b/Makefile @@ -36,12 +36,18 @@ dist: @ bash scripts/publish.sh # test.sh requires that we run the installed cmds, must not be out of date -test: install +test: @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; - @ echo "==> Running unit tests" + @ echo "==> Running go test" @ go test $(PACKAGES) - @ echo "==> Running integration tests (./tests)" - @ bash tests/test.sh + +test_race: + @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; + @ echo "==> Running go test --race" + @go test -v -race $(PACKAGES) + +test_integrations: + @ bash test.sh fmt: @ go fmt ./... diff --git a/circle.yml b/circle.yml index 459873637..c6904fae6 100644 --- a/circle.yml +++ b/circle.yml @@ -16,7 +16,7 @@ checkout: test: override: - - cd $REPO && make get_vendor_deps && make metalinter_test && bash ./test.sh + - cd $REPO && make get_vendor_deps && make metalinter_test && make test_integrations post: - cd "$REPO" && bash <(curl -s https://codecov.io/bash) -f coverage.txt - cd "$REPO" && mv coverage.txt "${CIRCLE_ARTIFACTS}" diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index d27bf24bc..d6e95d963 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -96,10 +96,10 @@ var RootCmd = &cobra.Command{ }, } -func Execute() { +func Execute() error { addGlobalFlags() addCommands() - RootCmd.Execute() + return RootCmd.Execute() } func addGlobalFlags() { diff --git a/cmd/abci-cli/main.go b/cmd/abci-cli/main.go index 736ef3102..a927e7ed8 100644 --- a/cmd/abci-cli/main.go +++ b/cmd/abci-cli/main.go @@ -1,5 +1,14 @@ package main +import ( + "fmt" + "os" +) + func main() { - Execute() + err := Execute() + if err != nil { + fmt.Print(err) + os.Exit(1) + } } diff --git a/test.sh b/test.sh index 136f60e2a..33839c062 100755 --- a/test.sh +++ b/test.sh @@ -5,11 +5,11 @@ echo "" > coverage.txt echo "==> Running unit tests" for d in $(go list ./... | grep -v vendor); do - go test -race -coverprofile=profile.out -covermode=atomic "$d" - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi + go test -race -coverprofile=profile.out -covermode=atomic "$d" + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi done echo "==> Running integration tests (./tests)" diff --git a/tests/test_app/app.go b/tests/test_app/app.go index c869fe83a..59d7aec4b 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -48,7 +48,7 @@ func startClient(abciType string) abcicli.Client { } func setOption(client abcicli.Client, key, value string) { - _, err := client.SetOptionSync(key, value) + _, err := client.SetOptionSync(types.RequestSetOption{key, value}) if err != nil { panicf("setting %v=%v: \nerr: %v", key, value, err) } From 7dc5b746ac7bf18d49c61154de81fc99909ef81c Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 27 Nov 2017 20:10:11 +0000 Subject: [PATCH 35/80] types: add gas and fee fields to CheckTx --- types/types.pb.go | 240 +++++++++++++++++++++++++--------------------- types/types.proto | 2 + 2 files changed, 131 insertions(+), 111 deletions(-) diff --git a/types/types.pb.go b/types/types.pb.go index 0cd976796..7b278ea26 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -1,5 +1,6 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. +// Code generated by protoc-gen-go. // source: types/types.proto +// DO NOT EDIT! /* Package types is a generated protocol buffer package. @@ -1361,6 +1362,8 @@ type ResponseCheckTx struct { Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Gas uint64 `protobuf:"varint,4,opt,name=gas" json:"gas,omitempty"` + Fee uint64 `protobuf:"varint,5,opt,name=fee" json:"fee,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } @@ -1389,6 +1392,20 @@ func (m *ResponseCheckTx) GetLog() string { return "" } +func (m *ResponseCheckTx) GetGas() uint64 { + if m != nil { + return m.Gas + } + return 0 +} + +func (m *ResponseCheckTx) GetFee() uint64 { + if m != nil { + return m.Fee + } + return 0 +} + type ResponseQuery struct { Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` @@ -2149,114 +2166,115 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1736 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcb, 0x6e, 0xdb, 0xcc, - 0x15, 0x36, 0x25, 0xea, 0x76, 0x2c, 0xcb, 0xf4, 0x58, 0xb6, 0x65, 0xa5, 0x8b, 0x84, 0x45, 0x1a, - 0x3b, 0x4d, 0x9d, 0xd6, 0x41, 0x8a, 0xb8, 0x29, 0x0a, 0xf8, 0x16, 0x5b, 0x08, 0xea, 0xb8, 0xb4, - 0x93, 0x4d, 0x0b, 0x08, 0xb4, 0x38, 0x92, 0xa6, 0x96, 0x86, 0x0c, 0x39, 0x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xba, 0xf3, 0x5b, 0x6e, 0xf4, 0x12, 0xea, 0xc9, 0xb3, 0xae, 0xf8, 0x7f, 0x80, - 0xee, 0xbc, 0xae, 0xfb, 0xaa, 0x2a, 0xfe, 0x62, 0x7a, 0xf6, 0x53, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x59, 0xf7, 0xaf, 0xdb, 0x77, 0x12, 0x00, 0x00, + // 1755 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x49, 0x6f, 0xdb, 0xce, + 0x15, 0x37, 0x25, 0x6a, 0x7b, 0x96, 0x65, 0x7a, 0x2c, 0xdb, 0xb2, 0xd2, 0x43, 0xc2, 0x22, 0x8d, + 0x9d, 0xa6, 0x4e, 0xeb, 0x20, 0x45, 0xdc, 0x14, 0x05, 0xbc, 0xc5, 0x16, 0x82, 0x3a, 0x2e, 0xed, + 0xe4, 0xd2, 0x83, 0x40, 0x8b, 0x23, 0x69, 0x6a, 0x69, 0xc8, 0x90, 0x43, 0x47, 0xee, 0xa9, 0xbd, + 0xe7, 0xde, 0x8f, 0x50, 0xa0, 0xc7, 0x02, 0xfd, 0x0a, 0x05, 0xfe, 0xfb, 0xf2, 0x89, 0xfe, 0x98, + 0x85, 0xab, 0xa9, 0xe0, 0x7f, 0xc8, 0x85, 0x98, 0xb7, 0xcd, 0xbc, 0x99, 0x79, 0xef, 0xf7, 0x1e, + 0x07, 0x56, 0xd8, 0xad, 0x87, 0x83, 0xa7, 0xe2, 0xbb, 0xe3, 0xf9, 0x2e, 0x73, 0x51, 0x45, 0x10, + 0xe6, 0xff, 0x75, 0xa8, 0x59, 0xf8, 0x7d, 0x88, 0x03, 0x86, 0xb6, 0x40, 0xc7, 0x83, 0xb1, 0xdb, + 0xd1, 0xee, 0x6b, 0x5b, 0x8b, 0xbb, 0x68, 0x47, 0xaa, 0x2b, 0xe9, 0xf1, 0x60, 0xec, 0x9e,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x30, 0xed, 0x64, 0x4d, 0x0f, 0xb8, 0xc2, 0x01, 0x97, 0x9f, 0x2e, + 0x58, 0x70, 0x15, 0x53, 0xe8, 0x39, 0x34, 0x30, 0x75, 0x94, 0xe9, 0xa2, 0x30, 0x5d, 0xcf, 0x45, + 0x00, 0x75, 0x22, 0xc3, 0x3a, 0x56, 0xe3, 0x83, 0x1a, 0x54, 0x6e, 0xec, 0x49, 0x88, 0xcd, 0x47, + 0xb0, 0x98, 0x8a, 0x14, 0xd4, 0x81, 0xda, 0x14, 0x07, 0x81, 0x3d, 0xc2, 0x22, 0x9c, 0x1a, 0x56, + 0x44, 0x9a, 0x2d, 0x68, 0xa6, 0xe3, 0x24, 0x65, 0xc8, 0x63, 0x81, 0x1b, 0xde, 0x60, 0x3f, 0xe0, + 0x01, 0xa0, 0x0c, 0x15, 0x69, 0xfe, 0x01, 0x8c, 0x7c, 0x10, 0x20, 0x03, 0xca, 0xd7, 0xf8, 0x56, + 0x69, 0xf2, 0x21, 0x6a, 0x2b, 0x87, 0x44, 0x68, 0x36, 0x2c, 0xe5, 0x9d, 0x19, 0xdb, 0xc6, 0x61, + 0x80, 0x5a, 0x50, 0x62, 0x33, 0x61, 0xda, 0xb4, 0x4a, 0x6c, 0x66, 0xde, 0x87, 0x56, 0xf6, 0xca, + 0xef, 0x68, 0x38, 0xb1, 0xeb, 0xe2, 0xce, 0x10, 0x02, 0xdd, 0xb1, 0x99, 0xad, 0x34, 0xc4, 0x98, + 0xf3, 0x3c, 0x9b, 0x8d, 0xd5, 0xf2, 0x62, 0x8c, 0xd6, 0xa1, 0x3a, 0xc6, 0x64, 0x34, 0x66, 0x22, + 0x07, 0x74, 0x4b, 0x51, 0xdc, 0x57, 0xcf, 0x77, 0x6f, 0xb0, 0x08, 0xf5, 0xba, 0x25, 0x09, 0x73, + 0x19, 0x96, 0x32, 0x81, 0x64, 0x1e, 0xc5, 0xce, 0xc7, 0x17, 0x8f, 0x7e, 0x0b, 0x70, 0x63, 0x4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0xd5, 0x97, 0xe0, 0x29, 0x33, 0xae, 0x2a, 0xce, 0xad, 0xc5, 0xf9, 0x0a, + 0x5d, 0x79, 0x41, 0xbd, 0x07, 0x0d, 0x7e, 0x92, 0x52, 0xa5, 0x26, 0x54, 0xea, 0x9c, 0x21, 0x84, + 0x8f, 0x60, 0x39, 0x29, 0xd2, 0x52, 0xa5, 0x2e, 0x67, 0x49, 0xd8, 0x42, 0x71, 0x13, 0xea, 0x71, + 0x66, 0x37, 0x84, 0x46, 0xcd, 0x56, 0x09, 0xdd, 0x83, 0x9a, 0x72, 0xb1, 0xb0, 0xa0, 0x3f, 0x86, + 0x8a, 0x67, 0xfb, 0x2c, 0x50, 0x85, 0x33, 0xc2, 0xf5, 0x73, 0xdb, 0xe7, 0x9d, 0x94, 0x2a, 0xeb, + 0x52, 0xc5, 0xdc, 0x83, 0xa5, 0x0c, 0x9f, 0x47, 0x22, 0x73, 0x99, 0x3d, 0x51, 0x25, 0x5d, 0x12, + 0xf1, 0x32, 0xa5, 0x64, 0x19, 0x73, 0x0f, 0x1a, 0xf1, 0x1d, 0xf2, 0x6b, 0xf1, 0xc2, 0xab, 0xd7, + 0xaa, 0x37, 0x6b, 0x5a, 0x8a, 0x12, 0x81, 0xed, 0x7e, 0x50, 0xbd, 0x85, 0x6e, 0x49, 0xc2, 0xfc, + 0x8f, 0x06, 0x55, 0x99, 0xf7, 0x05, 0x1d, 0xdd, 0xef, 0x44, 0xab, 0x13, 0xe2, 0x3e, 0x77, 0x5b, + 0xd8, 0xb5, 0xe2, 0xbf, 0x08, 0x69, 0xb4, 0x23, 0x42, 0xb8, 0x21, 0xb4, 0xf8, 0x10, 0x3d, 0x80, + 0xa6, 0x34, 0x09, 0x98, 0x4f, 0x68, 0x14, 0xbc, 0x8b, 0x82, 0x77, 0x21, 0x58, 0xfc, 0x52, 0xa4, + 0x0a, 0xa1, 0x4c, 0x44, 0x43, 0xd9, 0xaa, 0x0b, 0x46, 0x8f, 0x32, 0xf3, 0x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d, 0xc1, 0xcf, 0x7e, 0xb7, 0xa8, 0xc1, 0x46, + 0xbb, 0x50, 0x11, 0xed, 0x0d, 0x2a, 0xfa, 0xe7, 0xef, 0x16, 0xf6, 0xd9, 0x7c, 0x11, 0xd9, 0x00, + 0xdd, 0xfd, 0xf5, 0xef, 0x16, 0x35, 0xdb, 0xe8, 0x4f, 0xd0, 0x48, 0x1a, 0x93, 0x79, 0x0f, 0x00, + 0xdd, 0xb9, 0x6d, 0x37, 0xb7, 0x4f, 0x1a, 0x96, 0x79, 0xcf, 0x00, 0xdd, 0xb9, 0xbd, 0x37, 0x7a, + 0x01, 0xb5, 0xa8, 0xd9, 0x28, 0x7e, 0x0c, 0xe8, 0xce, 0x69, 0xbf, 0xf9, 0xf1, 0xc8, 0x1e, 0xa1, + 0xe8, 0x1f, 0xbf, 0x5b, 0xd8, 0x51, 0xa3, 0xe7, 0x50, 0x55, 0x35, 0xba, 0xf0, 0x1d, 0xa1, 0x5b, + 0xdc, 0xb7, 0xf3, 0x4d, 0x26, 0xbf, 0x83, 0xf3, 0x1e, 0x08, 0xba, 0x73, 0x3b, 0x72, 0xb4, 0x0f, + 0x90, 0xfa, 0x11, 0x9c, 0xfb, 0x4c, 0xd0, 0x9d, 0xdf, 0x97, 0xa3, 0x97, 0x50, 0x4f, 0xfe, 0xfd, + 0x8a, 0x1f, 0x0b, 0xba, 0xf3, 0x5a, 0xf3, 0xab, 0xaa, 0x78, 0x87, 0x7a, 0xf6, 0x53, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x3c, 0xa1, 0xc6, 0x00, 0x9c, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index e83df9851..7b2c75e32 100644 --- a/types/types.proto +++ b/types/types.proto @@ -166,6 +166,8 @@ message ResponseCheckTx{ CodeType code = 1; bytes data = 2; string log = 3; + uint64 gas = 4; + uint64 fee = 5; } message ResponseQuery{ From e08885e3cdf3163c2bbc81ddef9471ee15943cd8 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 27 Nov 2017 20:16:35 +0000 Subject: [PATCH 36/80] minor fix --- types/application.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/types/application.go b/types/application.go index c36e58f09..bb9a0030d 100644 --- a/types/application.go +++ b/types/application.go @@ -45,46 +45,46 @@ func (app *GRPCApplication) Flush(ctx context.Context, req *RequestFlush) (*Resp } func (app *GRPCApplication) Info(ctx context.Context, req *RequestInfo) (*ResponseInfo, error) { - resInfo := app.app.Info(*req) - return &resInfo, nil + res := app.app.Info(*req) + return &res, nil } func (app *GRPCApplication) SetOption(ctx context.Context, req *RequestSetOption) (*ResponseSetOption, error) { - resSetOption := app.app.SetOption(*req) - return &resSetOption, nil + res := app.app.SetOption(*req) + return &res, nil } func (app *GRPCApplication) DeliverTx(ctx context.Context, req *RequestDeliverTx) (*ResponseDeliverTx, error) { - r := app.app.DeliverTx(req.Tx) - return &ResponseDeliverTx{r.Code, r.Data, r.Log, r.Tags}, nil + res := app.app.DeliverTx(req.Tx) + return &res, nil } func (app *GRPCApplication) CheckTx(ctx context.Context, req *RequestCheckTx) (*ResponseCheckTx, error) { - r := app.app.CheckTx(req.Tx) - return &ResponseCheckTx{r.Code, r.Data, r.Log}, nil + res := app.app.CheckTx(req.Tx) + return &res, nil } func (app *GRPCApplication) Query(ctx context.Context, req *RequestQuery) (*ResponseQuery, error) { - resQuery := app.app.Query(*req) - return &resQuery, nil + res := app.app.Query(*req) + return &res, nil } func (app *GRPCApplication) Commit(ctx context.Context, req *RequestCommit) (*ResponseCommit, error) { - r := app.app.Commit() - return &ResponseCommit{r.Code, r.Data, r.Log}, nil + res := app.app.Commit() + return &res, nil } func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) { - resInitChain := app.app.InitChain(*req) - return &resInitChain, nil + res := app.app.InitChain(*req) + return &res, nil } func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*ResponseBeginBlock, error) { - resBeginBlock := app.app.BeginBlock(*req) - return &resBeginBlock, nil + res := app.app.BeginBlock(*req) + return &res, nil } func (app *GRPCApplication) EndBlock(ctx context.Context, req *RequestEndBlock) (*ResponseEndBlock, error) { - resEndBlock := app.app.EndBlock(*req) - return &resEndBlock, nil + res := app.app.EndBlock(*req) + return &res, nil } From e9094fbee3001db87f495fb8b6387cdc7deab75d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 27 Nov 2017 20:19:04 +0000 Subject: [PATCH 37/80] update changelog --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9db1817c4..3c6956cfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,14 @@ ## 0.8.0 (TBD) BREAKING CHANGES: - - [client] all {X}Sync methods now return an error + - [client] all XxxSync methods now return (ResponseXxx, error) + - [types] Application: all methods take RequestXxx and return (ResponseXxx, error), + except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing. - [types] removed Result - - [client] all {X}Sync methods now return Response{X} as first return value -IMPROVEMENTS: +FEATURES: - [types] added Tags field to ResponseDeliverTx + - [types] added Gas and Fee fields to ResponseCheckTx ## 0.7.1 (November 14, 2017) From 5a46675185d2bd76b79819075703a32b1cc175be Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 27 Nov 2017 20:27:18 +0000 Subject: [PATCH 38/80] minor things --- CHANGELOG.md | 5 +++-- client/socket_client.go | 9 ++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c6956cfc..44db318bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ BREAKING CHANGES: - [client] all XxxSync methods now return (ResponseXxx, error) - - [types] Application: all methods take RequestXxx and return (ResponseXxx, error), - except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing. + - [types] Application: all methods now take RequestXxx and return (ResponseXxx, error). + - Except `CheckTx`/`DeliverTx`, which takes a `tx []byte` argument. + - Except `Commit`, which takes no arguments. - [types] removed Result FEATURES: diff --git a/client/socket_client.go b/client/socket_client.go index 84377a055..7e5a1f30f 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -14,11 +14,6 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) -const ( - OK = types.CodeType_OK - LOG = "" -) - const reqQueueSize = 256 // TODO make configurable // const maxResponseSize = 1048576 // 1MB TODO make configurable const flushThrottleMS = 20 // Don't wait longer than... @@ -251,8 +246,8 @@ func (cli *socketClient) CheckTxAsync(tx []byte) *ReqRes { return cli.queueRequest(types.ToRequestCheckTx(tx)) } -func (cli *socketClient) QueryAsync(reqQuery types.RequestQuery) *ReqRes { - return cli.queueRequest(types.ToRequestQuery(reqQuery)) +func (cli *socketClient) QueryAsync(req types.RequestQuery) *ReqRes { + return cli.queueRequest(types.ToRequestQuery(req)) } func (cli *socketClient) CommitAsync() *ReqRes { From 26d967af7e5d348a5c072f121f931925258d29e9 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 27 Nov 2017 20:42:30 +0000 Subject: [PATCH 39/80] linter --- cmd/abci-cli/abci-cli.go | 4 ++-- server/socket_server.go | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index d6e95d963..789832508 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -294,7 +294,7 @@ func cmdBatch(cmd *cobra.Command, args []string) error { } pArgs := persistentArgs(line) - out, err := exec.Command(pArgs[0], pArgs[1:]...).Output() + out, err := exec.Command(pArgs[0], pArgs[1:]...).Output() // nolint: gas if err != nil { return err } @@ -316,7 +316,7 @@ func cmdConsole(cmd *cobra.Command, args []string) error { } pArgs := persistentArgs(line) - out, err := exec.Command(pArgs[0], pArgs[1:]...).Output() + out, err := exec.Command(pArgs[0], pArgs[1:]...).Output() // nolint: gas if err != nil { return err } diff --git a/server/socket_server.go b/server/socket_server.go index c88180d43..eb26dc353 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -56,13 +56,17 @@ func (s *SocketServer) OnStart() error { func (s *SocketServer) OnStop() { s.BaseService.OnStop() - s.listener.Close() + if err := s.listener.Close(); err != nil { + s.Logger.Error("Error closing listener", "err", err) + } s.connsMtx.Lock() defer s.connsMtx.Unlock() for id, conn := range s.conns { delete(s.conns, id) - conn.Close() + if err := conn.Close(); err != nil { + s.Logger.Error("Error closing connection", "id", id, "conn", conn, "err", err) + } } } From ab51bdef994946d5bf24c5808d730b493c8e923e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 27 Nov 2017 20:53:03 +0000 Subject: [PATCH 40/80] types.pb.go isnt linted. use nolint :( --- types/types.pb.go | 1 + 1 file changed, 1 insertion(+) diff --git a/types/types.pb.go b/types/types.pb.go index 7b278ea26..e433d1986 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -40,6 +40,7 @@ It has these top-level messages: Validator KVPair */ +//nolint: gas package types import proto "github.com/golang/protobuf/proto" From 0981c174ccc3f5ea7dea40f1e2b7d7cabfdc8b14 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 27 Nov 2017 22:28:41 +0000 Subject: [PATCH 41/80] update README for CheckTx Gas and Fee --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4cfcce749..f2546c004 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,8 @@ Here, we describe the requests and responses as function arguments and return va * `Code (uint32)`: Response code * `Data ([]byte)`: Result bytes, if any * `Log (string)`: Debug or error message + * `Gas (uint64)`: Amount of gas consumed by transaction + * `Fee (uint64)`: Fee paid by transaction * __Usage__:
Validate a mempool transaction, prior to broadcasting or proposing. This message should not mutate the main state, but application developers may want to keep a separate CheckTx state that gets reset upon Commit. From a0bf6dc1a136bbd79785649c2d678a75ed491ee5 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 27 Nov 2017 16:27:18 -0600 Subject: [PATCH 42/80] move comment --- Makefile | 1 - test.sh | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ab9223f61..11a75664a 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,6 @@ dist: @ bash scripts/dist.sh @ bash scripts/publish.sh -# test.sh requires that we run the installed cmds, must not be out of date test: @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; @ echo "==> Running go test" diff --git a/test.sh b/test.sh index 33839c062..978b26e1f 100755 --- a/test.sh +++ b/test.sh @@ -14,5 +14,6 @@ done echo "==> Running integration tests (./tests)" find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; +# tests/test.sh requires that we run the installed cmds, must not be out of date make install bash tests/test.sh From 6231652e87097dffcdc0115e470fd478ddae39de Mon Sep 17 00:00:00 2001 From: Emmanuel Odeke Date: Mon, 27 Nov 2017 21:12:00 -0700 Subject: [PATCH 43/80] tests: sunset tmlibs/process.Process Updates https://github.com/tendermint/tmlibs/issues/81 No longer using tmlibs/process.Process as we deemed it racy and would incur a maintenance cost yet not used anywhere else but in these tests and not in actual code. --- tests/test_app/app.go | 22 ---------------------- tests/test_app/main.go | 30 ++++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/tests/test_app/app.go b/tests/test_app/app.go index 59d7aec4b..f7ecbef5e 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -4,34 +4,12 @@ import ( "bytes" "fmt" "os" - "time" abcicli "github.com/tendermint/abci/client" "github.com/tendermint/abci/types" "github.com/tendermint/tmlibs/log" - "github.com/tendermint/tmlibs/process" ) -func startApp(abciApp string) *process.Process { - // Start the app - //outBuf := NewBufferCloser(nil) - proc, err := process.StartProcess("abci_app", - "", - "bash", - []string{"-c", fmt.Sprintf("abci-cli %s", abciApp)}, - nil, - os.Stdout, - ) - if err != nil { - panicf("running abci_app: %v", err) - } - - // TODO a better way to handle this? - time.Sleep(time.Second) - - return proc -} - func startClient(abciType string) abcicli.Client { // Start client client, err := abcicli.NewClient("tcp://127.0.0.1:46658", abciType, true) diff --git a/tests/test_app/main.go b/tests/test_app/main.go index 376c02fe5..e6b116168 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -2,7 +2,10 @@ package main import ( "fmt" + "log" "os" + "os/exec" + "time" "github.com/tendermint/abci/types" ) @@ -20,6 +23,19 @@ func main() { testCounter() } +func ensureABCIIsUp(subCommand string, n int) error { + var err error + for i := 0; i < n; i++ { + cmd := exec.Command("bash", "-c", "abci-cli", subCommand) + _, err = cmd.CombinedOutput() + if err == nil { + break + } + <-time.After(500 * time.Second) + } + return err +} + func testCounter() { abciApp := os.Getenv("ABCI_APP") if abciApp == "" { @@ -27,8 +43,18 @@ func testCounter() { } fmt.Printf("Running %s test with abci=%s\n", abciApp, abciType) - appProc := startApp(abciApp) - defer appProc.StopProcess(true) + cmd := exec.Command("bash", "-c", fmt.Sprintf("abci-cli %s", abciApp)) + cmd.Stdout = os.Stdout + if err := cmd.Start(); err != nil { + log.Fatalf("starting %q err: %v", abciApp, err) + } + defer cmd.Wait() + defer cmd.Process.Kill() + + if err := ensureABCIIsUp("echo", 5); err != nil { + log.Fatalf("echo failed: %v", err) + } + client := startClient(abciType) defer client.Stop() From 9ed5787b6afe4435942b2ec2af895072dc157722 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 28 Nov 2017 07:24:17 +0000 Subject: [PATCH 44/80] tests: fix ensureABCIIsUp --- tests/test.sh | 1 + tests/test_app/main.go | 17 +++++++++++++---- tests/test_cli/test.sh | 39 ++++++++++++++++++++------------------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/tests/test.sh b/tests/test.sh index 4087cdceb..c005c0de3 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,4 +1,5 @@ #! /bin/bash +set -e # test the counter using a go test script bash tests/test_app/test.sh diff --git a/tests/test_app/main.go b/tests/test_app/main.go index e6b116168..6c75a37e1 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -23,15 +23,24 @@ func main() { testCounter() } -func ensureABCIIsUp(subCommand string, n int) error { +const ( + maxABCIConnectTries = 10 +) + +func ensureABCIIsUp(typ string, n int) error { var err error + cmdString := "abci-cli echo hello" + if typ == "grpc" { + cmdString = "abci-cli --abci grpc echo hello" + } + for i := 0; i < n; i++ { - cmd := exec.Command("bash", "-c", "abci-cli", subCommand) + cmd := exec.Command("bash", "-c", cmdString) _, err = cmd.CombinedOutput() if err == nil { break } - <-time.After(500 * time.Second) + <-time.After(500 * time.Millisecond) } return err } @@ -51,7 +60,7 @@ func testCounter() { defer cmd.Wait() defer cmd.Process.Kill() - if err := ensureABCIIsUp("echo", 5); err != nil { + if err := ensureABCIIsUp(abciType, maxABCIConnectTries); err != nil { log.Fatalf("echo failed: %v", err) } diff --git a/tests/test_cli/test.sh b/tests/test_cli/test.sh index ea4ea4fa9..f6259148d 100644 --- a/tests/test_cli/test.sh +++ b/tests/test_cli/test.sh @@ -1,4 +1,5 @@ #! /bin/bash +set -e # Get the root directory. SOURCE="${BASH_SOURCE[0]}" @@ -9,29 +10,29 @@ DIR="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )" cd "$DIR" || exit function testExample() { - N=$1 - INPUT=$2 - APP="$3 $4" + N=$1 + INPUT=$2 + APP="$3 $4" - echo "Example $N: $APP" - $APP &> /dev/null & - sleep 2 - abci-cli --verbose batch < "$INPUT" > "${INPUT}.out.new" - killall "$3" + echo "Example $N: $APP" + $APP &> /dev/null & + sleep 2 + abci-cli --verbose batch < "$INPUT" > "${INPUT}.out.new" + killall "$3" - pre=$(shasum < "${INPUT}.out") - post=$(shasum < "${INPUT}.out.new") + pre=$(shasum < "${INPUT}.out") + post=$(shasum < "${INPUT}.out.new") - if [[ "$pre" != "$post" ]]; then - echo "You broke the tutorial" - echo "Got:" - cat "${INPUT}.out.new" - echo "Expected:" - cat "${INPUT}.out" - exit 1 - fi + if [[ "$pre" != "$post" ]]; then + echo "You broke the tutorial" + echo "Got:" + cat "${INPUT}.out.new" + echo "Expected:" + cat "${INPUT}.out" + exit 1 + fi - rm "${INPUT}".out.new + rm "${INPUT}".out.new } testExample 1 tests/test_cli/ex1.abci abci-cli dummy From bb141794c8a499feab1f5cb02a91b03ce5f1b444 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 28 Nov 2017 07:47:51 +0000 Subject: [PATCH 45/80] client: use vars for retry intervals --- client/client.go | 5 +++++ client/grpc_client.go | 4 ++-- client/socket_client.go | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/client.go b/client/client.go index ddb589a40..ad0e5a7ab 100644 --- a/client/client.go +++ b/client/client.go @@ -8,6 +8,11 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) +const ( + dialRetryIntervalSeconds = 3 + echoRetryIntervalSeconds = 1 +) + // Client defines an interface for an ABCI client. // All `Async` methods return a `ReqRes` object. // All `Sync` methods return the appropriate protobuf ResponseXxx struct and an error. diff --git a/client/grpc_client.go b/client/grpc_client.go index 6079c90ce..f65d27e69 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -56,7 +56,7 @@ RETRY_LOOP: return err } cli.Logger.Error(fmt.Sprintf("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) - time.Sleep(time.Second * 3) + time.Sleep(time.Second * dialRetryIntervalSeconds) continue RETRY_LOOP } @@ -68,7 +68,7 @@ RETRY_LOOP: if err == nil { break ENSURE_CONNECTED } - time.Sleep(time.Second) + time.Sleep(time.Second * echoRetryIntervalSeconds) } cli.client = client diff --git a/client/socket_client.go b/client/socket_client.go index 7e5a1f30f..a5d90dbe7 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -68,7 +68,7 @@ RETRY_LOOP: return err } cli.Logger.Error(fmt.Sprintf("abci.socketClient failed to connect to %v. Retrying...", cli.addr)) - time.Sleep(time.Second * 3) + time.Sleep(time.Second * dialRetryIntervalSeconds) continue RETRY_LOOP } cli.conn = conn From 67a81c13e2be6ee282bed7563008ac86482c1520 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 28 Nov 2017 07:48:00 +0000 Subject: [PATCH 46/80] run linter on make test --- Makefile | 18 ++++++++++-------- tests/test_app/main.go | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 11a75664a..cdee195d7 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,8 @@ dist: test: @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; + @ echo "==> Running linter" + @ make metalinter_test @ echo "==> Running go test" @ go test $(PACKAGES) @@ -54,20 +56,20 @@ fmt: get_deps: @ go get -d $(PACKAGES) -tools: +ensure_tools: go get -u -v $(GOTOOLS) + @gometalinter --install -get_vendor_deps: - @ go get github.com/Masterminds/glide +get_vendor_deps: ensure_tools + @rm -rf vendor/ + @echo "--> Running glide install" @ glide install -metalinter: tools - @gometalinter --install +metalinter: protoc --lint_out=. types/*.proto gometalinter --vendor --deadline=600s --enable-all --disable=lll ./... -metalinter_test: tools - @gometalinter --install +metalinter_test: # protoc --lint_out=. types/*.proto gometalinter --vendor --deadline=600s --disable-all \ --enable=maligned \ @@ -103,4 +105,4 @@ build-docker: run-docker: docker run -it --rm -v "$PWD:/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" "tendermint/abci-dev" /bin/bash -.PHONY: all build test fmt get_deps tools protoc install_protoc build-docker run-docker +.PHONY: all build test fmt get_deps ensure_tools protoc install_protoc build-docker run-docker diff --git a/tests/test_app/main.go b/tests/test_app/main.go index 6c75a37e1..a21918f51 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -35,7 +35,7 @@ func ensureABCIIsUp(typ string, n int) error { } for i := 0; i < n; i++ { - cmd := exec.Command("bash", "-c", cmdString) + cmd := exec.Command("bash", "-c", cmdString) // nolint: gas _, err = cmd.CombinedOutput() if err == nil { break @@ -52,7 +52,7 @@ func testCounter() { } fmt.Printf("Running %s test with abci=%s\n", abciApp, abciType) - cmd := exec.Command("bash", "-c", fmt.Sprintf("abci-cli %s", abciApp)) + cmd := exec.Command("bash", "-c", fmt.Sprintf("abci-cli %s", abciApp)) // nolint: gas cmd.Stdout = os.Stdout if err := cmd.Start(); err != nil { log.Fatalf("starting %q err: %v", abciApp, err) From 72c3ea3872424fba6b564de9d722acd74e6ecedc Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 29 Nov 2017 20:13:59 -0600 Subject: [PATCH 47/80] include tags into dummy application DeliverTx response Refs https://github.com/tendermint/tendermint/pull/835 --- example/dummy/dummy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 65d524cfe..45462c535 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -35,7 +35,8 @@ func (app *DummyApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { } else { app.state.Set(tx, tx) } - return types.ResponseDeliverTx{Code: types.CodeType_OK} + tags := []*types.KVPair{{Key: "app.creator", ValueType: types.KVPair_STRING, ValueString: "jae"}} + return types.ResponseDeliverTx{Code: types.CodeType_OK, Tags: tags} } func (app *DummyApplication) CheckTx(tx []byte) types.ResponseCheckTx { From 3b994b4e8a824d69b6973ae6154c274b382c9d9e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 02:45:40 +0000 Subject: [PATCH 48/80] dummy: include app.key tag --- example/dummy/dummy.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 45462c535..30eaff284 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -1,8 +1,8 @@ package dummy import ( + "bytes" "fmt" - "strings" "github.com/tendermint/abci/types" wire "github.com/tendermint/go-wire" @@ -29,13 +29,19 @@ func (app *DummyApplication) Info(req types.RequestInfo) (resInfo types.Response // tx is either "key=value" or just arbitrary bytes func (app *DummyApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { - parts := strings.Split(string(tx), "=") + var key, value []byte + parts := bytes.Split(tx, []byte("=")) if len(parts) == 2 { - app.state.Set([]byte(parts[0]), []byte(parts[1])) + key, value = parts[0], parts[1] } else { - app.state.Set(tx, tx) + key, value = tx, tx + } + app.state.Set(key, value) + + tags := []*types.KVPair{ + {Key: "app.creator", ValueType: types.KVPair_STRING, ValueString: "jae"}, + {Key: "app.key", ValueType: types.KVPair_STRING, ValueString: string(key)}, } - tags := []*types.KVPair{{Key: "app.creator", ValueType: types.KVPair_STRING, ValueString: "jae"}} return types.ResponseDeliverTx{Code: types.CodeType_OK, Tags: tags} } From 32a6545604367681017fc91c1866f987518f8e88 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 03:02:48 +0000 Subject: [PATCH 49/80] changelog [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44db318bf..6937eaeb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ BREAKING CHANGES: FEATURES: - [types] added Tags field to ResponseDeliverTx - [types] added Gas and Fee fields to ResponseCheckTx + - [dummy] DeliverTx returns tags ## 0.7.1 (November 14, 2017) From 20befcf6d6ba75b8de40e9fb5b6f74affb94a805 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 30 Nov 2017 11:17:35 -0600 Subject: [PATCH 50/80] add 2 helper methods for building KVPair(s) --- types/kvpair.go | 19 +++++++++++++++++++ types/kvpair_test.go | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 types/kvpair.go create mode 100644 types/kvpair_test.go diff --git a/types/kvpair.go b/types/kvpair.go new file mode 100644 index 000000000..c7aad4407 --- /dev/null +++ b/types/kvpair.go @@ -0,0 +1,19 @@ +package types + +// KVPairInt is a helper method to build KV pair with an integer value. +func KVPairInt(key string, val int64) *KVPair { + return &KVPair{ + Key: key, + ValueInt: val, + ValueType: KVPair_INT, + } +} + +// KVPairString is a helper method to build KV pair with a string value. +func KVPairString(key, val string) *KVPair { + return &KVPair{ + Key: key, + ValueString: val, + ValueType: KVPair_STRING, + } +} diff --git a/types/kvpair_test.go b/types/kvpair_test.go new file mode 100644 index 000000000..d006d56b3 --- /dev/null +++ b/types/kvpair_test.go @@ -0,0 +1,15 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestKVPairInt(t *testing.T) { + assert.Equal(t, KVPairInt("a", 1), &KVPair{Key: "a", ValueType: KVPair_INT, ValueInt: 1}) +} + +func TestKVPairString(t *testing.T) { + assert.Equal(t, KVPairString("a", "b"), &KVPair{Key: "a", ValueType: KVPair_STRING, ValueString: "b"}) +} From 42a8e3240c92e9dddda1e2dd2ca26e155a3d5025 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 14:29:12 -0500 Subject: [PATCH 51/80] remove CodeType --- Makefile | 2 +- client/grpc_client.go | 2 +- client/socket_client.go | 2 +- cmd/abci-cli/abci-cli.go | 4 +- example/counter/counter.go | 17 +- example/dummy/dummy.go | 6 +- example/dummy/dummy_test.go | 8 +- example/dummy/persistent_dummy.go | 17 +- example/example.go | 2 +- example/example_test.go | 4 +- tests/test_app/app.go | 4 +- tests/test_app/main.go | 17 +- types/base_app.go | 8 +- types/code.go | 37 --- types/code_test.go | 12 - types/result.go | 25 ++- types/result_test.go | 24 +- types/types.pb.go | 358 ++++++++++-------------------- types/types.proto | 51 +---- 19 files changed, 190 insertions(+), 410 deletions(-) delete mode 100644 types/code.go delete mode 100644 types/code_test.go diff --git a/Makefile b/Makefile index cdee195d7..e9d239003 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,6 @@ metalinter_test: gometalinter --vendor --deadline=600s --disable-all \ --enable=maligned \ --enable=deadcode \ - --enable=gas \ --enable=goconst \ --enable=goimports \ --enable=gosimple \ @@ -90,6 +89,7 @@ metalinter_test: --enable=vetshadow \ ./... + #--enable=gas \ #--enable=dupl \ #--enable=errcheck \ #--enable=gocyclo \ diff --git a/client/grpc_client.go b/client/grpc_client.go index f65d27e69..0afadc726 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -104,7 +104,7 @@ func (cli *grpcClient) StopForError(err error) { func (cli *grpcClient) Error() error { cli.mtx.Lock() defer cli.mtx.Unlock() - return errors.Wrap(cli.err, types.HumanCode(types.CodeType_InternalError)) + return errors.Wrap(cli.err, "grpc client error") } // Set listener for all responses diff --git a/client/socket_client.go b/client/socket_client.go index a5d90dbe7..ecdc36945 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -111,7 +111,7 @@ func (cli *socketClient) StopForError(err error) { func (cli *socketClient) Error() error { cli.mtx.Lock() defer cli.mtx.Unlock() - return errors.Wrap(cli.err, types.HumanCode(types.CodeType_InternalError)) + return errors.Wrap(cli.err, "socket client error") } // Set listener for all responses diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 789832508..c0dbbfafe 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -26,7 +26,7 @@ import ( type response struct { // generic abci response Data []byte - Code types.CodeType + Code uint32 Log string Query *queryResponse @@ -508,7 +508,7 @@ func printResponse(cmd *cobra.Command, args []string, rsp response) { } // Always print the status code. - fmt.Printf("-> code: %s\n", rsp.Code.String()) + fmt.Printf("-> code: %d\n", rsp.Code) if len(rsp.Data) != 0 { // Do no print this line when using the commit command diff --git a/example/counter/counter.go b/example/counter/counter.go index a7b090275..67fa06e31 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -4,6 +4,7 @@ import ( "encoding/binary" "fmt" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/types" cmn "github.com/tendermint/tmlibs/common" ) @@ -36,7 +37,7 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { if app.serial { if len(tx) > 8 { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))} } tx8 := make([]byte, 8) @@ -44,19 +45,19 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { return types.ResponseDeliverTx{ - Code: types.CodeType_BadNonce, + Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)} } } app.txCount++ - return types.ResponseDeliverTx{Code: types.CodeType_OK} + return types.ResponseDeliverTx{Code: types.CodeTypeOK} } func (app *CounterApplication) CheckTx(tx []byte) types.ResponseCheckTx { if app.serial { if len(tx) > 8 { return types.ResponseCheckTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))} } tx8 := make([]byte, 8) @@ -64,21 +65,21 @@ func (app *CounterApplication) CheckTx(tx []byte) types.ResponseCheckTx { txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { return types.ResponseCheckTx{ - Code: types.CodeType_BadNonce, + Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)} } } - return types.ResponseCheckTx{Code: types.CodeType_OK} + return types.ResponseCheckTx{Code: types.CodeTypeOK} } func (app *CounterApplication) Commit() (resp types.ResponseCommit) { app.hashCount++ if app.txCount == 0 { - return types.ResponseCommit{Code: types.CodeType_OK} + return types.ResponseCommit{Code: types.CodeTypeOK} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return types.ResponseCommit{Code: types.CodeType_OK, Data: hash} + return types.ResponseCommit{Code: types.CodeTypeOK, Data: hash} } func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 30eaff284..8329ef039 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -42,11 +42,11 @@ func (app *DummyApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { {Key: "app.creator", ValueType: types.KVPair_STRING, ValueString: "jae"}, {Key: "app.key", ValueType: types.KVPair_STRING, ValueString: string(key)}, } - return types.ResponseDeliverTx{Code: types.CodeType_OK, Tags: tags} + return types.ResponseDeliverTx{Code: types.CodeTypeOK, Tags: tags} } func (app *DummyApplication) CheckTx(tx []byte) types.ResponseCheckTx { - return types.ResponseCheckTx{Code: types.CodeType_OK} + return types.ResponseCheckTx{Code: types.CodeTypeOK} } func (app *DummyApplication) Commit() types.ResponseCommit { @@ -64,7 +64,7 @@ func (app *DummyApplication) Commit() types.ResponseCommit { } } - return types.ResponseCommit{Code: types.CodeType_OK, Data: hash} + return types.ResponseCommit{Code: types.CodeTypeOK, Data: hash} } func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index b7aef6a8b..bbb35dbe9 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -27,7 +27,7 @@ func testDummy(t *testing.T, app types.Application, tx []byte, key, value string Path: "/store", Data: []byte(key), }) - require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, types.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine @@ -36,7 +36,7 @@ func testDummy(t *testing.T, app types.Application, tx []byte, key, value string Data: []byte(key), Prove: true, }) - require.Equal(t, types.CodeType_OK, resQuery.Code) + require.EqualValues(t, types.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) proof, err := iavl.ReadKeyExistsProof(resQuery.Proof) require.Nil(t, err) @@ -295,7 +295,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) Data: []byte(key), }) require.Nil(t, err) - require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, types.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine @@ -305,7 +305,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) Prove: true, }) require.Nil(t, err) - require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, types.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) proof, err := iavl.ReadKeyExistsProof(resQuery.Proof) require.Nil(t, err) diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index ed2845296..51da8b30f 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -7,6 +7,7 @@ import ( "strconv" "strings" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/types" crypto "github.com/tendermint/go-crypto" "github.com/tendermint/iavl" @@ -96,7 +97,7 @@ func (app *PersistentDummyApplication) Commit() types.ResponseCommit { } app.logger.Info("Commit block", "height", height, "root", appHash) - return types.ResponseCommit{Code: types.CodeType_OK, Data: appHash} + return types.ResponseCommit{Code: types.CodeTypeOK, Data: appHash} } func (app *PersistentDummyApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { @@ -160,7 +161,7 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Response pubKeyAndPower := strings.Split(string(tx), "/") if len(pubKeyAndPower) != 2 { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Expected 'pubkey/power'. Got %v", pubKeyAndPower)} } pubkeyS, powerS := pubKeyAndPower[0], pubKeyAndPower[1] @@ -169,13 +170,13 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Response pubkey, err := hex.DecodeString(pubkeyS) if err != nil { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Pubkey (%s) is invalid hex", pubkeyS)} } _, err = crypto.PubKeyFromBytes(pubkey) if err != nil { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Pubkey (%X) is invalid go-crypto encoded", pubkey)} } @@ -183,7 +184,7 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Response power, err := strconv.Atoi(powerS) if err != nil { return types.ResponseDeliverTx{ - Code: types.CodeType_EncodingError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Power (%s) is not an int", powerS)} } @@ -198,7 +199,7 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types // remove validator if !app.app.state.Has(key) { return types.ResponseDeliverTx{ - Code: types.CodeType_Unauthorized, + Code: code.CodeTypeUnauthorized, Log: fmt.Sprintf("Cannot remove non-existent validator %X", key)} } app.app.state.Remove(key) @@ -207,7 +208,7 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types value := bytes.NewBuffer(make([]byte, 0)) if err := types.WriteMessage(v, value); err != nil { return types.ResponseDeliverTx{ - Code: types.CodeType_InternalError, + Code: code.CodeTypeEncodingError, Log: fmt.Sprintf("Error encoding validator: %v", err)} } app.app.state.Set(key, value.Bytes()) @@ -216,5 +217,5 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types // we only update the changes array if we successfully updated the tree app.changes = append(app.changes, v) - return types.ResponseDeliverTx{Code: types.CodeType_OK} + return types.ResponseDeliverTx{Code: types.CodeTypeOK} } diff --git a/example/example.go b/example/example.go index ee491c1b5..5a2b24494 100644 --- a/example/example.go +++ b/example/example.go @@ -1,3 +1,3 @@ package example -// so the go tool doesn't return errors about no buildable go files ... +// so go get doesnt complain diff --git a/example/example_test.go b/example/example_test.go index 496ed3d3f..952f8cb2c 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -60,7 +60,7 @@ func testStream(t *testing.T, app types.Application) { switch r := res.Value.(type) { case *types.Response_DeliverTx: counter++ - if r.DeliverTx.Code != types.CodeType_OK { + if r.DeliverTx.Code != types.CodeTypeOK { t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code) } if counter > numDeliverTxs { @@ -135,7 +135,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { t.Fatalf("Error in GRPC DeliverTx: %v", err.Error()) } counter++ - if response.Code != types.CodeType_OK { + if response.Code != types.CodeTypeOK { t.Error("DeliverTx failed with ret_code", response.Code) } if counter > numDeliverTxs { diff --git a/tests/test_app/app.go b/tests/test_app/app.go index f7ecbef5e..d55fb1601 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -45,7 +45,7 @@ func commit(client abcicli.Client, hashExp []byte) { } } -func deliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { +func deliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) { res, err := client.DeliverTxSync(txBytes) if err != nil { panicf("client error: %v", err) @@ -58,7 +58,7 @@ func deliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, da } } -/*func checkTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { +/*func checkTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) { res, err := client.CheckTxSync(txBytes) if err != nil { panicf("client error: %v", err) diff --git a/tests/test_app/main.go b/tests/test_app/main.go index a21918f51..95a7515d4 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -7,6 +7,7 @@ import ( "os/exec" "time" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/types" ) @@ -69,15 +70,15 @@ func testCounter() { setOption(client, "serial", "on") commit(client, nil) - deliverTx(client, []byte("abc"), types.CodeType_BadNonce, nil) + deliverTx(client, []byte("abc"), code.CodeTypeBadNonce, nil) commit(client, nil) - deliverTx(client, []byte{0x00}, types.CodeType_OK, nil) + deliverTx(client, []byte{0x00}, types.CodeTypeOK, nil) commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) - deliverTx(client, []byte{0x00}, types.CodeType_BadNonce, nil) - deliverTx(client, []byte{0x01}, types.CodeType_OK, nil) - deliverTx(client, []byte{0x00, 0x02}, types.CodeType_OK, nil) - deliverTx(client, []byte{0x00, 0x03}, types.CodeType_OK, nil) - deliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeType_OK, nil) - deliverTx(client, []byte{0x00, 0x00, 0x06}, types.CodeType_BadNonce, nil) + deliverTx(client, []byte{0x00}, code.CodeTypeBadNonce, nil) + deliverTx(client, []byte{0x01}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x02}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x03}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeTypeOK, nil) + deliverTx(client, []byte{0x00, 0x00, 0x06}, code.CodeTypeBadNonce, nil) commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5}) } diff --git a/types/base_app.go b/types/base_app.go index 404678e95..f8d1946ab 100644 --- a/types/base_app.go +++ b/types/base_app.go @@ -16,19 +16,19 @@ func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption { } func (BaseApplication) DeliverTx(tx []byte) ResponseDeliverTx { - return ResponseDeliverTx{Code: CodeType_OK} + return ResponseDeliverTx{Code: CodeTypeOK} } func (BaseApplication) CheckTx(tx []byte) ResponseCheckTx { - return ResponseCheckTx{Code: CodeType_OK} + return ResponseCheckTx{Code: CodeTypeOK} } func (BaseApplication) Commit() ResponseCommit { - return ResponseCommit{Code: CodeType_OK, Data: []byte("nil")} + return ResponseCommit{Code: CodeTypeOK, Data: []byte("nil")} } func (BaseApplication) Query(req RequestQuery) ResponseQuery { - return ResponseQuery{Code: CodeType_OK} + return ResponseQuery{Code: CodeTypeOK} } func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain { diff --git a/types/code.go b/types/code.go deleted file mode 100644 index 613c4cda3..000000000 --- a/types/code.go +++ /dev/null @@ -1,37 +0,0 @@ -package types - -var ( - code2string = map[CodeType]string{ - CodeType_InternalError: "Internal error", - CodeType_EncodingError: "Encoding error", - CodeType_BadNonce: "Error bad nonce", - CodeType_Unauthorized: "Unauthorized", - CodeType_InsufficientFunds: "Insufficient funds", - CodeType_UnknownRequest: "Unknown request", - - CodeType_BaseDuplicateAddress: "Error (base) duplicate address", - CodeType_BaseEncodingError: "Error (base) encoding error", - CodeType_BaseInsufficientFees: "Error (base) insufficient fees", - CodeType_BaseInsufficientFunds: "Error (base) insufficient funds", - CodeType_BaseInsufficientGasPrice: "Error (base) insufficient gas price", - CodeType_BaseInvalidInput: "Error (base) invalid input", - CodeType_BaseInvalidOutput: "Error (base) invalid output", - CodeType_BaseInvalidPubKey: "Error (base) invalid pubkey", - CodeType_BaseInvalidSequence: "Error (base) invalid sequence", - CodeType_BaseInvalidSignature: "Error (base) invalid signature", - CodeType_BaseUnknownAddress: "Error (base) unknown address", - CodeType_BaseUnknownPlugin: "Error (base) unknown plugin", - CodeType_BaseUnknownPubKey: "Error (base) unknown pubkey", - } -) - -func (c CodeType) IsOK() bool { return c == CodeType_OK } - -// HumanCode transforms code into a more humane format, such as "Internal error" instead of 0. -func HumanCode(code CodeType) string { - s, ok := code2string[code] - if !ok { - return "Unknown code" - } - return s -} diff --git a/types/code_test.go b/types/code_test.go deleted file mode 100644 index d9032d3c5..000000000 --- a/types/code_test.go +++ /dev/null @@ -1,12 +0,0 @@ -package types - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestHumanCode(t *testing.T) { - assert.Equal(t, "Internal error", HumanCode(CodeType_InternalError)) - assert.Equal(t, "Unknown code", HumanCode(-1)) -} diff --git a/types/result.go b/types/result.go index 6ebad8ab2..59d82ffc2 100644 --- a/types/result.go +++ b/types/result.go @@ -6,9 +6,15 @@ import ( "github.com/tendermint/go-wire/data" ) +// type CodeType uint32 + +const ( + CodeTypeOK uint32 = 0 +) + // IsErr returns true if Code is something other than OK. func (r ResponseCheckTx) IsErr() bool { - return r.Code != CodeType_OK + return r.Code != CodeTypeOK } // Error implements error interface by formatting response as string. @@ -18,7 +24,7 @@ func (r ResponseCheckTx) Error() string { // IsErr returns true if Code is something other than OK. func (r ResponseDeliverTx) IsErr() bool { - return r.Code != CodeType_OK + return r.Code != CodeTypeOK } // Error implements error interface by formatting response as string. @@ -28,7 +34,7 @@ func (r ResponseDeliverTx) Error() string { // IsErr returns true if Code is something other than OK. func (r ResponseCommit) IsErr() bool { - return r.Code != CodeType_OK + return r.Code != CodeTypeOK } // Error implements error interface by formatting response as string. @@ -36,19 +42,14 @@ func (r ResponseCommit) Error() string { return fmtError(r.Code, r.Log) } -func fmtError(code CodeType, log string) string { - codeAsStr, ok := code2string[code] - if ok { - return fmt.Sprintf("%s (%d): %s", codeAsStr, code, log) - } else { - return fmt.Sprintf("Unknown error (%d): %s", code, log) - } +func fmtError(code uint32, log string) string { + return fmt.Sprintf("Error code (%d): %s", code, log) } // ResultQuery is a wrapper around ResponseQuery using data.Bytes instead of // raw byte slices. type ResultQuery struct { - Code CodeType `json:"code"` + Code uint32 `json:"code"` Index int64 `json:"index"` Key data.Bytes `json:"key"` Value data.Bytes `json:"value"` @@ -72,7 +73,7 @@ func (r *ResponseQuery) Result() *ResultQuery { // IsErr returns true if Code is something other than OK. func (r *ResultQuery) IsErr() bool { - return r.Code != CodeType_OK + return r.Code != CodeTypeOK } // Error implements error interface by formatting result as string. diff --git a/types/result_test.go b/types/result_test.go index 14f334c49..7791cf526 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -8,7 +8,7 @@ import ( func TestResultQuery(t *testing.T) { orig := &ResponseQuery{ - Code: CodeType_OK, + Code: CodeTypeOK, Index: 0, Key: []byte("hello"), Value: []byte("world"), @@ -18,7 +18,7 @@ func TestResultQuery(t *testing.T) { assert.False(t, res.IsErr()) orig = &ResponseQuery{ - Code: CodeType_BadNonce, + Code: 1, Index: 0, Key: []byte("hello"), Value: []byte("world"), @@ -27,50 +27,50 @@ func TestResultQuery(t *testing.T) { } res = orig.Result() assert.True(t, res.IsErr()) - assert.Equal(t, "Error bad nonce (3): bad", res.Error()) + assert.Equal(t, "Error code (1): bad", res.Error()) } func TestResponseDeliverTx(t *testing.T) { res := ResponseDeliverTx{ - Code: CodeType_OK, + Code: CodeTypeOK, Data: []byte("Victor Mancha"), } assert.False(t, res.IsErr()) res = ResponseDeliverTx{ - Code: CodeType_InternalError, + Code: 1, Log: "bad", } assert.True(t, res.IsErr()) - assert.Equal(t, "Internal error (1): bad", res.Error()) + assert.Equal(t, "Error code (1): bad", res.Error()) } func TestResponseCheckTx(t *testing.T) { res := ResponseCheckTx{ - Code: CodeType_OK, + Code: CodeTypeOK, Data: []byte("Talos"), } assert.False(t, res.IsErr()) res = ResponseCheckTx{ - Code: CodeType_InternalError, + Code: 1, Log: "bad", } assert.True(t, res.IsErr()) - assert.Equal(t, "Internal error (1): bad", res.Error()) + assert.Equal(t, "Error code (1): bad", res.Error()) } func TestResponseCommit(t *testing.T) { res := ResponseCommit{ - Code: CodeType_OK, + Code: CodeTypeOK, Data: []byte("Old Lace"), } assert.False(t, res.IsErr()) res = ResponseCommit{ - Code: CodeType_Unauthorized, + Code: 1, Log: "bad", } assert.True(t, res.IsErr()) - assert.Equal(t, "Unauthorized (4): bad", res.Error()) + assert.Equal(t, "Error code (1): bad", res.Error()) } diff --git a/types/types.pb.go b/types/types.pb.go index e433d1986..454f8dd77 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -40,7 +40,6 @@ It has these top-level messages: Validator KVPair */ -//nolint: gas package types import proto "github.com/golang/protobuf/proto" @@ -63,114 +62,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package -type CodeType int32 - -const ( - CodeType_OK CodeType = 0 - // General response codes, 0 ~ 99 - CodeType_InternalError CodeType = 1 - CodeType_EncodingError CodeType = 2 - CodeType_BadNonce CodeType = 3 - CodeType_Unauthorized CodeType = 4 - CodeType_InsufficientFunds CodeType = 5 - CodeType_UnknownRequest CodeType = 6 - // Reserved for basecoin, 100 ~ 199 - CodeType_BaseDuplicateAddress CodeType = 101 - CodeType_BaseEncodingError CodeType = 102 - CodeType_BaseInsufficientFees CodeType = 103 - CodeType_BaseInsufficientFunds CodeType = 104 - CodeType_BaseInsufficientGasPrice CodeType = 105 - CodeType_BaseInvalidInput CodeType = 106 - CodeType_BaseInvalidOutput CodeType = 107 - CodeType_BaseInvalidPubKey CodeType = 108 - CodeType_BaseInvalidSequence CodeType = 109 - CodeType_BaseInvalidSignature CodeType = 110 - CodeType_BaseUnknownAddress CodeType = 111 - CodeType_BaseUnknownPubKey CodeType = 112 - CodeType_BaseUnknownPlugin CodeType = 113 - // Reserved for governance, 200 ~ 299 - CodeType_GovUnknownEntity CodeType = 201 - CodeType_GovUnknownGroup CodeType = 202 - CodeType_GovUnknownProposal CodeType = 203 - CodeType_GovDuplicateGroup CodeType = 204 - CodeType_GovDuplicateMember CodeType = 205 - CodeType_GovDuplicateProposal CodeType = 206 - CodeType_GovDuplicateVote CodeType = 207 - CodeType_GovInvalidMember CodeType = 208 - CodeType_GovInvalidVote CodeType = 209 - CodeType_GovInvalidVotingPower CodeType = 210 -) - -var CodeType_name = map[int32]string{ - 0: "OK", - 1: "InternalError", - 2: "EncodingError", - 3: "BadNonce", - 4: "Unauthorized", - 5: "InsufficientFunds", - 6: "UnknownRequest", - 101: "BaseDuplicateAddress", - 102: "BaseEncodingError", - 103: "BaseInsufficientFees", - 104: "BaseInsufficientFunds", - 105: "BaseInsufficientGasPrice", - 106: "BaseInvalidInput", - 107: "BaseInvalidOutput", - 108: "BaseInvalidPubKey", - 109: "BaseInvalidSequence", - 110: "BaseInvalidSignature", - 111: "BaseUnknownAddress", - 112: "BaseUnknownPubKey", - 113: "BaseUnknownPlugin", - 201: "GovUnknownEntity", - 202: "GovUnknownGroup", - 203: "GovUnknownProposal", - 204: "GovDuplicateGroup", - 205: "GovDuplicateMember", - 206: "GovDuplicateProposal", - 207: "GovDuplicateVote", - 208: "GovInvalidMember", - 209: "GovInvalidVote", - 210: "GovInvalidVotingPower", -} -var CodeType_value = map[string]int32{ - "OK": 0, - "InternalError": 1, - "EncodingError": 2, - "BadNonce": 3, - "Unauthorized": 4, - "InsufficientFunds": 5, - "UnknownRequest": 6, - "BaseDuplicateAddress": 101, - "BaseEncodingError": 102, - "BaseInsufficientFees": 103, - "BaseInsufficientFunds": 104, - "BaseInsufficientGasPrice": 105, - "BaseInvalidInput": 106, - "BaseInvalidOutput": 107, - "BaseInvalidPubKey": 108, - "BaseInvalidSequence": 109, - "BaseInvalidSignature": 110, - "BaseUnknownAddress": 111, - "BaseUnknownPubKey": 112, - "BaseUnknownPlugin": 113, - "GovUnknownEntity": 201, - "GovUnknownGroup": 202, - "GovUnknownProposal": 203, - "GovDuplicateGroup": 204, - "GovDuplicateMember": 205, - "GovDuplicateProposal": 206, - "GovDuplicateVote": 207, - "GovInvalidMember": 208, - "GovInvalidVote": 209, - "GovInvalidVotingPower": 210, -} - -func (x CodeType) String() string { - return proto.EnumName(CodeType_name, int32(x)) -} -func (CodeType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - type KVPair_Type int32 const ( @@ -1320,7 +1211,7 @@ func (m *ResponseSetOption) GetLog() string { } type ResponseDeliverTx struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` @@ -1331,11 +1222,11 @@ func (m *ResponseDeliverTx) String() string { return proto.CompactTex func (*ResponseDeliverTx) ProtoMessage() {} func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } -func (m *ResponseDeliverTx) GetCode() CodeType { +func (m *ResponseDeliverTx) GetCode() uint32 { if m != nil { return m.Code } - return CodeType_OK + return 0 } func (m *ResponseDeliverTx) GetData() []byte { @@ -1360,11 +1251,11 @@ func (m *ResponseDeliverTx) GetTags() []*KVPair { } type ResponseCheckTx struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` - Gas uint64 `protobuf:"varint,4,opt,name=gas" json:"gas,omitempty"` - Fee uint64 `protobuf:"varint,5,opt,name=fee" json:"fee,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Gas uint64 `protobuf:"varint,4,opt,name=gas" json:"gas,omitempty"` + Fee uint64 `protobuf:"varint,5,opt,name=fee" json:"fee,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } @@ -1372,11 +1263,11 @@ func (m *ResponseCheckTx) String() string { return proto.CompactTextS func (*ResponseCheckTx) ProtoMessage() {} func (*ResponseCheckTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } -func (m *ResponseCheckTx) GetCode() CodeType { +func (m *ResponseCheckTx) GetCode() uint32 { if m != nil { return m.Code } - return CodeType_OK + return 0 } func (m *ResponseCheckTx) GetData() []byte { @@ -1408,13 +1299,13 @@ func (m *ResponseCheckTx) GetFee() uint64 { } type ResponseQuery struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - Height uint64 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` - Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` + Height uint64 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` + Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` } func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } @@ -1422,11 +1313,11 @@ func (m *ResponseQuery) String() string { return proto.CompactTextStr func (*ResponseQuery) ProtoMessage() {} func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } -func (m *ResponseQuery) GetCode() CodeType { +func (m *ResponseQuery) GetCode() uint32 { if m != nil { return m.Code } - return CodeType_OK + return 0 } func (m *ResponseQuery) GetIndex() int64 { @@ -1472,9 +1363,9 @@ func (m *ResponseQuery) GetLog() string { } type ResponseCommit struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` } func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } @@ -1482,11 +1373,11 @@ func (m *ResponseCommit) String() string { return proto.CompactTextSt func (*ResponseCommit) ProtoMessage() {} func (*ResponseCommit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } -func (m *ResponseCommit) GetCode() CodeType { +func (m *ResponseCommit) GetCode() uint32 { if m != nil { return m.Code } - return CodeType_OK + return 0 } func (m *ResponseCommit) GetData() []byte { @@ -1758,7 +1649,6 @@ func init() { proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") proto.RegisterType((*Validator)(nil), "types.Validator") proto.RegisterType((*KVPair)(nil), "types.KVPair") - proto.RegisterEnum("types.CodeType", CodeType_name, CodeType_value) proto.RegisterEnum("types.KVPair_Type", KVPair_Type_name, KVPair_Type_value) } @@ -2167,115 +2057,93 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1755 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x49, 0x6f, 0xdb, 0xce, - 0x15, 0x37, 0x25, 0x6a, 0x7b, 0x96, 0x65, 0x7a, 0x2c, 0xdb, 0xb2, 0xd2, 0x43, 0xc2, 0x22, 0x8d, - 0x9d, 0xa6, 0x4e, 0xeb, 0x20, 0x45, 0xdc, 0x14, 0x05, 0xbc, 0xc5, 0x16, 0x82, 0x3a, 0x2e, 0xed, - 0xe4, 0xd2, 0x83, 0x40, 0x8b, 0x23, 0x69, 0x6a, 0x69, 0xc8, 0x90, 0x43, 0x47, 0xee, 0xa9, 0xbd, - 0xe7, 0xde, 0x8f, 0x50, 0xa0, 0xc7, 0x02, 0xfd, 0x0a, 0x05, 0xfe, 0xfb, 0xf2, 0x89, 0xfe, 0x98, - 0x85, 0xab, 0xa9, 0xe0, 0x7f, 0xc8, 0x85, 0x98, 0xb7, 0xcd, 0xbc, 0x99, 0x79, 0xef, 0xf7, 0x1e, - 0x07, 0x56, 0xd8, 0xad, 0x87, 0x83, 0xa7, 0xe2, 0xbb, 0xe3, 0xf9, 0x2e, 0x73, 0x51, 0x45, 0x10, - 0xe6, 0xff, 0x75, 0xa8, 0x59, 0xf8, 0x7d, 0x88, 0x03, 0x86, 0x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x3b, 0xe4, 0x62, 0xbe, 0x15, 0x12, 0x11, 0xe8, 0x25, 0x2c, 0x5e, 0xe1, 0x11, 0xa1, 0xfd, 0xab, - 0x89, 0x3b, 0xb8, 0xee, 0x80, 0x30, 0xed, 0x64, 0x4d, 0x0f, 0xb8, 0xc2, 0x01, 0x97, 0x9f, 0x2e, - 0x58, 0x70, 0x15, 0x53, 0xe8, 0x39, 0x34, 0x30, 0x75, 0x94, 0xe9, 0xa2, 0x30, 0x5d, 0xcf, 0x45, - 0x00, 0x75, 0x22, 0xc3, 0x3a, 0x56, 0xe3, 0x83, 0x1a, 0x54, 0x6e, 0xec, 0x49, 0x88, 0xcd, 0x47, - 0xb0, 0x98, 0x8a, 0x14, 0xd4, 0x81, 0xda, 0x14, 0x07, 0x81, 0x3d, 0xc2, 0x22, 0x9c, 0x1a, 0x56, - 0x44, 0x9a, 0x2d, 0x68, 0xa6, 0xe3, 0x24, 0x65, 0xc8, 0x63, 0x81, 0x1b, 0xde, 0x60, 0x3f, 0xe0, - 0x01, 0xa0, 0x0c, 0x15, 0x69, 0xfe, 0x01, 0x8c, 0x7c, 0x10, 0x20, 0x03, 0xca, 0xd7, 0xf8, 0x56, - 0x69, 0xf2, 0x21, 0x6a, 0x2b, 0x87, 0x44, 0x68, 0x36, 0x2c, 0xe5, 0x9d, 0x19, 0xdb, 0xc6, 0x61, - 0x80, 0x5a, 0x50, 0x62, 0x33, 0x61, 0xda, 0xb4, 0x4a, 0x6c, 0x66, 0xde, 0x87, 0x56, 0xf6, 0xca, - 0xef, 0x68, 0x38, 0xb1, 0xeb, 0xe2, 0xce, 0x10, 0x02, 0xdd, 0xb1, 0x99, 0xad, 0x34, 0xc4, 0x98, - 0xf3, 0x3c, 0x9b, 0x8d, 0xd5, 0xf2, 0x62, 0x8c, 0xd6, 0xa1, 0x3a, 0xc6, 0x64, 0x34, 0x66, 0x22, - 0x07, 0x74, 0x4b, 0x51, 0xdc, 0x57, 0xcf, 0x77, 0x6f, 0xb0, 0x08, 0xf5, 0xba, 0x25, 0x09, 0x73, - 0x19, 0x96, 0x32, 0x81, 0x64, 0x1e, 0xc5, 0xce, 0xc7, 0x17, 0x8f, 0x7e, 0x0b, 0x70, 0x63, 0x4f, - 0x88, 0x63, 0x33, 0xd7, 0x0f, 0x3a, 0xda, 0xfd, 0xf2, 0xd6, 0xe2, 0xae, 0xa1, 0xee, 0xeb, 0x5d, - 0x24, 0xb0, 0x52, 0x3a, 0xe6, 0x19, 0xac, 0xdc, 0x89, 0x01, 0xee, 0xed, 0xd8, 0x0e, 0xc6, 0xd1, - 0x0e, 0xf8, 0x18, 0x3d, 0xe4, 0xde, 0xda, 0x0e, 0xf6, 0x55, 0x76, 0x2f, 0xa9, 0x69, 0x4f, 0x05, - 0xd3, 0x52, 0x42, 0x73, 0x1b, 0x96, 0x73, 0x81, 0x91, 0xda, 0xa7, 0x96, 0xde, 0xa7, 0xf9, 0xb1, - 0x02, 0x75, 0x0b, 0x07, 0x9e, 0x4b, 0x03, 0x8c, 0x5e, 0x40, 0x03, 0xcf, 0x06, 0x58, 0xe6, 0xb8, - 0x96, 0x8b, 0x51, 0xa9, 0x73, 0x1c, 0xc9, 0x79, 0x7c, 0xc7, 0xca, 0x68, 0x5b, 0xe1, 0x53, 0x1e, - 0x74, 0x94, 0x51, 0x1a, 0xa0, 0x9e, 0x44, 0x00, 0x55, 0xce, 0x25, 0xa8, 0xd4, 0xcd, 0x21, 0xd4, - 0xb6, 0x42, 0x28, 0xbd, 0x70, 0xe2, 0x0c, 0x44, 0xed, 0x65, 0x20, 0xaa, 0x52, 0xe8, 0xfe, 0x1c, - 0x8c, 0xda, 0xcb, 0x60, 0x54, 0xb5, 0xd0, 0x74, 0x0e, 0x48, 0x3d, 0x4b, 0x81, 0x54, 0x2d, 0x97, - 0x9b, 0xd2, 0xb0, 0x00, 0xa5, 0x9e, 0xc6, 0x28, 0x55, 0xcf, 0xe1, 0x9a, 0x32, 0xc9, 0xc3, 0xd4, - 0x93, 0x08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x12, - 0x88, 0x38, 0x0a, 0xd8, 0x5b, 0xca, 0x35, 0xe1, 0x77, 0xef, 0xc8, 0x5a, 0x8c, 0x53, 0xa9, 0xe7, - 0xa0, 0x2d, 0x10, 0x99, 0xd5, 0x97, 0xe0, 0x29, 0x33, 0xae, 0x2a, 0xce, 0xad, 0xc5, 0xf9, 0x0a, - 0x5d, 0x79, 0x41, 0xbd, 0x07, 0x0d, 0x7e, 0x92, 0x52, 0xa5, 0x26, 0x54, 0xea, 0x9c, 0x21, 0x84, - 0x8f, 0x60, 0x39, 0x29, 0xd2, 0x52, 0xa5, 0x2e, 0x67, 0x49, 0xd8, 0x42, 0x71, 0x13, 0xea, 0x71, - 0x66, 0x37, 0x84, 0x46, 0xcd, 0x56, 0x09, 0xdd, 0x83, 0x9a, 0x72, 0xb1, 0xb0, 0xa0, 0x3f, 0x86, - 0x8a, 0x67, 0xfb, 0x2c, 0x50, 0x85, 0x33, 0xc2, 0xf5, 0x73, 0xdb, 0xe7, 0x9d, 0x94, 0x2a, 0xeb, - 0x52, 0xc5, 0xdc, 0x83, 0xa5, 0x0c, 0x9f, 0x47, 0x22, 0x73, 0x99, 0x3d, 0x51, 0x25, 0x5d, 0x12, - 0xf1, 0x32, 0xa5, 0x64, 0x19, 0x73, 0x0f, 0x1a, 0xf1, 0x1d, 0xf2, 0x6b, 0xf1, 0xc2, 0xab, 0xd7, - 0xaa, 0x37, 0x6b, 0x5a, 0x8a, 0x12, 0x81, 0xed, 0x7e, 0x50, 0xbd, 0x85, 0x6e, 0x49, 0xc2, 0xfc, - 0x8f, 0x06, 0x55, 0x99, 0xf7, 0x05, 0x1d, 0xdd, 0xef, 0x44, 0xab, 0x13, 0xe2, 0x3e, 0x77, 0x5b, - 0xd8, 0xb5, 0xe2, 0xbf, 0x08, 0x69, 0xb4, 0x23, 0x42, 0xb8, 0x21, 0xb4, 0xf8, 0x10, 0x3d, 0x80, - 0xa6, 0x34, 0x09, 0x98, 0x4f, 0x68, 0x14, 0xb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x8f, 0xda, 0xee, 0xc7, 0x0a, 0x2c, 0xef, 0x1f, 0x1c, 0xf6, 0xf6, 0x3d, - 0xb9, 0x00, 0xaf, 0xfa, 0x4f, 0x41, 0x17, 0x7d, 0x4d, 0xc1, 0xcf, 0x7e, 0xb7, 0xa8, 0xc1, 0x46, - 0xbb, 0x50, 0x11, 0xed, 0x0d, 0x2a, 0xfa, 0xe7, 0xef, 0x16, 0xf6, 0xd9, 0x7c, 0x11, 0xd9, 0x00, - 0xdd, 0xfd, 0xf5, 0xef, 0x16, 0x35, 0xdb, 0xe8, 0x4f, 0xd0, 0x48, 0x1a, 0x93, 0x79, 0x0f, 0x00, - 0xdd, 0xb9, 0x6d, 0x37, 0xb7, 0x4f, 0x1a, 0x96, 0x79, 0xcf, 0x00, 0xdd, 0xb9, 0xbd, 0x37, 0x7a, - 0x01, 0xb5, 0xa8, 0xd9, 0x28, 0x7e, 0x0c, 0xe8, 0xce, 0x69, 0xbf, 0xf9, 0xf1, 0xc8, 0x1e, 0xa1, - 0xe8, 0x1f, 0xbf, 0x5b, 0xd8, 0x51, 0xa3, 0xe7, 0x50, 0x55, 0x35, 0xba, 0xf0, 0x1d, 0xa1, 0x5b, - 0xdc, 0xb7, 0xf3, 0x4d, 0x26, 0xbf, 0x83, 0xf3, 0x1e, 0x08, 0xba, 0x73, 0x3b, 0x72, 0xb4, 0x0f, - 0x90, 0xfa, 0x11, 0x9c, 0xfb, 0x4c, 0xd0, 0x9d, 0xdf, 0x97, 0xa3, 0x97, 0x50, 0x4f, 0xfe, 0xfd, - 0x8a, 0x1f, 0x0b, 0xba, 0xf3, 0x5a, 0xf3, 0xab, 0xaa, 0x78, 0x87, 0x7a, 0xf6, 0x53, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x3c, 0xa1, 0xc6, 0x00, 0x9c, 0x12, 0x00, 0x00, + // 1395 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0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 0xab, 0xca, 0x0d, 0xf6, 0x23, 0x98, 0x19, 0x9a, 0xeb, 0x9e, 0x40, 0xc3, 0xda, 0xc2, + 0x03, 0xfd, 0x33, 0x66, 0xd7, 0x3d, 0x84, 0x86, 0xb5, 0xd5, 0x07, 0x7b, 0x0e, 0xdd, 0x84, 0xc0, + 0xd5, 0xcf, 0xa1, 0x61, 0x4d, 0x01, 0x82, 0xdb, 0xa3, 0x48, 0x5a, 0xf5, 0xca, 0x19, 0x56, 0xd6, + 0x14, 0xec, 0x19, 0x74, 0x34, 0xda, 0x2a, 0x5f, 0x52, 0xc3, 0xea, 0xca, 0x05, 0x17, 0x99, 0x15, + 0xc4, 0x75, 0x4f, 0xa4, 0x61, 0x6d, 0x4d, 0xc2, 0x8e, 0x01, 0x72, 0xa5, 0x70, 0xed, 0x43, 0x69, + 0x58, 0x5f, 0x99, 0xb0, 0x17, 0xd0, 0xcb, 0xaa, 0xdf, 0xea, 0xe7, 0xd2, 0xb0, 0xae, 0x38, 0x39, + 0xeb, 0xd0, 0x4b, 0xfc, 0xe9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x66, 0x37, 0xca, 0x9e, + 0x0f, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 7b2c75e32..48608cd40 100644 --- a/types/types.proto +++ b/types/types.proto @@ -3,49 +3,6 @@ package types; // This file is copied from http://github.com/tendermint/abci -//---------------------------------------- -// Code types - -enum CodeType { - OK = 0; - - // General response codes, 0 ~ 99 - InternalError = 1; - EncodingError = 2; - BadNonce = 3; - Unauthorized = 4; - InsufficientFunds = 5; - UnknownRequest = 6; - - // Reserved for basecoin, 100 ~ 199 - BaseDuplicateAddress = 101; - BaseEncodingError = 102; - BaseInsufficientFees = 103; - BaseInsufficientFunds = 104; - BaseInsufficientGasPrice = 105; - BaseInvalidInput = 106; - BaseInvalidOutput = 107; - BaseInvalidPubKey = 108; - BaseInvalidSequence = 109; - BaseInvalidSignature = 110; - BaseUnknownAddress = 111; - BaseUnknownPubKey = 112; - BaseUnknownPlugin = 113; - - // Reserved for governance, 200 ~ 299 - GovUnknownEntity = 201; - GovUnknownGroup = 202; - GovUnknownProposal = 203; - GovDuplicateGroup = 204; - GovDuplicateMember = 205; - GovDuplicateProposal = 206; - GovDuplicateVote = 207; - GovInvalidMember = 208; - GovInvalidVote = 209; - GovInvalidVotingPower = 210; - -} - //---------------------------------------- // Request types @@ -156,14 +113,14 @@ message ResponseSetOption{ } message ResponseDeliverTx{ - CodeType code = 1; + uint32 code = 1; bytes data = 2; string log = 3; repeated KVPair tags = 4; } message ResponseCheckTx{ - CodeType code = 1; + uint32 code = 1; bytes data = 2; string log = 3; uint64 gas = 4; @@ -171,7 +128,7 @@ message ResponseCheckTx{ } message ResponseQuery{ - CodeType code = 1; + uint32 code = 1; int64 index = 2; bytes key = 3; bytes value = 4; @@ -181,7 +138,7 @@ message ResponseQuery{ } message ResponseCommit{ - CodeType code = 1; + uint32 code = 1; bytes data = 2; string log = 3; } From 308cb8e4547ba31aef96e45a46b24f6399bc5d74 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 14:30:21 -0500 Subject: [PATCH 52/80] use gogo/protobuf --- Makefile | 6 +- types/messages.go | 2 +- types/types.pb.go | 197 +++++++++++++++++++++++----------------------- 3 files changed, 101 insertions(+), 104 deletions(-) diff --git a/Makefile b/Makefile index e9d239003..32e8df4ee 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ GOTOOLS = \ github.com/mitchellh/gox \ github.com/Masterminds/glide \ github.com/alecthomas/gometalinter \ - github.com/ckaznocha/protoc-gen-lint + github.com/ckaznocha/protoc-gen-lint \ + github.com/gogo/protobuf/protoc-gen-gogo all: install test @@ -17,13 +18,12 @@ install_protoc: make install && \ cd .. && \ rm -rf protobuf-3.4.1 - go get github.com/golang/protobuf/protoc-gen-go protoc: ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## ldconfig (may require sudo) ## https://stackoverflow.com/a/25518702 - protoc --go_out=plugins=grpc:. types/*.proto + protoc --gogo_out=plugins=grpc:. types/*.proto install: @ go install ./cmd/... diff --git a/types/messages.go b/types/messages.go index 77ad538ed..7b9c81f97 100644 --- a/types/messages.go +++ b/types/messages.go @@ -3,7 +3,7 @@ package types import ( "io" - "github.com/golang/protobuf/proto" + "github.com/gogo/protobuf/proto" wire "github.com/tendermint/go-wire" ) diff --git a/types/types.pb.go b/types/types.pb.go index 454f8dd77..149c060ad 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -1,6 +1,5 @@ -// Code generated by protoc-gen-go. +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: types/types.proto -// DO NOT EDIT! /* Package types is a generated protocol buffer package. @@ -42,14 +41,12 @@ It has these top-level messages: */ package types -import proto "github.com/golang/protobuf/proto" +import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -60,7 +57,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type KVPair_Type int32 @@ -81,7 +78,7 @@ var KVPair_Type_value = map[string]int32{ func (x KVPair_Type) String() string { return proto.EnumName(KVPair_Type_name, int32(x)) } -func (KVPair_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{29, 0} } +func (KVPair_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29, 0} } type Request struct { // Types that are valid to be assigned to Value: @@ -102,7 +99,7 @@ type Request struct { func (m *Request) Reset() { *m = Request{} } func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{0} } type isRequest_Value interface { isRequest_Value() @@ -260,57 +257,57 @@ func _Request_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { // value switch x := m.Value.(type) { case *Request_Echo: - b.EncodeVarint(1<<3 | proto.WireBytes) + _ = b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Echo); err != nil { return err } case *Request_Flush: - b.EncodeVarint(2<<3 | proto.WireBytes) + _ = b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Flush); err != nil { return err } case *Request_Info: - b.EncodeVarint(3<<3 | proto.WireBytes) + _ = b.EncodeVarint(3<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Info); err != nil { return err } case *Request_SetOption: - b.EncodeVarint(4<<3 | proto.WireBytes) + _ = b.EncodeVarint(4<<3 | proto.WireBytes) if err := b.EncodeMessage(x.SetOption); err != nil { return err } case *Request_DeliverTx: - b.EncodeVarint(5<<3 | proto.WireBytes) + _ = b.EncodeVarint(5<<3 | proto.WireBytes) if err := b.EncodeMessage(x.DeliverTx); err != nil { return err } case *Request_CheckTx: - b.EncodeVarint(6<<3 | proto.WireBytes) + _ = b.EncodeVarint(6<<3 | proto.WireBytes) if err := b.EncodeMessage(x.CheckTx); err != nil { return err } case *Request_Commit: - b.EncodeVarint(7<<3 | proto.WireBytes) + _ = b.EncodeVarint(7<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Commit); err != nil { return err } case *Request_Query: - b.EncodeVarint(8<<3 | proto.WireBytes) + _ = b.EncodeVarint(8<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Query); err != nil { return err } case *Request_InitChain: - b.EncodeVarint(9<<3 | proto.WireBytes) + _ = b.EncodeVarint(9<<3 | proto.WireBytes) if err := b.EncodeMessage(x.InitChain); err != nil { return err } case *Request_BeginBlock: - b.EncodeVarint(10<<3 | proto.WireBytes) + _ = b.EncodeVarint(10<<3 | proto.WireBytes) if err := b.EncodeMessage(x.BeginBlock); err != nil { return err } case *Request_EndBlock: - b.EncodeVarint(11<<3 | proto.WireBytes) + _ = b.EncodeVarint(11<<3 | proto.WireBytes) if err := b.EncodeMessage(x.EndBlock); err != nil { return err } @@ -484,13 +481,13 @@ func _Request_OneofSizer(msg proto.Message) (n int) { } type RequestEcho struct { - Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } func (m *RequestEcho) Reset() { *m = RequestEcho{} } func (m *RequestEcho) String() string { return proto.CompactTextString(m) } func (*RequestEcho) ProtoMessage() {} -func (*RequestEcho) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (*RequestEcho) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{1} } func (m *RequestEcho) GetMessage() string { if m != nil { @@ -505,16 +502,16 @@ type RequestFlush struct { func (m *RequestFlush) Reset() { *m = RequestFlush{} } func (m *RequestFlush) String() string { return proto.CompactTextString(m) } func (*RequestFlush) ProtoMessage() {} -func (*RequestFlush) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (*RequestFlush) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{2} } type RequestInfo struct { - Version string `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` } func (m *RequestInfo) Reset() { *m = RequestInfo{} } func (m *RequestInfo) String() string { return proto.CompactTextString(m) } func (*RequestInfo) ProtoMessage() {} -func (*RequestInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (*RequestInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{3} } func (m *RequestInfo) GetVersion() string { if m != nil { @@ -524,14 +521,14 @@ func (m *RequestInfo) GetVersion() string { } type RequestSetOption struct { - Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (m *RequestSetOption) Reset() { *m = RequestSetOption{} } func (m *RequestSetOption) String() string { return proto.CompactTextString(m) } func (*RequestSetOption) ProtoMessage() {} -func (*RequestSetOption) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (*RequestSetOption) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{4} } func (m *RequestSetOption) GetKey() string { if m != nil { @@ -554,7 +551,7 @@ type RequestDeliverTx struct { func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } func (*RequestDeliverTx) ProtoMessage() {} -func (*RequestDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (*RequestDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{5} } func (m *RequestDeliverTx) GetTx() []byte { if m != nil { @@ -570,7 +567,7 @@ type RequestCheckTx struct { func (m *RequestCheckTx) Reset() { *m = RequestCheckTx{} } func (m *RequestCheckTx) String() string { return proto.CompactTextString(m) } func (*RequestCheckTx) ProtoMessage() {} -func (*RequestCheckTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (*RequestCheckTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{6} } func (m *RequestCheckTx) GetTx() []byte { if m != nil { @@ -581,15 +578,15 @@ func (m *RequestCheckTx) GetTx() []byte { type RequestQuery struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - Height uint64 `protobuf:"varint,3,opt,name=height" json:"height,omitempty"` - Prove bool `protobuf:"varint,4,opt,name=prove" json:"prove,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` } func (m *RequestQuery) Reset() { *m = RequestQuery{} } func (m *RequestQuery) String() string { return proto.CompactTextString(m) } func (*RequestQuery) ProtoMessage() {} -func (*RequestQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +func (*RequestQuery) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{7} } func (m *RequestQuery) GetData() []byte { if m != nil { @@ -625,7 +622,7 @@ type RequestCommit struct { func (m *RequestCommit) Reset() { *m = RequestCommit{} } func (m *RequestCommit) String() string { return proto.CompactTextString(m) } func (*RequestCommit) ProtoMessage() {} -func (*RequestCommit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (*RequestCommit) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{8} } type RequestInitChain struct { Validators []*Validator `protobuf:"bytes,1,rep,name=validators" json:"validators,omitempty"` @@ -634,7 +631,7 @@ type RequestInitChain struct { func (m *RequestInitChain) Reset() { *m = RequestInitChain{} } func (m *RequestInitChain) String() string { return proto.CompactTextString(m) } func (*RequestInitChain) ProtoMessage() {} -func (*RequestInitChain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } +func (*RequestInitChain) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{9} } func (m *RequestInitChain) GetValidators() []*Validator { if m != nil { @@ -651,7 +648,7 @@ type RequestBeginBlock struct { func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } func (m *RequestBeginBlock) String() string { return proto.CompactTextString(m) } func (*RequestBeginBlock) ProtoMessage() {} -func (*RequestBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +func (*RequestBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{10} } func (m *RequestBeginBlock) GetHash() []byte { if m != nil { @@ -668,13 +665,13 @@ func (m *RequestBeginBlock) GetHeader() *Header { } type RequestEndBlock struct { - Height uint64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` } func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } func (m *RequestEndBlock) String() string { return proto.CompactTextString(m) } func (*RequestEndBlock) ProtoMessage() {} -func (*RequestEndBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } +func (*RequestEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{11} } func (m *RequestEndBlock) GetHeight() uint64 { if m != nil { @@ -703,7 +700,7 @@ type Response struct { func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } +func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{12} } type isResponse_Value interface { isResponse_Value() @@ -873,62 +870,62 @@ func _Response_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { // value switch x := m.Value.(type) { case *Response_Exception: - b.EncodeVarint(1<<3 | proto.WireBytes) + _ = b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Exception); err != nil { return err } case *Response_Echo: - b.EncodeVarint(2<<3 | proto.WireBytes) + _ = b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Echo); err != nil { return err } case *Response_Flush: - b.EncodeVarint(3<<3 | proto.WireBytes) + _ = b.EncodeVarint(3<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Flush); err != nil { return err } case *Response_Info: - b.EncodeVarint(4<<3 | proto.WireBytes) + _ = b.EncodeVarint(4<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Info); err != nil { return err } case *Response_SetOption: - b.EncodeVarint(5<<3 | proto.WireBytes) + _ = b.EncodeVarint(5<<3 | proto.WireBytes) if err := b.EncodeMessage(x.SetOption); err != nil { return err } case *Response_DeliverTx: - b.EncodeVarint(6<<3 | proto.WireBytes) + _ = b.EncodeVarint(6<<3 | proto.WireBytes) if err := b.EncodeMessage(x.DeliverTx); err != nil { return err } case *Response_CheckTx: - b.EncodeVarint(7<<3 | proto.WireBytes) + _ = b.EncodeVarint(7<<3 | proto.WireBytes) if err := b.EncodeMessage(x.CheckTx); err != nil { return err } case *Response_Commit: - b.EncodeVarint(8<<3 | proto.WireBytes) + _ = b.EncodeVarint(8<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Commit); err != nil { return err } case *Response_Query: - b.EncodeVarint(9<<3 | proto.WireBytes) + _ = b.EncodeVarint(9<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Query); err != nil { return err } case *Response_InitChain: - b.EncodeVarint(10<<3 | proto.WireBytes) + _ = b.EncodeVarint(10<<3 | proto.WireBytes) if err := b.EncodeMessage(x.InitChain); err != nil { return err } case *Response_BeginBlock: - b.EncodeVarint(11<<3 | proto.WireBytes) + _ = b.EncodeVarint(11<<3 | proto.WireBytes) if err := b.EncodeMessage(x.BeginBlock); err != nil { return err } case *Response_EndBlock: - b.EncodeVarint(12<<3 | proto.WireBytes) + _ = b.EncodeVarint(12<<3 | proto.WireBytes) if err := b.EncodeMessage(x.EndBlock); err != nil { return err } @@ -1115,13 +1112,13 @@ func _Response_OneofSizer(msg proto.Message) (n int) { } type ResponseException struct { - Error string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (m *ResponseException) Reset() { *m = ResponseException{} } func (m *ResponseException) String() string { return proto.CompactTextString(m) } func (*ResponseException) ProtoMessage() {} -func (*ResponseException) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } +func (*ResponseException) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{13} } func (m *ResponseException) GetError() string { if m != nil { @@ -1131,13 +1128,13 @@ func (m *ResponseException) GetError() string { } type ResponseEcho struct { - Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } func (m *ResponseEcho) Reset() { *m = ResponseEcho{} } func (m *ResponseEcho) String() string { return proto.CompactTextString(m) } func (*ResponseEcho) ProtoMessage() {} -func (*ResponseEcho) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } +func (*ResponseEcho) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{14} } func (m *ResponseEcho) GetMessage() string { if m != nil { @@ -1152,19 +1149,19 @@ type ResponseFlush struct { func (m *ResponseFlush) Reset() { *m = ResponseFlush{} } func (m *ResponseFlush) String() string { return proto.CompactTextString(m) } func (*ResponseFlush) ProtoMessage() {} -func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } +func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{15} } type ResponseInfo struct { - Data string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` - LastBlockHeight uint64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight" json:"last_block_height,omitempty"` + Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + LastBlockHeight uint64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` LastBlockAppHash []byte `protobuf:"bytes,4,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` } func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } func (m *ResponseInfo) String() string { return proto.CompactTextString(m) } func (*ResponseInfo) ProtoMessage() {} -func (*ResponseInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } +func (*ResponseInfo) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{16} } func (m *ResponseInfo) GetData() string { if m != nil { @@ -1195,13 +1192,13 @@ func (m *ResponseInfo) GetLastBlockAppHash() []byte { } type ResponseSetOption struct { - Log string `protobuf:"bytes,1,opt,name=log" json:"log,omitempty"` + Log string `protobuf:"bytes,1,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } func (m *ResponseSetOption) String() string { return proto.CompactTextString(m) } func (*ResponseSetOption) ProtoMessage() {} -func (*ResponseSetOption) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } +func (*ResponseSetOption) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{17} } func (m *ResponseSetOption) GetLog() string { if m != nil { @@ -1211,16 +1208,16 @@ func (m *ResponseSetOption) GetLog() string { } type ResponseDeliverTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` } func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } func (m *ResponseDeliverTx) String() string { return proto.CompactTextString(m) } func (*ResponseDeliverTx) ProtoMessage() {} -func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } +func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{18} } func (m *ResponseDeliverTx) GetCode() uint32 { if m != nil { @@ -1251,17 +1248,17 @@ func (m *ResponseDeliverTx) GetTags() []*KVPair { } type ResponseCheckTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` - Gas uint64 `protobuf:"varint,4,opt,name=gas" json:"gas,omitempty"` - Fee uint64 `protobuf:"varint,5,opt,name=fee" json:"fee,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` + Fee uint64 `protobuf:"varint,5,opt,name=fee,proto3" json:"fee,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } func (m *ResponseCheckTx) String() string { return proto.CompactTextString(m) } func (*ResponseCheckTx) ProtoMessage() {} -func (*ResponseCheckTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } +func (*ResponseCheckTx) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{19} } func (m *ResponseCheckTx) GetCode() uint32 { if m != nil { @@ -1299,19 +1296,19 @@ func (m *ResponseCheckTx) GetFee() uint64 { } type ResponseQuery struct { - Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - Height uint64 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` - Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` + Height uint64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` + Log string `protobuf:"bytes,7,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } func (*ResponseQuery) ProtoMessage() {} -func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } +func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{20} } func (m *ResponseQuery) GetCode() uint32 { if m != nil { @@ -1363,15 +1360,15 @@ func (m *ResponseQuery) GetLog() string { } type ResponseCommit struct { - Code uint32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } func (m *ResponseCommit) String() string { return proto.CompactTextString(m) } func (*ResponseCommit) ProtoMessage() {} -func (*ResponseCommit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } +func (*ResponseCommit) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{21} } func (m *ResponseCommit) GetCode() uint32 { if m != nil { @@ -1400,7 +1397,7 @@ type ResponseInitChain struct { func (m *ResponseInitChain) Reset() { *m = ResponseInitChain{} } func (m *ResponseInitChain) String() string { return proto.CompactTextString(m) } func (*ResponseInitChain) ProtoMessage() {} -func (*ResponseInitChain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } +func (*ResponseInitChain) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{22} } type ResponseBeginBlock struct { } @@ -1408,7 +1405,7 @@ type ResponseBeginBlock struct { func (m *ResponseBeginBlock) Reset() { *m = ResponseBeginBlock{} } func (m *ResponseBeginBlock) String() string { return proto.CompactTextString(m) } func (*ResponseBeginBlock) ProtoMessage() {} -func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } +func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{23} } type ResponseEndBlock struct { Diffs []*Validator `protobuf:"bytes,1,rep,name=diffs" json:"diffs,omitempty"` @@ -1417,7 +1414,7 @@ type ResponseEndBlock struct { func (m *ResponseEndBlock) Reset() { *m = ResponseEndBlock{} } func (m *ResponseEndBlock) String() string { return proto.CompactTextString(m) } func (*ResponseEndBlock) ProtoMessage() {} -func (*ResponseEndBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } +func (*ResponseEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{24} } func (m *ResponseEndBlock) GetDiffs() []*Validator { if m != nil { @@ -1427,10 +1424,10 @@ func (m *ResponseEndBlock) GetDiffs() []*Validator { } type Header struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` - Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` - Time uint64 `protobuf:"varint,3,opt,name=time" json:"time,omitempty"` - NumTxs uint64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs" json:"num_txs,omitempty"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Time uint64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` + NumTxs uint64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` LastBlockId *BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId" json:"last_block_id,omitempty"` LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` @@ -1441,7 +1438,7 @@ type Header struct { func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } +func (*Header) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{25} } func (m *Header) GetChainId() string { if m != nil { @@ -1514,7 +1511,7 @@ type BlockID struct { func (m *BlockID) Reset() { *m = BlockID{} } func (m *BlockID) String() string { return proto.CompactTextString(m) } func (*BlockID) ProtoMessage() {} -func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } +func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{26} } func (m *BlockID) GetHash() []byte { if m != nil { @@ -1531,14 +1528,14 @@ func (m *BlockID) GetParts() *PartSetHeader { } type PartSetHeader struct { - Total uint64 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"` + Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` } func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } func (*PartSetHeader) ProtoMessage() {} -func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } +func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{27} } func (m *PartSetHeader) GetTotal() uint64 { if m != nil { @@ -1556,13 +1553,13 @@ func (m *PartSetHeader) GetHash() []byte { type Validator struct { PubKey []byte `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"` - Power uint64 `protobuf:"varint,2,opt,name=power" json:"power,omitempty"` + Power uint64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` } func (m *Validator) Reset() { *m = Validator{} } func (m *Validator) String() string { return proto.CompactTextString(m) } func (*Validator) ProtoMessage() {} -func (*Validator) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } +func (*Validator) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{28} } func (m *Validator) GetPubKey() []byte { if m != nil { @@ -1579,16 +1576,16 @@ func (m *Validator) GetPower() uint64 { } type KVPair struct { - Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - ValueType KVPair_Type `protobuf:"varint,2,opt,name=value_type,json=valueType,enum=types.KVPair_Type" json:"value_type,omitempty"` - ValueString string `protobuf:"bytes,3,opt,name=value_string,json=valueString" json:"value_string,omitempty"` - ValueInt int64 `protobuf:"varint,4,opt,name=value_int,json=valueInt" json:"value_int,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + ValueType KVPair_Type `protobuf:"varint,2,opt,name=value_type,json=valueType,proto3,enum=types.KVPair_Type" json:"value_type,omitempty"` + ValueString string `protobuf:"bytes,3,opt,name=value_string,json=valueString,proto3" json:"value_string,omitempty"` + ValueInt int64 `protobuf:"varint,4,opt,name=value_int,json=valueInt,proto3" json:"value_int,omitempty"` } func (m *KVPair) Reset() { *m = KVPair{} } func (m *KVPair) String() string { return proto.CompactTextString(m) } func (*KVPair) ProtoMessage() {} -func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } +func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29} } func (m *KVPair) GetKey() string { if m != nil { @@ -2054,9 +2051,9 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ Metadata: "types/types.proto", } -func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } +func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } -var fileDescriptor0 = []byte{ +var fileDescriptorTypes = []byte{ // 1395 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x97, 0x4b, 0x6f, 0xdb, 0x46, 0x10, 0x80, 0x2d, 0x89, 0x7a, 0x70, 0xe4, 0x87, 0xb2, 0x71, 0x13, 0x46, 0xb9, 0x24, 0x04, 0xd2, From 24fbe291ab2d1b6d562b133b3c7251323888c1a6 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 15:17:54 -0500 Subject: [PATCH 53/80] update glide; update services for new signature --- cmd/abci-cli/abci-cli.go | 6 ++--- example/dummy/dummy_test.go | 8 +++---- example/example_test.go | 6 ++--- glide.lock | 46 ++++++++++++++++++++----------------- glide.yaml | 2 +- tests/client_server_test.go | 4 ++-- tests/test_app/app.go | 2 +- 7 files changed, 39 insertions(+), 35 deletions(-) diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index c0dbbfafe..cc60a4bc3 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -88,7 +88,7 @@ var RootCmd = &cobra.Command{ return err } client.SetLogger(logger.With("module", "abci-client")) - if _, err := client.Start(); err != nil { + if err := client.Start(); err != nil { return err } } @@ -457,7 +457,7 @@ func cmdCounter(cmd *cobra.Command, args []string) error { return err } srv.SetLogger(logger.With("module", "abci-server")) - if _, err := srv.Start(); err != nil { + if err := srv.Start(); err != nil { return err } @@ -487,7 +487,7 @@ func cmdDummy(cmd *cobra.Command, args []string) error { return err } srv.SetLogger(logger.With("module", "abci-server")) - if _, err := srv.Start(); err != nil { + if err := srv.Start(); err != nil { return err } diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index bbb35dbe9..65970ecd7 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -212,14 +212,14 @@ func makeSocketClientServer(app types.Application, name string) (abcicli.Client, server := abciserver.NewSocketServer(socket, app) server.SetLogger(logger.With("module", "abci-server")) - if _, err := server.Start(); err != nil { + if err := server.Start(); err != nil { return nil, nil, err } // Connect to the socket client := abcicli.NewSocketClient(socket, false) client.SetLogger(logger.With("module", "abci-client")) - if _, err := client.Start(); err != nil { + if err := client.Start(); err != nil { server.Stop() return nil, nil, err } @@ -235,13 +235,13 @@ func makeGRPCClientServer(app types.Application, name string) (abcicli.Client, c gapp := types.NewGRPCApplication(app) server := abciserver.NewGRPCServer(socket, gapp) server.SetLogger(logger.With("module", "abci-server")) - if _, err := server.Start(); err != nil { + if err := server.Start(); err != nil { return nil, nil, err } client := abcicli.NewGRPCClient(socket, true) client.SetLogger(logger.With("module", "abci-client")) - if _, err := client.Start(); err != nil { + if err := client.Start(); err != nil { server.Stop() return nil, nil, err } diff --git a/example/example_test.go b/example/example_test.go index 952f8cb2c..7fd3bb520 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -40,7 +40,7 @@ func testStream(t *testing.T, app types.Application) { // Start the listener server := abciserver.NewSocketServer("unix://test.sock", app) server.SetLogger(log.TestingLogger().With("module", "abci-server")) - if _, err := server.Start(); err != nil { + if err := server.Start(); err != nil { t.Fatalf("Error starting socket server: %v", err.Error()) } defer server.Stop() @@ -48,7 +48,7 @@ func testStream(t *testing.T, app types.Application) { // Connect to the socket client := abcicli.NewSocketClient("unix://test.sock", false) client.SetLogger(log.TestingLogger().With("module", "abci-client")) - if _, err := client.Start(); err != nil { + if err := client.Start(); err != nil { t.Fatalf("Error starting socket client: %v", err.Error()) } defer client.Stop() @@ -113,7 +113,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { // Start the listener server := abciserver.NewGRPCServer("unix://test.sock", app) server.SetLogger(log.TestingLogger().With("module", "abci-server")) - if _, err := server.Start(); err != nil { + if err := server.Start(); err != nil { t.Fatalf("Error starting GRPC server: %v", err.Error()) } defer server.Stop() diff --git a/glide.lock b/glide.lock index 80dbc4835..b4a2125e9 100644 --- a/glide.lock +++ b/glide.lock @@ -1,14 +1,12 @@ -hash: 5501ab3d7136aa8fb425c995d45221849b33aefab76c5d2c192e721dad28da38 -updated: 2017-11-14T18:23:41.2024073Z +hash: eb1802c17bab227061f9198f2a738ad6e2bb676cefdd5729dc2ac90d5d10e610 +updated: 2017-11-30T15:00:40.216000076-05:00 imports: - name: github.com/btcsuite/btcd - version: b8df516b4b267acf2de46be593a9d948d1d2c420 + version: 8cea3866d0f7fb12d567a20744942c0d078c7d15 subpackages: - btcec -- name: github.com/btcsuite/fastsha256 - version: 637e656429416087660c84436a2a035d69d54e2e - name: github.com/go-kit/kit - version: d67bb4c202e3b91377d1079b110a6c9ce23ab2f8 + version: e3b2152e0063c5f05efea89ecbe297852af2a92d subpackages: - log - log/level @@ -16,15 +14,21 @@ imports: - name: github.com/go-logfmt/logfmt version: 390ab7935ee28ec6b286364bba9b4dd6410cb3d5 - name: github.com/go-playground/locales - version: 1e5f1161c6416a5ff48840eb8724a394e48cc534 + version: e4cbcb5d0652150d40ad0646651076b6bd2be4f6 subpackages: - currency - name: github.com/go-playground/universal-translator version: 71201497bace774495daed26a3874fd339e0b538 - name: github.com/go-stack/stack - version: 100eb0c0a9c5b306ca2fb4f165df21d80ada4b82 + version: 259ab82a6cad3992b4e21ff5cac294ccb06474bc +- name: github.com/gogo/protobuf + version: 342cbe0a04158f6dcb03ca0079991a51a4248c02 + subpackages: + - gogoproto + - proto + - protoc-gen-gogo/descriptor - name: github.com/golang/protobuf - version: 1643683e1b54a9e88ad26d98f81400c8c9d9f4f9 + version: 1e59b77b52bf8e4b449a57e6f79f21226d571845 subpackages: - proto - ptypes @@ -44,9 +48,9 @@ imports: - name: github.com/spf13/cobra version: 7b2c5ac9fc04fc5efafb60700713d4fa609b777b - name: github.com/spf13/pflag - version: 80fe0fb4eba54167e2ccae1c6c950e72abf61b73 + version: 4c012f6dcd9546820e378d0bdda4d8fc772cdfea - name: github.com/syndtr/goleveldb - version: 8c81ea47d4c41a385645e133e15510fc6a2a74b4 + version: adf24ef3f94bd13ec4163060b21a5678f22b429b subpackages: - leveldb - leveldb/cache @@ -61,27 +65,27 @@ imports: - leveldb/table - leveldb/util - name: github.com/tendermint/ed25519 - version: 1f52c6f8b8a5c7908aff4497c186af344b428925 + version: d8387025d2b9d158cf4efb07e7ebf814bcce2057 subpackages: - edwards25519 - extra25519 - name: github.com/tendermint/go-crypto version: b4f04f196cd719660e43b91202cd60d9a95b1837 - name: github.com/tendermint/go-wire - version: 1c96861c03231361546944d883d99593b2e6b408 + version: 7d50b38b3815efe313728de77e2995c8813ce13f subpackages: - data - name: github.com/tendermint/iavl version: 595f3dcd5b6cd4a292e90757ae6d367fd7a6e653 - name: github.com/tendermint/tmlibs - version: 2442a0a698d271d5cf5d6a8e7c1db20335e959c1 + version: 21fb7819891997c96838308b4eba5a50b07ff03f subpackages: - common - db - log - process - name: golang.org/x/crypto - version: c7af5bf2638a1164f2eb5467c39c6cffbd13a02e + version: 9f005a07e0d31d45e6656d241bb5c0f2efd4bc94 subpackages: - nacl/secretbox - openpgp/armor @@ -90,7 +94,7 @@ imports: - ripemd160 - salsa20/salsa - name: golang.org/x/net - version: cd69bc3fc700721b709c3a59e16e24c67b58f6ff + version: 9dfe39835686865bff950a07b394c12a98ddc811 subpackages: - context - http2 @@ -100,14 +104,14 @@ imports: - lex/httplex - trace - name: golang.org/x/text - version: 470f45bf29f4147d6fbd7dfd0a02a848e49f5bf4 + version: 88f656faf3f37f690df1a32515b479415e1a6769 subpackages: - secure/bidirule - transform - unicode/bidi - unicode/norm - name: google.golang.org/genproto - version: f676e0f3ac6395ff1a529ae59a6670878a8371a6 + version: 891aceb7c239e72692819142dfca057bdcbfcb96 subpackages: - googleapis/rpc/status - name: google.golang.org/grpc @@ -130,10 +134,10 @@ imports: - tap - transport - name: gopkg.in/go-playground/validator.v9 - version: 6d8c18553ea1ac493d049edd6f102f52e618f085 + version: 61caf9d3038e1af346dbf5c2e16f6678e1548364 testImports: - name: github.com/davecgh/go-spew - version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9 + version: 04cdfd42973bb9c8589fd6a731800cf222fde1a9 subpackages: - spew - name: github.com/pmezard/go-difflib @@ -141,7 +145,7 @@ testImports: subpackages: - difflib - name: github.com/stretchr/testify - version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0 + version: 2aa2c176b9dab406a6970f6a55f513e8a8c8b18f subpackages: - assert - require diff --git a/glide.yaml b/glide.yaml index ce8057234..f4a796cf3 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,6 +1,6 @@ package: github.com/tendermint/abci import: -- package: github.com/golang/protobuf +- package: github.com/gogo/protobuf subpackages: - proto - package: github.com/spf13/cobra diff --git a/tests/client_server_test.go b/tests/client_server_test.go index cc946fcef..646c8b609 100644 --- a/tests/client_server_test.go +++ b/tests/client_server_test.go @@ -17,11 +17,11 @@ func TestClientServerNoAddrPrefix(t *testing.T) { server, err := abciserver.NewServer(addr, transport, app) assert.NoError(t, err, "expected no error on NewServer") - _, err = server.Start() + err = server.Start() assert.NoError(t, err, "expected no error on server.Start") client, err := abciclient.NewClient(addr, transport, true) assert.NoError(t, err, "expected no error on NewClient") - _, err = client.Start() + err = client.Start() assert.NoError(t, err, "expected no error on client.Start") } diff --git a/tests/test_app/app.go b/tests/test_app/app.go index d55fb1601..f04036216 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -18,7 +18,7 @@ func startClient(abciType string) abcicli.Client { } logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) client.SetLogger(logger.With("module", "abcicli")) - if _, err := client.Start(); err != nil { + if err := client.Start(); err != nil { panicf("connecting to abci_app: %v", err.Error()) } From 81e4effbdb8f42ebd4806c17936fc07efce04148 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 15:31:10 -0500 Subject: [PATCH 54/80] types: use data.Bytes directly in type.proto via gogo/protobuf. wow --- Makefile | 5 +- glide.lock | 6 +- glide.yaml | 2 +- types/base_app.go | 2 +- types/result.go | 41 ++----- types/result_test.go | 8 +- types/types.pb.go | 266 +++++++++++++++++++------------------------ types/types.proto | 15 ++- 8 files changed, 143 insertions(+), 202 deletions(-) diff --git a/Makefile b/Makefile index 32e8df4ee..e6a7af362 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,8 @@ GOTOOLS = \ github.com/Masterminds/glide \ github.com/alecthomas/gometalinter \ github.com/ckaznocha/protoc-gen-lint \ - github.com/gogo/protobuf/protoc-gen-gogo + github.com/gogo/protobuf/protoc-gen-gogo \ + github.com/gogo/protobuf/gogoproto all: install test @@ -23,7 +24,7 @@ protoc: ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## ldconfig (may require sudo) ## https://stackoverflow.com/a/25518702 - protoc --gogo_out=plugins=grpc:. types/*.proto + protoc -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf --gogo_out=plugins=grpc:. types/*.proto install: @ go install ./cmd/... diff --git a/glide.lock b/glide.lock index b4a2125e9..d52acc7b5 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: eb1802c17bab227061f9198f2a738ad6e2bb676cefdd5729dc2ac90d5d10e610 -updated: 2017-11-30T15:00:40.216000076-05:00 +hash: 971ad090f3190ffd759deecf118a0eaefe7eceb4b1a8057800e332712fc1a7c2 +updated: 2017-11-30T15:29:31.740172292-05:00 imports: - name: github.com/btcsuite/btcd version: 8cea3866d0f7fb12d567a20744942c0d078c7d15 @@ -72,7 +72,7 @@ imports: - name: github.com/tendermint/go-crypto version: b4f04f196cd719660e43b91202cd60d9a95b1837 - name: github.com/tendermint/go-wire - version: 7d50b38b3815efe313728de77e2995c8813ce13f + version: 3f073b1a9c841d9b88d03ca8181f61278188adca subpackages: - data - name: github.com/tendermint/iavl diff --git a/glide.yaml b/glide.yaml index f4a796cf3..aeb6b674f 100644 --- a/glide.yaml +++ b/glide.yaml @@ -7,7 +7,7 @@ import: - package: github.com/tendermint/go-crypto version: develop - package: github.com/tendermint/go-wire - version: develop + version: data-bytes-marshal-unmarshal subpackages: - data - package: github.com/tendermint/iavl diff --git a/types/base_app.go b/types/base_app.go index f8d1946ab..1998e9dcb 100644 --- a/types/base_app.go +++ b/types/base_app.go @@ -24,7 +24,7 @@ func (BaseApplication) CheckTx(tx []byte) ResponseCheckTx { } func (BaseApplication) Commit() ResponseCommit { - return ResponseCommit{Code: CodeTypeOK, Data: []byte("nil")} + return ResponseCommit{Code: CodeTypeOK} } func (BaseApplication) Query(req RequestQuery) ResponseQuery { diff --git a/types/result.go b/types/result.go index 59d82ffc2..3344b27c0 100644 --- a/types/result.go +++ b/types/result.go @@ -2,8 +2,6 @@ package types import ( "fmt" - - "github.com/tendermint/go-wire/data" ) // type CodeType uint32 @@ -42,41 +40,16 @@ func (r ResponseCommit) Error() string { return fmtError(r.Code, r.Log) } -func fmtError(code uint32, log string) string { - return fmt.Sprintf("Error code (%d): %s", code, log) -} - -// ResultQuery is a wrapper around ResponseQuery using data.Bytes instead of -// raw byte slices. -type ResultQuery struct { - Code uint32 `json:"code"` - Index int64 `json:"index"` - Key data.Bytes `json:"key"` - Value data.Bytes `json:"value"` - Proof data.Bytes `json:"proof"` - Height uint64 `json:"height"` - Log string `json:"log"` -} - -// Result converts response query to ResultQuery. -func (r *ResponseQuery) Result() *ResultQuery { - return &ResultQuery{ - Code: r.Code, - Index: r.Index, - Key: r.Key, - Value: r.Value, - Proof: r.Proof, - Height: r.Height, - Log: r.Log, - } -} - // IsErr returns true if Code is something other than OK. -func (r *ResultQuery) IsErr() bool { +func (r ResponseQuery) IsErr() bool { return r.Code != CodeTypeOK } -// Error implements error interface by formatting result as string. -func (r *ResultQuery) Error() string { +// Error implements error interface by formatting response as string. +func (r ResponseQuery) Error() string { return fmtError(r.Code, r.Log) } + +func fmtError(code uint32, log string) string { + return fmt.Sprintf("Error code (%d): %s", code, log) +} diff --git a/types/result_test.go b/types/result_test.go index 7791cf526..b7da838cc 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -6,18 +6,17 @@ import ( "github.com/stretchr/testify/assert" ) -func TestResultQuery(t *testing.T) { - orig := &ResponseQuery{ +func TestResponseQuery(t *testing.T) { + res := ResponseQuery{ Code: CodeTypeOK, Index: 0, Key: []byte("hello"), Value: []byte("world"), Height: 1, } - res := orig.Result() assert.False(t, res.IsErr()) - orig = &ResponseQuery{ + res = ResponseQuery{ Code: 1, Index: 0, Key: []byte("hello"), @@ -25,7 +24,6 @@ func TestResultQuery(t *testing.T) { Height: 1, Log: "bad", } - res = orig.Result() assert.True(t, res.IsErr()) assert.Equal(t, "Error code (1): bad", res.Error()) } diff --git a/types/types.pb.go b/types/types.pb.go index 149c060ad..61a56cacf 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -44,6 +44,9 @@ package types import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" +import _ "github.com/gogo/protobuf/gogoproto" + +import github_com_tendermint_go_wire_data "github.com/tendermint/go-wire/data" import context "golang.org/x/net/context" import grpc "google.golang.org/grpc" @@ -1208,10 +1211,10 @@ func (m *ResponseSetOption) GetLog() string { } type ResponseDeliverTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,2,opt,name=data,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"data"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Tags []*KVPair `protobuf:"bytes,4,rep,name=tags" json:"tags,omitempty"` } func (m *ResponseDeliverTx) Reset() { *m = ResponseDeliverTx{} } @@ -1226,13 +1229,6 @@ func (m *ResponseDeliverTx) GetCode() uint32 { return 0 } -func (m *ResponseDeliverTx) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - func (m *ResponseDeliverTx) GetLog() string { if m != nil { return m.Log @@ -1248,11 +1244,11 @@ func (m *ResponseDeliverTx) GetTags() []*KVPair { } type ResponseCheckTx struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` - Fee uint64 `protobuf:"varint,5,opt,name=fee,proto3" json:"fee,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,2,opt,name=data,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"data"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` + Fee uint64 `protobuf:"varint,5,opt,name=fee,proto3" json:"fee,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } @@ -1267,13 +1263,6 @@ func (m *ResponseCheckTx) GetCode() uint32 { return 0 } -func (m *ResponseCheckTx) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - func (m *ResponseCheckTx) GetLog() string { if m != nil { return m.Log @@ -1296,13 +1285,13 @@ func (m *ResponseCheckTx) GetFee() uint64 { } type ResponseQuery struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - Height uint64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` - Log string `protobuf:"bytes,7,opt,name=log,proto3" json:"log,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + Key github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,3,opt,name=key,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"key"` + Value github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,4,opt,name=value,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"value"` + Proof github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,5,opt,name=proof,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"proof"` + Height uint64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` + Log string `protobuf:"bytes,7,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } @@ -1324,27 +1313,6 @@ func (m *ResponseQuery) GetIndex() int64 { return 0 } -func (m *ResponseQuery) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *ResponseQuery) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *ResponseQuery) GetProof() []byte { - if m != nil { - return m.Proof - } - return nil -} - func (m *ResponseQuery) GetHeight() uint64 { if m != nil { return m.Height @@ -1360,9 +1328,9 @@ func (m *ResponseQuery) GetLog() string { } type ResponseCommit struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Data github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,2,opt,name=data,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"data"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseCommit) Reset() { *m = ResponseCommit{} } @@ -1377,13 +1345,6 @@ func (m *ResponseCommit) GetCode() uint32 { return 0 } -func (m *ResponseCommit) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - func (m *ResponseCommit) GetLog() string { if m != nil { return m.Log @@ -2054,93 +2015,98 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 1395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa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xca, 0x0d, 0xf6, 0x23, 0x98, 0x19, 0x9a, 0xeb, 0x9e, 0x40, 0xc3, 0xda, 0xc2, - 0x03, 0xfd, 0x33, 0x66, 0xd7, 0x3d, 0x84, 0x86, 0xb5, 0xd5, 0x07, 0x7b, 0x0e, 0xdd, 0x84, 0xc0, - 0xd5, 0xcf, 0xa1, 0x61, 0x4d, 0x01, 0x82, 0xdb, 0xa3, 0x48, 0x5a, 0xf5, 0xca, 0x19, 0x56, 0xd6, - 0x14, 0xec, 0x19, 0x74, 0x34, 0xda, 0x2a, 0x5f, 0x52, 0xc3, 0xea, 0xca, 0x05, 0x17, 0x99, 0x15, - 0xc4, 0x75, 0x4f, 0xa4, 0x61, 0x6d, 0x4d, 0xc2, 0x8e, 0x01, 0x72, 0xa5, 0x70, 0xed, 0x43, 0x69, - 0x58, 0x5f, 0x99, 0xb0, 0x17, 0xd0, 0xcb, 0xaa, 0xdf, 0xea, 0xe7, 0xd2, 0xb0, 0xae, 0x38, 0x39, - 0xeb, 0xd0, 0x4b, 0xfc, 0xe9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x66, 0x37, 0xca, 0x9e, - 0x0f, 0x00, 0x00, + // 1485 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x8e, 0x13, 0x47, + 0x10, 0x5e, 0xdb, 0xe3, 0xbf, 0xf2, 0xfe, 0x98, 0x66, 0x03, 0xc6, 0x1c, 0x80, 0x91, 0x08, 0xbb, + 0x04, 0xd6, 0x64, 0x11, 0x11, 0x1b, 0xa2, 0x48, 0x6b, 0x16, 0x62, 0x0b, 0x89, 0x90, 0x61, 0xc5, + 0xd5, 0x1a, 0x7b, 0xda, 0xf6, 0x08, 0x7b, 0x66, 0x98, 0x69, 0x2f, 0x5e, 0x29, 0x8f, 0xc0, 0x3d, + 0xe7, 0xe4, 0x12, 0x29, 0x2f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a, 0xf4, 0x40, 0xa3, + 0x3a, 0x98, 0x33, 0x1c, 0x76, 0xf3, 0x1a, 0x32, 0x76, 0x08, 0x55, 0x2a, 0x87, 0x2c, 0x6f, 0x46, + 0xec, 0xe6, 0xf6, 0x65, 0xf8, 0x23, 0xb2, 0x60, 0x5e, 0x1c, 0x15, 0xbb, 0x79, 0xcd, 0x19, 0xfb, + 0x11, 0x9a, 0x71, 0x21, 0x2b, 0x1a, 0x18, 0xbb, 0x85, 0x6d, 0x1a, 0xe2, 0xe3, 0x02, 0x57, 0x34, + 0x36, 0x76, 0x0b, 0x7b, 0x35, 0xf6, 0x18, 0xea, 0x61, 0xed, 0xc9, 0x1f, 0x1e, 0xbb, 0x05, 0xed, + 0x1a, 0x5e, 0x8f, 0xac, 0x08, 0x79, 0x33, 0x61, 0x37, 0xb7, 0x03, 0x63, 0x8f, 0xa0, 0xa6, 0xc8, + 0x30, 0x77, 0xee, 0xec, 0xe6, 0xf7, 0x79, 0x18, 0x64, 0x3c, 0x3e, 0x14, 0x0d, 0x94, 0xdd, 0xc2, + 0x0e, 0x8e, 0x1d, 0x03, 0x24, 0x06, 0x87, 0xc2, 0xb1, 0xb2, 0x5b, 0xdc, 0xc7, 0xb1, 0x27, 0xd0, + 0x88, 0x67, 0x85, 0xfc, 0xe1, 0xb2, 0x5b, 0xd4, 0xca, 0x8d, 0x6b, 0xf4, 0x0f, 0x8b, 0x87, 0xff, + 0x07, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xbb, 0x93, 0x98, 0xfb, 0x10, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 48608cd40..2754a3624 100644 --- a/types/types.proto +++ b/types/types.proto @@ -1,6 +1,9 @@ syntax = "proto3"; package types; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + + // This file is copied from http://github.com/tendermint/abci //---------------------------------------- @@ -114,14 +117,14 @@ message ResponseSetOption{ message ResponseDeliverTx{ uint32 code = 1; - bytes data = 2; + bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; string log = 3; repeated KVPair tags = 4; } message ResponseCheckTx{ uint32 code = 1; - bytes data = 2; + bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; string log = 3; uint64 gas = 4; uint64 fee = 5; @@ -130,16 +133,16 @@ message ResponseCheckTx{ message ResponseQuery{ uint32 code = 1; int64 index = 2; - bytes key = 3; - bytes value = 4; - bytes proof = 5; + bytes key = 3 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; + bytes value = 4 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; + bytes proof = 5 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; uint64 height = 6; string log = 7; } message ResponseCommit{ uint32 code = 1; - bytes data = 2; + bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; string log = 3; } From 550d6a6081dbdc0c4acee7f101f1828852ddca8f Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 15:37:31 -0500 Subject: [PATCH 55/80] shame: forgot to add new code pkg --- example/code/code.go | 9 +++++++++ example/counter/counter.go | 8 ++++---- example/dummy/dummy.go | 7 ++++--- example/dummy/dummy_test.go | 17 ++++++++++------- example/dummy/persistent_dummy.go | 4 ++-- example/example_test.go | 10 ++++++---- 6 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 example/code/code.go diff --git a/example/code/code.go b/example/code/code.go new file mode 100644 index 000000000..94e9d015e --- /dev/null +++ b/example/code/code.go @@ -0,0 +1,9 @@ +package code + +// Return codes for the examples +const ( + CodeTypeOK uint32 = 0 + CodeTypeEncodingError uint32 = 1 + CodeTypeBadNonce uint32 = 2 + CodeTypeUnauthorized uint32 = 3 +) diff --git a/example/counter/counter.go b/example/counter/counter.go index 67fa06e31..0978799e8 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -50,7 +50,7 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { } } app.txCount++ - return types.ResponseDeliverTx{Code: types.CodeTypeOK} + return types.ResponseDeliverTx{Code: code.CodeTypeOK} } func (app *CounterApplication) CheckTx(tx []byte) types.ResponseCheckTx { @@ -69,17 +69,17 @@ func (app *CounterApplication) CheckTx(tx []byte) types.ResponseCheckTx { Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)} } } - return types.ResponseCheckTx{Code: types.CodeTypeOK} + return types.ResponseCheckTx{Code: code.CodeTypeOK} } func (app *CounterApplication) Commit() (resp types.ResponseCommit) { app.hashCount++ if app.txCount == 0 { - return types.ResponseCommit{Code: types.CodeTypeOK} + return types.ResponseCommit{Code: code.CodeTypeOK} } hash := make([]byte, 8) binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return types.ResponseCommit{Code: types.CodeTypeOK, Data: hash} + return types.ResponseCommit{Code: code.CodeTypeOK, Data: hash} } func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 8329ef039..fdb4851cf 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/types" wire "github.com/tendermint/go-wire" "github.com/tendermint/iavl" @@ -42,11 +43,11 @@ func (app *DummyApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { {Key: "app.creator", ValueType: types.KVPair_STRING, ValueString: "jae"}, {Key: "app.key", ValueType: types.KVPair_STRING, ValueString: string(key)}, } - return types.ResponseDeliverTx{Code: types.CodeTypeOK, Tags: tags} + return types.ResponseDeliverTx{Code: code.CodeTypeOK, Tags: tags} } func (app *DummyApplication) CheckTx(tx []byte) types.ResponseCheckTx { - return types.ResponseCheckTx{Code: types.CodeTypeOK} + return types.ResponseCheckTx{Code: code.CodeTypeOK} } func (app *DummyApplication) Commit() types.ResponseCommit { @@ -64,7 +65,7 @@ func (app *DummyApplication) Commit() types.ResponseCommit { } } - return types.ResponseCommit{Code: types.CodeTypeOK, Data: hash} + return types.ResponseCommit{Code: code.CodeTypeOK, Data: hash} } func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 65970ecd7..738da6e85 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -7,12 +7,15 @@ import ( "testing" "github.com/stretchr/testify/require" - abcicli "github.com/tendermint/abci/client" - abciserver "github.com/tendermint/abci/server" - "github.com/tendermint/abci/types" + "github.com/tendermint/iavl" cmn "github.com/tendermint/tmlibs/common" "github.com/tendermint/tmlibs/log" + + abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/example/code" + abciserver "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) func testDummy(t *testing.T, app types.Application, tx []byte, key, value string) { @@ -27,7 +30,7 @@ func testDummy(t *testing.T, app types.Application, tx []byte, key, value string Path: "/store", Data: []byte(key), }) - require.Equal(t, types.CodeTypeOK, resQuery.Code) + require.Equal(t, code.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine @@ -36,7 +39,7 @@ func testDummy(t *testing.T, app types.Application, tx []byte, key, value string Data: []byte(key), Prove: true, }) - require.EqualValues(t, types.CodeTypeOK, resQuery.Code) + require.EqualValues(t, code.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) proof, err := iavl.ReadKeyExistsProof(resQuery.Proof) require.Nil(t, err) @@ -295,7 +298,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) Data: []byte(key), }) require.Nil(t, err) - require.Equal(t, types.CodeTypeOK, resQuery.Code) + require.Equal(t, code.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine @@ -305,7 +308,7 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) Prove: true, }) require.Nil(t, err) - require.Equal(t, types.CodeTypeOK, resQuery.Code) + require.Equal(t, code.CodeTypeOK, resQuery.Code) require.Equal(t, value, string(resQuery.Value)) proof, err := iavl.ReadKeyExistsProof(resQuery.Proof) require.Nil(t, err) diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 51da8b30f..1d72bea14 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -97,7 +97,7 @@ func (app *PersistentDummyApplication) Commit() types.ResponseCommit { } app.logger.Info("Commit block", "height", height, "root", appHash) - return types.ResponseCommit{Code: types.CodeTypeOK, Data: appHash} + return types.ResponseCommit{Code: code.CodeTypeOK, Data: appHash} } func (app *PersistentDummyApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { @@ -217,5 +217,5 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types // we only update the changes array if we successfully updated the tree app.changes = append(app.changes, v) - return types.ResponseDeliverTx{Code: types.CodeTypeOK} + return types.ResponseDeliverTx{Code: code.CodeTypeOK} } diff --git a/example/example_test.go b/example/example_test.go index 7fd3bb520..dfa38a398 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -11,12 +11,14 @@ import ( "golang.org/x/net/context" + cmn "github.com/tendermint/tmlibs/common" + "github.com/tendermint/tmlibs/log" + abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/example/dummy" abciserver "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - cmn "github.com/tendermint/tmlibs/common" - "github.com/tendermint/tmlibs/log" ) func TestDummy(t *testing.T) { @@ -60,7 +62,7 @@ func testStream(t *testing.T, app types.Application) { switch r := res.Value.(type) { case *types.Response_DeliverTx: counter++ - if r.DeliverTx.Code != types.CodeTypeOK { + if r.DeliverTx.Code != code.CodeTypeOK { t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code) } if counter > numDeliverTxs { @@ -135,7 +137,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { t.Fatalf("Error in GRPC DeliverTx: %v", err.Error()) } counter++ - if response.Code != types.CodeTypeOK { + if response.Code != code.CodeTypeOK { t.Error("DeliverTx failed with ret_code", response.Code) } if counter > numDeliverTxs { From 10031f57d5ae773f5d2013e94f03d9c35a785b1f Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 17:20:36 -0500 Subject: [PATCH 56/80] fix grpc version; add log_level and some logging --- client/grpc_client.go | 2 ++ cmd/abci-cli/abci-cli.go | 66 ++++++++++++++++++++++------------------ glide.lock | 20 ++++++------ glide.yaml | 5 ++- server/grpc_server.go | 1 + tests/test_app/test.sh | 5 +++ tests/test_cli/test.sh | 2 +- 7 files changed, 60 insertions(+), 41 deletions(-) diff --git a/client/grpc_client.go b/client/grpc_client.go index 0afadc726..308a9e139 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -60,6 +60,7 @@ RETRY_LOOP: continue RETRY_LOOP } + cli.Logger.Info("Dialed server. Waiting for echo.", "addr", cli.addr) client := types.NewABCIApplicationClient(conn) ENSURE_CONNECTED: @@ -68,6 +69,7 @@ RETRY_LOOP: if err == nil { break ENSURE_CONNECTED } + cli.Logger.Info("Echo failed", "err", err) time.Sleep(time.Second * echoRetryIntervalSeconds) } diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index cc60a4bc3..25786b377 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -10,46 +10,32 @@ import ( "os/exec" "strings" + "github.com/spf13/cobra" + + cmn "github.com/tendermint/tmlibs/common" + "github.com/tendermint/tmlibs/log" + abcicli "github.com/tendermint/abci/client" "github.com/tendermint/abci/example/counter" "github.com/tendermint/abci/example/dummy" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" "github.com/tendermint/abci/version" - cmn "github.com/tendermint/tmlibs/common" - "github.com/tendermint/tmlibs/log" - - "github.com/spf13/cobra" ) -// Structure for data passed to print response. -type response struct { - // generic abci response - Data []byte - Code uint32 - Log string - - Query *queryResponse -} - -type queryResponse struct { - Key []byte - Value []byte - Height uint64 - Proof []byte -} - // client is a global variable so it can be reused by the console -var client abcicli.Client - -var logger log.Logger +var ( + client abcicli.Client + logger log.Logger +) // flags var ( // global - address string - abci string - verbose bool + address string + abci string + verbose bool // for the println output + logLevel string // for the logger // query path string @@ -79,7 +65,11 @@ var RootCmd = &cobra.Command{ } if logger == nil { - logger = log.NewFilter(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), log.AllowError()) + allowLevel, err := log.AllowLevel(logLevel) + if err != nil { + return err + } + logger = log.NewFilter(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), allowLevel) } if client == nil { var err error @@ -96,6 +86,23 @@ var RootCmd = &cobra.Command{ }, } +// Structure for data passed to print response. +type response struct { + // generic abci response + Data []byte + Code uint32 + Log string + + Query *queryResponse +} + +type queryResponse struct { + Key []byte + Value []byte + Height uint64 + Proof []byte +} + func Execute() error { addGlobalFlags() addCommands() @@ -103,9 +110,10 @@ func Execute() error { } func addGlobalFlags() { - RootCmd.PersistentFlags().StringVarP(&address, "address", "", "tcp://127.0.0.1:46658", "Address of application socket") + RootCmd.PersistentFlags().StringVarP(&address, "address", "", "tcp://0.0.0.0:46658", "Address of application socket") RootCmd.PersistentFlags().StringVarP(&abci, "abci", "", "socket", "Either socket or grpc") RootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Print the command and results as if it were a console session") + RootCmd.PersistentFlags().StringVarP(&logLevel, "log_level", "", "debug", "Set the logger level") } func addQueryFlags() { diff --git a/glide.lock b/glide.lock index d52acc7b5..f96fd1c08 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ -hash: 971ad090f3190ffd759deecf118a0eaefe7eceb4b1a8057800e332712fc1a7c2 -updated: 2017-11-30T15:29:31.740172292-05:00 +hash: 6cb2c869c8ce7d9e43b1e8930b9b1bc974ebb3d36d4b704fc78b77efba956a13 +updated: 2017-11-30T17:08:29.176515576-05:00 imports: - name: github.com/btcsuite/btcd - version: 8cea3866d0f7fb12d567a20744942c0d078c7d15 + version: 2e60448ffcc6bf78332d1fe590260095f554dd78 subpackages: - btcec - name: github.com/go-kit/kit @@ -44,7 +44,7 @@ imports: - name: github.com/kr/logfmt version: b84e30acd515aadc4b783ad4ff83aff3299bdfe0 - name: github.com/pkg/errors - version: 645ef00459ed84a119197bfb8d8205042c6df63d + version: f15c970de5b76fac0b59abb32d62c17cc7bed265 - name: github.com/spf13/cobra version: 7b2c5ac9fc04fc5efafb60700713d4fa609b777b - name: github.com/spf13/pflag @@ -72,7 +72,7 @@ imports: - name: github.com/tendermint/go-crypto version: b4f04f196cd719660e43b91202cd60d9a95b1837 - name: github.com/tendermint/go-wire - version: 3f073b1a9c841d9b88d03ca8181f61278188adca + version: 5ab49b4c6ad674da6b81442911cf713ef0afb544 subpackages: - data - name: github.com/tendermint/iavl @@ -85,7 +85,7 @@ imports: - log - process - name: golang.org/x/crypto - version: 9f005a07e0d31d45e6656d241bb5c0f2efd4bc94 + version: 94eea52f7b742c7cbe0b03b22f0c4c8631ece122 subpackages: - nacl/secretbox - openpgp/armor @@ -94,7 +94,7 @@ imports: - ripemd160 - salsa20/salsa - name: golang.org/x/net - version: 9dfe39835686865bff950a07b394c12a98ddc811 + version: a8b9294777976932365dabb6640cf1468d95c70f subpackages: - context - http2 @@ -104,18 +104,18 @@ imports: - lex/httplex - trace - name: golang.org/x/text - version: 88f656faf3f37f690df1a32515b479415e1a6769 + version: 75cc3cad82b5f47d3fb229ddda8c5167da14f294 subpackages: - secure/bidirule - transform - unicode/bidi - unicode/norm - name: google.golang.org/genproto - version: 891aceb7c239e72692819142dfca057bdcbfcb96 + version: 7f0da29060c682909f650ad8ed4e515bd74fa12a subpackages: - googleapis/rpc/status - name: google.golang.org/grpc - version: f7bf885db0b7479a537ec317c6e48ce53145f3db + version: 401e0e00e4bb830a10496d64cd95e068c5bf50de subpackages: - balancer - codes diff --git a/glide.yaml b/glide.yaml index aeb6b674f..88f49dde4 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,13 +1,15 @@ package: github.com/tendermint/abci import: - package: github.com/gogo/protobuf + version: v0.5 subpackages: - proto - package: github.com/spf13/cobra + version: v0.0.1 - package: github.com/tendermint/go-crypto version: develop - package: github.com/tendermint/go-wire - version: data-bytes-marshal-unmarshal + version: develop subpackages: - data - package: github.com/tendermint/iavl @@ -23,6 +25,7 @@ import: subpackages: - context - package: google.golang.org/grpc + version: v1.7.3 testImport: - package: github.com/stretchr/testify subpackages: diff --git a/server/grpc_server.go b/server/grpc_server.go index 077f0e525..e7dad15cf 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -42,6 +42,7 @@ func (s *GRPCServer) OnStart() error { if err != nil { return err } + s.Logger.Info("Listening", "proto", s.proto, "addr", s.addr) s.listener = ln s.server = grpc.NewServer() types.RegisterABCIApplicationServer(s.server, s.app) diff --git a/tests/test_app/test.sh b/tests/test_app/test.sh index 5b523fefe..230c94163 100755 --- a/tests/test_app/test.sh +++ b/tests/test_app/test.sh @@ -11,11 +11,16 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" # Change into that dir because we expect that. cd "$DIR" +echo "RUN COUNTER OVER SOCKET" # test golang counter ABCI_APP="counter" go run ./*.go +echo "----------------------" + +echo "RUN COUNTER OVER GRPC" # test golang counter via grpc ABCI_APP="counter --abci=grpc" ABCI="grpc" go run ./*.go +echo "----------------------" # test nodejs counter # TODO: fix node app diff --git a/tests/test_cli/test.sh b/tests/test_cli/test.sh index f6259148d..ed00b9d72 100644 --- a/tests/test_cli/test.sh +++ b/tests/test_cli/test.sh @@ -17,7 +17,7 @@ function testExample() { echo "Example $N: $APP" $APP &> /dev/null & sleep 2 - abci-cli --verbose batch < "$INPUT" > "${INPUT}.out.new" + abci-cli --log_level=error --verbose batch < "$INPUT" > "${INPUT}.out.new" killall "$3" pre=$(shasum < "${INPUT}.out") From f00a19eaad06917edd719e935d81780d0f9c2ed9 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 17:36:16 -0500 Subject: [PATCH 57/80] fix tutorial output to remove code msg --- tests/test_cli/ex2.abci.out | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_cli/ex2.abci.out b/tests/test_cli/ex2.abci.out index 40e10f83e..741dd7b72 100644 --- a/tests/test_cli/ex2.abci.out +++ b/tests/test_cli/ex2.abci.out @@ -11,14 +11,14 @@ -> code: OK > check_tx 0x00 --> code: BadNonce +-> code: 2 -> log: Invalid nonce. Expected >= 1, got 0 > deliver_tx 0x01 -> code: OK > deliver_tx 0x04 --> code: BadNonce +-> code: 2 -> log: Invalid nonce. Expected 2, got 4 > info From e3f6666ecc83aa5bbc22cb6d19b1fcb9455b5440 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 17:48:05 -0500 Subject: [PATCH 58/80] update changelog; add rudis script for safe keeping --- .gitignore | 1 + CHANGELOG.md | 9 +++-- example/example.go | 2 +- types/protoreplace/protoreplace.go | 55 ++++++++++++++++++++++++++++++ types/result.go | 2 -- 5 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 types/protoreplace/protoreplace.go diff --git a/.gitignore b/.gitignore index 62f28681c..ea27eda1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ vendor .glide +types/types.pb.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6937eaeb4..28dd29473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,15 +4,20 @@ BREAKING CHANGES: - [client] all XxxSync methods now return (ResponseXxx, error) - - [types] Application: all methods now take RequestXxx and return (ResponseXxx, error). + - [types] all methods on Application interface now take RequestXxx and return (ResponseXxx, error). - Except `CheckTx`/`DeliverTx`, which takes a `tx []byte` argument. - Except `Commit`, which takes no arguments. - - [types] removed Result + - [types] removed Result and ResultQuery + - [types] removed CodeType - only `0 == OK` is defined here, everything else is left to convention at the application level + - [types] switched to using `gogo/protobuf` for code generation + - [types] use `customtype` feature of `gogo/protobuf` to replace `[]byte` with `data.Bytes` in all generated types :) + - this eliminates the need for additional types like ResultQuery FEATURES: - [types] added Tags field to ResponseDeliverTx - [types] added Gas and Fee fields to ResponseCheckTx - [dummy] DeliverTx returns tags + - [abci-cli] added `log_level` flag to control the logger ## 0.7.1 (November 14, 2017) diff --git a/example/example.go b/example/example.go index 5a2b24494..ee491c1b5 100644 --- a/example/example.go +++ b/example/example.go @@ -1,3 +1,3 @@ package example -// so go get doesnt complain +// so the go tool doesn't return errors about no buildable go files ... diff --git a/types/protoreplace/protoreplace.go b/types/protoreplace/protoreplace.go new file mode 100644 index 000000000..c859098f8 --- /dev/null +++ b/types/protoreplace/protoreplace.go @@ -0,0 +1,55 @@ +package main + +// +build ignore + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "os/exec" + "regexp" + "strings" +) + +// This script replaces most `[]byte` with `data.Bytes` in a `.pb.go` file. +// It was written before we realized we could use `gogo/protobuf` to achieve +// this more natively. So it's here for safe keeping in case we ever need to +// abandon `gogo/protobuf`. + +func main() { + bytePattern := regexp.MustCompile("[[][]]byte") + const oldPath = "types/types.pb.go" + const tmpPath = "types/types.pb.new" + content, err := ioutil.ReadFile(oldPath) + if err != nil { + panic("cannot read " + oldPath) + os.Exit(1) + } + lines := bytes.Split(content, []byte("\n")) + outFile, _ := os.Create(tmpPath) + wroteImport := false + for _, line_bytes := range lines { + line := string(line_bytes) + gotPackageLine := strings.HasPrefix(line, "package ") + writeImportTime := strings.HasPrefix(line, "import ") + containsDescriptor := strings.Contains(line, "Descriptor") + containsByteArray := strings.Contains(line, "[]byte") + if containsByteArray && !containsDescriptor { + line = string(bytePattern.ReplaceAll([]byte(line), []byte("data.Bytes"))) + } + if writeImportTime && !wroteImport { + wroteImport = true + fmt.Fprintf(outFile, "import \"github.com/tendermint/go-wire/data\"\n") + + } + if gotPackageLine { + fmt.Fprintf(outFile, "%s\n", "//nolint: gas") + } + fmt.Fprintf(outFile, "%s\n", line) + } + outFile.Close() + os.Remove(oldPath) + os.Rename(tmpPath, oldPath) + exec.Command("goimports", "-w", oldPath) +} diff --git a/types/result.go b/types/result.go index 3344b27c0..3f3fdd827 100644 --- a/types/result.go +++ b/types/result.go @@ -4,8 +4,6 @@ import ( "fmt" ) -// type CodeType uint32 - const ( CodeTypeOK uint32 = 0 ) From ed393f9934c0c78d098b4935814582370a1efd4f Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 17:49:53 -0500 Subject: [PATCH 59/80] abci-cli: print OK if code is 0 --- CHANGELOG.md | 1 + cmd/abci-cli/abci-cli.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28dd29473..8dba7032b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ BREAKING CHANGES: - [types] switched to using `gogo/protobuf` for code generation - [types] use `customtype` feature of `gogo/protobuf` to replace `[]byte` with `data.Bytes` in all generated types :) - this eliminates the need for additional types like ResultQuery + - [abci-cli] codes are printed as their number instead of a message, except for `code == 0`, which is still printed as `OK` FEATURES: - [types] added Tags field to ResponseDeliverTx diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 25786b377..ef8b90635 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -516,7 +516,12 @@ func printResponse(cmd *cobra.Command, args []string, rsp response) { } // Always print the status code. - fmt.Printf("-> code: %d\n", rsp.Code) + if rsp.Code == types.CodeTypeOK { + fmt.Printf("-> code: OK\n") + } else { + fmt.Printf("-> code: %d\n", rsp.Code) + + } if len(rsp.Data) != 0 { // Do no print this line when using the commit command From 5d2838ebab9d81e6c888922ab11fb4c894e8b827 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 30 Nov 2017 20:17:06 -0500 Subject: [PATCH 60/80] fix from review --- client/grpc_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/grpc_client.go b/client/grpc_client.go index 308a9e139..9328fa326 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -69,7 +69,7 @@ RETRY_LOOP: if err == nil { break ENSURE_CONNECTED } - cli.Logger.Info("Echo failed", "err", err) + cli.Logger.Error("Echo failed", "err", err) time.Sleep(time.Second * echoRetryIntervalSeconds) } From b59fe60e65e5f8e51b20c4bba4b9b564001d478e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 1 Dec 2017 00:35:14 -0500 Subject: [PATCH 61/80] abci-cli: prefix flag variables with flag --- cmd/abci-cli/abci-cli.go | 68 ++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index ef8b90635..e7fae52ee 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -32,23 +32,23 @@ var ( // flags var ( // global - address string - abci string - verbose bool // for the println output - logLevel string // for the logger + flagAddress string + flagAbci string + flagVerbose bool // for the println output + flagLogLevel string // for the logger // query - path string - height int - prove bool + flagPath string + flagHeight int + flagProve bool // counter - addrC string - serial bool + flagAddrC string + flagSerial bool // dummy - addrD string - persist string + flagAddrD string + flagPersist string ) var RootCmd = &cobra.Command{ @@ -65,7 +65,7 @@ var RootCmd = &cobra.Command{ } if logger == nil { - allowLevel, err := log.AllowLevel(logLevel) + allowLevel, err := log.AllowLevel(flagLogLevel) if err != nil { return err } @@ -73,7 +73,7 @@ var RootCmd = &cobra.Command{ } if client == nil { var err error - client, err = abcicli.NewClient(address, abci, false) + client, err = abcicli.NewClient(flagAddress, flagAbci, false) if err != nil { return err } @@ -99,7 +99,7 @@ type response struct { type queryResponse struct { Key []byte Value []byte - Height uint64 + Height int64 Proof []byte } @@ -110,26 +110,26 @@ func Execute() error { } func addGlobalFlags() { - RootCmd.PersistentFlags().StringVarP(&address, "address", "", "tcp://0.0.0.0:46658", "Address of application socket") - RootCmd.PersistentFlags().StringVarP(&abci, "abci", "", "socket", "Either socket or grpc") - RootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Print the command and results as if it were a console session") - RootCmd.PersistentFlags().StringVarP(&logLevel, "log_level", "", "debug", "Set the logger level") + RootCmd.PersistentFlags().StringVarP(&flagAddress, "address", "", "tcp://0.0.0.0:46658", "Address of application socket") + RootCmd.PersistentFlags().StringVarP(&flagAbci, "abci", "", "socket", "Either socket or grpc") + RootCmd.PersistentFlags().BoolVarP(&flagVerbose, "verbose", "v", false, "Print the command and results as if it were a console session") + RootCmd.PersistentFlags().StringVarP(&flagLogLevel, "log_level", "", "debug", "Set the logger level") } func addQueryFlags() { - queryCmd.PersistentFlags().StringVarP(&path, "path", "", "/store", "Path to prefix query with") - queryCmd.PersistentFlags().IntVarP(&height, "height", "", 0, "Height to query the blockchain at") - queryCmd.PersistentFlags().BoolVarP(&prove, "prove", "", false, "Whether or not to return a merkle proof of the query result") + queryCmd.PersistentFlags().StringVarP(&flagPath, "path", "", "/store", "Path to prefix query with") + queryCmd.PersistentFlags().IntVarP(&flagHeight, "height", "", 0, "Height to query the blockchain at") + queryCmd.PersistentFlags().BoolVarP(&flagProve, "prove", "", false, "Whether or not to return a merkle proof of the query result") } func addCounterFlags() { - counterCmd.PersistentFlags().StringVarP(&addrC, "addr", "", "tcp://0.0.0.0:46658", "Listen address") - counterCmd.PersistentFlags().BoolVarP(&serial, "serial", "", false, "Enforce incrementing (serial) transactions") + counterCmd.PersistentFlags().StringVarP(&flagAddrC, "addr", "", "tcp://0.0.0.0:46658", "Listen address") + counterCmd.PersistentFlags().BoolVarP(&flagSerial, "serial", "", false, "Enforce incrementing (serial) transactions") } func addDummyFlags() { - dummyCmd.PersistentFlags().StringVarP(&addrD, "addr", "", "tcp://0.0.0.0:46658", "Listen address") - dummyCmd.PersistentFlags().StringVarP(&persist, "persist", "", "", "Directory to use for a database") + dummyCmd.PersistentFlags().StringVarP(&flagAddrD, "addr", "", "tcp://0.0.0.0:46658", "Listen address") + dummyCmd.PersistentFlags().StringVarP(&flagPersist, "persist", "", "", "Directory to use for a database") } func addCommands() { RootCmd.AddCommand(batchCmd) @@ -433,9 +433,9 @@ func cmdQuery(cmd *cobra.Command, args []string) error { resQuery, err := client.QuerySync(types.RequestQuery{ Data: queryBytes, - Path: path, - Height: uint64(height), - Prove: prove, + Path: flagPath, + Height: int64(flagHeight), + Prove: flagProve, }) if err != nil { return err @@ -455,12 +455,12 @@ func cmdQuery(cmd *cobra.Command, args []string) error { func cmdCounter(cmd *cobra.Command, args []string) error { - app := counter.NewCounterApplication(serial) + app := counter.NewCounterApplication(flagSerial) logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) // Start the listener - srv, err := server.NewServer(addrC, abci, app) + srv, err := server.NewServer(flagAddrC, flagAbci, app) if err != nil { return err } @@ -482,15 +482,15 @@ func cmdDummy(cmd *cobra.Command, args []string) error { // Create the application - in memory or persisted to disk var app types.Application - if persist == "" { + if flagPersist == "" { app = dummy.NewDummyApplication() } else { - app = dummy.NewPersistentDummyApplication(persist) + app = dummy.NewPersistentDummyApplication(flagPersist) app.(*dummy.PersistentDummyApplication).SetLogger(logger.With("module", "dummy")) } // Start the listener - srv, err := server.NewServer(addrD, abci, app) + srv, err := server.NewServer(flagAddrD, flagAbci, app) if err != nil { return err } @@ -511,7 +511,7 @@ func cmdDummy(cmd *cobra.Command, args []string) error { func printResponse(cmd *cobra.Command, args []string, rsp response) { - if verbose { + if flagVerbose { fmt.Println(">", cmd.Use, strings.Join(args, " ")) } From 0ad7dea71fb9cf188e057a41e78175ae765fef04 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 1 Dec 2017 00:41:07 -0500 Subject: [PATCH 62/80] uint64 -> int64 --- CHANGELOG.md | 2 + Makefile | 8 +- example/dummy/dummy_test.go | 8 +- example/dummy/helpers.go | 2 +- example/dummy/persistent_dummy.go | 9 +- types/types.pb.go | 234 +++++++++++++++--------------- types/types.proto | 24 +-- types/validators.go | 5 +- 8 files changed, 148 insertions(+), 144 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dba7032b..b1449a436 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ BREAKING CHANGES: - [types] switched to using `gogo/protobuf` for code generation - [types] use `customtype` feature of `gogo/protobuf` to replace `[]byte` with `data.Bytes` in all generated types :) - this eliminates the need for additional types like ResultQuery + - [types] `pubKey` -> `pub_key` + - [types] `uint64` -> `int64` - [abci-cli] codes are printed as their number instead of a message, except for `code == 0`, which is still printed as `OK` FEATURES: diff --git a/Makefile b/Makefile index e6a7af362..ebe8f3a9a 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,8 @@ GOTOOLS = \ github.com/gogo/protobuf/protoc-gen-gogo \ github.com/gogo/protobuf/gogoproto +INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf + all: install test PACKAGES=$(shell go list ./... | grep -v '/vendor/') @@ -24,7 +26,7 @@ protoc: ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## ldconfig (may require sudo) ## https://stackoverflow.com/a/25518702 - protoc -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf --gogo_out=plugins=grpc:. types/*.proto + protoc $(INCLUDE) --gogo_out=plugins=grpc:. types/*.proto install: @ go install ./cmd/... @@ -67,11 +69,11 @@ get_vendor_deps: ensure_tools @ glide install metalinter: - protoc --lint_out=. types/*.proto + protoc $(INCLUDE) --lint_out=. types/*.proto gometalinter --vendor --deadline=600s --enable-all --disable=lll ./... metalinter_test: - # protoc --lint_out=. types/*.proto + protoc $(INCLUDE) --lint_out=. types/*.proto gometalinter --vendor --deadline=600s --disable-all \ --enable=maligned \ --enable=deadcode \ diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 738da6e85..ec4d2e33d 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -82,7 +82,7 @@ func TestPersistentDummyInfo(t *testing.T) { } dummy := NewPersistentDummyApplication(dir) InitDummy(dummy) - height := uint64(0) + height := int64(0) resInfo := dummy.Info(types.RequestInfo{}) if resInfo.LastBlockHeight != height { @@ -90,10 +90,10 @@ func TestPersistentDummyInfo(t *testing.T) { } // make and apply block - height = uint64(1) + height = int64(1) hash := []byte("foo") header := &types.Header{ - Height: uint64(height), + Height: int64(height), } dummy.BeginBlock(types.RequestBeginBlock{hash, header}) dummy.EndBlock(types.RequestEndBlock{header.Height}) @@ -173,7 +173,7 @@ func TestValSetChanges(t *testing.T) { func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff []*types.Validator, txs ...[]byte) { // make and apply block - height := uint64(heightInt) + height := int64(heightInt) hash := []byte("foo") header := &types.Header{ Height: height, diff --git a/example/dummy/helpers.go b/example/dummy/helpers.go index 55c464de0..d6b4338c6 100644 --- a/example/dummy/helpers.go +++ b/example/dummy/helpers.go @@ -11,7 +11,7 @@ import ( func RandVal(i int) *types.Validator { pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(cmn.Fmt("test%d", i))).PubKey().Bytes() power := cmn.RandUint16() + 1 - return &types.Validator{pubkey, uint64(power)} + return &types.Validator{pubkey, int64(power)} } // RandVals returns a list of cnt validators for initializing diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 1d72bea14..6f389c507 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -55,7 +55,8 @@ func (app *PersistentDummyApplication) SetLogger(l log.Logger) { func (app *PersistentDummyApplication) Info(req types.RequestInfo) types.ResponseInfo { res := app.app.Info(req) - res.LastBlockHeight = app.app.state.LatestVersion() + var latestVersion uint64 = app.app.state.LatestVersion() // TODO: change to int64 + res.LastBlockHeight = int64(latestVersion) res.LastBlockAppHash = app.app.state.Hash() return res } @@ -145,7 +146,7 @@ func (app *PersistentDummyApplication) Validators() (validators []*types.Validat return } -func MakeValSetChangeTx(pubkey []byte, power uint64) []byte { +func MakeValSetChangeTx(pubkey []byte, power int64) []byte { return []byte(cmn.Fmt("val:%X/%d", pubkey, power)) } @@ -181,7 +182,7 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Response } // decode the power - power, err := strconv.Atoi(powerS) + power, err := strconv.ParseInt(powerS, 10, 64) if err != nil { return types.ResponseDeliverTx{ Code: code.CodeTypeEncodingError, @@ -189,7 +190,7 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Response } // update - return app.updateValidator(&types.Validator{pubkey, uint64(power)}) + return app.updateValidator(&types.Validator{pubkey, power}) } // add, update, or remove a validator diff --git a/types/types.pb.go b/types/types.pb.go index 61a56cacf..094f3012f 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -582,7 +582,7 @@ func (m *RequestCheckTx) GetTx() []byte { type RequestQuery struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` } @@ -605,7 +605,7 @@ func (m *RequestQuery) GetPath() string { return "" } -func (m *RequestQuery) GetHeight() uint64 { +func (m *RequestQuery) GetHeight() int64 { if m != nil { return m.Height } @@ -668,7 +668,7 @@ func (m *RequestBeginBlock) GetHeader() *Header { } type RequestEndBlock struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` } func (m *RequestEndBlock) Reset() { *m = RequestEndBlock{} } @@ -676,7 +676,7 @@ func (m *RequestEndBlock) String() string { return proto.CompactTextS func (*RequestEndBlock) ProtoMessage() {} func (*RequestEndBlock) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{11} } -func (m *RequestEndBlock) GetHeight() uint64 { +func (m *RequestEndBlock) GetHeight() int64 { if m != nil { return m.Height } @@ -1157,7 +1157,7 @@ func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptorTypes, type ResponseInfo struct { Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - LastBlockHeight uint64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` + LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` LastBlockAppHash []byte `protobuf:"bytes,4,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` } @@ -1180,7 +1180,7 @@ func (m *ResponseInfo) GetVersion() string { return "" } -func (m *ResponseInfo) GetLastBlockHeight() uint64 { +func (m *ResponseInfo) GetLastBlockHeight() int64 { if m != nil { return m.LastBlockHeight } @@ -1247,8 +1247,8 @@ type ResponseCheckTx struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,2,opt,name=data,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"data"` Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Gas uint64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` - Fee uint64 `protobuf:"varint,5,opt,name=fee,proto3" json:"fee,omitempty"` + Gas int64 `protobuf:"varint,4,opt,name=gas,proto3" json:"gas,omitempty"` + Fee int64 `protobuf:"varint,5,opt,name=fee,proto3" json:"fee,omitempty"` } func (m *ResponseCheckTx) Reset() { *m = ResponseCheckTx{} } @@ -1270,14 +1270,14 @@ func (m *ResponseCheckTx) GetLog() string { return "" } -func (m *ResponseCheckTx) GetGas() uint64 { +func (m *ResponseCheckTx) GetGas() int64 { if m != nil { return m.Gas } return 0 } -func (m *ResponseCheckTx) GetFee() uint64 { +func (m *ResponseCheckTx) GetFee() int64 { if m != nil { return m.Fee } @@ -1290,7 +1290,7 @@ type ResponseQuery struct { Key github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,3,opt,name=key,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"key"` Value github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,4,opt,name=value,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"value"` Proof github_com_tendermint_go_wire_data.Bytes `protobuf:"bytes,5,opt,name=proof,proto3,customtype=github.com/tendermint/go-wire/data.Bytes" json:"proof"` - Height uint64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` + Height int64 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` Log string `protobuf:"bytes,7,opt,name=log,proto3" json:"log,omitempty"` } @@ -1313,7 +1313,7 @@ func (m *ResponseQuery) GetIndex() int64 { return 0 } -func (m *ResponseQuery) GetHeight() uint64 { +func (m *ResponseQuery) GetHeight() int64 { if m != nil { return m.Height } @@ -1386,9 +1386,9 @@ func (m *ResponseEndBlock) GetDiffs() []*Validator { type Header struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Time uint64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` - NumTxs uint64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Time int64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` + NumTxs int64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` LastBlockId *BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId" json:"last_block_id,omitempty"` LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` @@ -1408,21 +1408,21 @@ func (m *Header) GetChainId() string { return "" } -func (m *Header) GetHeight() uint64 { +func (m *Header) GetHeight() int64 { if m != nil { return m.Height } return 0 } -func (m *Header) GetTime() uint64 { +func (m *Header) GetTime() int64 { if m != nil { return m.Time } return 0 } -func (m *Header) GetNumTxs() uint64 { +func (m *Header) GetNumTxs() int64 { if m != nil { return m.NumTxs } @@ -1489,7 +1489,7 @@ func (m *BlockID) GetParts() *PartSetHeader { } type PartSetHeader struct { - Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` } @@ -1498,7 +1498,7 @@ func (m *PartSetHeader) String() string { return proto.CompactTextStr func (*PartSetHeader) ProtoMessage() {} func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{27} } -func (m *PartSetHeader) GetTotal() uint64 { +func (m *PartSetHeader) GetTotal() int64 { if m != nil { return m.Total } @@ -1513,8 +1513,8 @@ func (m *PartSetHeader) GetHash() []byte { } type Validator struct { - PubKey []byte `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"` - Power uint64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` + PubKey []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` } func (m *Validator) Reset() { *m = Validator{} } @@ -1529,7 +1529,7 @@ func (m *Validator) GetPubKey() []byte { return nil } -func (m *Validator) GetPower() uint64 { +func (m *Validator) GetPower() int64 { if m != nil { return m.Power } @@ -2015,98 +2015,98 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 1485 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x8e, 0x13, 0x47, - 0x10, 0x5e, 0xdb, 0xe3, 0xbf, 0xf2, 0xfe, 0x98, 0x66, 0x03, 0xc6, 0x1c, 0x80, 0x91, 0x08, 0xbb, - 0x04, 0xd6, 0x64, 0x11, 0x11, 0x1b, 0xa2, 0x48, 0x6b, 0x16, 0x62, 0x0b, 0x89, 0x90, 0x61, 0xc5, - 0xd5, 0x1a, 0x7b, 0xda, 0xf6, 0x08, 0x7b, 0x66, 0x98, 0x69, 0x2f, 0x5e, 0x29, 0x8f, 0xc0, 0x3d, - 0xe7, 0xe4, 0x12, 0x29, 0x2f, 0x90, 0x37, 0x88, 0xf2, 0x0c, 0x39, 0xf0, 0x2c, 0x51, 0x55, 0xf7, - 0xfc, 0xee, 0x0c, 0x07, 0x0e, 0x5c, 0x56, 0x5d, 0x5d, 0xf5, 0xb5, 0xab, 0x7a, 0xaa, 0xbf, 0xaa, - 0x5a, 0xb8, 0x24, 0xce, 0x3d, 0x1e, 0xf4, 0xe8, 0xef, 0x81, 0xe7, 0xbb, 0xc2, 0x65, 0x55, 0x12, - 0xba, 0xf7, 0x67, 0xb6, 0x98, 0xaf, 0xc6, 0x07, 0x13, 0x77, 0xd9, 0x9b, 0xb9, 0x33, 0xb7, 0x47, - 0xda, 0xf1, 0x6a, 0x4a, 0x12, 0x09, 0xb4, 0x92, 0x28, 0xfd, 0x1f, 0x0d, 0xea, 0x06, 0x7f, 0xb7, - 0xe2, 0x81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 0x63, 0x8f, 0xa0, 0xa6, 0xc8, - 0x30, 0x77, 0xee, 0xec, 0xe6, 0xf7, 0x79, 0x18, 0x64, 0x3c, 0x3e, 0x14, 0x0d, 0x94, 0xdd, 0xc2, - 0x0e, 0x8e, 0x1d, 0x03, 0x24, 0x06, 0x87, 0xc2, 0xb1, 0xb2, 0x5b, 0xdc, 0xc7, 0xb1, 0x27, 0xd0, - 0x88, 0x67, 0x85, 0xfc, 0xe1, 0xb2, 0x5b, 0xd4, 0xca, 0x8d, 0x6b, 0xf4, 0x0f, 0x8b, 0x87, 0xff, - 0x07, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xbb, 0x93, 0x98, 0xfb, 0x10, 0x00, 0x00, + // 1488 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x8e, 0x13, 0xc7, + 0x13, 0x5f, 0x7f, 0xdb, 0xe5, 0xfd, 0x30, 0xcd, 0xfe, 0x61, 0x30, 0x07, 0x60, 0x24, 0xfe, 0xec, + 0x12, 0x58, 0x93, 0x45, 0x44, 0x2c, 0x44, 0x91, 0xd6, 0x2c, 0xc4, 0x16, 0x12, 0x21, 0xc3, 0x8a, + 0xab, 0x35, 0xf6, 0xb4, 0xed, 0x11, 0xf6, 0xcc, 0x30, 0xd3, 0x5e, 0xbc, 0x52, 0x1e, 0x81, 0x7b, + 0xce, 0xc9, 0x25, 0x52, 0x5e, 0x20, 0x6f, 0x10, 0xe5, 0x19, 0x72, 0xe0, 0x59, 0xa2, 0xaa, 0xee, + 0xf9, 0xdc, 0x19, 0x0e, 0x1c, 0xb8, 0xac, 0xba, 0xba, 0xea, 0xd7, 0xae, 0xea, 0xa9, 0xfe, 0x55, + 0xd5, 0xc2, 0x25, 0x71, 0xee, 0xf1, 0xa0, 0x47, 0x7f, 0x0f, 0x3c, 0xdf, 0x15, 0x2e, 0xab, 0x91, + 0xd0, 0xb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 0xec, 0xd3, 0x10, 0x1f, + 0x57, 0xb8, 0xa2, 0xb9, 0xb1, 0x5b, 0xd8, 0xac, 0xb1, 0xc7, 0xd0, 0x08, 0x8b, 0x4f, 0xfe, 0xf4, + 0xd8, 0x2d, 0xe8, 0xd7, 0xf0, 0x7a, 0x64, 0x49, 0xc8, 0x1b, 0x0a, 0xbb, 0xb9, 0x2d, 0x18, 0x7b, + 0x04, 0x75, 0xc5, 0x86, 0xb9, 0x83, 0x67, 0x37, 0xbf, 0xd1, 0xc3, 0x20, 0xe3, 0xf9, 0xa1, 0x68, + 0xa2, 0xec, 0x16, 0xb6, 0x70, 0xec, 0x18, 0x20, 0x31, 0x39, 0x14, 0xce, 0x95, 0xdd, 0xe2, 0x46, + 0x8e, 0x3d, 0x85, 0x66, 0x3c, 0x2c, 0xe4, 0x4f, 0x97, 0xdd, 0xa2, 0x5e, 0x6e, 0x5c, 0xa7, 0xff, + 0x58, 0x3c, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x34, 0x61, 0x21, 0x91, 0xfc, 0x10, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 2754a3624..d40e8885f 100644 --- a/types/types.proto +++ b/types/types.proto @@ -52,7 +52,7 @@ message RequestCheckTx{ message RequestQuery{ bytes data = 1; string path = 2; - uint64 height = 3; + int64 height = 3; bool prove = 4; } @@ -69,7 +69,7 @@ message RequestBeginBlock{ } message RequestEndBlock{ - uint64 height = 1; + int64 height = 1; } //---------------------------------------- @@ -107,7 +107,7 @@ message ResponseFlush{ message ResponseInfo { string data = 1; string version = 2; - uint64 last_block_height = 3; + int64 last_block_height = 3; bytes last_block_app_hash = 4; } @@ -126,8 +126,8 @@ message ResponseCheckTx{ uint32 code = 1; bytes data = 2 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; string log = 3; - uint64 gas = 4; - uint64 fee = 5; + int64 gas = 4; + int64 fee = 5; } message ResponseQuery{ @@ -136,7 +136,7 @@ message ResponseQuery{ bytes key = 3 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; bytes value = 4 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; bytes proof = 5 [(gogoproto.customtype) = "github.com/tendermint/go-wire/data.Bytes", (gogoproto.nullable) = false]; - uint64 height = 6; + int64 height = 6; string log = 7; } @@ -162,9 +162,9 @@ message ResponseEndBlock{ message Header { string chain_id = 1; - uint64 height = 2; - uint64 time = 3; - uint64 num_txs = 4; + int64 height = 2; + int64 time = 3; + int64 num_txs = 4; BlockID last_block_id = 5; bytes last_commit_hash = 6; bytes data_hash = 7; @@ -178,13 +178,13 @@ message BlockID { } message PartSetHeader { - uint64 total = 1; + int64 total = 1; bytes hash = 2; } message Validator { - bytes pubKey = 1; - uint64 power = 2; + bytes pub_key = 1; + int64 power = 2; } //---------------------------------------- diff --git a/types/validators.go b/types/validators.go index 95258aa23..6bbe3f847 100644 --- a/types/validators.go +++ b/types/validators.go @@ -8,8 +8,7 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) -// validators implements sort - +// Validators is a list of validators that implements the Sort interface type Validators []*Validator func (v Validators) Len() int { @@ -31,7 +30,7 @@ func (v Validators) Swap(i, j int) { type validatorPretty struct { PubKey data.Bytes `json:"pub_key"` - Power uint64 `json:"power"` + Power int64 `json:"power"` } func ValidatorsString(vs Validators) string { From b7a75ce8c31f19730e64c1485b4b2f53f038f9e7 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 1 Dec 2017 01:16:00 -0500 Subject: [PATCH 63/80] update readme --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f2546c004..0deec1817 100644 --- a/README.md +++ b/README.md @@ -102,8 +102,8 @@ Here, we describe the requests and responses as function arguments and return va * `Code (uint32)`: Response code * `Data ([]byte)`: Result bytes, if any * `Log (string)`: Debug or error message - * `Gas (uint64)`: Amount of gas consumed by transaction - * `Fee (uint64)`: Fee paid by transaction + * `Gas (int64)`: Amount of gas consumed by transaction + * `Fee (int64)`: Fee paid by transaction * __Usage__:
Validate a mempool transaction, prior to broadcasting or proposing. This message should not mutate the main state, but application developers may want to keep a separate CheckTx state that gets reset upon Commit. @@ -127,14 +127,14 @@ Here, we describe the requests and responses as function arguments and return va * `Path (string)`: Path of request, like an HTTP GET path. Can be used with or in liue of Data. * Apps MUST interpret '/store' as a query by key on the underlying store. The key SHOULD be specified in the Data field. * Apps SHOULD allow queries over specific types like '/accounts/...' or '/votes/...' - * `Height (uint64)`: The block height for which you want the query (default=0 returns data for the latest committed block). Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1 + * `Height (int64)`: The block height for which you want the query (default=0 returns data for the latest committed block). Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1 * `Prove (bool)`: Return Merkle proof with response if possible * __Returns__: * `Code (uint32)`: Response code * `Key ([]byte)`: The key of the matching data * `Value ([]byte)`: The value of the matching data * `Proof ([]byte)`: Proof for the data, if requested - * `Height (uint64)`: The block height from which data was derived. Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1 + * `Height (int64)`: The block height from which data was derived. Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1 * `Log (string)`: Debug or error message *Please note* The current implementation of go-merkle doesn't support querying proofs from past blocks, so for the present moment, any height other than 0 will return an error (recall height=0 defaults to latest block). Hopefully this will be improved soon(ish) @@ -142,7 +142,7 @@ Here, we describe the requests and responses as function arguments and return va * __Returns__: * `Data (string)`: Some arbitrary information * `Version (Version)`: Version information - * `LastBlockHeight (uint64)`: Latest block for which the app has called Commit + * `LastBlockHeight (int64)`: Latest block for which the app has called Commit * `LastBlockAppHash ([]byte)`: Latest result of Commit * __Usage__:
@@ -173,7 +173,7 @@ Here, we describe the requests and responses as function arguments and return va #### EndBlock * __Arguments__: - * `Height (uint64)`: The block height that ended + * `Height (int64)`: The block height that ended * __Returns__: * `Diffs ([]Validator)`: Changed validators with new voting powers (0 to remove) * __Usage__:
From b39e768a1af4ece98e60de2ae3ba480a4ce041d5 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 1 Dec 2017 02:50:17 -0500 Subject: [PATCH 64/80] disable metalinter on CI --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index c6904fae6..7d4545e54 100644 --- a/circle.yml +++ b/circle.yml @@ -16,7 +16,7 @@ checkout: test: override: - - cd $REPO && make get_vendor_deps && make metalinter_test && make test_integrations + - cd $REPO && make get_vendor_deps && make test_integrations post: - cd "$REPO" && bash <(curl -s https://codecov.io/bash) -f coverage.txt - cd "$REPO" && mv coverage.txt "${CIRCLE_ARTIFACTS}" From 3d3d1288d1bdd2255fd9002b00b1615deef1b0b5 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 1 Dec 2017 00:51:20 -0500 Subject: [PATCH 65/80] types: consolidate some file --- types/application.go | 52 +++++++++++++++++++++++++- types/base_app.go | 44 ---------------------- types/kvpair.go | 19 ---------- types/{validators.go => util.go} | 34 +++++++++++++---- types/{kvpair_test.go => util_test.go} | 0 5 files changed, 78 insertions(+), 71 deletions(-) delete mode 100644 types/base_app.go delete mode 100644 types/kvpair.go rename types/{validators.go => util.go} (60%) rename types/{kvpair_test.go => util_test.go} (100%) diff --git a/types/application.go b/types/application.go index bb9a0030d..f0ce18955 100644 --- a/types/application.go +++ b/types/application.go @@ -25,7 +25,57 @@ type Application interface { Commit() ResponseCommit // Commit the state and return the application Merkle root hash } -//------------------------------------ +//------------------------------------------------------- +// BaseApplication is a base form of Application + +var _ Application = (*BaseApplication)(nil) + +type BaseApplication struct { +} + +func NewBaseApplication() *BaseApplication { + return &BaseApplication{} +} + +func (BaseApplication) Info(req RequestInfo) ResponseInfo { + return ResponseInfo{} +} + +func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption { + return ResponseSetOption{} +} + +func (BaseApplication) DeliverTx(tx []byte) ResponseDeliverTx { + return ResponseDeliverTx{Code: CodeTypeOK} +} + +func (BaseApplication) CheckTx(tx []byte) ResponseCheckTx { + return ResponseCheckTx{Code: CodeTypeOK} +} + +func (BaseApplication) Commit() ResponseCommit { + return ResponseCommit{Code: CodeTypeOK} +} + +func (BaseApplication) Query(req RequestQuery) ResponseQuery { + return ResponseQuery{Code: CodeTypeOK} +} + +func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain { + return ResponseInitChain{} +} + +func (BaseApplication) BeginBlock(req RequestBeginBlock) ResponseBeginBlock { + return ResponseBeginBlock{} +} + +func (BaseApplication) EndBlock(req RequestEndBlock) ResponseEndBlock { + return ResponseEndBlock{} +} + +//------------------------------------------------------- + +var _ Application = (*GRPCApplication)(nil) // GRPCApplication is a GRPC wrapper for Application type GRPCApplication struct { diff --git a/types/base_app.go b/types/base_app.go deleted file mode 100644 index 1998e9dcb..000000000 --- a/types/base_app.go +++ /dev/null @@ -1,44 +0,0 @@ -package types - -type BaseApplication struct { -} - -func NewBaseApplication() *BaseApplication { - return &BaseApplication{} -} - -func (BaseApplication) Info(req RequestInfo) ResponseInfo { - return ResponseInfo{} -} - -func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption { - return ResponseSetOption{} -} - -func (BaseApplication) DeliverTx(tx []byte) ResponseDeliverTx { - return ResponseDeliverTx{Code: CodeTypeOK} -} - -func (BaseApplication) CheckTx(tx []byte) ResponseCheckTx { - return ResponseCheckTx{Code: CodeTypeOK} -} - -func (BaseApplication) Commit() ResponseCommit { - return ResponseCommit{Code: CodeTypeOK} -} - -func (BaseApplication) Query(req RequestQuery) ResponseQuery { - return ResponseQuery{Code: CodeTypeOK} -} - -func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain { - return ResponseInitChain{} -} - -func (BaseApplication) BeginBlock(req RequestBeginBlock) ResponseBeginBlock { - return ResponseBeginBlock{} -} - -func (BaseApplication) EndBlock(req RequestEndBlock) ResponseEndBlock { - return ResponseEndBlock{} -} diff --git a/types/kvpair.go b/types/kvpair.go deleted file mode 100644 index c7aad4407..000000000 --- a/types/kvpair.go +++ /dev/null @@ -1,19 +0,0 @@ -package types - -// KVPairInt is a helper method to build KV pair with an integer value. -func KVPairInt(key string, val int64) *KVPair { - return &KVPair{ - Key: key, - ValueInt: val, - ValueType: KVPair_INT, - } -} - -// KVPairString is a helper method to build KV pair with a string value. -func KVPairString(key, val string) *KVPair { - return &KVPair{ - Key: key, - ValueString: val, - ValueType: KVPair_STRING, - } -} diff --git a/types/validators.go b/types/util.go similarity index 60% rename from types/validators.go rename to types/util.go index 6bbe3f847..17c53f659 100644 --- a/types/validators.go +++ b/types/util.go @@ -8,6 +8,8 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) +//------------------------------------------------------------------------------ + // Validators is a list of validators that implements the Sort interface type Validators []*Validator @@ -26,13 +28,6 @@ func (v Validators) Swap(i, j int) { v[j] = v1 } -//------------------------------------- - -type validatorPretty struct { - PubKey data.Bytes `json:"pub_key"` - Power int64 `json:"power"` -} - func ValidatorsString(vs Validators) string { s := make([]validatorPretty, len(vs)) for i, v := range vs { @@ -44,3 +39,28 @@ func ValidatorsString(vs Validators) string { } return string(b) } + +type validatorPretty struct { + PubKey data.Bytes `json:"pub_key"` + Power int64 `json:"power"` +} + +//------------------------------------------------------------------------------ + +// KVPairInt is a helper method to build KV pair with an integer value. +func KVPairInt(key string, val int64) *KVPair { + return &KVPair{ + Key: key, + ValueInt: val, + ValueType: KVPair_INT, + } +} + +// KVPairString is a helper method to build KV pair with a string value. +func KVPairString(key, val string) *KVPair { + return &KVPair{ + Key: key, + ValueString: val, + ValueType: KVPair_STRING, + } +} diff --git a/types/kvpair_test.go b/types/util_test.go similarity index 100% rename from types/kvpair_test.go rename to types/util_test.go From 9272756c498e524273baff0ec5c6578e5fae5de4 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 1 Dec 2017 01:05:13 -0500 Subject: [PATCH 66/80] types: add note about ReadMessage having no cap --- types/application.go | 2 -- types/messages.go | 50 +++++++++++++++++++++--------------------- types/messages_test.go | 28 +++++++++++++++++++++++ 3 files changed, 53 insertions(+), 27 deletions(-) create mode 100644 types/messages_test.go diff --git a/types/application.go b/types/application.go index f0ce18955..6c0b8bd04 100644 --- a/types/application.go +++ b/types/application.go @@ -75,8 +75,6 @@ func (BaseApplication) EndBlock(req RequestEndBlock) ResponseEndBlock { //------------------------------------------------------- -var _ Application = (*GRPCApplication)(nil) - // GRPCApplication is a GRPC wrapper for Application type GRPCApplication struct { app Application diff --git a/types/messages.go b/types/messages.go index 7b9c81f97..5ce234cf1 100644 --- a/types/messages.go +++ b/types/messages.go @@ -7,6 +7,31 @@ import ( wire "github.com/tendermint/go-wire" ) +// WriteMessage writes a length-delimited protobuf message. +func WriteMessage(msg proto.Message, w io.Writer) error { + bz, err := proto.Marshal(msg) + if err != nil { + return err + } + var n int + wire.WriteByteSlice(bz, w, &n, &err) + return err +} + +// ReadMessage reads a length delimited protobuf message. +func ReadMessage(r io.Reader, msg proto.Message) error { + var n int + var err error + bz := wire.ReadByteSlice(r, 0, &n, &err) //XXX: no max + if err != nil { + return err + } + err = proto.Unmarshal(bz, msg) + return err +} + +//---------------------------------------- + func ToRequestEcho(message string) *Request { return &Request{ Value: &Request_Echo{&RequestEcho{message}}, @@ -146,28 +171,3 @@ func ToResponseEndBlock(res ResponseEndBlock) *Response { Value: &Response_EndBlock{&res}, } } - -//---------------------------------------- - -// Write proto message, length delimited -func WriteMessage(msg proto.Message, w io.Writer) error { - bz, err := proto.Marshal(msg) - if err != nil { - return err - } - var n int - wire.WriteByteSlice(bz, w, &n, &err) - return err -} - -// Read proto message, length delimited -func ReadMessage(r io.Reader, msg proto.Message) error { - var n int - var err error - bz := wire.ReadByteSlice(r, 0, &n, &err) - if err != nil { - return err - } - err = proto.Unmarshal(bz, msg) - return err -} diff --git a/types/messages_test.go b/types/messages_test.go new file mode 100644 index 000000000..7f078979e --- /dev/null +++ b/types/messages_test.go @@ -0,0 +1,28 @@ +package types + +import ( + "bytes" + "testing" + + "github.com/gogo/protobuf/proto" + "github.com/stretchr/testify/assert" +) + +func TestWriteReadMessage(t *testing.T) { + cases := []proto.Message{ + &RequestEcho{"hello"}, + // TODO: add the rest + } + + for _, c := range cases { + buf := new(bytes.Buffer) + err := WriteMessage(c, buf) + assert.Nil(t, err) + + msg := new(RequestEcho) + err = ReadMessage(buf, msg) + assert.Nil(t, err) + + assert.Equal(t, c, msg) + } +} From b20273439de2d532f8480c6557f2ebff0854ac69 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 1 Dec 2017 01:09:16 -0500 Subject: [PATCH 67/80] types: RequestBeginBlock includes absent and byzantine validators --- CHANGELOG.md | 7 +- Makefile | 6 +- README.md | 4 +- types/types.pb.go | 242 +++++++++++++++++++++++++++------------------- types/types.proto | 7 ++ 5 files changed, 161 insertions(+), 105 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1449a436..5395989fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,9 +17,10 @@ BREAKING CHANGES: - [abci-cli] codes are printed as their number instead of a message, except for `code == 0`, which is still printed as `OK` FEATURES: - - [types] added Tags field to ResponseDeliverTx - - [types] added Gas and Fee fields to ResponseCheckTx - - [dummy] DeliverTx returns tags + - [types] ResponseDeliverTx: added `tags` field + - [types] ResponseCheckTx: added `gas` and `fee` fields + - [types] RequestBeginBlock: added `absent_validators` and `byzantine_validators` fields + - [dummy] DeliverTx returns an owner tag and a key tag - [abci-cli] added `log_level` flag to control the logger ## 0.7.1 (November 14, 2017) diff --git a/Makefile b/Makefile index ebe8f3a9a..d2384ae44 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ protoc: ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## ldconfig (may require sudo) ## https://stackoverflow.com/a/25518702 - protoc $(INCLUDE) --gogo_out=plugins=grpc:. types/*.proto + protoc $(INCLUDE) --gogo_out=plugins=grpc:. --lint_out=. types/*.proto install: @ go install ./cmd/... @@ -38,14 +38,14 @@ dist: @ bash scripts/dist.sh @ bash scripts/publish.sh -test: +test: @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; @ echo "==> Running linter" @ make metalinter_test @ echo "==> Running go test" @ go test $(PACKAGES) -test_race: +test_race: @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; @ echo "==> Running go test --race" @go test -v -race $(PACKAGES) diff --git a/README.md b/README.md index 0deec1817..1b7f89007 100644 --- a/README.md +++ b/README.md @@ -168,8 +168,10 @@ Here, we describe the requests and responses as function arguments and return va * __Arguments__: * `Hash ([]byte)`: The block's hash. This can be derived from the block header. * `Header (struct{})`: The block header + * `AbsentValidators ([]int32)`: List of indices of validators not included in the LastCommit + * `ByzantineValidators ([]Evidence)`: List of evidence of validators that acted maliciously * __Usage__:
- Signals the beginning of a new block. Called prior to any DeliverTxs. The header is expected to at least contain the Height. + Signals the beginning of a new block. Called prior to any DeliverTxs. The header is expected to at least contain the Height. The `AbsentValidators` and `ByzantineValidators` can be used to determine rewards and punishments for the validators. #### EndBlock * __Arguments__: diff --git a/types/types.pb.go b/types/types.pb.go index 094f3012f..02d63e61a 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -37,6 +37,7 @@ It has these top-level messages: BlockID PartSetHeader Validator + Evidence KVPair */ package types @@ -81,7 +82,7 @@ var KVPair_Type_value = map[string]int32{ func (x KVPair_Type) String() string { return proto.EnumName(KVPair_Type_name, int32(x)) } -func (KVPair_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29, 0} } +func (KVPair_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorTypes, []int{30, 0} } type Request struct { // Types that are valid to be assigned to Value: @@ -644,8 +645,10 @@ func (m *RequestInitChain) GetValidators() []*Validator { } type RequestBeginBlock struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Header *Header `protobuf:"bytes,2,opt,name=header" json:"header,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Header *Header `protobuf:"bytes,2,opt,name=header" json:"header,omitempty"` + AbsentValidators []int32 `protobuf:"varint,3,rep,packed,name=absent_validators,json=absentValidators" json:"absent_validators,omitempty"` + ByzantineValidators []*Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators" json:"byzantine_validators,omitempty"` } func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } @@ -667,6 +670,20 @@ func (m *RequestBeginBlock) GetHeader() *Header { return nil } +func (m *RequestBeginBlock) GetAbsentValidators() []int32 { + if m != nil { + return m.AbsentValidators + } + return nil +} + +func (m *RequestBeginBlock) GetByzantineValidators() []*Evidence { + if m != nil { + return m.ByzantineValidators + } + return nil +} + type RequestEndBlock struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` } @@ -1536,6 +1553,30 @@ func (m *Validator) GetPower() int64 { return 0 } +type Evidence struct { + PubKey []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *Evidence) Reset() { *m = Evidence{} } +func (m *Evidence) String() string { return proto.CompactTextString(m) } +func (*Evidence) ProtoMessage() {} +func (*Evidence) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29} } + +func (m *Evidence) GetPubKey() []byte { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *Evidence) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + type KVPair struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` ValueType KVPair_Type `protobuf:"varint,2,opt,name=value_type,json=valueType,proto3,enum=types.KVPair_Type" json:"value_type,omitempty"` @@ -1546,7 +1587,7 @@ type KVPair struct { func (m *KVPair) Reset() { *m = KVPair{} } func (m *KVPair) String() string { return proto.CompactTextString(m) } func (*KVPair) ProtoMessage() {} -func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{29} } +func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{30} } func (m *KVPair) GetKey() string { if m != nil { @@ -1606,6 +1647,7 @@ func init() { proto.RegisterType((*BlockID)(nil), "types.BlockID") proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") proto.RegisterType((*Validator)(nil), "types.Validator") + proto.RegisterType((*Evidence)(nil), "types.Evidence") proto.RegisterType((*KVPair)(nil), "types.KVPair") proto.RegisterEnum("types.KVPair_Type", KVPair_Type_name, KVPair_Type_value) } @@ -2015,98 +2057,102 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 1488 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x8e, 0x13, 0xc7, - 0x13, 0x5f, 0x7f, 0xdb, 0xe5, 0xfd, 0x30, 0xcd, 0xfe, 0x61, 0x30, 0x07, 0x60, 0x24, 0xfe, 0xec, - 0x12, 0x58, 0x93, 0x45, 0x44, 0x2c, 0x44, 0x91, 0xd6, 0x2c, 0xc4, 0x16, 0x12, 0x21, 0xc3, 0x8a, - 0xab, 0x35, 0xf6, 0xb4, 0xed, 0x11, 0xf6, 0xcc, 0x30, 0xd3, 0x5e, 0xbc, 0x52, 0x1e, 0x81, 0x7b, - 0xce, 0xc9, 0x25, 0x52, 0x5e, 0x20, 0x6f, 0x10, 0xe5, 0x19, 0x72, 0xe0, 0x59, 0xa2, 0xaa, 0xee, - 0xf9, 0xdc, 0x19, 0x0e, 0x1c, 0xb8, 0xac, 0xba, 0xba, 0xea, 0xd7, 0xae, 0xea, 0xa9, 0xfe, 0x55, - 0xd5, 0xc2, 0x25, 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, 0x93, 0x6c, 0xf5, 0x35, 0xbf, 0xad, 0x7e, 0x39, 0xce, 0xff, 0x88, 0xc8, 0xf4, 0x5d, 0x60, - 0x17, 0x19, 0x4a, 0xf6, 0x26, 0x69, 0xee, 0x61, 0xff, 0x87, 0x9a, 0x65, 0x4f, 0xa7, 0xc5, 0xd5, - 0x59, 0xaa, 0xf5, 0x3f, 0xca, 0x50, 0x97, 0xb5, 0x95, 0x5d, 0x43, 0x9e, 0x37, 0x6d, 0x67, 0x64, - 0x5b, 0x21, 0xbf, 0x90, 0x3c, 0xb4, 0x12, 0x97, 0x56, 0x4e, 0x5d, 0x1a, 0x83, 0xaa, 0xb0, 0x97, - 0x5c, 0x51, 0x03, 0xad, 0xd9, 0x55, 0x68, 0x38, 0xab, 0xe5, 0x48, 0xac, 0xc3, 0xc4, 0xac, 0x3b, - 0xab, 0xe5, 0xe9, 0x3a, 0x60, 0x87, 0xb0, 0x95, 0x20, 0x0a, 0xdb, 0x52, 0x05, 0x6c, 0x5b, 0xb9, - 0x46, 0x7e, 0x0f, 0x4f, 0x8c, 0x76, 0x44, 0x19, 0x43, 0x8b, 0xed, 0x01, 0x31, 0xc8, 0x48, 0x16, - 0x09, 0xc9, 0x2c, 0x75, 0x62, 0x96, 0x6d, 0xdc, 0x57, 0x55, 0x04, 0x1b, 0x87, 0xeb, 0xd0, 0xc2, - 0x9b, 0x94, 0x26, 0x0d, 0x32, 0x69, 0xe2, 0x06, 0x29, 0xef, 0xc0, 0x4e, 0xdc, 0x8c, 0x48, 0x93, - 0xa6, 0x3c, 0x25, 0xde, 0x26, 0xc3, 0x6b, 0xd0, 0x8c, 0x18, 0xac, 0x45, 0x16, 0x0d, 0x53, 0x11, - 0xd7, 0x10, 0x1a, 0xca, 0xc5, 0xdc, 0xc6, 0xe5, 0x2e, 0xd4, 0x3c, 0xd3, 0x17, 0x81, 0x6a, 0x10, - 0xc2, 0xfa, 0xf5, 0xda, 0xf4, 0xb1, 0x63, 0x54, 0xed, 0x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0xd8, 0xcd, - 0xeb, 0xce, 0xd8, 0x0f, 0xd0, 0x8a, 0x2b, 0x59, 0xd1, 0xc4, 0xd8, 0x2d, 0xec, 0xd3, 0x10, 0x1f, - 0x57, 0xb8, 0xa2, 0xb9, 0xb1, 0x5b, 0xd8, 0xac, 0xb1, 0xc7, 0xd0, 0x08, 0x8b, 0x4f, 0xfe, 0xf4, - 0xd8, 0x2d, 0xe8, 0xd7, 0xf0, 0x7a, 0x64, 0x49, 0xc8, 0x1b, 0x0a, 0xbb, 0xb9, 0x2d, 0x18, 0x7b, - 0x04, 0x75, 0xc5, 0x86, 0xb9, 0x83, 0x67, 0x37, 0xbf, 0xd1, 0xc3, 0x20, 0xe3, 0xf9, 0xa1, 0x68, - 0xa2, 0xec, 0x16, 0xb6, 0x70, 0xec, 0x18, 0x20, 0x31, 0x39, 0x14, 0xce, 0x95, 0xdd, 0xe2, 0x46, - 0x8e, 0x3d, 0x85, 0x66, 0x3c, 0x2c, 0xe4, 0x4f, 0x97, 0xdd, 0xa2, 0x5e, 0x6e, 0x5c, 0xa7, 0xff, - 0x58, 0x3c, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x34, 0x61, 0x21, 0x91, 0xfc, 0x10, 0x00, 0x00, + // 1551 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0xcb, 0x8e, 0x13, 0x47, + 0x17, 0xc7, 0x6d, 0xb7, 0xaf, 0xc7, 0x73, 0xf1, 0xd4, 0xcc, 0x07, 0xc6, 0x2c, 0x18, 0x5a, 0xe2, + 0xc3, 0xc3, 0x65, 0xcc, 0x37, 0x88, 0x4f, 0x0c, 0x44, 0x91, 0xc6, 0x0c, 0xc4, 0x16, 0x12, 0x21, + 0xcd, 0x88, 0xad, 0xd5, 0x76, 0x97, 0xed, 0x12, 0x76, 0x77, 0xd3, 0x5d, 0x1e, 0x3c, 0x51, 0x1e,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x7e, 0x0f, 0x4f, 0x8d, 0x66, 0x88, 0x8c, 0xa1, 0x45, 0xba, 0x80, 0x04, 0x19, + 0xc9, 0x24, 0x21, 0xc9, 0x52, 0x45, 0xb2, 0x6c, 0x89, 0x71, 0x95, 0x45, 0x44, 0xa5, 0x72, 0x1d, + 0x1a, 0xe2, 0x24, 0xa5, 0x49, 0x0d, 0x4d, 0xea, 0x62, 0x00, 0x27, 0x6f, 0xc3, 0x76, 0x54, 0x68, + 0x48, 0x93, 0xba, 0x5c, 0x25, 0x1a, 0x46, 0xc3, 0x6b, 0x50, 0x0f, 0x09, 0xd6, 0x40, 0x8b, 0x9a, + 0xa9, 0xc0, 0x35, 0x84, 0x9a, 0x72, 0x31, 0xb3, 0x52, 0xba, 0x03, 0x15, 0xd7, 0xf4, 0xb8, 0xaf, + 0x0a, 0x84, 0x20, 0x7f, 0xbd, 0x36, 0x3d, 0x51, 0xa3, 0xaa, 0x7a, 0x49, 0x9a, 0xe8, 0xc7, 0xb0, + 0x99, 0x18, 0x17, 0xd7, 0x8f, 0x3b, 0xdc, 0x5c, 0xa8, 0xd2, 0x45, 0x76, 0xc2, 0x9f, 0x29, 0x45, + 0x3f, 0xa3, 0x3f, 0x81, 0x46, 0xf8, 0x0d, 0xc5, 0x51, 0xbb, 0xab, 0xf1, 0x28, 0x28, 0x7b, 0x37, + 0x8c, 0xaa, 0xbb, 0x1a, 0xbf, 0x94, 0x95, 0xaf, 0xeb, 0x7c, 0x50, 0x55, 0x9b, 0x66, 0xc8, 0x8e, + 0xfe, 0x14, 0xea, 0x41, 0x55, 0x95, 0x2f, 0xcd, 0xf9, 0xd4, 0xfa, 0xef, 0x45, 0xa8, 0x4a, 0xf8, + 0x65, 0x54, 0xda, 0xff, 0xc3, 0x12, 0x74, 0x45, 0x47, 0x62, 0xd3, 0x28, 0xdc, 0x0a, 0x5f, 0x77, + 0x52, 0x74, 0x78, 0x76, 0xe1, 0x52, 0xa3, 0x81, 0x56, 0xa2, 0x49, 0x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8, 0x3b, 0xe1, 0x4b, 0x23, 0xfb, 0x31, 0xdc, 0xc9, 0x2b, 0x04, 0xc7, 0x55, 0xfc, 0x07, 0xcb, + 0xc3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x39, 0xd6, 0x39, 0x74, 0xab, 0x11, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index d40e8885f..6538ba2db 100644 --- a/types/types.proto +++ b/types/types.proto @@ -66,6 +66,8 @@ message RequestInitChain{ message RequestBeginBlock{ bytes hash = 1; Header header = 2; + repeated int32 absent_validators = 3; + repeated Evidence byzantine_validators = 4; } message RequestEndBlock{ @@ -187,6 +189,11 @@ message Validator { int64 power = 2; } +message Evidence { + bytes pub_key = 1; + int64 height = 2; +} + //---------------------------------------- // Abstract types From fc90b2de1c3b257291ccdfef346614aa2a08ac54 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 1 Dec 2017 11:33:07 -0500 Subject: [PATCH 68/80] fix dummy test --- example/dummy/dummy_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index ec4d2e33d..bfe9ef7a9 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -95,7 +95,7 @@ func TestPersistentDummyInfo(t *testing.T) { header := &types.Header{ Height: int64(height), } - dummy.BeginBlock(types.RequestBeginBlock{hash, header}) + dummy.BeginBlock(types.RequestBeginBlock{hash, header, nil, nil}) dummy.EndBlock(types.RequestEndBlock{header.Height}) dummy.Commit() @@ -179,7 +179,7 @@ func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff [ Height: height, } - dummy.BeginBlock(types.RequestBeginBlock{hash, header}) + dummy.BeginBlock(types.RequestBeginBlock{hash, header, nil, nil}) for _, tx := range txs { if r := dummy.DeliverTx(tx); r.IsErr() { t.Fatal(r) From 3890a2058f723c2a6b106e6e65d89666bb9691c8 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 2 Dec 2017 01:48:37 -0500 Subject: [PATCH 69/80] types: IsOK() --- types/result.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/types/result.go b/types/result.go index 3f3fdd827..cb2fb7a38 100644 --- a/types/result.go +++ b/types/result.go @@ -8,6 +8,11 @@ const ( CodeTypeOK uint32 = 0 ) +// IsOK returns true if Code is OK. +func (r ResponseCheckTx) IsOK() bool { + return r.Code == CodeTypeOK +} + // IsErr returns true if Code is something other than OK. func (r ResponseCheckTx) IsErr() bool { return r.Code != CodeTypeOK @@ -18,6 +23,11 @@ func (r ResponseCheckTx) Error() string { return fmtError(r.Code, r.Log) } +// IsOK returns true if Code is OK. +func (r ResponseDeliverTx) IsOK() bool { + return r.Code == CodeTypeOK +} + // IsErr returns true if Code is something other than OK. func (r ResponseDeliverTx) IsErr() bool { return r.Code != CodeTypeOK @@ -28,6 +38,11 @@ func (r ResponseDeliverTx) Error() string { return fmtError(r.Code, r.Log) } +// IsOK returns true if Code is OK. +func (r ResponseCommit) IsOK() bool { + return r.Code == CodeTypeOK +} + // IsErr returns true if Code is something other than OK. func (r ResponseCommit) IsErr() bool { return r.Code != CodeTypeOK @@ -38,6 +53,11 @@ func (r ResponseCommit) Error() string { return fmtError(r.Code, r.Log) } +// IsOK returns true if Code is OK. +func (r ResponseQuery) IsOK() bool { + return r.Code == CodeTypeOK +} + // IsErr returns true if Code is something other than OK. func (r ResponseQuery) IsErr() bool { return r.Code != CodeTypeOK From 82d56571b54f95f2015a33969382b56d2a059ff5 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 2 Dec 2017 01:48:46 -0500 Subject: [PATCH 70/80] types: int32 with gogo int --- types/types.pb.go | 224 +++++++++++++++++++++------------------------- types/types.proto | 6 +- 2 files changed, 105 insertions(+), 125 deletions(-) diff --git a/types/types.pb.go b/types/types.pb.go index 02d63e61a..ec42f2525 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -647,7 +647,7 @@ func (m *RequestInitChain) GetValidators() []*Validator { type RequestBeginBlock struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` Header *Header `protobuf:"bytes,2,opt,name=header" json:"header,omitempty"` - AbsentValidators []int32 `protobuf:"varint,3,rep,packed,name=absent_validators,json=absentValidators" json:"absent_validators,omitempty"` + AbsentValidators []int `protobuf:"varint,3,rep,packed,name=absent_validators,json=absentValidators,customtype=int" json:"absent_validators"` ByzantineValidators []*Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators" json:"byzantine_validators,omitempty"` } @@ -670,13 +670,6 @@ func (m *RequestBeginBlock) GetHeader() *Header { return nil } -func (m *RequestBeginBlock) GetAbsentValidators() []int32 { - if m != nil { - return m.AbsentValidators - } - return nil -} - func (m *RequestBeginBlock) GetByzantineValidators() []*Evidence { if m != nil { return m.ByzantineValidators @@ -1405,7 +1398,7 @@ type Header struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` Time int64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` - NumTxs int64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` + NumTxs int `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3,customtype=int" json:"num_txs"` LastBlockId *BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId" json:"last_block_id,omitempty"` LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` @@ -1439,13 +1432,6 @@ func (m *Header) GetTime() int64 { return 0 } -func (m *Header) GetNumTxs() int64 { - if m != nil { - return m.NumTxs - } - return 0 -} - func (m *Header) GetLastBlockId() *BlockID { if m != nil { return m.LastBlockId @@ -1506,7 +1492,7 @@ func (m *BlockID) GetParts() *PartSetHeader { } type PartSetHeader struct { - Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Total int `protobuf:"varint,1,opt,name=total,proto3,customtype=int" json:"total"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` } @@ -1515,13 +1501,6 @@ func (m *PartSetHeader) String() string { return proto.CompactTextStr func (*PartSetHeader) ProtoMessage() {} func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{27} } -func (m *PartSetHeader) GetTotal() int64 { - if m != nil { - return m.Total - } - return 0 -} - func (m *PartSetHeader) GetHash() []byte { if m != nil { return m.Hash @@ -2057,102 +2036,103 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 1551 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0xcb, 0x8e, 0x13, 0x47, - 0x17, 0xc7, 0x6d, 0xb7, 0xaf, 0xc7, 0x73, 0xf1, 0xd4, 0xcc, 0x07, 0xc6, 0x2c, 0x18, 0x5a, 0xe2, - 0xc3, 0xc3, 0x65, 0xcc, 0x37, 0x88, 0x4f, 0x0c, 0x44, 0x91, 0xc6, 0x0c, 0xc4, 0x16, 0x12, 0x21, - 0xcd, 0x88, 0xad, 0xd5, 0x76, 0x97, 0xed, 0x12, 0x76, 0x77, 0xd3, 0x5d, 0x1e, 0x3c, 0x51, 0x1e, - 0x81, 0x7d, 0xd6, 0xc9, 0x26, 0x52, 0x5e, 0x20, 0xcb, 0xec, 0xa2, 0x3c, 0x43, 0x16, 0x3c, 0x4b, - 0x54, 0xa7, 0xaa, 0xaf, 0xd3, 0xcd, 0x82, 0x05, 0x9b, 0x51, 0x5d, 0xce, 0xbf, 0x7c, 0xaa, 0xf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a8, 0xaa, 0x4d, 0x64, 0x93, 0x1c, 0x42, 0x75, 0xe2, 0x2c, 0x97, 0x8c, 0xb7, - 0x6b, 0xa8, 0xd8, 0x4b, 0x29, 0x70, 0x6e, 0x50, 0x30, 0x94, 0x95, 0x38, 0xae, 0xf7, 0x2b, 0xea, - 0x5d, 0xb4, 0xeb, 0x59, 0xc7, 0xf5, 0x83, 0x98, 0x12, 0xc7, 0x85, 0x36, 0x62, 0x2b, 0xcc, 0x66, - 0x7c, 0x34, 0x99, 0x9b, 0xcc, 0x6e, 0x37, 0xb2, 0xb6, 0x32, 0xb4, 0x19, 0x7f, 0x26, 0xa6, 0xc5, - 0x56, 0x58, 0xd0, 0x21, 0x4f, 0xa1, 0x39, 0xa6, 0x33, 0x66, 0x8f, 0xc6, 0x0b, 0x67, 0xf2, 0xae, - 0x0d, 0x28, 0x6d, 0x27, 0xa5, 0x7d, 0x61, 0xd0, 0x17, 0xf3, 0x83, 0x82, 0x01, 0xe3, 0xb0, 0x47, - 0x1e, 0x41, 0x83, 0xda, 0x96, 0x92, 0x36, 0x51, 0x7a, 0x25, 0x15, 0x01, 0xb6, 0x15, 0x08, 0xeb, - 0x54, 0xb5, 0xfb, 0x35, 0xa8, 0x9c, 0x9b, 0x8b, 0x15, 0xd5, 0x6f, 0x43, 0x33, 0x16, 0x29, 0xa4, - 0x0d, 0xb5, 0x25, 0xf5, 0x7d, 0x73, 0x46, 0x31, 0x9c, 0x1a, 0x46, 0xd0, 0xd5, 0xb7, 0x60, 0x23, - 0x1e, 0x27, 0x31, 0xa1, 0x88, 0x05, 0x21, 0x3c, 0xa7, 0x9e, 0x2f, 0x02, 0x40, 0x09, 0x55, 0x57, - 0x7f, 0x02, 0xad, 0x74, 0x10, 0x90, 0x16, 0x68, 0xef, 0xe8, 0x85, 0xb2, 0x14, 0x4d, 0xb2, 0xa7, - 0x1c, 0xc2, 0xd0, 0x6c, 0x18, 0xca, 0x3b, 0x3d, 0xd4, 0x86, 0x61, 0x40, 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ped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0x4d, 0x6f, 0xdb, 0x46, + 0x13, 0xc7, 0x2d, 0x51, 0x12, 0xa5, 0x91, 0x5f, 0xe4, 0xb5, 0x9f, 0x44, 0x51, 0x0e, 0x71, 0x88, + 0x27, 0x4f, 0xec, 0x3c, 0x89, 0x95, 0x3a, 0x48, 0xe1, 0x24, 0x45, 0x01, 0x2b, 0x4e, 0x2a, 0x21, + 0x40, 0x9a, 0x32, 0x46, 0xae, 0x02, 0x25, 0xae, 0xa4, 0x45, 0x24, 0x92, 0x21, 0x57, 0x8e, 0x5c, + 0xf4, 0x23, 0xe4, 0xde, 0x73, 0x7b, 0xec, 0xb9, 0x40, 0xbf, 0x41, 0xd1, 0x43, 0x3f, 0x41, 0x0f, + 0xf9, 0x2c, 0xc5, 0xce, 0x2e, 0x5f, 0x4d, 0xe6, 0x90, 0x43, 0x2e, 0xc6, 0x2e, 0x67, 0xfe, 0xab, + 0xd9, 0xe5, 0xf0, 0x37, 0xb3, 0x86, 0x6d, 0x7e, 0xe1, 0xd1, 0xa0, 0x8b, 0x7f, 0x0f, 0x3d, 0xdf, + 0xe5, 0x2e, 0xa9, 0xe2, 0xa4, 0x73, 0x6f, 0xca, 0xf8, 0x6c, 0x39, 0x3a, 0x1c, 0xbb, 0x8b, 0xee, + 0xd4, 0x9d, 0xba, 0x5d, 0xb4, 0x8e, 0x96, 0x13, 0x9c, 0xe1, 0x04, 0x47, 0x52, 0x65, 0xfc, 0x59, + 0x01, 0xdd, 0xa4, 0xef, 0x96, 0x34, 0xe0, 0x64, 0x1f, 0x2a, 0x74, 0x3c, 0x73, 0xdb, 0xa5, 0xbd, + 0xd2, 0x7e, 0xf3, 0x88, 0x1c, 0xca, 0xd5, 0x95, 0xf5, 0xd9, 0x78, 0xe6, 0xf6, 0xd7, 0x4c, 0xf4, + 0x20, 0xff, 0x87, 0xea, 0x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, 0xac, 0xe6, 0x86, 0x5f, 0x80, 0xc8, 0x47, 0x29, + 0x44, 0xd6, 0x72, 0xa5, 0x05, 0x8c, 0x7c, 0x90, 0x60, 0xa4, 0x9e, 0x41, 0x83, 0x14, 0xe6, 0x40, + 0xb2, 0x1b, 0x41, 0xb2, 0x9e, 0xc1, 0xaa, 0x92, 0x64, 0x29, 0x79, 0x37, 0xa4, 0x64, 0x23, 0xf7, + 0xd0, 0x32, 0x98, 0x7c, 0x94, 0xc2, 0x24, 0xe4, 0x6e, 0xa7, 0x80, 0x93, 0xdf, 0xa4, 0x39, 0x29, + 0x61, 0x77, 0x2d, 0xa3, 0x2d, 0x04, 0xe5, 0xd7, 0x49, 0x50, 0xae, 0x67, 0xf0, 0xac, 0x72, 0xe1, + 0x93, 0xa4, 0x3c, 0x10, 0xdf, 0x61, 0x26, 0xd3, 0x04, 0x0a, 0xa8, 0xef, 0xbb, 0xbe, 0x42, 0x99, + 0x9c, 0x18, 0xfb, 0x02, 0x38, 0x71, 0x7e, 0x7d, 0x82, 0xaa, 0x08, 0x8d, 0x44, 0x76, 0x19, 0x3f, + 0x97, 0x62, 0x2d, 0x82, 0x35, 0x09, 0xab, 0x86, 0x82, 0x55, 0x02, 0xb6, 0xe5, 0x14, 0x6c, 0xc9, + 0x1d, 0xd8, 0x9e, 0x5b, 0x01, 0x97, 0xdb, 0x1c, 0xa6, 0xe8, 0xb5, 0x25, 0x0c, 0x72, 0x7f, 0x12, + 0x63, 0xf7, 0x60, 0x27, 0xe1, 0x6b, 0x79, 0xde, 0x10, 0x91, 0x52, 0x41, 0xa4, 0xb4, 0x22, 0xef, + 0x13, 0xcf, 0xeb, 0x5b, 0xc1, 0xcc, 0xb8, 0x15, 0xef, 0x3f, 0x05, 0xf2, 0xb9, 0x3b, 0x0d, 0x41, + 0x3e, 0x77, 0xa7, 0xc6, 0xaf, 0xa5, 0xd8, 0x2f, 0x86, 0x36, 0x81, 0xca, 0xd8, 0xb5, 0xe5, 0xf6, + 0x37, 0x4c, 0x1c, 0x93, 0x53, 0xb5, 0x33, 0xb1, 0x85, 0xf5, 0xde, 0x7d, 0xc5, 0x9e, 0xfd, 0x44, + 0x23, 0xc4, 0xa9, 0x63, 0x53, 0x7f, 0xc1, 0x1c, 0xde, 0x9d, 0xba, 0xf7, 0xde, 0x33, 0x9f, 0x76, + 0x85, 0xe2, 0xb0, 0x77, 0xc1, 0x69, 0xa0, 0xce, 0x42, 0x45, 0xa0, 0x45, 0x11, 0x90, 0x9b, 0x50, + 0xe1, 0xd6, 0x34, 0xc4, 0x52, 0x48, 0xc1, 0x17, 0x6f, 0x5e, 0x59, 0xcc, 0x37, 0xd1, 0x64, 0xfc, + 0x52, 0x12, 0x18, 0x4a, 0x7d, 0x03, 0x5f, 0x34, 0xc4, 0x16, 0x68, 0x53, 0x2b, 0xc0, 0xa3, 0xd6, + 0x4c, 0x31, 0x14, 0x4f, 0x26, 0x94, 0x22, 0x1a, 0x34, 0x53, 0x0c, 0x8d, 0x3f, 0xca, 0x71, 0x6e, + 0x44, 0x75, 0xeb, 0x52, 0x84, 0xbb, 0x50, 0x65, 0x8e, 0x4d, 0x57, 0x18, 0xa2, 0x66, 0xca, 0x09, + 0xe9, 0xc9, 0xfa, 0xaa, 0x7d, 0x66, 0xd8, 0x58, 0x91, 0x9f, 0x87, 0x15, 0xb9, 0xf2, 0x99, 0xab, + 0x48, 0xb9, 0x58, 0xc7, 0xf3, 0x5d, 0x77, 0x82, 0x7b, 0xfb, 0xac, 0x75, 0x50, 0x9e, 0x28, 0x13, + 0xb5, 0x54, 0x35, 0x56, 0xa7, 0xab, 0xc7, 0x29, 0xf8, 0x93, 0xe8, 0x08, 0x92, 0xb4, 0xfa, 0x92, + 0xef, 0xd6, 0xd8, 0x89, 0xf3, 0x3f, 0x02, 0x99, 0xb1, 0x0b, 0xe4, 0x32, 0xa1, 0x64, 0x6b, 0x94, + 0x66, 0x0f, 0xf9, 0x1f, 0x54, 0x6d, 0x36, 0x99, 0x14,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, 0x83, 0x3b, 0x85, 0xed, 0x9f, 0xd0, 0xc7, 0x85, 0xb3, 0xe8, 0x36, + 0xdc, 0x29, 0xec, 0x01, 0xc9, 0x31, 0xe8, 0x61, 0x4d, 0xcb, 0xbf, 0x13, 0x77, 0x0a, 0xda, 0x40, + 0x71, 0x3c, 0xb2, 0xd2, 0xe4, 0x5d, 0x75, 0x3b, 0xb9, 0x9d, 0x1d, 0x79, 0x08, 0x35, 0x05, 0xd9, + 0xdc, 0xeb, 0x74, 0x27, 0xbf, 0x7f, 0x14, 0x9b, 0x8c, 0x6f, 0x45, 0x45, 0xf7, 0xe4, 0x4e, 0x61, + 0x67, 0x48, 0x4e, 0x00, 0x12, 0xd7, 0xa1, 0xc2, 0xdb, 0x72, 0xa7, 0xb8, 0x3f, 0x24, 0xe2, 0xdb, + 0x89, 0xee, 0x20, 0xf9, 0x77, 0xe6, 0x4e, 0x51, 0x8b, 0x38, 0xaa, 0xe1, 0xff, 0x61, 0x1e, 0xfc, + 0x1b, 0x00, 0x00, 0xff, 0xff, 0x93, 0x8a, 0xe6, 0x33, 0xd2, 0x11, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 6538ba2db..6cf02966b 100644 --- a/types/types.proto +++ b/types/types.proto @@ -66,7 +66,7 @@ message RequestInitChain{ message RequestBeginBlock{ bytes hash = 1; Header header = 2; - repeated int32 absent_validators = 3; + repeated int32 absent_validators = 3 [(gogoproto.customtype) = "int", (gogoproto.nullable) = false]; repeated Evidence byzantine_validators = 4; } @@ -166,7 +166,7 @@ message Header { string chain_id = 1; int64 height = 2; int64 time = 3; - int64 num_txs = 4; + int32 num_txs = 4 [(gogoproto.customtype) = "int", (gogoproto.nullable) = false]; BlockID last_block_id = 5; bytes last_commit_hash = 6; bytes data_hash = 7; @@ -180,7 +180,7 @@ message BlockID { } message PartSetHeader { - int64 total = 1; + int32 total = 1 [(gogoproto.customtype) = "int", (gogoproto.nullable) = false]; bytes hash = 2; } From 9afd3da3b24f31541cb4bb83297677a9b48108c7 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 2 Dec 2017 01:56:21 -0500 Subject: [PATCH 71/80] changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5395989fa..38a7c7d84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ BREAKING CHANGES: - [types] use `customtype` feature of `gogo/protobuf` to replace `[]byte` with `data.Bytes` in all generated types :) - this eliminates the need for additional types like ResultQuery - [types] `pubKey` -> `pub_key` - - [types] `uint64` -> `int64` + - [types] `uint64` -> `int32` for `Header.num_txs` and `PartSetHeader.total`, but generated code uses `int` + - [types] `uint64` -> `int64` for everything else - [abci-cli] codes are printed as their number instead of a message, except for `code == 0`, which is still printed as `OK` FEATURES: From 2b804bb5a13a7d1a66e5d53e5108879f2dae9847 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 2 Dec 2017 11:47:02 -0500 Subject: [PATCH 72/80] remove custom type int https://github.com/gogo/protobuf/issues/359 --- CHANGELOG.md | 2 +- Makefile | 1 + types/messages_test.go | 6 +- types/types.pb.go | 225 ++++++++++++++++++++++------------------- types/types.proto | 6 +- 5 files changed, 132 insertions(+), 108 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38a7c7d84..6d66384d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ BREAKING CHANGES: - [types] use `customtype` feature of `gogo/protobuf` to replace `[]byte` with `data.Bytes` in all generated types :) - this eliminates the need for additional types like ResultQuery - [types] `pubKey` -> `pub_key` - - [types] `uint64` -> `int32` for `Header.num_txs` and `PartSetHeader.total`, but generated code uses `int` + - [types] `uint64` -> `int32` for `Header.num_txs` and `PartSetHeader.total` - [types] `uint64` -> `int64` for everything else - [abci-cli] codes are printed as their number instead of a message, except for `code == 0`, which is still printed as `OK` diff --git a/Makefile b/Makefile index d2384ae44..d5fe913b2 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ install_protoc: rm -rf protobuf-3.4.1 protoc: + ## Note to self: ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## ldconfig (may require sudo) ## https://stackoverflow.com/a/25518702 diff --git a/types/messages_test.go b/types/messages_test.go index 7f078979e..607215be1 100644 --- a/types/messages_test.go +++ b/types/messages_test.go @@ -10,7 +10,9 @@ import ( func TestWriteReadMessage(t *testing.T) { cases := []proto.Message{ - &RequestEcho{"hello"}, + &Header{ + NumTxs: 4, + }, // TODO: add the rest } @@ -19,7 +21,7 @@ func TestWriteReadMessage(t *testing.T) { err := WriteMessage(c, buf) assert.Nil(t, err) - msg := new(RequestEcho) + msg := new(Header) err = ReadMessage(buf, msg) assert.Nil(t, err) diff --git a/types/types.pb.go b/types/types.pb.go index ec42f2525..9233a05c8 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -647,7 +647,7 @@ func (m *RequestInitChain) GetValidators() []*Validator { type RequestBeginBlock struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` Header *Header `protobuf:"bytes,2,opt,name=header" json:"header,omitempty"` - AbsentValidators []int `protobuf:"varint,3,rep,packed,name=absent_validators,json=absentValidators,customtype=int" json:"absent_validators"` + AbsentValidators []int32 `protobuf:"varint,3,rep,packed,name=absent_validators,json=absentValidators" json:"absent_validators,omitempty"` ByzantineValidators []*Evidence `protobuf:"bytes,4,rep,name=byzantine_validators,json=byzantineValidators" json:"byzantine_validators,omitempty"` } @@ -670,6 +670,13 @@ func (m *RequestBeginBlock) GetHeader() *Header { return nil } +func (m *RequestBeginBlock) GetAbsentValidators() []int32 { + if m != nil { + return m.AbsentValidators + } + return nil +} + func (m *RequestBeginBlock) GetByzantineValidators() []*Evidence { if m != nil { return m.ByzantineValidators @@ -1398,7 +1405,7 @@ type Header struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` Time int64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` - NumTxs int `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3,customtype=int" json:"num_txs"` + NumTxs int32 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` LastBlockId *BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId" json:"last_block_id,omitempty"` LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` @@ -1432,6 +1439,13 @@ func (m *Header) GetTime() int64 { return 0 } +func (m *Header) GetNumTxs() int32 { + if m != nil { + return m.NumTxs + } + return 0 +} + func (m *Header) GetLastBlockId() *BlockID { if m != nil { return m.LastBlockId @@ -1492,7 +1506,7 @@ func (m *BlockID) GetParts() *PartSetHeader { } type PartSetHeader struct { - Total int `protobuf:"varint,1,opt,name=total,proto3,customtype=int" json:"total"` + Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` } @@ -1501,6 +1515,13 @@ func (m *PartSetHeader) String() string { return proto.CompactTextStr func (*PartSetHeader) ProtoMessage() {} func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{27} } +func (m *PartSetHeader) GetTotal() int32 { + if m != nil { + return m.Total + } + return 0 +} + func (m *PartSetHeader) GetHash() []byte { if m != nil { return m.Hash @@ -2036,103 +2057,103 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 1565 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0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0x29, - 0x44, 0xd6, 0x72, 0xa5, 0x05, 0x8c, 0x7c, 0x90, 0x60, 0xa4, 0x9e, 0x41, 0x83, 0x14, 0xe6, 0x40, - 0xb2, 0x1b, 0x41, 0xb2, 0x9e, 0xc1, 0xaa, 0x92, 0x64, 0x29, 0x79, 0x37, 0xa4, 0x64, 0x23, 0xf7, - 0xd0, 0x32, 0x98, 0x7c, 0x94, 0xc2, 0x24, 0xe4, 0x6e, 0xa7, 0x80, 0x93, 0xdf, 0xa4, 0x39, 0x29, - 0x61, 0x77, 0x2d, 0xa3, 0x2d, 0x04, 0xe5, 0xd7, 0x49, 0x50, 0xae, 0x67, 0xf0, 0xac, 0x72, 0xe1, - 0x93, 0xa4, 0x3c, 0x10, 0xdf, 0x61, 0x26, 0xd3, 0x04, 0x0a, 0xa8, 0xef, 0xbb, 0xbe, 0x42, 0x99, - 0x9c, 0x18, 0xfb, 0x02, 0x38, 0x71, 0x7e, 0x7d, 0x82, 0xaa, 0x08, 0x8d, 0x44, 0x76, 0x19, 0x3f, - 0x97, 0x62, 0x2d, 0x82, 0x35, 0x09, 0xab, 0x86, 0x82, 0x55, 0x02, 0xb6, 0xe5, 0x14, 0x6c, 0xc9, - 0x1d, 0xd8, 0x9e, 0x5b, 0x01, 0x97, 0xdb, 0x1c, 0xa6, 0xe8, 0xb5, 0x25, 0x0c, 0x72, 0x7f, 0x12, - 0x63, 0xf7, 0x60, 0x27, 0xe1, 0x6b, 0x79, 0xde, 0x10, 0x91, 0x52, 0x41, 0xa4, 0xb4, 0x22, 0xef, - 0x13, 0xcf, 0xeb, 0x5b, 0xc1, 0xcc, 0xb8, 0x15, 0xef, 0x3f, 0x05, 0xf2, 0xb9, 0x3b, 0x0d, 0x41, - 0x3e, 0x77, 0xa7, 0xc6, 0xaf, 0xa5, 0xd8, 0x2f, 0x86, 0x36, 0x81, 0xca, 0xd8, 0xb5, 0xe5, 0xf6, - 0x37, 0x4c, 0x1c, 0x93, 0x53, 0xb5, 0x33, 0xb1, 0x85, 0xf5, 0xde, 0x7d, 0xc5, 0x9e, 0xfd, 0x44, - 0x23, 0xc4, 0xa9, 0x63, 0x53, 0x7f, 0xc1, 0x1c, 0xde, 0x9d, 0xba, 0xf7, 0xde, 0x33, 0x9f, 0x76, - 0x85, 0xe2, 0xb0, 0x77, 0xc1, 0x69, 0xa0, 0xce, 0x42, 0x45, 0xa0, 0x45, 0x11, 0x90, 0x9b, 0x50, - 0xe1, 0xd6, 0x34, 0xc4, 0x52, 0x48, 0xc1, 0x17, 0x6f, 0x5e, 0x59, 0xcc, 0x37, 0xd1, 0x64, 0xfc, - 0x52, 0x12, 0x18, 0x4a, 0x7d, 0x03, 0x5f, 0x34, 0xc4, 0x16, 0x68, 0x53, 0x2b, 0xc0, 0xa3, 0xd6, - 0x4c, 0x31, 0x14, 0x4f, 0x26, 0x94, 0x22, 0x1a, 0x34, 0x53, 0x0c, 0x8d, 0x3f, 0xca, 0x71, 0x6e, - 0x44, 0x75, 0xeb, 0x52, 0x84, 0xbb, 0x50, 0x65, 0x8e, 0x4d, 0x57, 0x18, 0xa2, 0x66, 0xca, 0x09, - 0xe9, 0xc9, 0xfa, 0xaa, 0x7d, 0x66, 0xd8, 0x58, 0x91, 0x9f, 0x87, 0x15, 0xb9, 0xf2, 0x99, 0xab, - 0x48, 0xb9, 0x58, 0xc7, 0xf3, 0x5d, 0x77, 0x82, 0x7b, 0xfb, 0xac, 0x75, 0x50, 0x9e, 0x28, 0x13, - 0xb5, 0x54, 0x35, 0x56, 0xa7, 0xab, 0xc7, 0x29, 0xf8, 0x93, 0xe8, 0x08, 0x92, 0xb4, 0xfa, 0x92, - 0xef, 0xd6, 0xd8, 0x89, 0xf3, 0x3f, 0x02, 0x99, 0xb1, 0x0b, 0xe4, 0x32, 0xa1, 0x64, 0x6b, 0x94, - 0x66, 0x0f, 0xf9, 0x1f, 0x54, 0x6d, 0x36, 0x99, 0x14, 0x37, 0x07, 0xd2, 0x6c, 0xfc, 0x5e, 0x86, -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 0x85, 0xb3, 0xe8, 0x36, - 0xdc, 0x29, 0xec, 0x01, 0xc9, 0x31, 0xe8, 0x61, 0x4d, 0xcb, 0xbf, 0x13, 0x77, 0x0a, 0xda, 0x40, - 0x71, 0x3c, 0xb2, 0xd2, 0xe4, 0x5d, 0x75, 0x3b, 0xb9, 0x9d, 0x1d, 0x79, 0x08, 0x35, 0x05, 0xd9, - 0xdc, 0xeb, 0x74, 0x27, 0xbf, 0x7f, 0x14, 0x9b, 0x8c, 0x6f, 0x45, 0x45, 0xf7, 0xe4, 0x4e, 0x61, - 0x67, 0x48, 0x4e, 0x00, 0x12, 0xd7, 0xa1, 0xc2, 0xdb, 0x72, 0xa7, 0xb8, 0x3f, 0x24, 0xe2, 0xdb, - 0x89, 0xee, 0x20, 0xf9, 0x77, 0xe6, 0x4e, 0x51, 0x8b, 0x38, 0xaa, 0xe1, 0xff, 0x61, 0x1e, 0xfc, - 0x1b, 0x00, 0x00, 0xff, 0xff, 0x93, 0x8a, 0xe6, 0x33, 0xd2, 0x11, 0x00, 0x00, + // 1554 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0xcb, 0x6e, 0xdb, 0x46, + 0x17, 0xc7, 0x2d, 0x51, 0xd4, 0xe5, 0xf8, 0x26, 0x8f, 0xfd, 0x25, 0x8a, 0xb2, 0x88, 0x43, 0x20, + 0x5f, 0xe4, 0x5c, 0xac, 0x7c, 0x0e, 0xf2, 0x21, 0x4e, 0x8a, 0x02, 0x56, 0x9c, 0x54, 0x42, 0x80, + 0x34, 0x9d, 0x18, 0xd9, 0x0a, 0x94, 0x38, 0x92, 0x88, 0x48, 0x24, 0x43, 0x8e, 0x1c, 0xb9, 0xe8, + 0x23, 0x64, 0xdf, 0x75, 0xbb, 0x29, 0xd0, 0x17, 0xe8, 0xb2, 0xbb, 0xa2, 0xcf, 0xd0, 0x45, 0x9e, + 0xa5, 0x98,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 0xb1, 0xf1, 0x3b, 0xa1, 0xab, 0xa2, 0xee, 0x3f, 0x69, + 0xdd, 0x33, 0x31, 0x8b, 0xaa, 0xda, 0x58, 0x36, 0xc9, 0x21, 0x54, 0xc7, 0xee, 0x62, 0x61, 0xf3, + 0x56, 0x0d, 0x15, 0x7b, 0x19, 0x05, 0xce, 0xf5, 0xd7, 0xa8, 0xb2, 0x12, 0xc7, 0xf5, 0x7e, 0xc9, + 0xfc, 0x8b, 0x56, 0x3d, 0xef, 0xb8, 0x7e, 0x10, 0x53, 0xe2, 0xb8, 0xd0, 0x46, 0x6c, 0xc5, 0x76, + 0x6c, 0x3e, 0x1c, 0xcf, 0x4c, 0xdb, 0x69, 0x35, 0xf2, 0xb6, 0x32, 0x70, 0x6c, 0xfe, 0x4c, 0x4c, + 0x8b, 0xad, 0xd8, 0x61, 0x87, 0x3c, 0x85, 0xf5, 0x11, 0x9b, 0xda, 0xce, 0x70, 0x34, 0x77, 0xc7, + 0xef, 0x5a, 0x80, 0xd2, 0x56, 0x5a, 0xda, 0x13, 0x06, 0x3d, 0x31, 0xdf, 0x5f, 0xa3, 0x30, 0x8a, + 0x7a, 0xe4, 0x11, 0x34, 0x98, 0x63, 0x29, 0xe9, 0x3a, 0x4a, 0xaf, 0x64, 0x22, 0xc0, 0xb1, 0x42, + 0x61, 0x9d, 0xa9, 0x76, 0xaf, 0x06, 0xfa, 0xb9, 0x39, 0x5f, 0x32, 0xe3, 0x36, 0xac, 0x27, 0x22, + 0x85, 0xb4, 0xa0, 0xb6, 0x60, 0x41, 0x60, 0x4e, 0x19, 0x86, 0x53, 0x83, 0x86, 0x5d, 0x63, 0x0b, + 0x36, 0x92, 0x71, 0x92, 0x10, 0x8a, 0x58, 0x10, 0xc2, 0x73, 0xe6, 0x07, 0x22, 0x00, 0x94, 0x50, + 0x75, 0x8d, 0x27, 0xd0, 0xcc, 0x06, 0x01, 0x69, 0x82, 0xf6, 0x8e, 0x5d, 0x28, 0x4b, 0xd1, 0x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, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x15, 0x2f, 0x59, 0xab, 0x11, + 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 6cf02966b..2424474d3 100644 --- a/types/types.proto +++ b/types/types.proto @@ -66,7 +66,7 @@ message RequestInitChain{ message RequestBeginBlock{ bytes hash = 1; Header header = 2; - repeated int32 absent_validators = 3 [(gogoproto.customtype) = "int", (gogoproto.nullable) = false]; + repeated int32 absent_validators = 3; repeated Evidence byzantine_validators = 4; } @@ -166,7 +166,7 @@ message Header { string chain_id = 1; int64 height = 2; int64 time = 3; - int32 num_txs = 4 [(gogoproto.customtype) = "int", (gogoproto.nullable) = false]; + int32 num_txs = 4; BlockID last_block_id = 5; bytes last_commit_hash = 6; bytes data_hash = 7; @@ -180,7 +180,7 @@ message BlockID { } message PartSetHeader { - int32 total = 1 [(gogoproto.customtype) = "int", (gogoproto.nullable) = false]; + int32 total = 1; bytes hash = 2; } From e99e6ea0c7d913a8484b642d222044a47565d65a Mon Sep 17 00:00:00 2001 From: Adrian Brink Date: Thu, 4 May 2017 11:29:25 +0200 Subject: [PATCH 73/80] Extend abci-cli to allow integration tests This commit adds the basic test command 'abci-cli test' that will allow developers of server for their own language to continuously test their implementation. --- README.md | 44 +++++++++++++++++ client/grpc_client.go | 5 +- cmd/abci-cli/abci-cli.go | 51 +++++++++++++++++++ tests/server/client.go | 103 +++++++++++++++++++++++++++++++++++++++ tests/test_cli/test.sh | 0 tests/tests.go | 1 + 6 files changed, 201 insertions(+), 3 deletions(-) create mode 100644 tests/server/client.go mode change 100644 => 100755 tests/test_cli/test.sh create mode 100644 tests/tests.go diff --git a/README.md b/README.md index 1b7f89007..3c7453a26 100644 --- a/README.md +++ b/README.md @@ -192,3 +192,47 @@ Here, we describe the requests and responses as function arguments and return va #### Flush * __Usage__:
* Signals that messages queued on the client should be flushed to the server. It is called periodically by the client implementation to ensure asynchronous requests are actually sent, and is called immediately to make a synchronous request, which returns when the Flush response comes back. + +# Implementation + +We provide three implementations of the ABCI in Go: + +1. ABCI-socket +2. GRPC +3. Golang in-process + +## Socket + +ABCI is best implemented as a streaming protocol. +The socket implementation provides for asynchronous, ordered message passing over unix or tcp. +Messages are serialized using Protobuf3 and length-prefixed. +Protobuf3 doesn't have an official length-prefix standard, so we use our own. The first byte represents the length of the big-endian encoded length. + +For example, if the Protobuf3 encoded ABCI message is `0xDEADBEEF` (4 bytes), the length-prefixed message is `0x0104DEADBEEF`. If the Protobuf3 encoded ABCI message is 65535 bytes long, the length-prefixed message would be like `0x02FFFF...`. + +## GRPC + +GRPC is an rpc framework native to Protocol Buffers with support in many languages. +Implementing the ABCI using GRPC can allow for faster prototyping, but is expected to be much slower than +the ordered, asynchronous socket protocol. + +Note the length-prefixing used in the socket implementation does not apply for GRPC. + +## In Process + +The simplest implementation just uses function calls within Go. +This means ABCI applications written in Golang can be compiled with TendermintCore and run as a single binary. + + +# Tools and Apps + +The `abci-cli` tool wraps any ABCI client and can be used for probing/testing an ABCI application. +See the [guide](https://tendermint.readthedocs.io/en/master/abci-cli.html) for more details. + +Multiple example apps are included: +- the `counter` application, which illustrates nonce checking in txs +- the `dummy` application, which illustrates a simple key-value merkle tree +- the `dummy --persistent` application, which augments the dummy with persistence and validator set changes + +When you are developing an implementation of the ABCI server in your favourite language, we provide the `abci-cli test` +command that allows you to run our tests against your own ABCI server. Please make sure that your server supports at least the TSP protocol, and optionally gRPC. diff --git a/client/grpc_client.go b/client/grpc_client.go index 9328fa326..f277e1d77 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -48,7 +48,6 @@ func (cli *grpcClient) OnStart() error { return err } RETRY_LOOP: - for { conn, err := grpc.Dial(cli.addr, grpc.WithInsecure(), grpc.WithDialer(dialerFunc)) if err != nil { @@ -83,8 +82,8 @@ func (cli *grpcClient) OnStop() { cli.mtx.Lock() defer cli.mtx.Unlock() // TODO: how to close conn? its not a net.Conn and grpc doesn't expose a Close() - /*if cli.conn != nil { - cli.conn.Close() + /*if cli.client.conn != nil { + cli.client.conn.Close() }*/ } diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index e7fae52ee..9e8e86b97 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -19,6 +19,7 @@ import ( "github.com/tendermint/abci/example/counter" "github.com/tendermint/abci/example/dummy" "github.com/tendermint/abci/server" + servertest "github.com/tendermint/abci/tests/server" "github.com/tendermint/abci/types" "github.com/tendermint/abci/version" ) @@ -141,6 +142,7 @@ func addCommands() { RootCmd.AddCommand(checkTxCmd) RootCmd.AddCommand(commitCmd) RootCmd.AddCommand(versionCmd) + RootCmd.AddCommand(testCmd) addQueryFlags() RootCmd.AddCommand(queryCmd) @@ -271,6 +273,16 @@ var dummyCmd = &cobra.Command{ }, } +var testCmd = &cobra.Command{ + Use: "test", + Short: "Run integration tests", + Long: "", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + return cmdTest(cmd, args) + }, +} + // Generates new Args array based off of previous call args to maintain flag persistence func persistentArgs(line []byte) []string { @@ -287,6 +299,45 @@ func persistentArgs(line []byte) []string { //-------------------------------------------------------------------------------- +func cmdTest(cmd *cobra.Command, args []string) error { + fmt.Println("Running tests") + + var err error + + err = servertest.InitChain(client) + fmt.Println("") + err = servertest.SetOption(client, "serial", "on") + fmt.Println("") + err = servertest.Commit(client, nil) + fmt.Println("") + err = servertest.DeliverTx(client, []byte("abc"), types.CodeType_BadNonce, nil) + fmt.Println("") + err = servertest.Commit(client, nil) + fmt.Println("") + err = servertest.DeliverTx(client, []byte{0x00}, types.CodeType_OK, nil) + fmt.Println("") + err = servertest.Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) + fmt.Println("") + err = servertest.DeliverTx(client, []byte{0x00}, types.CodeType_BadNonce, nil) + fmt.Println("") + err = servertest.DeliverTx(client, []byte{0x01}, types.CodeType_OK, nil) + fmt.Println("") + err = servertest.DeliverTx(client, []byte{0x00, 0x02}, types.CodeType_OK, nil) + fmt.Println("") + err = servertest.DeliverTx(client, []byte{0x00, 0x03}, types.CodeType_OK, nil) + fmt.Println("") + err = servertest.DeliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeType_OK, nil) + fmt.Println("") + err = servertest.DeliverTx(client, []byte{0x00, 0x00, 0x06}, types.CodeType_BadNonce, nil) + fmt.Println("") + err = servertest.Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5}) + + if err != nil { + return errors.New("Some checks didn't pass, please use the cli to see the exact failures.") + } + return nil +} + func cmdBatch(cmd *cobra.Command, args []string) error { bufReader := bufio.NewReader(os.Stdin) for { diff --git a/tests/server/client.go b/tests/server/client.go new file mode 100644 index 000000000..502e4e8e6 --- /dev/null +++ b/tests/server/client.go @@ -0,0 +1,103 @@ +package testsuite + +import ( + "bytes" + "errors" + "fmt" + + abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/types" + crypto "github.com/tendermint/go-crypto" + cmn "github.com/tendermint/tmlibs/common" +) + +func InitChain(client abcicli.Client) error { + total := 10 + vals := make([]*types.Validator, total) + for i := 0; i < total; i++ { + pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(cmn.Fmt("test%d", i))).PubKey().Bytes() + power := cmn.RandInt() + vals[i] = &types.Validator{pubkey, uint64(power)} + } + err := client.InitChainSync(vals) + if err != nil { + fmt.Println("Failed test: InitChain - %v", err) + return err + } + fmt.Println("Passed test: InitChain") + return nil +} + +func SetOption(client abcicli.Client, key, value string) error { + res := client.SetOptionSync(key, value) + _, _, log := res.Code, res.Data, res.Log + if res.IsErr() { + fmt.Println("Failed test: SetOption") + fmt.Printf("setting %v=%v: \nlog: %v", key, value, log) + fmt.Println("Failed test: SetOption") + return errors.New(res.Error()) + } + fmt.Println("Passed test: SetOption") + return nil +} + +func Commit(client abcicli.Client, hashExp []byte) error { + res := client.CommitSync() + _, data, log := res.Code, res.Data, res.Log + if res.IsErr() { + fmt.Println("Failed test: Commit") + fmt.Printf("committing %v\nlog: %v", log) + return errors.New(res.Error()) + } + if !bytes.Equal(res.Data, hashExp) { + fmt.Println("Failed test: Commit") + fmt.Printf("Commit hash was unexpected. Got %X expected %X", + data, hashExp) + return errors.New("CommitTx failed") + } + fmt.Println("Passed test: Commit") + return nil +} + +func DeliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) error { + res := client.DeliverTxSync(txBytes) + code, data, log := res.Code, res.Data, res.Log + if code != codeExp { + fmt.Println("Failed test: DeliverTx") + fmt.Printf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", + code, codeExp, log) + return errors.New("DeliverTx error") + } + if !bytes.Equal(data, dataExp) { + fmt.Println("Failed test: DeliverTx") + fmt.Printf("DeliverTx response data was unexpected. Got %X expected %X", + data, dataExp) + return errors.New("DeliverTx error") + } + fmt.Println("Passed test: DeliverTx") + return nil +} + +func CheckTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) error { + res := client.CheckTxSync(txBytes) + code, data, log := res.Code, res.Data, res.Log + if res.IsErr() { + fmt.Println("Failed test: CheckTx") + fmt.Printf("checking tx %X: %v\nlog: %v", txBytes, log) + return errors.New(res.Error()) + } + if code != codeExp { + fmt.Println("Failed test: CheckTx") + fmt.Printf("CheckTx response code was unexpected. Got %v expected %v. Log: %v", + code, codeExp, log) + return errors.New("CheckTx") + } + if !bytes.Equal(data, dataExp) { + fmt.Println("Failed test: CheckTx") + fmt.Printf("CheckTx response data was unexpected. Got %X expected %X", + data, dataExp) + return errors.New("CheckTx") + } + fmt.Println("Passed test: CheckTx") + return nil +} diff --git a/tests/test_cli/test.sh b/tests/test_cli/test.sh old mode 100644 new mode 100755 diff --git a/tests/tests.go b/tests/tests.go new file mode 100644 index 000000000..ca8701d29 --- /dev/null +++ b/tests/tests.go @@ -0,0 +1 @@ +package tests From 8357326db011b1b30bc13392423e953a815d95cf Mon Sep 17 00:00:00 2001 From: Krzysztof Jurewicz Date: Fri, 20 Oct 2017 18:44:37 +0200 Subject: [PATCH 74/80] Fix test command --- cmd/abci-cli/abci-cli.go | 43 ++++++++++++++++++++++++---------------- tests/server/client.go | 39 ++++++++++++++++-------------------- 2 files changed, 43 insertions(+), 39 deletions(-) diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 9e8e86b97..3ee454aa6 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -16,6 +16,7 @@ import ( "github.com/tendermint/tmlibs/log" abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/example/code" "github.com/tendermint/abci/example/counter" "github.com/tendermint/abci/example/dummy" "github.com/tendermint/abci/server" @@ -274,10 +275,10 @@ var dummyCmd = &cobra.Command{ } var testCmd = &cobra.Command{ - Use: "test", + Use: "test", Short: "Run integration tests", - Long: "", - Args: cobra.ExactArgs(0), + Long: "", + Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, args []string) error { return cmdTest(cmd, args) }, @@ -299,6 +300,14 @@ func persistentArgs(line []byte) []string { //-------------------------------------------------------------------------------- +func or(err1 error, err2 error) error { + if err1 == nil { + return err2 + } else { + return err1 + } +} + func cmdTest(cmd *cobra.Command, args []string) error { fmt.Println("Running tests") @@ -306,34 +315,34 @@ func cmdTest(cmd *cobra.Command, args []string) error { err = servertest.InitChain(client) fmt.Println("") - err = servertest.SetOption(client, "serial", "on") + err = or(err, servertest.SetOption(client, "serial", "on")) fmt.Println("") - err = servertest.Commit(client, nil) + err = or(err, servertest.Commit(client, nil)) fmt.Println("") - err = servertest.DeliverTx(client, []byte("abc"), types.CodeType_BadNonce, nil) + err = or(err, servertest.DeliverTx(client, []byte("abc"), code.CodeTypeBadNonce, nil)) fmt.Println("") - err = servertest.Commit(client, nil) + err = or(err, servertest.Commit(client, nil)) fmt.Println("") - err = servertest.DeliverTx(client, []byte{0x00}, types.CodeType_OK, nil) + err = or(err, servertest.DeliverTx(client, []byte{0x00}, code.CodeTypeOK, nil)) fmt.Println("") - err = servertest.Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) + err = or(err, servertest.Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1})) fmt.Println("") - err = servertest.DeliverTx(client, []byte{0x00}, types.CodeType_BadNonce, nil) + err = or(err, servertest.DeliverTx(client, []byte{0x00}, code.CodeTypeBadNonce, nil)) fmt.Println("") - err = servertest.DeliverTx(client, []byte{0x01}, types.CodeType_OK, nil) + err = or(err, servertest.DeliverTx(client, []byte{0x01}, code.CodeTypeOK, nil)) fmt.Println("") - err = servertest.DeliverTx(client, []byte{0x00, 0x02}, types.CodeType_OK, nil) + err = or(err, servertest.DeliverTx(client, []byte{0x00, 0x02}, code.CodeTypeOK, nil)) fmt.Println("") - err = servertest.DeliverTx(client, []byte{0x00, 0x03}, types.CodeType_OK, nil) + err = or(err, servertest.DeliverTx(client, []byte{0x00, 0x03}, code.CodeTypeOK, nil)) fmt.Println("") - err = servertest.DeliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeType_OK, nil) + err = or(err, servertest.DeliverTx(client, []byte{0x00, 0x00, 0x04}, code.CodeTypeOK, nil)) fmt.Println("") - err = servertest.DeliverTx(client, []byte{0x00, 0x00, 0x06}, types.CodeType_BadNonce, nil) + err = or(err, servertest.DeliverTx(client, []byte{0x00, 0x00, 0x06}, code.CodeTypeBadNonce, nil)) fmt.Println("") - err = servertest.Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5}) + err = or(err, servertest.Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5})) if err != nil { - return errors.New("Some checks didn't pass, please use the cli to see the exact failures.") + return errors.New("Some checks didn't pass, please inspect stdout to see the exact failures.") } return nil } diff --git a/tests/server/client.go b/tests/server/client.go index 502e4e8e6..f1757fe15 100644 --- a/tests/server/client.go +++ b/tests/server/client.go @@ -17,9 +17,9 @@ func InitChain(client abcicli.Client) error { for i := 0; i < total; i++ { pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(cmn.Fmt("test%d", i))).PubKey().Bytes() power := cmn.RandInt() - vals[i] = &types.Validator{pubkey, uint64(power)} + vals[i] = &types.Validator{pubkey, int64(power)} } - err := client.InitChainSync(vals) + _, err := client.InitChainSync(types.RequestInitChain{Validators: vals}) if err != nil { fmt.Println("Failed test: InitChain - %v", err) return err @@ -29,38 +29,38 @@ func InitChain(client abcicli.Client) error { } func SetOption(client abcicli.Client, key, value string) error { - res := client.SetOptionSync(key, value) - _, _, log := res.Code, res.Data, res.Log - if res.IsErr() { + res, err := client.SetOptionSync(types.RequestSetOption{Key: key, Value: value}) + log := res.GetLog() + if err != nil { fmt.Println("Failed test: SetOption") fmt.Printf("setting %v=%v: \nlog: %v", key, value, log) fmt.Println("Failed test: SetOption") - return errors.New(res.Error()) + return err } fmt.Println("Passed test: SetOption") return nil } func Commit(client abcicli.Client, hashExp []byte) error { - res := client.CommitSync() - _, data, log := res.Code, res.Data, res.Log - if res.IsErr() { + res, err := client.CommitSync() + _, data := res.Code, res.Data + if err != nil { fmt.Println("Failed test: Commit") - fmt.Printf("committing %v\nlog: %v", log) - return errors.New(res.Error()) + fmt.Printf("committing %v\nlog: %v", res.GetLog()) + return err } - if !bytes.Equal(res.Data, hashExp) { + if !bytes.Equal(data, hashExp) { fmt.Println("Failed test: Commit") fmt.Printf("Commit hash was unexpected. Got %X expected %X", - data, hashExp) + data.Bytes(), hashExp) return errors.New("CommitTx failed") } fmt.Println("Passed test: Commit") return nil } -func DeliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) error { - res := client.DeliverTxSync(txBytes) +func DeliverTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error { + res, _ := client.DeliverTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if code != codeExp { fmt.Println("Failed test: DeliverTx") @@ -78,14 +78,9 @@ func DeliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, da return nil } -func CheckTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) error { - res := client.CheckTxSync(txBytes) +func CheckTx(client abcicli.Client, txBytes []byte, codeExp uint32, dataExp []byte) error { + res, _ := client.CheckTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log - if res.IsErr() { - fmt.Println("Failed test: CheckTx") - fmt.Printf("checking tx %X: %v\nlog: %v", txBytes, log) - return errors.New(res.Error()) - } if code != codeExp { fmt.Println("Failed test: CheckTx") fmt.Printf("CheckTx response code was unexpected. Got %v expected %v. Log: %v", From f6e22e42960e32c91a050529b712ed64e13947fa Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 5 Dec 2017 17:22:06 -0500 Subject: [PATCH 75/80] update readme for notes about grpc --- README.md | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 1b7f89007..5ab2bfbbb 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,12 @@ [![CircleCI](https://circleci.com/gh/tendermint/abci.svg?style=svg)](https://circleci.com/gh/tendermint/abci) -Blockchains are a system for multi-master state machine replication. +Blockchains are systems for multi-master state machine replication. **ABCI** is an interface that defines the boundary between the replication engine (the blockchain), and the state machine (the application). By using a socket protocol, we enable a consensus engine running in one process to manage an application state running in another. -## Install - -``` -go get github.com/tendermint/abci -cd $GOPATH/src/github.com/tendermint/abci -make get_vendor_deps -make install -``` - For background information on ABCI, motivations, and tendermint, please visit [the documentation](http://tendermint.readthedocs.io/en/master/). The two guides to focus on are the `Application Development Guide` and `Using ABCI-CLI`. @@ -28,9 +19,17 @@ The community has provided a number of addtional implementations, see the `Tende We provide three implementations of the ABCI in Go: +- Golang in-process - ABCI-socket - GRPC -- Golang in-process + +Note the GRPC version is maintained primarily to simplify onboarding and prototyping and is not receiving the same +attention to security and performance as the others. + +### In Process + +The simplest implementation just uses function calls within Go. +This means ABCI applications written in Golang can be compiled with TendermintCore and run as a single binary. ### Socket @@ -45,15 +44,10 @@ For example, if the Protobuf3 encoded ABCI message is `0xDEADBEEF` (4 bytes), th GRPC is an rpc framework native to Protocol Buffers with support in many languages. Implementing the ABCI using GRPC can allow for faster prototyping, but is expected to be much slower than -the ordered, asynchronous socket protocol. +the ordered, asynchronous socket protocol. The implementation has also not received as much testing or review. Note the length-prefixing used in the socket implementation does not apply for GRPC. -### In Process - -The simplest implementation just uses function calls within Go. -This means ABCI applications written in Golang can be compiled with TendermintCore and run as a single binary. - ## Example Apps The `abci-cli` tool wraps any ABCI client and can be used for probing/testing an ABCI application. @@ -64,6 +58,15 @@ Multiple example apps are included: - the `abci-cli dummy` application, which illustrates a simple key-value merkle tree - the `abci-cli dummy --persistent` application, which augments the dummy with persistence and validator set changes +### Install + +``` +go get github.com/tendermint/abci +cd $GOPATH/src/github.com/tendermint/abci +make get_vendor_deps +make install +``` + ## Specification The [primary specification](https://github.com/tendermint/abci/blob/master/types/types.proto) is made using Protocol Buffers. From fff8e963f89fe00a5b529e3a06b5babb94b69996 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 5 Dec 2017 17:45:26 -0500 Subject: [PATCH 76/80] update readme --- README.md | 53 +++++++---------------------------------------------- 1 file changed, 7 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index adf9e9ef4..83c4e33bb 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ attention to security and performance as the others. The simplest implementation just uses function calls within Go. This means ABCI applications written in Golang can be compiled with TendermintCore and run as a single binary. -### Socket +### Socket (TSP) ABCI is best implemented as a streaming protocol. The socket implementation provides for asynchronous, ordered message passing over unix or tcp. @@ -48,11 +48,15 @@ the ordered, asynchronous socket protocol. The implementation has also not recei Note the length-prefixing used in the socket implementation does not apply for GRPC. -## Example Apps +## Tools -The `abci-cli` tool wraps any ABCI client and can be used for probing/testing an ABCI application. +The `abci-cli` tool wraps an ABCI client and can be used for probing/testing an ABCI server. +For instance, `abci-cli test` will run a test sequence against a listening server running the Counter application (see below). +It can also be used to run some example applications. See [the documentation](http://tendermint.readthedocs.io/en/master/) for more details. +### Example Apps + Multiple example apps are included: - the `abci-cli counter` application, which illustrates nonce checking in txs - the `abci-cli dummy` application, which illustrates a simple key-value merkle tree @@ -196,46 +200,3 @@ Here, we describe the requests and responses as function arguments and return va * __Usage__:
* Signals that messages queued on the client should be flushed to the server. It is called periodically by the client implementation to ensure asynchronous requests are actually sent, and is called immediately to make a synchronous request, which returns when the Flush response comes back. -# Implementation - -We provide three implementations of the ABCI in Go: - -1. ABCI-socket -2. GRPC -3. Golang in-process - -## Socket - -ABCI is best implemented as a streaming protocol. -The socket implementation provides for asynchronous, ordered message passing over unix or tcp. -Messages are serialized using Protobuf3 and length-prefixed. -Protobuf3 doesn't have an official length-prefix standard, so we use our own. The first byte represents the length of the big-endian encoded length. - -For example, if the Protobuf3 encoded ABCI message is `0xDEADBEEF` (4 bytes), the length-prefixed message is `0x0104DEADBEEF`. If the Protobuf3 encoded ABCI message is 65535 bytes long, the length-prefixed message would be like `0x02FFFF...`. - -## GRPC - -GRPC is an rpc framework native to Protocol Buffers with support in many languages. -Implementing the ABCI using GRPC can allow for faster prototyping, but is expected to be much slower than -the ordered, asynchronous socket protocol. - -Note the length-prefixing used in the socket implementation does not apply for GRPC. - -## In Process - -The simplest implementation just uses function calls within Go. -This means ABCI applications written in Golang can be compiled with TendermintCore and run as a single binary. - - -# Tools and Apps - -The `abci-cli` tool wraps any ABCI client and can be used for probing/testing an ABCI application. -See the [guide](https://tendermint.readthedocs.io/en/master/abci-cli.html) for more details. - -Multiple example apps are included: -- the `counter` application, which illustrates nonce checking in txs -- the `dummy` application, which illustrates a simple key-value merkle tree -- the `dummy --persistent` application, which augments the dummy with persistence and validator set changes - -When you are developing an implementation of the ABCI server in your favourite language, we provide the `abci-cli test` -command that allows you to run our tests against your own ABCI server. Please make sure that your server supports at least the TSP protocol, and optionally gRPC. From 1b2c383205e6bffc5b1cbffc35b663096c6920cd Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 5 Dec 2017 18:41:48 -0500 Subject: [PATCH 77/80] ResponseSetOption includes a response Code. Closes #64" --- CHANGELOG.md | 1 + README.md | 1 + cmd/abci-cli/abci-cli.go | 3 +- example/code/code.go | 2 + example/counter/counter.go | 10 +- types/application.go | 2 +- types/types.pb.go | 202 +++++++++++++++++++------------------ types/types.proto | 3 +- 8 files changed, 123 insertions(+), 101 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d66384d3..029067a0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ BREAKING CHANGES: - [types] `pubKey` -> `pub_key` - [types] `uint64` -> `int32` for `Header.num_txs` and `PartSetHeader.total` - [types] `uint64` -> `int64` for everything else + - [types] ResponseSetOption includes error code - [abci-cli] codes are printed as their number instead of a message, except for `code == 0`, which is still printed as `OK` FEATURES: diff --git a/README.md b/README.md index 83c4e33bb..46abcc4fd 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ Here, we describe the requests and responses as function arguments and return va * `Key (string)`: Key to set * `Value (string)`: Value to set for key * __Returns__: + * `Code (uint32)`: Response code * `Log (string)`: Debug or error message * __Usage__:
Set application options. E.g. Key="mode", Value="mempool" for a mempool connection, or Key="mode", Value="consensus" for a consensus connection. diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 3ee454aa6..18437ff71 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -429,7 +429,8 @@ func cmdSetOption(cmd *cobra.Command, args []string) error { return err } printResponse(cmd, args, response{ - Log: res.Log, + Code: res.Code, + Log: res.Log, }) return nil } diff --git a/example/code/code.go b/example/code/code.go index 94e9d015e..b7e37d366 100644 --- a/example/code/code.go +++ b/example/code/code.go @@ -6,4 +6,6 @@ const ( CodeTypeEncodingError uint32 = 1 CodeTypeBadNonce uint32 = 2 CodeTypeUnauthorized uint32 = 3 + + CodeTypeBadOption uint32 = 101 ) diff --git a/example/counter/counter.go b/example/counter/counter.go index 0978799e8..abd7bb183 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -29,8 +29,16 @@ func (app *CounterApplication) SetOption(req types.RequestSetOption) types.Respo key, value := req.Key, req.Value if key == "serial" && value == "on" { app.serial = true + } else { + return types.ResponseSetOption{ + Code: code.CodeTypeBadOption, + Log: cmn.Fmt("Unknown key (%s) or value (%s)", key, value), + } + } + + return types.ResponseSetOption{ + Code: code.CodeTypeOK, } - return types.ResponseSetOption{} } func (app *CounterApplication) DeliverTx(tx []byte) types.ResponseDeliverTx { diff --git a/types/application.go b/types/application.go index 6c0b8bd04..c8ea19c3a 100644 --- a/types/application.go +++ b/types/application.go @@ -42,7 +42,7 @@ func (BaseApplication) Info(req RequestInfo) ResponseInfo { } func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption { - return ResponseSetOption{} + return ResponseSetOption{Code: CodeTypeOK} } func (BaseApplication) DeliverTx(tx []byte) ResponseDeliverTx { diff --git a/types/types.pb.go b/types/types.pb.go index 9233a05c8..69777d6d5 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -1212,7 +1212,8 @@ func (m *ResponseInfo) GetLastBlockAppHash() []byte { } type ResponseSetOption struct { - Log string `protobuf:"bytes,1,opt,name=log,proto3" json:"log,omitempty"` + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` } func (m *ResponseSetOption) Reset() { *m = ResponseSetOption{} } @@ -1220,6 +1221,13 @@ func (m *ResponseSetOption) String() string { return proto.CompactTex func (*ResponseSetOption) ProtoMessage() {} func (*ResponseSetOption) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{17} } +func (m *ResponseSetOption) GetCode() uint32 { + if m != nil { + return m.Code + } + return 0 +} + func (m *ResponseSetOption) GetLog() string { if m != nil { return m.Log @@ -2059,101 +2067,101 @@ func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ // 1554 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b,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0x30, 0x8a, - 0x7a, 0xe4, 0x11, 0x34, 0x98, 0x63, 0x29, 0xe9, 0x3a, 0x4a, 0xaf, 0x64, 0x22, 0xc0, 0xb1, 0x42, - 0x61, 0x9d, 0xa9, 0x76, 0xaf, 0x06, 0xfa, 0xb9, 0x39, 0x5f, 0x32, 0xe3, 0x36, 0xac, 0x27, 0x22, - 0x85, 0xb4, 0xa0, 0xb6, 0x60, 0x41, 0x60, 0x4e, 0x19, 0x86, 0x53, 0x83, 0x86, 0x5d, 0x63, 0x0b, - 0x36, 0x92, 0x71, 0x92, 0x10, 0x8a, 0x58, 0x10, 0xc2, 0x73, 0xe6, 0x07, 0x22, 0x00, 0x94, 0x50, - 0x75, 0x8d, 0x27, 0xd0, 0xcc, 0x06, 0x01, 0x69, 0x82, 0xf6, 0x8e, 0x5d, 0x28, 0x4b, 0xd1, 0x24, - 0x7b, 0xca, 0x21, 0x0c, 0xcd, 0x06, 0x55, 0xde, 0x19, 0x91, 0x36, 0x0a, 0x03, 0xb2, 0x05, 0x65, - 0xbe, 0x42, 0xe9, 0x06, 0x2d, 0xf3, 0x95, 0xb1, 0x0f, 0x5b, 0xe9, 0x4f, 0x7e, 0xc9, 0xc2, 0x8a, - 0x5c, 0xc7, 0x6f, 0x46, 0x08, 0x54, 0x2c, 0x93, 0x9b, 0xca, 0x02, 0xdb, 0x62, 0xcc, 0x33, 0xf9, - 0x4c, 0xfd, 0x3c, 0xb6, 0xc9, 0x15, 0xa8, 0xce, 0x98, 0x3d, 0x9d, 0x71, 0xbc, 0x03, 0x1a, 0x55, - 0x3d, 0xe1, 0xab, 0xe7, 0xbb, 0xe7, 0x0c, 0x43, 0xbd, 0x4e, 0x65, 0xc7, 0xd8, 0x86, 0xcd, 0x54, - 0x20, 0x19, 0xa7, 0x91, 0xf3, 0xd1, 0x87, 0x27, 0x0f, 0x00, 0xce, 0xcd, 0xb9, 0x6d, 0x99, 0xdc, - 0xf5, 0x83, 0x56, 0x69, 0x5f, 0xeb, 0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 0x55, 0x26, 0x73, 0x72, 0x4d, 0x70, 0xde, - 0xb4, 0x9d, 0xa1, 0x6d, 0x85, 0x7c, 0xc1, 0xfe, 0xc0, 0x4a, 0x1c, 0x5a, 0x39, 0x75, 0x68, 0x04, - 0x2a, 0xdc, 0x5e, 0x30, 0x85, 0x06, 0x6c, 0x93, 0xab, 0x50, 0x73, 0x96, 0x8b, 0x21, 0x5f, 0xc9, - 0xc0, 0xd4, 0x69, 0xd5, 0x59, 0x2e, 0xce, 0x56, 0x01, 0x39, 0x82, 0xcd, 0x04, 0x28, 0x6c, 0x4b, - 0x25, 0xb0, 0x2d, 0xe5, 0x1a, 0xfa, 0x3d, 0x38, 0xa5, 0xeb, 0x11, 0x32, 0x06, 0x16, 0xe9, 0x00, - 0x12, 0x64, 0x28, 0x93, 0x84, 0x24, 0x4b, 0x15, 0xc9, 0xb2, 0x25, 0xc6, 0x55, 0x16, 0x11, 0x95, - 0xca, 0x75, 0x68, 0x88, 0x93, 0x94, 0x26, 0x35, 0x34, 0xa9, 0x8b, 0x01, 0x9c, 0xbc, 0x0d, 0xdb, - 0x71, 0xa1, 0x21, 0x4d, 0xea, 0x72, 0x95, 0x78, 0x18, 0x0d, 0xaf, 0x41, 0x3d, 0x22, 0x58, 0x03, - 0x2d, 0x6a, 0xa6, 0x02, 0xd7, 0x00, 0x6a, 0xca, 0xc5, 0xdc, 0x4a, 0xe9, 0x0e, 0xe8, 0x9e, 0xe9, - 0xf3, 0x40, 0x15, 0x08, 0x61, 0xfe, 0x7a, 0x6d, 0xfa, 0xa2, 0x46, 0x55, 0xf5, 0x92, 0x34, 0x31, - 0x8e, 0x61, 0x33, 0x35, 0x2e, 0xae, 0x1f, 0x77, 0xb9, 0x39, 0xc7, 0x15, 0x75, 0x2a, 0x3b, 0xd1, - 0xcf, 0x94, 0xe3, 0x9f, 0x31, 0x9e, 0x40, 0x23, 0xfa, 0x86, 0xe2, 0xa8, 0xbd, 0xe5, 0x68, 0x18, - 0x96, 0xbd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, 0x58, 0xe9, 0x91, 0xc7, 0x50, 0x0b, 0x33, 0x57, 0xfe, 0x63, - 0xb7, 0x5d, 0x50, 0xec, 0x89, 0xe3, 0x91, 0xf9, 0x24, 0xef, 0x0d, 0xdb, 0xce, 0xad, 0xdf, 0xc8, - 0x23, 0xa8, 0x2a, 0x94, 0xe6, 0xbe, 0x93, 0xdb, 0xf9, 0x55, 0xa2, 0xd8, 0x64, 0xfc, 0xdc, 0x29, - 0x7a, 0x00, 0xb7, 0x0b, 0xeb, 0x3f, 0x72, 0x02, 0x90, 0x78, 0xe7, 0x14, 0x3e, 0x83, 0xdb, 0xc5, - 0x55, 0x20, 0x11, 0x77, 0x27, 0x7a, 0x69, 0xe4, 0x3f, 0x86, 0xdb, 0x45, 0x85, 0xe0, 0xa8, 0x8a, - 0xff, 0x60, 0x79, 0xf8, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x15, 0x2f, 0x59, 0xab, 0x11, + 0x17, 0xc7, 0x2d, 0x51, 0xd4, 0xe5, 0xf8, 0x26, 0x8f, 0xfd, 0x25, 0x8a, 0xb2, 0x88, 0x43, 0xe0, + 0x6b, 0xe4, 0x5c, 0xac, 0xd4, 0x41, 0x8a, 0x38, 0x29, 0x0a, 0x58, 0x71, 0x52, 0x09, 0x01, 0xd2, + 0x74, 0x62, 0x64, 0x2b, 0x50, 0xe2, 0x48, 0x22, 0x22, 0x91, 0x0c, 0x39, 0x72, 0xe4, 0xa2, 0x8f, + 0x90, 0x7d, 0xd7, 0xed, 0xa6, 0x40, 0x5f, 0xa0, 0xcb, 0xee, 0x8a, 0x3e, 0x43, 0x17, 0x79, 0x96, + 0x62, 0xce, 0x0c, 0xaf, 0x26, 0xb3, 0xc8, 0x22, 0x1b, 0x63, 0x2e, 0xe7, 0x3f, 0x3a, 0x33, 0x3c, + 0xf3, 0x3b, 0x67, 0x0c, 0x3b, 0xfc, 0xc2, 0x63, 0x41, 0x17, 0xff, 0x1e, 0x7a, 0xbe,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, 0x5c, 0x23, 0x35, 0xd0, 0x06, 0x2f, 0xcf, 0x9a, 0xa5, + 0xa3, 0x0f, 0x3a, 0x6c, 0x9f, 0xf4, 0x9e, 0x0e, 0x4e, 0x3c, 0x6f, 0x6e, 0x8f, 0x4d, 0xcc, 0x3b, + 0x5d, 0xa8, 0x60, 0x66, 0xcd, 0x79, 0xe0, 0xb6, 0xf3, 0x4a, 0x3c, 0x72, 0x04, 0x3a, 0x26, 0x58, + 0x92, 0xf7, 0xce, 0x6d, 0xe7, 0x56, 0x7a, 0xe2, 0x47, 0x64, 0x0a, 0xbe, 0xfc, 0xdc, 0x6d, 0xe7, + 0x95, 0x7b, 0xe4, 0x3b, 0x68, 0xc4, 0xa9, 0xb1, 0xe8, 0xd1, 0xdb, 0x2e, 0x2c, 0xfc, 0x84, 0x3e, + 0x4e, 0x8f, 0x45, 0x4f, 0xdf, 0x76, 0x61, 0xf5, 0x47, 0x1e, 0x41, 0x2d, 0xcc, 0x5c, 0xf9, 0x0f, + 0xe0, 0x76, 0x41, 0x01, 0x28, 0x8e, 0x47, 0xe6, 0x93, 0xbc, 0x77, 0x6d, 0x3b, 0xb7, 0xa6, 0x23, + 0x0f, 0xa1, 0xaa, 0x50, 0x9a, 0xfb, 0x76, 0x6e, 0xe7, 0x57, 0x8e, 0x62, 0x93, 0xf1, 0x13, 0xa8, + 0xe8, 0x51, 0xdc, 0x2e, 0xac, 0x09, 0xc9, 0x09, 0x40, 0xe2, 0xed, 0x53, 0xf8, 0x34, 0x6e, 0x17, + 0x57, 0x86, 0x44, 0xdc, 0x9d, 0xe8, 0xf5, 0x91, 0xff, 0x40, 0x6e, 0x17, 0x15, 0x87, 0xa3, 0x2a, + 0xfe, 0xd3, 0xe5, 0xc1, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x00, 0x4d, 0x6a, 0x92, 0xbf, 0x11, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 2424474d3..516cca15b 100644 --- a/types/types.proto +++ b/types/types.proto @@ -114,7 +114,8 @@ message ResponseInfo { } message ResponseSetOption{ - string log = 1; + uint32 code = 1; + string log = 2; } message ResponseDeliverTx{ From e1ee4d6bf5067c366acb484393da17e395fa4332 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 6 Dec 2017 01:56:39 -0500 Subject: [PATCH 78/80] types: add MarshalJSON funcs for Response types with a Code --- types/messages_test.go | 8 ++++++++ types/result.go | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/types/messages_test.go b/types/messages_test.go index 607215be1..32f09623f 100644 --- a/types/messages_test.go +++ b/types/messages_test.go @@ -2,12 +2,20 @@ package types import ( "bytes" + "encoding/json" + "strings" "testing" "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/assert" ) +func TestMarshalJSON(t *testing.T) { + b, err := json.Marshal(&ResponseDeliverTx{}) + assert.Nil(t, err) + assert.True(t, strings.Contains(string(b), "code")) +} + func TestWriteReadMessage(t *testing.T) { cases := []proto.Message{ &Header{ diff --git a/types/result.go b/types/result.go index cb2fb7a38..1963520da 100644 --- a/types/result.go +++ b/types/result.go @@ -2,6 +2,8 @@ package types import ( "fmt" + + "github.com/gogo/protobuf/jsonpb" ) const ( @@ -71,3 +73,36 @@ func (r ResponseQuery) Error() string { func fmtError(code uint32, log string) string { return fmt.Sprintf("Error code (%d): %s", code, log) } + +//--------------------------------------------------------------------------- +// override JSON marshalling so we dont emit defaults (ie. disable omitempty) + +func (r *ResponseSetOption) MarshalJSON() ([]byte, error) { + m := jsonpb.Marshaler{EmitDefaults: true} + s, err := m.MarshalToString(r) + return []byte(s), err +} + +func (r *ResponseCheckTx) MarshalJSON() ([]byte, error) { + m := jsonpb.Marshaler{EmitDefaults: true} + s, err := m.MarshalToString(r) + return []byte(s), err +} + +func (r *ResponseDeliverTx) MarshalJSON() ([]byte, error) { + m := jsonpb.Marshaler{EmitDefaults: true} + s, err := m.MarshalToString(r) + return []byte(s), err +} + +func (r *ResponseQuery) MarshalJSON() ([]byte, error) { + m := jsonpb.Marshaler{EmitDefaults: true} + s, err := m.MarshalToString(r) + return []byte(s), err +} + +func (r *ResponseCommit) MarshalJSON() ([]byte, error) { + m := jsonpb.Marshaler{EmitDefaults: true} + s, err := m.MarshalToString(r) + return []byte(s), err +} From f860c33515cd06a1dd65af9062bc5cdc6b35e63c Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 6 Dec 2017 02:33:35 -0500 Subject: [PATCH 79/80] changelog and version --- CHANGELOG.md | 2 +- version/version.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 029067a0f..47bf92939 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.8.0 (TBD) +## 0.8.0 (December 6, 2017) BREAKING CHANGES: - [client] all XxxSync methods now return (ResponseXxx, error) diff --git a/version/version.go b/version/version.go index e02653d83..c06995264 100644 --- a/version/version.go +++ b/version/version.go @@ -3,7 +3,7 @@ package version // NOTE: we should probably be versioning the ABCI and the abci-cli separately const Maj = "0" -const Min = "7" -const Fix = "1" +const Min = "8" +const Fix = "0" -const Version = "0.7.1" +const Version = "0.8.0" From 293cf5e63426fcd9c50f5b20018ee03bfb9dae1d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 6 Dec 2017 02:41:14 -0500 Subject: [PATCH 80/80] minor fix [ci skip] --- CHANGELOG.md | 1 + tests/client_server_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47bf92939..64c0cbce1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ FEATURES: - [types] RequestBeginBlock: added `absent_validators` and `byzantine_validators` fields - [dummy] DeliverTx returns an owner tag and a key tag - [abci-cli] added `log_level` flag to control the logger + - [abci-cli] introduce `abci-cli test` command for simple testing of ABCI server implementations via Counter application ## 0.7.1 (November 14, 2017) diff --git a/tests/client_server_test.go b/tests/client_server_test.go index 646c8b609..3d74478bc 100644 --- a/tests/client_server_test.go +++ b/tests/client_server_test.go @@ -1,4 +1,4 @@ -package main +package tests import ( "testing"