From 98c4679f39414a3ff7a1896aab6884f54f7d820b Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 10 Jan 2017 15:29:47 +0100 Subject: [PATCH 01/10] Fixed Makefile to cleanup after run --- .gitignore | 1 + Makefile | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d2d414be..920af762 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.swp *.swo *.pyc +vendor diff --git a/Makefile b/Makefile index d80410ff..4db16ccd 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ install: go install github.com/tendermint/abci/cmd/... test: - go test `${NOVENDOR}` + find . -name test.sock -exec rm {} \; + go test -p 1 `${NOVENDOR}` bash tests/test.sh test_integrations: get_vendor_deps install test From 58ea995032ccb4098fe56b904a41f34de879981e Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 10 Jan 2017 15:49:26 +0100 Subject: [PATCH 02/10] Begin adding proof calls --- client/client.go | 2 ++ client/grpc_client.go | 18 ++++++++++++++++++ client/local_client.go | 17 +++++++++++++++++ client/socket_client.go | 15 +++++++++++++++ cmd/abci-cli/tmsp-cli.go | 19 +++++++++++++++++++ example/chain_aware/chain_aware_app.go | 4 ++++ example/counter/counter.go | 4 ++++ example/dummy/dummy.go | 4 ++++ example/dummy/persistent_dummy.go | 4 ++++ example/nil/nil_app.go | 4 ++++ server/socket_server.go | 3 +++ types/application.go | 8 ++++++++ types/messages.go | 12 ++++++++++++ types/types.proto | 19 +++++++++++++++++-- 14 files changed, 131 insertions(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index 8ea29593..a8bc8ea8 100644 --- a/client/client.go +++ b/client/client.go @@ -21,6 +21,7 @@ type Client interface { DeliverTxAsync(tx []byte) *ReqRes CheckTxAsync(tx []byte) *ReqRes QueryAsync(tx []byte) *ReqRes + ProofAsync(tx []byte) *ReqRes CommitAsync() *ReqRes FlushSync() error @@ -30,6 +31,7 @@ type Client interface { DeliverTxSync(tx []byte) (res types.Result) CheckTxSync(tx []byte) (res types.Result) QuerySync(tx []byte) (res types.Result) + ProofSync(tx []byte) (res types.Result) CommitSync() (res types.Result) InitChainAsync(validators []*types.Validator) *ReqRes diff --git a/client/grpc_client.go b/client/grpc_client.go index 566ee183..740623c6 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -182,6 +182,15 @@ func (cli *grpcClient) QueryAsync(query []byte) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_Query{res}}) } +func (cli *grpcClient) ProofAsync(key []byte) *ReqRes { + req := types.ToRequestProof(key) + res, err := cli.client.Proof(context.Background(), req.GetProof(), grpc.FailFast(true)) + if err != nil { + cli.StopForError(err) + } + return cli.finishAsyncCall(req, &types.Response{&types.Response_Proof{res}}) +} + func (cli *grpcClient) CommitAsync() *ReqRes { req := types.ToRequestCommit() res, err := cli.client.Commit(context.Background(), req.GetCommit(), grpc.FailFast(true)) @@ -301,6 +310,15 @@ func (cli *grpcClient) CheckTxSync(tx []byte) (res types.Result) { return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } +func (cli *grpcClient) ProofSync(key []byte) (res types.Result) { + reqres := cli.ProofAsync(key) + if res := cli.checkErrGetResult(); res.IsErr() { + return res + } + resp := reqres.Response.GetProof() + return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} +} + func (cli *grpcClient) QuerySync(query []byte) (res types.Result) { reqres := cli.QueryAsync(query) if res := cli.checkErrGetResult(); res.IsErr() { diff --git a/client/local_client.go b/client/local_client.go index b787eb36..8c092cec 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -99,6 +99,16 @@ func (app *localClient) QueryAsync(tx []byte) *ReqRes { ) } +func (app *localClient) ProofAsync(key []byte) *ReqRes { + app.mtx.Lock() + res := app.Application.Proof(key) + app.mtx.Unlock() + return app.callback( + types.ToRequestProof(key), + types.ToResponseQuery(res.Code, res.Data, res.Log), + ) +} + func (app *localClient) CommitAsync() *ReqRes { app.mtx.Lock() res := app.Application.Commit() @@ -192,6 +202,13 @@ func (app *localClient) QuerySync(query []byte) (res types.Result) { return res } +func (app *localClient) ProofSync(key []byte) (res types.Result) { + app.mtx.Lock() + res = app.Application.Proof(key) + app.mtx.Unlock() + return res +} + func (app *localClient) CommitSync() (res types.Result) { app.mtx.Lock() res = app.Application.Commit() diff --git a/client/socket_client.go b/client/socket_client.go index 9b4f9aed..252c8777 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -255,6 +255,10 @@ func (cli *socketClient) QueryAsync(query []byte) *ReqRes { return cli.queueRequest(types.ToRequestQuery(query)) } +func (cli *socketClient) ProofAsync(key []byte) *ReqRes { + return cli.queueRequest(types.ToRequestProof(key)) +} + func (cli *socketClient) CommitAsync() *ReqRes { return cli.queueRequest(types.ToRequestCommit()) } @@ -345,6 +349,15 @@ func (cli *socketClient) QuerySync(query []byte) (res types.Result) { return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } +func (cli *socketClient) ProofSync(key []byte) (res types.Result) { + reqres := cli.queueRequest(types.ToRequestProof(key)) + cli.FlushSync() + if err := cli.Error(); err != nil { + return types.ErrInternalError.SetLog(err.Error()) + } + resp := reqres.Response.GetProof() + return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} +} func (cli *socketClient) CommitSync() (res types.Result) { reqres := cli.queueRequest(types.ToRequestCommit()) cli.FlushSync() @@ -437,6 +450,8 @@ func resMatchesReq(req *types.Request, res *types.Response) (ok bool) { _, ok = res.Value.(*types.Response_Commit) case *types.Request_Query: _, ok = res.Value.(*types.Response_Query) + case *types.Request_Proof: + _, ok = res.Value.(*types.Response_Proof) case *types.Request_InitChain: _, ok = res.Value.(*types.Response_InitChain) case *types.Request_BeginBlock: diff --git a/cmd/abci-cli/tmsp-cli.go b/cmd/abci-cli/tmsp-cli.go index 39dace9f..d40b510b 100644 --- a/cmd/abci-cli/tmsp-cli.go +++ b/cmd/abci-cli/tmsp-cli.go @@ -131,6 +131,13 @@ func main() { return cmdQuery(c) }, }, + { + Name: "proof", + Usage: "Get proof for a key", + Action: func(c *cli.Context) error { + return cmdProof(c) + }, + }, } app.Before = before err := app.Run(os.Args) @@ -305,6 +312,18 @@ func cmdQuery(c *cli.Context) error { return nil } +// Prove application state +func cmdProof(c *cli.Context) error { + args := c.Args() + if len(args) != 1 { + return errors.New("Command proof takes 1 argument") + } + keyBytes := stringOrHexToBytes(c.Args()[0]) + res := client.ProofSync(keyBytes) + printResponse(c, res, string(res.Data), true) + return nil +} + //-------------------------------------------------------------------------------- func printResponse(c *cli.Context, rsp *response) { diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index e3543f13..387a88e8 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -61,6 +61,10 @@ func (app *ChainAwareApplication) Query(query []byte) types.Result { return types.NewResultOK([]byte(Fmt("%d,%d", app.beginCount, app.endCount)), "") } +func (app *ChainAwareApplication) Proof(key []byte) types.Result { + return types.NewResultOK(nil, Fmt("Proof is not supported")) +} + func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) { app.beginCount += 1 return diff --git a/example/counter/counter.go b/example/counter/counter.go index 90be6d92..e5b17992 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -83,3 +83,7 @@ func (app *CounterApplication) Query(query []byte) types.Result { return types.ErrUnknownRequest.SetLog(Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr)) } + +func (app *CounterApplication) Proof(key []byte) types.Result { + return types.NewResultOK(nil, Fmt("Proof is not supported")) +} diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 6fdf8785..2336add8 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -53,6 +53,10 @@ func (app *DummyApplication) Query(query []byte) types.Result { return types.NewResultOK(wire.JSONBytes(queryResult), "") } +func (app *DummyApplication) Proof(key []byte) types.Result { + return types.NewResultOK(nil, Fmt("TODO: support proof!")) +} + type QueryResult struct { Index int `json:"index"` Value string `json:"value"` diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index fa730bcb..bb8783ee 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -93,6 +93,10 @@ func (app *PersistentDummyApplication) Query(query []byte) types.Result { return app.app.Query(query) } +func (app *PersistentDummyApplication) Proof(key []byte) types.Result { + return types.NewResultOK(nil, Fmt("TODO: support proof!")) +} + // Save the validators in the merkle tree func (app *PersistentDummyApplication) InitChain(validators []*types.Validator) { for _, v := range validators { diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index cd57f0d9..a4d181c0 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -34,3 +34,7 @@ func (app *NilApplication) Commit() types.Result { func (app *NilApplication) Query(query []byte) types.Result { return types.NewResultOK(nil, "") } + +func (app *NilApplication) Proof(key []byte) types.Result { + return types.NewResultOK(nil, "") +} diff --git a/server/socket_server.go b/server/socket_server.go index bd26a18a..046b55ed 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -186,6 +186,9 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types case *types.Request_Query: res := s.app.Query(r.Query.Query) responses <- types.ToResponseQuery(res.Code, res.Data, res.Log) + case *types.Request_Proof: + res := s.app.Proof(r.Proof.Key, r.Proof.Height) + responses <- types.ToResponseProof(res.Code, res.Data, res.Log) case *types.Request_InitChain: if app, ok := s.app.(types.BlockchainAware); ok { app.InitChain(r.InitChain.Validators) diff --git a/types/application.go b/types/application.go index 4da5e6f7..95f35d4a 100644 --- a/types/application.go +++ b/types/application.go @@ -22,6 +22,9 @@ type Application interface { // Query for state Query(query []byte) Result + // Get proof for state + Proof(key []byte, blockHeight int) Result + // Return the application Merkle root hash Commit() Result } @@ -82,6 +85,11 @@ func (app *GRPCApplication) Query(ctx context.Context, req *RequestQuery) (*Resp return &ResponseQuery{r.Code, r.Data, r.Log}, nil } +func (app *GRPCApplication) Proof(ctx context.Context, req *RequestProof) (*ResponseQuery, error) { + r := app.app.Proof(req.Key, req.Height) + return &ResponseProof{r.Code, r.Data, r.Log}, 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 diff --git a/types/messages.go b/types/messages.go index 84e6ee0b..b445c535 100644 --- a/types/messages.go +++ b/types/messages.go @@ -55,6 +55,12 @@ func ToRequestQuery(queryBytes []byte) *Request { } } +func ToRequestProof(key []byte, blockHeight int) *Request { + return &Request{ + Value: &Request_Proof{&RequestProof{key, blockHeight}}, + } +} + func ToRequestInitChain(validators []*Validator) *Request { return &Request{ Value: &Request_InitChain{&RequestInitChain{validators}}, @@ -129,6 +135,12 @@ func ToResponseQuery(code CodeType, data []byte, log string) *Response { } } +func ToResponseProof(code CodeType, data []byte, log string) *Response { + return &Response{ + Value: &Response_Proof{&ResponseProof{code, data, log}}, + } +} + func ToResponseInitChain() *Response { return &Response{ Value: &Response_InitChain{&ResponseInitChain{}}, diff --git a/types/types.proto b/types/types.proto index b3ff1655..09a2af8f 100644 --- a/types/types.proto +++ b/types/types.proto @@ -6,7 +6,7 @@ package types; //---------------------------------------- // Message types -// Not being used +// Not being used // Could be added to request/response // so we don't have to type switch // (would be twice as fast, but we're talking about 15ns) @@ -25,6 +25,7 @@ enum MessageType { InitChain = 0x15; BeginBlock = 0x16; EndBlock = 0x17; + Proof = 0x18; } //---------------------------------------- @@ -116,6 +117,12 @@ message RequestQuery{ bytes query = 1; } +message RequestProof{ + bytes key = 1; + int64 height = 2; +} + + message RequestCommit{ } @@ -150,6 +157,7 @@ message Response { ResponseInitChain init_chain = 10; ResponseBeginBlock begin_block = 11; ResponseEndBlock end_block = 12; + ResponseProof proof = 13; } } @@ -193,6 +201,12 @@ message ResponseQuery{ string log = 3; } +message ResponseProof{ + CodeType code = 1; + bytes data = 2; + string log = 3; +} + message ResponseCommit{ CodeType code = 1; bytes data = 2; @@ -222,7 +236,7 @@ message Header { bytes last_commit_hash = 6; bytes data_hash = 7; bytes validators_hash = 8; - bytes app_hash = 9; + bytes app_hash = 9; } message BlockID { @@ -251,6 +265,7 @@ service ABCIApplication { rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); rpc Query(RequestQuery) returns (ResponseQuery); + rpc Proof(RequestProof) returns (ResponseProof); rpc Commit(RequestCommit) returns (ResponseCommit); rpc InitChain(RequestInitChain) returns (ResponseInitChain); rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); From 7cd39dafea5e2d14d4f6bbab18dbb280f77629a7 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 10 Jan 2017 15:59:29 +0100 Subject: [PATCH 03/10] Update protocol buffers --- Makefile | 4 + example/chain_aware/chain_aware_app.go | 2 +- example/counter/counter.go | 2 +- example/dummy/dummy.go | 2 +- example/dummy/persistent_dummy.go | 2 +- example/nil/nil_app.go | 2 +- types/application.go | 4 +- types/messages.go | 2 +- types/types.pb.go | 413 +++++++++++++++++-------- types/types.proto | 2 +- 10 files changed, 301 insertions(+), 134 deletions(-) diff --git a/Makefile b/Makefile index 4db16ccd..740bce9b 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ all: protoc install test NOVENDOR = go list github.com/tendermint/abci/... | grep -v /vendor/ +install-protoc: + # Download: https://github.com/google/protobuf/releases + go get github.com/golang/protobuf/protoc-gen-go + protoc: protoc --go_out=plugins=grpc:. types/*.proto diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index 387a88e8..f335e543 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -61,7 +61,7 @@ func (app *ChainAwareApplication) Query(query []byte) types.Result { return types.NewResultOK([]byte(Fmt("%d,%d", app.beginCount, app.endCount)), "") } -func (app *ChainAwareApplication) Proof(key []byte) types.Result { +func (app *ChainAwareApplication) Proof(key []byte, blockHeight int64) types.Result { return types.NewResultOK(nil, Fmt("Proof is not supported")) } diff --git a/example/counter/counter.go b/example/counter/counter.go index e5b17992..9ffec400 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -84,6 +84,6 @@ func (app *CounterApplication) Query(query []byte) types.Result { return types.ErrUnknownRequest.SetLog(Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr)) } -func (app *CounterApplication) Proof(key []byte) types.Result { +func (app *CounterApplication) Proof(key []byte, blockHeight int64) types.Result { return types.NewResultOK(nil, Fmt("Proof is not supported")) } diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 2336add8..ebce1099 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -53,7 +53,7 @@ func (app *DummyApplication) Query(query []byte) types.Result { return types.NewResultOK(wire.JSONBytes(queryResult), "") } -func (app *DummyApplication) Proof(key []byte) types.Result { +func (app *DummyApplication) Proof(key []byte, blockHeight int64) types.Result { return types.NewResultOK(nil, Fmt("TODO: support proof!")) } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index bb8783ee..70c0e667 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -93,7 +93,7 @@ func (app *PersistentDummyApplication) Query(query []byte) types.Result { return app.app.Query(query) } -func (app *PersistentDummyApplication) Proof(key []byte) types.Result { +func (app *PersistentDummyApplication) Proof(key []byte, blockHeight int64) types.Result { return types.NewResultOK(nil, Fmt("TODO: support proof!")) } diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index a4d181c0..1088ac96 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -35,6 +35,6 @@ func (app *NilApplication) Query(query []byte) types.Result { return types.NewResultOK(nil, "") } -func (app *NilApplication) Proof(key []byte) types.Result { +func (app *NilApplication) Proof(key []byte, blockHeight int64) types.Result { return types.NewResultOK(nil, "") } diff --git a/types/application.go b/types/application.go index 95f35d4a..5ba440dd 100644 --- a/types/application.go +++ b/types/application.go @@ -23,7 +23,7 @@ type Application interface { Query(query []byte) Result // Get proof for state - Proof(key []byte, blockHeight int) Result + Proof(key []byte, blockHeight int64) Result // Return the application Merkle root hash Commit() Result @@ -85,7 +85,7 @@ func (app *GRPCApplication) Query(ctx context.Context, req *RequestQuery) (*Resp return &ResponseQuery{r.Code, r.Data, r.Log}, nil } -func (app *GRPCApplication) Proof(ctx context.Context, req *RequestProof) (*ResponseQuery, error) { +func (app *GRPCApplication) Proof(ctx context.Context, req *RequestProof) (*ResponseProof, error) { r := app.app.Proof(req.Key, req.Height) return &ResponseProof{r.Code, r.Data, r.Log}, nil } diff --git a/types/messages.go b/types/messages.go index b445c535..9e303a71 100644 --- a/types/messages.go +++ b/types/messages.go @@ -55,7 +55,7 @@ func ToRequestQuery(queryBytes []byte) *Request { } } -func ToRequestProof(key []byte, blockHeight int) *Request { +func ToRequestProof(key []byte, blockHeight int64) *Request { return &Request{ Value: &Request_Proof{&RequestProof{key, blockHeight}}, } diff --git a/types/types.pb.go b/types/types.pb.go index 6cae5433..8467a78c 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -17,6 +17,7 @@ It has these top-level messages: RequestDeliverTx RequestCheckTx RequestQuery + RequestProof RequestCommit RequestInitChain RequestBeginBlock @@ -30,6 +31,7 @@ It has these top-level messages: ResponseDeliverTx ResponseCheckTx ResponseQuery + ResponseProof ResponseCommit ResponseInitChain ResponseBeginBlock @@ -81,6 +83,7 @@ const ( MessageType_InitChain MessageType = 21 MessageType_BeginBlock MessageType = 22 MessageType_EndBlock MessageType = 23 + MessageType_Proof MessageType = 24 ) var MessageType_name = map[int32]string{ @@ -97,6 +100,7 @@ var MessageType_name = map[int32]string{ 21: "InitChain", 22: "BeginBlock", 23: "EndBlock", + 24: "Proof", } var MessageType_value = map[string]int32{ "NullMessage": 0, @@ -112,6 +116,7 @@ var MessageType_value = map[string]int32{ "InitChain": 21, "BeginBlock": 22, "EndBlock": 23, + "Proof": 24, } func (x MessageType) String() string { @@ -240,6 +245,7 @@ type Request struct { // *Request_InitChain // *Request_BeginBlock // *Request_EndBlock + // *Request_Proof Value isRequest_Value `protobuf_oneof:"value"` } @@ -285,6 +291,9 @@ type Request_BeginBlock struct { type Request_EndBlock struct { EndBlock *RequestEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,oneof"` } +type Request_Proof struct { + Proof *RequestProof `protobuf:"bytes,12,opt,name=proof,oneof"` +} func (*Request_Echo) isRequest_Value() {} func (*Request_Flush) isRequest_Value() {} @@ -297,6 +306,7 @@ func (*Request_Query) isRequest_Value() {} func (*Request_InitChain) isRequest_Value() {} func (*Request_BeginBlock) isRequest_Value() {} func (*Request_EndBlock) isRequest_Value() {} +func (*Request_Proof) isRequest_Value() {} func (m *Request) GetValue() isRequest_Value { if m != nil { @@ -382,6 +392,13 @@ func (m *Request) GetEndBlock() *RequestEndBlock { return nil } +func (m *Request) GetProof() *RequestProof { + if x, ok := m.GetValue().(*Request_Proof); ok { + return x.Proof + } + return nil +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*Request) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Request_OneofMarshaler, _Request_OneofUnmarshaler, _Request_OneofSizer, []interface{}{ @@ -396,6 +413,7 @@ func (*Request) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error (*Request_InitChain)(nil), (*Request_BeginBlock)(nil), (*Request_EndBlock)(nil), + (*Request_Proof)(nil), } } @@ -458,6 +476,11 @@ func _Request_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { if err := b.EncodeMessage(x.EndBlock); err != nil { return err } + case *Request_Proof: + b.EncodeVarint(12<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Proof); err != nil { + return err + } case nil: default: return fmt.Errorf("Request.Value has unexpected type %T", x) @@ -556,6 +579,14 @@ func _Request_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer err := b.DecodeMessage(msg) m.Value = &Request_EndBlock{msg} return true, err + case 12: // value.proof + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RequestProof) + err := b.DecodeMessage(msg) + m.Value = &Request_Proof{msg} + return true, err default: return false, nil } @@ -620,6 +651,11 @@ func _Request_OneofSizer(msg proto.Message) (n int) { n += proto.SizeVarint(11<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s + case *Request_Proof: + s := proto.Size(x.Proof) + n += proto.SizeVarint(12<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -731,13 +767,37 @@ func (m *RequestQuery) GetQuery() []byte { return nil } +type RequestProof struct { + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Height int64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` +} + +func (m *RequestProof) Reset() { *m = RequestProof{} } +func (m *RequestProof) String() string { return proto.CompactTextString(m) } +func (*RequestProof) ProtoMessage() {} +func (*RequestProof) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *RequestProof) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *RequestProof) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + 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 fileDescriptor0, []int{9} } type RequestInitChain struct { Validators []*Validator `protobuf:"bytes,1,rep,name=validators" json:"validators,omitempty"` @@ -746,7 +806,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 fileDescriptor0, []int{10} } func (m *RequestInitChain) GetValidators() []*Validator { if m != nil { @@ -763,7 +823,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 fileDescriptor0, []int{11} } func (m *RequestBeginBlock) GetHash() []byte { if m != nil { @@ -786,7 +846,7 @@ type RequestEndBlock struct { 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 fileDescriptor0, []int{12} } func (m *RequestEndBlock) GetHeight() uint64 { if m != nil { @@ -809,13 +869,14 @@ type Response struct { // *Response_InitChain // *Response_BeginBlock // *Response_EndBlock + // *Response_Proof Value isResponse_Value `protobuf_oneof:"value"` } 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 fileDescriptor0, []int{13} } type isResponse_Value interface { isResponse_Value() @@ -857,6 +918,9 @@ type Response_BeginBlock struct { type Response_EndBlock struct { EndBlock *ResponseEndBlock `protobuf:"bytes,12,opt,name=end_block,json=endBlock,oneof"` } +type Response_Proof struct { + Proof *ResponseProof `protobuf:"bytes,13,opt,name=proof,oneof"` +} func (*Response_Exception) isResponse_Value() {} func (*Response_Echo) isResponse_Value() {} @@ -870,6 +934,7 @@ func (*Response_Query) isResponse_Value() {} func (*Response_InitChain) isResponse_Value() {} func (*Response_BeginBlock) isResponse_Value() {} func (*Response_EndBlock) isResponse_Value() {} +func (*Response_Proof) isResponse_Value() {} func (m *Response) GetValue() isResponse_Value { if m != nil { @@ -962,6 +1027,13 @@ func (m *Response) GetEndBlock() *ResponseEndBlock { return nil } +func (m *Response) GetProof() *ResponseProof { + if x, ok := m.GetValue().(*Response_Proof); ok { + return x.Proof + } + return nil +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*Response) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Response_OneofMarshaler, _Response_OneofUnmarshaler, _Response_OneofSizer, []interface{}{ @@ -977,6 +1049,7 @@ func (*Response) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) erro (*Response_InitChain)(nil), (*Response_BeginBlock)(nil), (*Response_EndBlock)(nil), + (*Response_Proof)(nil), } } @@ -1044,6 +1117,11 @@ func _Response_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { if err := b.EncodeMessage(x.EndBlock); err != nil { return err } + case *Response_Proof: + b.EncodeVarint(13<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Proof); err != nil { + return err + } case nil: default: return fmt.Errorf("Response.Value has unexpected type %T", x) @@ -1150,6 +1228,14 @@ func _Response_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffe err := b.DecodeMessage(msg) m.Value = &Response_EndBlock{msg} return true, err + case 13: // value.proof + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ResponseProof) + err := b.DecodeMessage(msg) + m.Value = &Response_Proof{msg} + return true, err default: return false, nil } @@ -1219,6 +1305,11 @@ func _Response_OneofSizer(msg proto.Message) (n int) { n += proto.SizeVarint(12<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s + case *Response_Proof: + s := proto.Size(x.Proof) + n += proto.SizeVarint(13<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -1233,7 +1324,7 @@ type ResponseException struct { 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 fileDescriptor0, []int{14} } func (m *ResponseException) GetError() string { if m != nil { @@ -1249,7 +1340,7 @@ type ResponseEcho struct { 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 fileDescriptor0, []int{15} } func (m *ResponseEcho) GetMessage() string { if m != nil { @@ -1264,7 +1355,7 @@ 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 fileDescriptor0, []int{16} } type ResponseInfo struct { Data string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` @@ -1276,7 +1367,7 @@ type ResponseInfo struct { 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 fileDescriptor0, []int{17} } func (m *ResponseInfo) GetData() string { if m != nil { @@ -1313,7 +1404,7 @@ type ResponseSetOption struct { 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 fileDescriptor0, []int{18} } func (m *ResponseSetOption) GetLog() string { if m != nil { @@ -1331,7 +1422,7 @@ type ResponseDeliverTx struct { 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 fileDescriptor0, []int{19} } func (m *ResponseDeliverTx) GetCode() CodeType { if m != nil { @@ -1363,7 +1454,7 @@ type ResponseCheckTx struct { 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 fileDescriptor0, []int{20} } func (m *ResponseCheckTx) GetCode() CodeType { if m != nil { @@ -1395,7 +1486,7 @@ type ResponseQuery struct { 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 fileDescriptor0, []int{21} } func (m *ResponseQuery) GetCode() CodeType { if m != nil { @@ -1418,6 +1509,38 @@ func (m *ResponseQuery) GetLog() string { return "" } +type ResponseProof 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"` +} + +func (m *ResponseProof) Reset() { *m = ResponseProof{} } +func (m *ResponseProof) String() string { return proto.CompactTextString(m) } +func (*ResponseProof) ProtoMessage() {} +func (*ResponseProof) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *ResponseProof) GetCode() CodeType { + if m != nil { + return m.Code + } + return CodeType_OK +} + +func (m *ResponseProof) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *ResponseProof) GetLog() string { + if m != nil { + return m.Log + } + return "" +} + 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"` @@ -1427,7 +1550,7 @@ type ResponseCommit struct { 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 fileDescriptor0, []int{23} } func (m *ResponseCommit) GetCode() CodeType { if m != nil { @@ -1456,7 +1579,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 fileDescriptor0, []int{24} } type ResponseBeginBlock struct { } @@ -1464,7 +1587,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 fileDescriptor0, []int{25} } type ResponseEndBlock struct { Diffs []*Validator `protobuf:"bytes,4,rep,name=diffs" json:"diffs,omitempty"` @@ -1473,7 +1596,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 fileDescriptor0, []int{26} } func (m *ResponseEndBlock) GetDiffs() []*Validator { if m != nil { @@ -1497,7 +1620,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 fileDescriptor0, []int{27} } func (m *Header) GetChainId() string { if m != nil { @@ -1570,7 +1693,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 fileDescriptor0, []int{28} } func (m *BlockID) GetHash() []byte { if m != nil { @@ -1594,7 +1717,7 @@ type PartSetHeader struct { 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 fileDescriptor0, []int{29} } func (m *PartSetHeader) GetTotal() uint64 { if m != nil { @@ -1618,7 +1741,7 @@ type Validator struct { 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 fileDescriptor0, []int{30} } func (m *Validator) GetPubKey() []byte { if m != nil { @@ -1643,6 +1766,7 @@ func init() { proto.RegisterType((*RequestDeliverTx)(nil), "types.RequestDeliverTx") proto.RegisterType((*RequestCheckTx)(nil), "types.RequestCheckTx") proto.RegisterType((*RequestQuery)(nil), "types.RequestQuery") + proto.RegisterType((*RequestProof)(nil), "types.RequestProof") proto.RegisterType((*RequestCommit)(nil), "types.RequestCommit") proto.RegisterType((*RequestInitChain)(nil), "types.RequestInitChain") proto.RegisterType((*RequestBeginBlock)(nil), "types.RequestBeginBlock") @@ -1656,6 +1780,7 @@ func init() { proto.RegisterType((*ResponseDeliverTx)(nil), "types.ResponseDeliverTx") proto.RegisterType((*ResponseCheckTx)(nil), "types.ResponseCheckTx") proto.RegisterType((*ResponseQuery)(nil), "types.ResponseQuery") + proto.RegisterType((*ResponseProof)(nil), "types.ResponseProof") proto.RegisterType((*ResponseCommit)(nil), "types.ResponseCommit") proto.RegisterType((*ResponseInitChain)(nil), "types.ResponseInitChain") proto.RegisterType((*ResponseBeginBlock)(nil), "types.ResponseBeginBlock") @@ -1686,6 +1811,7 @@ type ABCIApplicationClient interface { DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) + Proof(ctx context.Context, in *RequestProof, opts ...grpc.CallOption) (*ResponseProof, error) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error) @@ -1763,6 +1889,15 @@ func (c *aBCIApplicationClient) Query(ctx context.Context, in *RequestQuery, opt return out, nil } +func (c *aBCIApplicationClient) Proof(ctx context.Context, in *RequestProof, opts ...grpc.CallOption) (*ResponseProof, error) { + out := new(ResponseProof) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Proof", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *aBCIApplicationClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) { out := new(ResponseCommit) err := grpc.Invoke(ctx, "/types.ABCIApplication/Commit", in, out, c.cc, opts...) @@ -1809,6 +1944,7 @@ type ABCIApplicationServer interface { DeliverTx(context.Context, *RequestDeliverTx) (*ResponseDeliverTx, error) CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error) Query(context.Context, *RequestQuery) (*ResponseQuery, error) + Proof(context.Context, *RequestProof) (*ResponseProof, error) Commit(context.Context, *RequestCommit) (*ResponseCommit, error) InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) BeginBlock(context.Context, *RequestBeginBlock) (*ResponseBeginBlock, error) @@ -1945,6 +2081,24 @@ func _ABCIApplication_Query_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _ABCIApplication_Proof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestProof) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ABCIApplicationServer).Proof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/types.ABCIApplication/Proof", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ABCIApplicationServer).Proof(ctx, req.(*RequestProof)) + } + return interceptor(ctx, in, info, handler) +} + func _ABCIApplication_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestCommit) if err := dec(in); err != nil { @@ -2049,6 +2203,10 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ MethodName: "Query", Handler: _ABCIApplication_Query_Handler, }, + { + MethodName: "Proof", + Handler: _ABCIApplication_Proof_Handler, + }, { MethodName: "Commit", Handler: _ABCIApplication_Commit_Handler, @@ -2073,108 +2231,113 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1642 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0xc9, 0x6e, 0xdb, 0xdc, - 0x15, 0x36, 0x35, 0xeb, 0xc8, 0x96, 0xae, 0x8f, 0x65, 0x5b, 0x56, 0xbb, 0x08, 0xd8, 0xa6, 0xb1, - 0xdd, 0x34, 0x29, 0x1c, 0xa4, 0x88, 0x9b, 0xa2, 0x80, 0xa7, 0xd8, 0x42, 0x90, 0xc4, 0x65, 0x86, - 0x45, 0x5b, 0x54, 0xa0, 0xc5, 0x2b, 0x89, 0x35, 0x45, 0x32, 0x1c, 0x1c, 0xbb, 0xcf, 0x90, 0x7d, - 0x1f, 0xa1, 0x4f, 0xd0, 0xd5, 0xbf, 0xff, 0x81, 0x7f, 0x1e, 0x9e, 0xe8, 0xc7, 0x1d, 0x38, 0x9a, - 0xcc, 0x2a, 0x1b, 0x81, 0x67, 0xbc, 0xd3, 0x77, 0xbe, 0x7b, 0xae, 0x60, 0x35, 0xb8, 0x71, 0xa9, - 0xff, 0x90, 0xff, 0x3e, 0x70, 0x3d, 0x27, 0x70, 0xb0, 0xce, 0x05, 0xf5, 0xcb, 0x1a, 0x34, 0x35, - 0xfa, 0x3e, 0xa4, 0x7e, 0x80, 0xdb, 0x50, 0xa3, 0x93, 0xb9, 0x33, 0x50, 0xee, 0x28, 0xdb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, - 0xc7, 0xf5, 0xb0, 0xb8, 0x4d, 0x66, 0x8b, 0x4c, 0x5e, 0x5f, 0x65, 0xaf, 0xe6, 0x61, 0x69, 0x03, - 0x8c, 0x07, 0x69, 0x92, 0xc3, 0xd2, 0xb7, 0xf3, 0xb0, 0xbc, 0x0d, 0xc6, 0xa7, 0x09, 0x2f, 0x62, - 0xc9, 0x0b, 0x7a, 0x58, 0xd6, 0x09, 0x5f, 0x34, 0xf8, 0x9f, 0x33, 0x8f, 0x7e, 0x09, 0x00, 0x00, - 0xff, 0xff, 0x84, 0x7d, 0xd1, 0x2f, 0xb1, 0x11, 0x00, 0x00, + // 1714 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0x5b, 0x6f, 0xe4, 0x48, + 0x15, 0x8e, 0xfb, 0xde, 0xa7, 0x93, 0x4e, 0xe5, 0xe4, 0xe6, 0x34, 0x3c, 0x8c, 0x0c, 0xcb, 0x66, + 0x86, 0x61, 0x06, 0x65, 0xb5, 0x68, 0xc2, 0x22, 0xa4, 0x64, 0x26, 0x9b, 0xb4, 0x56, 0x3b, 0x13, + 0xbc, 0xb3, 0xfb, 0x00, 0x88, 0x96, 0xd3, 0xae, 0xee, 0x36, 0x71, 0x6c, 0x8f, 0x2f, 0xd9, 0x84, + 0x3f, 0xc2, 0x4f, 0xe0, 0x17, 0xf0, 0xc2, 0x13, 0x4f, 0x48, 0xdc, 0x2f, 0x7f, 0x85, 0x3f, 0x80, + 0x4e, 0x55, 0xf9, 0x1a, 0x9b, 0xa7, 0xd9, 0x97, 0x96, 0xeb, 0xdc, 0xaa, 0x4e, 0xd5, 0x77, 0xbe, + 0x3a, 0x5d, 0xb0, 0x15, 0xdf, 0x07, 0x3c, 0x7a, 0x2e, 0x7e, 0x9f, 0x05, 0xa1, 0x1f, 0xfb, 0xd8, + 0x15, 0x03, 0xe3, 0xbf, 0x1d, 0xe8,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xc6, + 0x75, 0xb9, 0xc6, 0x3d, 0xe8, 0xad, 0xb8, 0xb3, 0x5c, 0xc5, 0x62, 0x91, 0x6d, 0x53, 0x8d, 0x8c, + 0x4d, 0xd8, 0x28, 0xa1, 0xca, 0x78, 0x95, 0x2d, 0x3b, 0x43, 0x01, 0xfe, 0x10, 0xe0, 0xd6, 0x72, + 0x1d, 0xdb, 0x8a, 0xfd, 0x30, 0xd2, 0xb5, 0x47, 0xed, 0xc3, 0xd1, 0x11, 0x53, 0x27, 0xf1, 0x55, + 0xaa, 0x30, 0x0b, 0x36, 0xc6, 0x6b, 0xd8, 0x7a, 0x00, 0x08, 0x44, 0xe8, 0xac, 0xac, 0x68, 0xa5, + 0x96, 0x25, 0xbe, 0xf1, 0x03, 0x5a, 0x97, 0x65, 0xf3, 0x50, 0x95, 0xfa, 0x86, 0x0a, 0x7b, 0x21, + 0x84, 0xa6, 0x52, 0x1a, 0x8f, 0x61, 0xb3, 0x82, 0x92, 0x42, 0x46, 0x14, 0xaf, 0x93, 0x65, 0xf4, + 0x87, 0x2e, 0x0c, 0x4c, 0x1e, 0x05, 0xbe, 0x17, 0x71, 0x7c, 0x01, 0x43, 0x7e, 0x37, 0xe7, 0xb2, + 0xe0, 0xb5, 0x0a, 0x60, 0xa5, 0xcd, 0x59, 0xaa, 0x27, 0xb0, 0x67, 0xc6, 0xf8, 0x58, 0x91, 0x55, + 0x95, 0x81, 0x94, 0x53, 0x91, 0xad, 0x9e, 0xa6, 0x6c, 0xd5, 0xae, 0x54, 0xab, 0xb4, 0xad, 0xd0, + 0xd5, 0x63, 0x45, 0x57, 0x9d, 0xda, 0xc0, 0x25, 0xbe, 0x3a, 0x2e, 0xf1, 0x55, 0xb7, 0x76, 0xf9, + 0x0d, 0x84, 0x75, 0x5c, 0x22, 0xac, 0x5e, 0xad, 0x6b, 0x03, 0x63, 0x7d, 0x54, 0x60, 0xac, 0x7e, + 0xa5, 0x50, 0xa5, 0x63, 0x0d, 0x65, 0x3d, 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 0xa9, 0xd2, 0xc4, 0xba, 0x47, 0x80, 0x49, 0x6d, 0xaf, 0x4d, + 0x93, 0xc8, 0xb6, 0xe6, 0xe1, 0x5b, 0xc0, 0xa4, 0xae, 0xe1, 0xc6, 0x9f, 0x16, 0x4a, 0x1d, 0x9b, + 0x5e, 0x04, 0x26, 0x8d, 0xad, 0x37, 0xf9, 0xe7, 0x7d, 0x48, 0xd3, 0xbb, 0xc0, 0xa4, 0xb1, 0xff, + 0xc6, 0x17, 0x19, 0x7b, 0x60, 0xfd, 0xeb, 0xc0, 0xa4, 0xa1, 0x05, 0xa7, 0xed, 0x91, 0x3d, 0x44, + 0xdd, 0x9f, 0xfe, 0x49, 0x6d, 0x57, 0x4d, 0x3e, 0xb2, 0x37, 0xa8, 0xfb, 0x37, 0x3d, 0xa9, 0x6d, + 0x55, 0xf1, 0xe3, 0x94, 0xd2, 0xb0, 0xf6, 0x31, 0x62, 0x52, 0xdf, 0xef, 0xd3, 0xc6, 0xe4, 0x7f, + 0x23, 0x9b, 0x5e, 0x19, 0x26, 0x8d, 0x9d, 0x3c, 0x9e, 0x14, 0x39, 0x12, 0x1b, 0xdf, 0x1a, 0x26, + 0xcd, 0xfd, 0x3c, 0x7e, 0x92, 0xd3, 0x2a, 0x36, 0xbc, 0x38, 0x4c, 0x9a, 0x5a, 0xfa, 0xab, 0x9e, + 0x78, 0xcc, 0xfa, 0xe8, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xce, 0x8c, 0x71, 0x92, 0xe1, 0x12, + 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 09a2af8f..16dc2856 100644 --- a/types/types.proto +++ b/types/types.proto @@ -87,6 +87,7 @@ message Request { RequestInitChain init_chain = 9; RequestBeginBlock begin_block = 10; RequestEndBlock end_block = 11; + RequestProof proof = 12; } } @@ -122,7 +123,6 @@ message RequestProof{ int64 height = 2; } - message RequestCommit{ } From cfc3f247516574944f99e55a20544bbd81910a0d Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 10 Jan 2017 17:06:51 +0100 Subject: [PATCH 04/10] Everything compiles, test proof in dummy app --- client/client.go | 4 ++-- client/grpc_client.go | 8 ++++---- client/local_client.go | 10 +++++----- client/socket_client.go | 8 ++++---- cmd/abci-cli/tmsp-cli.go | 20 +++++++++++++++----- example/dummy/dummy.go | 11 ++++++++++- example/dummy/dummy_test.go | 22 ++++++++++++++++++++++ example/dummy/persistent_dummy.go | 2 +- 8 files changed, 63 insertions(+), 22 deletions(-) diff --git a/client/client.go b/client/client.go index a8bc8ea8..fd31b21a 100644 --- a/client/client.go +++ b/client/client.go @@ -21,7 +21,7 @@ type Client interface { DeliverTxAsync(tx []byte) *ReqRes CheckTxAsync(tx []byte) *ReqRes QueryAsync(tx []byte) *ReqRes - ProofAsync(tx []byte) *ReqRes + ProofAsync(key []byte, blockHeight int64) *ReqRes CommitAsync() *ReqRes FlushSync() error @@ -31,7 +31,7 @@ type Client interface { DeliverTxSync(tx []byte) (res types.Result) CheckTxSync(tx []byte) (res types.Result) QuerySync(tx []byte) (res types.Result) - ProofSync(tx []byte) (res types.Result) + ProofSync(key []byte, blockHeight int64) (res types.Result) CommitSync() (res types.Result) InitChainAsync(validators []*types.Validator) *ReqRes diff --git a/client/grpc_client.go b/client/grpc_client.go index 740623c6..3654c47c 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -182,8 +182,8 @@ func (cli *grpcClient) QueryAsync(query []byte) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_Query{res}}) } -func (cli *grpcClient) ProofAsync(key []byte) *ReqRes { - req := types.ToRequestProof(key) +func (cli *grpcClient) ProofAsync(key []byte, blockHeight int64) *ReqRes { + req := types.ToRequestProof(key, blockHeight) res, err := cli.client.Proof(context.Background(), req.GetProof(), grpc.FailFast(true)) if err != nil { cli.StopForError(err) @@ -310,8 +310,8 @@ func (cli *grpcClient) CheckTxSync(tx []byte) (res types.Result) { return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } -func (cli *grpcClient) ProofSync(key []byte) (res types.Result) { - reqres := cli.ProofAsync(key) +func (cli *grpcClient) ProofSync(key []byte, blockHeight int64) (res types.Result) { + reqres := cli.ProofAsync(key, blockHeight) if res := cli.checkErrGetResult(); res.IsErr() { return res } diff --git a/client/local_client.go b/client/local_client.go index 8c092cec..bdc59c5a 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -99,12 +99,12 @@ func (app *localClient) QueryAsync(tx []byte) *ReqRes { ) } -func (app *localClient) ProofAsync(key []byte) *ReqRes { +func (app *localClient) ProofAsync(key []byte, blockHeight int64) *ReqRes { app.mtx.Lock() - res := app.Application.Proof(key) + res := app.Application.Proof(key, blockHeight) app.mtx.Unlock() return app.callback( - types.ToRequestProof(key), + types.ToRequestProof(key, blockHeight), types.ToResponseQuery(res.Code, res.Data, res.Log), ) } @@ -202,9 +202,9 @@ func (app *localClient) QuerySync(query []byte) (res types.Result) { return res } -func (app *localClient) ProofSync(key []byte) (res types.Result) { +func (app *localClient) ProofSync(key []byte, blockHeight int64) (res types.Result) { app.mtx.Lock() - res = app.Application.Proof(key) + res = app.Application.Proof(key, blockHeight) app.mtx.Unlock() return res } diff --git a/client/socket_client.go b/client/socket_client.go index 252c8777..cacd67bf 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -255,8 +255,8 @@ func (cli *socketClient) QueryAsync(query []byte) *ReqRes { return cli.queueRequest(types.ToRequestQuery(query)) } -func (cli *socketClient) ProofAsync(key []byte) *ReqRes { - return cli.queueRequest(types.ToRequestProof(key)) +func (cli *socketClient) ProofAsync(key []byte, blockHeight int64) *ReqRes { + return cli.queueRequest(types.ToRequestProof(key, blockHeight)) } func (cli *socketClient) CommitAsync() *ReqRes { @@ -349,8 +349,8 @@ func (cli *socketClient) QuerySync(query []byte) (res types.Result) { return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } -func (cli *socketClient) ProofSync(key []byte) (res types.Result) { - reqres := cli.queueRequest(types.ToRequestProof(key)) +func (cli *socketClient) ProofSync(key []byte, blockHeight int64) (res types.Result) { + reqres := cli.queueRequest(types.ToRequestProof(key, blockHeight)) cli.FlushSync() if err := cli.Error(); err != nil { return types.ErrInternalError.SetLog(err.Error()) diff --git a/cmd/abci-cli/tmsp-cli.go b/cmd/abci-cli/tmsp-cli.go index d40b510b..0eae4d85 100644 --- a/cmd/abci-cli/tmsp-cli.go +++ b/cmd/abci-cli/tmsp-cli.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "os" + "strconv" "strings" "github.com/tendermint/abci/client" @@ -315,12 +316,21 @@ func cmdQuery(c *cli.Context) error { // Prove application state func cmdProof(c *cli.Context) error { args := c.Args() - if len(args) != 1 { - return errors.New("Command proof takes 1 argument") + if len(args) < 1 { + return errors.New("Command proof takes 1 or 2 arguments") } - keyBytes := stringOrHexToBytes(c.Args()[0]) - res := client.ProofSync(keyBytes) - printResponse(c, res, string(res.Data), true) + keyBytes, err := stringOrHexToBytes(c.Args()[0]) + if err != nil { + return err + } + + var height int64 + if len(args) == 2 { + height, _ = strconv.ParseInt(args[1], 10, 0) + } + res := client.ProofSync(keyBytes, height) + rsp := newResponse(res, string(res.Data), true) + printResponse(c, rsp) return nil } diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index ebce1099..fcf067dc 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -2,6 +2,7 @@ package dummy import ( "encoding/hex" + "fmt" "strings" "github.com/tendermint/abci/types" @@ -54,7 +55,15 @@ func (app *DummyApplication) Query(query []byte) types.Result { } func (app *DummyApplication) Proof(key []byte, blockHeight int64) types.Result { - return types.NewResultOK(nil, Fmt("TODO: support proof!")) + if blockHeight != 0 { + return types.ErrUnknownRequest + } + proof, exists := app.state.Proof(key) + if !exists { + fmt.Println("Didn't find nothing") + return types.NewResultOK(nil, "") + } + return types.NewResultOK(proof, "Found the key") } type QueryResult struct { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index d2294347..8cd999c0 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -8,6 +8,7 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" + merkle "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" "github.com/tendermint/abci/types" ) @@ -34,6 +35,27 @@ func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value stri t.Fatalf("Got %s, expected %s", q.Value, value) } + rp := dummy.Proof([]byte(key), 0) + if rp.IsErr() { + t.Fatal(rp) + } + + p, err := merkle.LoadProof(rp.Data) + if err != nil { + t.Fatal(err) + } + + if !p.Valid() { + t.Fatal("Invalid proof") + } + + if !bytes.Equal([]byte(key), p.Key()) { + t.Fatalf("Invalid key: %s", p.Key()) + } + + if !bytes.Equal([]byte(value), p.Value()) { + t.Fatalf("Invalid key: %s", p.Value()) + } } func TestDummyKV(t *testing.T) { diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 70c0e667..3a1ce3b5 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -94,7 +94,7 @@ func (app *PersistentDummyApplication) Query(query []byte) types.Result { } func (app *PersistentDummyApplication) Proof(key []byte, blockHeight int64) types.Result { - return types.NewResultOK(nil, Fmt("TODO: support proof!")) + return app.app.Proof(key, blockHeight) } // Save the validators in the merkle tree From 732274b7f6ad695a5b02a537b97c852b92f34c69 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 10 Jan 2017 18:12:20 +0100 Subject: [PATCH 05/10] Add tests for client-server proofs over socket and grpc --- README.md | 22 ++- example/dummy/dummy_test.go | 158 +++++++++++---- example/dummy/dummy_test.go.orig | 321 +++++++++++++++++++++++++++++++ glide.lock | 15 +- glide.yaml | 4 + 5 files changed, 473 insertions(+), 47 deletions(-) create mode 100644 example/dummy/dummy_test.go.orig diff --git a/README.md b/README.md index ea09fa7c..3a9b27cb 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,8 @@ [![CircleCI](https://circleci.com/gh/tendermint/abci.svg?style=svg)](https://circleci.com/gh/tendermint/abci) -Blockchains are a system for creating shared multi-master application state. +Blockchains are a system for creating shared multi-master application state. **ABCI** is a socket protocol enabling a blockchain consensus engine, running in one process, -to manage a blockchain application state, running in another. For more information on ABCI, motivations, and tutorials, please visit [our blog post](https://tendermint.com/blog/abci-the-tendermint-socket-protocol). @@ -18,15 +17,15 @@ Other implementations: This repository holds a number of important pieces: - `types/types.proto` - - the protobuf file defining ABCI message types, and the optional grpc interface. + - the protobuf file defining ABCI message types, and the optional grpc interface. - to build, run `make protoc` - see `protoc --help` and [the grpc docs](https://www.grpc.io/docs) for examples and details of other languages - golang implementation of ABCI client and server - two implementations: - - asynchronous, ordered message passing over unix or tcp; + - asynchronous, ordered message passing over unix or tcp; - messages are serialized using protobuf and length prefixed - - grpc + - grpc - TendermintCore runs a client, and the application runs a server - `cmd/abci-cli` @@ -77,7 +76,7 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil You can make CheckTx semi-stateful and clear the state upon `Commit` or `BeginBlock`, to allow for dependent sequences of transactions in the same block. -#### Commit +#### Commit * __Returns__: * `Data ([]byte)`: The Merkle root hash * `Log (string)`: Debug or error message @@ -92,6 +91,17 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil * `Data ([]byte)`: The query response bytes * `Log (string)`: Debug or error message +#### Proof + * __Arguments__: + * `Key ([]byte)`: The key whose data you want to verifiably query + * `Height (int64)`: The block height for which you want the proof (default=0 returns the proof for last committed block) + * __Returns__: + * `Code (uint32)`: Response code + * `Data ([]byte)`: The query response bytes + * `Log (string)`: Debug or error message + * __Usage__:
+ Return a Merkle proof from the key/value pair back to the application hash. + #### Flush * __Usage__:
Flush the response queue. Applications that implement `types.Application` need not implement this message -- it's handled by the project. diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 8cd999c0..aa6c837d 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -6,56 +6,40 @@ import ( "sort" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + abcicli "github.com/tendermint/abci/client" + "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" . "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" merkle "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" - "github.com/tendermint/abci/types" ) -func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value string) { - if r := dummy.DeliverTx(tx); r.IsErr() { - t.Fatal(r) - } - if r := dummy.DeliverTx(tx); r.IsErr() { - t.Fatal(r) - } - - r := dummy.Query([]byte(key)) - if r.IsErr() { - t.Fatal(r) - } +func testDummy(t *testing.T, app types.Application, tx []byte, key, value string) { + ar := app.DeliverTx(tx) + require.False(t, ar.IsErr(), ar) + // repeating tx doesn't raise error + ar = app.DeliverTx(tx) + require.False(t, ar.IsErr(), ar) + // make sure query is fine + r := app.Query([]byte(key)) + require.False(t, r.IsErr(), r) q := new(QueryResult) - if err := wire.ReadJSONBytes(r.Data, q); err != nil { - t.Fatal(err) - } - - if q.Value != value { - t.Fatalf("Got %s, expected %s", q.Value, value) - } - - rp := dummy.Proof([]byte(key), 0) - if rp.IsErr() { - t.Fatal(rp) - } + err := wire.ReadJSONBytes(r.Data, q) + require.Nil(t, err) + require.Equal(t, value, q.Value) + // make sure proof is fine + rp := app.Proof([]byte(key), 0) + require.False(t, rp.IsErr(), rp) p, err := merkle.LoadProof(rp.Data) - if err != nil { - t.Fatal(err) - } - - if !p.Valid() { - t.Fatal("Invalid proof") - } - - if !bytes.Equal([]byte(key), p.Key()) { - t.Fatalf("Invalid key: %s", p.Key()) - } - - if !bytes.Equal([]byte(value), p.Value()) { - t.Fatalf("Invalid key: %s", p.Value()) - } + require.Nil(t, err) + require.True(t, p.Valid()) + assert.Equal(t, []byte(key), p.Key()) + assert.Equal(t, []byte(value), p.Value()) } func TestDummyKV(t *testing.T) { @@ -223,3 +207,97 @@ func valsEqual(t *testing.T, vals1, vals2 []*types.Validator) { } } } + +func makeSocketClientServer(app types.Application, name string) (abcicli.Client, Service, error) { + // Start the listener + socket := Fmt("unix://%s.sock", name) + server, err := server.NewSocketServer(socket, app) + if err != nil { + return nil, nil, err + } + + // Connect to the socket + client, err := abcicli.NewSocketClient(socket, false) + if err != nil { + server.Stop() + return nil, nil, err + } + client.Start() + + return client, server, err +} + +func makeGRPCClientServer(app types.Application, name string) (abcicli.Client, Service, error) { + // Start the listener + socket := Fmt("unix://%s.sock", name) + + gapp := types.NewGRPCApplication(app) + server, err := server.NewGRPCServer(socket, gapp) + if err != nil { + return nil, nil, err + } + + client, err := abcicli.NewGRPCClient(socket, true) + if err != nil { + server.Stop() + return nil, nil, err + } + return client, server, err +} + +func TestClientServer(t *testing.T) { + // set up socket app + dummy := NewDummyApplication() + client, server, err := makeSocketClientServer(dummy, "dummy-socket") + require.Nil(t, err) + defer server.Stop() + defer client.Stop() + + runClientTests(t, client) + + // set up grpc app + dummy = NewDummyApplication() + gclient, gserver, err := makeGRPCClientServer(dummy, "dummy-grpc") + require.Nil(t, err) + defer gserver.Stop() + defer gclient.Stop() + + runClientTests(t, gclient) +} + +func runClientTests(t *testing.T, client abcicli.Client) { + // run some tests.... + key := "abc" + value := key + tx := []byte(key) + testClient(t, client, tx, key, value) + + value = "def" + tx = []byte(key + "=" + value) + testClient(t, client, tx, key, value) +} + +func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) { + ar := app.DeliverTxSync(tx) + require.False(t, ar.IsErr(), ar) + // repeating tx doesn't raise error + ar = app.DeliverTxSync(tx) + require.False(t, ar.IsErr(), ar) + + // make sure query is fine + r := app.QuerySync([]byte(key)) + require.False(t, r.IsErr(), r) + q := new(QueryResult) + err := wire.ReadJSONBytes(r.Data, q) + require.Nil(t, err) + require.Equal(t, value, q.Value) + + // make sure proof is fine + rp := app.ProofSync([]byte(key), 0) + require.False(t, rp.IsErr(), rp) + p, err := merkle.LoadProof(rp.Data) + require.Nil(t, err) + require.True(t, p.Valid()) + assert.Equal(t, []byte(key), p.Key()) + assert.Equal(t, []byte(value), p.Value()) +} diff --git a/example/dummy/dummy_test.go.orig b/example/dummy/dummy_test.go.orig new file mode 100644 index 00000000..5cf7eee7 --- /dev/null +++ b/example/dummy/dummy_test.go.orig @@ -0,0 +1,321 @@ +package dummy + +import ( + "bytes" + "io/ioutil" + "sort" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + . "github.com/tendermint/go-common" + "github.com/tendermint/go-crypto" + merkle "github.com/tendermint/go-merkle" + "github.com/tendermint/go-wire" +<<<<<<< HEAD + "github.com/tendermint/abci/types" +) + +func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value string) { + if r := dummy.DeliverTx(tx); r.IsErr() { + t.Fatal(r) + } + if r := dummy.DeliverTx(tx); r.IsErr() { + t.Fatal(r) + } + + r := dummy.Query([]byte(key)) + if r.IsErr() { + t.Fatal(r) + } +======= + tmspcli "github.com/tendermint/tmsp/client" + "github.com/tendermint/tmsp/server" + "github.com/tendermint/tmsp/types" +) + +func testDummy(t *testing.T, app types.Application, tx []byte, key, value string) { + ar := app.AppendTx(tx) + require.False(t, ar.IsErr(), ar) + // repeating tx doesn't raise error + ar = app.AppendTx(tx) + require.False(t, ar.IsErr(), ar) +>>>>>>> Add tests for client-server proofs over socket and grpc + + // make sure query is fine + r := app.Query([]byte(key)) + require.False(t, r.IsErr(), r) + q := new(QueryResult) + err := wire.ReadJSONBytes(r.Data, q) + require.Nil(t, err) + require.Equal(t, value, q.Value) + + // make sure proof is fine + rp := app.Proof([]byte(key), 0) + require.False(t, rp.IsErr(), rp) + p, err := merkle.LoadProof(rp.Data) + require.Nil(t, err) + require.True(t, p.Valid()) + assert.Equal(t, []byte(key), p.Key()) + assert.Equal(t, []byte(value), p.Value()) +} + +func TestDummyKV(t *testing.T) { + dummy := NewDummyApplication() + key := "abc" + value := key + tx := []byte(key) + testDummy(t, dummy, tx, key, value) + + value = "def" + tx = []byte(key + "=" + value) + testDummy(t, dummy, tx, key, value) +} + +func TestPersistentDummyKV(t *testing.T) { + dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO + if err != nil { + t.Fatal(err) + } + dummy := NewPersistentDummyApplication(dir) + key := "abc" + value := key + tx := []byte(key) + testDummy(t, dummy, tx, key, value) + + value = "def" + tx = []byte(key + "=" + value) + testDummy(t, dummy, tx, key, value) +} + +func TestPersistentDummyInfo(t *testing.T) { + dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO + if err != nil { + t.Fatal(err) + } + dummy := NewPersistentDummyApplication(dir) + height := uint64(0) + + resInfo := dummy.Info() + if resInfo.LastBlockHeight != height { + t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) + } + + // make and apply block + height = uint64(1) + hash := []byte("foo") + header := &types.Header{ + Height: uint64(height), + } + dummy.BeginBlock(hash, header) + dummy.EndBlock(height) + dummy.Commit() + + resInfo = dummy.Info() + if resInfo.LastBlockHeight != height { + t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) + } + +} + +// add a validator, remove a validator, update a validator +func TestValSetChanges(t *testing.T) { + dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO + if err != nil { + t.Fatal(err) + } + dummy := NewPersistentDummyApplication(dir) + + // init with some validators + total := 10 + nInit := 5 + vals := make([]*types.Validator, total) + for i := 0; i < total; i++ { + pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(Fmt("test%d", i))).PubKey().Bytes() + power := RandInt() + vals[i] = &types.Validator{pubkey, uint64(power)} + } + // iniitalize with the first nInit + dummy.InitChain(vals[:nInit]) + + vals1, vals2 := vals[:nInit], dummy.Validators() + valsEqual(t, vals1, vals2) + + var v1, v2, v3 *types.Validator + + // add some validators + v1, v2 = vals[nInit], vals[nInit+1] + diff := []*types.Validator{v1, v2} + tx1 := MakeValSetChangeTx(v1.PubKey, v1.Power) + tx2 := MakeValSetChangeTx(v2.PubKey, v2.Power) + + makeApplyBlock(t, dummy, 1, diff, tx1, tx2) + + vals1, vals2 = vals[:nInit+2], dummy.Validators() + valsEqual(t, vals1, vals2) + + // remove some validators + v1, v2, v3 = vals[nInit-2], vals[nInit-1], vals[nInit] + v1.Power = 0 + v2.Power = 0 + v3.Power = 0 + diff = []*types.Validator{v1, v2, v3} + tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) + tx2 = MakeValSetChangeTx(v2.PubKey, v2.Power) + tx3 := MakeValSetChangeTx(v3.PubKey, v3.Power) + + makeApplyBlock(t, dummy, 2, diff, tx1, tx2, tx3) + + vals1 = append(vals[:nInit-2], vals[nInit+1]) + vals2 = dummy.Validators() + valsEqual(t, vals1, vals2) + + // update some validators + v1 = vals[0] + if v1.Power == 5 { + v1.Power = 6 + } else { + v1.Power = 5 + } + diff = []*types.Validator{v1} + tx1 = MakeValSetChangeTx(v1.PubKey, v1.Power) + + makeApplyBlock(t, dummy, 3, diff, tx1) + + vals1 = append([]*types.Validator{v1}, vals1[1:len(vals1)]...) + vals2 = dummy.Validators() + valsEqual(t, vals1, vals2) + +} + +func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff []*types.Validator, txs ...[]byte) { + // make and apply block + height := uint64(heightInt) + hash := []byte("foo") + header := &types.Header{ + Height: height, + } + + dummyChain := dummy.(types.BlockchainAware) // hmm... + dummyChain.BeginBlock(hash, header) + for _, tx := range txs { + if r := dummy.DeliverTx(tx); r.IsErr() { + t.Fatal(r) + } + } + resEndBlock := dummyChain.EndBlock(height) + dummy.Commit() + + valsEqual(t, diff, resEndBlock.Diffs) + +} + +// order doesn't matter +func valsEqual(t *testing.T, vals1, vals2 []*types.Validator) { + if len(vals1) != len(vals2) { + t.Fatalf("vals dont match in len. got %d, expected %d", len(vals2), len(vals1)) + } + sort.Sort(types.Validators(vals1)) + sort.Sort(types.Validators(vals2)) + for i, v1 := range vals1 { + v2 := vals2[i] + if !bytes.Equal(v1.PubKey, v2.PubKey) || + v1.Power != v2.Power { + t.Fatalf("vals dont match at index %d. got %X/%d , expected %X/%d", i, v2.PubKey, v2.Power, v1.PubKey, v1.Power) + } + } +} + +func makeSocketClientServer(app types.Application, name string) (tmspcli.Client, Service, error) { + // Start the listener + socket := Fmt("unix://%s.sock", name) + server, err := server.NewSocketServer(socket, app) + if err != nil { + return nil, nil, err + } + + // Connect to the socket + client, err := tmspcli.NewSocketClient(socket, false) + if err != nil { + server.Stop() + return nil, nil, err + } + client.Start() + + return client, server, err +} + +func makeGRPCClientServer(app types.Application, name string) (tmspcli.Client, Service, error) { + // Start the listener + socket := Fmt("unix://%s.sock", name) + + gapp := types.NewGRPCApplication(app) + server, err := server.NewGRPCServer(socket, gapp) + if err != nil { + return nil, nil, err + } + + client, err := tmspcli.NewGRPCClient(socket, true) + if err != nil { + server.Stop() + return nil, nil, err + } + return client, server, err +} + +func TestClientServer(t *testing.T) { + // set up socket app + dummy := NewDummyApplication() + client, server, err := makeSocketClientServer(dummy, "dummy-socket") + require.Nil(t, err) + defer server.Stop() + defer client.Stop() + + runClientTests(t, client) + + // set up grpc app + dummy = NewDummyApplication() + gclient, gserver, err := makeGRPCClientServer(dummy, "dummy-grpc") + require.Nil(t, err) + defer gserver.Stop() + defer gclient.Stop() + + runClientTests(t, gclient) +} + +func runClientTests(t *testing.T, client tmspcli.Client) { + // run some tests.... + key := "abc" + value := key + tx := []byte(key) + testClient(t, client, tx, key, value) + + value = "def" + tx = []byte(key + "=" + value) + testClient(t, client, tx, key, value) +} + +func testClient(t *testing.T, app tmspcli.Client, tx []byte, key, value string) { + ar := app.AppendTxSync(tx) + require.False(t, ar.IsErr(), ar) + // repeating tx doesn't raise error + ar = app.AppendTxSync(tx) + require.False(t, ar.IsErr(), ar) + + // make sure query is fine + r := app.QuerySync([]byte(key)) + require.False(t, r.IsErr(), r) + q := new(QueryResult) + err := wire.ReadJSONBytes(r.Data, q) + require.Nil(t, err) + require.Equal(t, value, q.Value) + + // make sure proof is fine + rp := app.ProofSync([]byte(key), 0) + require.False(t, rp.IsErr(), rp) + p, err := merkle.LoadProof(rp.Data) + require.Nil(t, err) + require.True(t, p.Valid()) + assert.Equal(t, []byte(key), p.Key()) + assert.Equal(t, []byte(value), p.Value()) +} diff --git a/glide.lock b/glide.lock index 42776a3a..4829e672 100644 --- a/glide.lock +++ b/glide.lock @@ -19,6 +19,11 @@ imports: version: d228849504861217f796da67fae4f6e347643f15 - name: github.com/mattn/go-isatty version: 30a891c33c7cde7b02a981314b4228ec99380cca +- name: github.com/stretchr/testify + version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0 + subpackages: + - assert + - require - name: github.com/syndtr/goleveldb version: 23851d93a2292dcc56e71a18ec9e0624d84a0f65 subpackages: @@ -102,4 +107,12 @@ imports: - stats - tap - transport -testImports: [] +testImports: +- name: github.com/davecgh/go-spew + version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9 + subpackages: + - spew +- name: github.com/pmezard/go-difflib + version: d8ed2627bdf02c080bf22230dbb337003b7aba2d + subpackages: + - difflib diff --git a/glide.yaml b/glide.yaml index 295b3d3e..af174387 100644 --- a/glide.yaml +++ b/glide.yaml @@ -15,3 +15,7 @@ import: subpackages: - context - package: google.golang.org/grpc +- package: github.com/stretchr/testify + version: ^1.1.4 + subpackages: + - require From dde413d44bb0a3b718dda3c6918949243da008af Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 10 Jan 2017 19:14:35 +0100 Subject: [PATCH 06/10] Cleaned up text --- README.md | 3 ++- example/dummy/dummy.go | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3a9b27cb..23c1ac65 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,8 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil * `Data ([]byte)`: The query response bytes * `Log (string)`: Debug or error message * __Usage__:
- Return a Merkle proof from the key/value pair back to the application hash. + Return a Merkle proof from the key/value pair back to the application hash.
+ *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. Hopefully this will be improved soon(ish) #### Flush * __Usage__:
diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index fcf067dc..39f54fc2 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -2,7 +2,6 @@ package dummy import ( "encoding/hex" - "fmt" "strings" "github.com/tendermint/abci/types" @@ -50,18 +49,21 @@ func (app *DummyApplication) Commit() types.Result { func (app *DummyApplication) Query(query []byte) types.Result { index, value, exists := app.state.Get(query) + queryResult := QueryResult{index, string(value), hex.EncodeToString(value), exists} return types.NewResultOK(wire.JSONBytes(queryResult), "") } func (app *DummyApplication) Proof(key []byte, blockHeight int64) types.Result { + // TODO: when go-merkle supports querying older blocks without possible panics, + // we should store a cache and allow a query. But for now it is impossible. + // And this is just a Dummy application anyway, what do you expect? ;) if blockHeight != 0 { return types.ErrUnknownRequest } proof, exists := app.state.Proof(key) if !exists { - fmt.Println("Didn't find nothing") - return types.NewResultOK(nil, "") + return types.NewResultOK(nil, Fmt("Cannot find key = %v", key)) } return types.NewResultOK(proof, "Found the key") } From e0309007ad431ddd126e2ec0d36bd2adbede1aed Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Thu, 12 Jan 2017 12:37:47 +0100 Subject: [PATCH 07/10] Improve Makefile --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 740bce9b..5cbe0b62 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,8 @@ protoc: install: go install github.com/tendermint/abci/cmd/... -test: +# test.sh requires that we run the installed cmds, must not be out of date +test: install find . -name test.sock -exec rm {} \; go test -p 1 `${NOVENDOR}` bash tests/test.sh From fdc047ae7af0f0189dd9f21b932eb92ce455ffa5 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 17 Jan 2017 17:22:34 +0100 Subject: [PATCH 08/10] Proof uses uint64 for blockHeight --- client/client.go | 6 +- client/grpc_client.go | 6 +- client/local_client.go | 6 +- client/socket_client.go | 6 +- cmd/abci-cli/tmsp-cli.go | 4 +- example/chain_aware/chain_aware_app.go | 4 +- example/counter/counter.go | 4 +- example/dummy/dummy.go | 2 +- example/dummy/persistent_dummy.go | 4 +- example/nil/nil_app.go | 2 +- types/application.go | 2 +- types/messages.go | 2 +- types/types.pb.go | 219 ++++++++++++------------- types/types.proto | 120 +++++++------- 14 files changed, 193 insertions(+), 194 deletions(-) diff --git a/client/client.go b/client/client.go index fd31b21a..bbd41398 100644 --- a/client/client.go +++ b/client/client.go @@ -4,8 +4,8 @@ import ( "fmt" "sync" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) type Client interface { @@ -21,7 +21,7 @@ type Client interface { DeliverTxAsync(tx []byte) *ReqRes CheckTxAsync(tx []byte) *ReqRes QueryAsync(tx []byte) *ReqRes - ProofAsync(key []byte, blockHeight int64) *ReqRes + ProofAsync(key []byte, blockHeight uint64) *ReqRes CommitAsync() *ReqRes FlushSync() error @@ -31,7 +31,7 @@ type Client interface { DeliverTxSync(tx []byte) (res types.Result) CheckTxSync(tx []byte) (res types.Result) QuerySync(tx []byte) (res types.Result) - ProofSync(key []byte, blockHeight int64) (res types.Result) + ProofSync(key []byte, blockHeight uint64) (res types.Result) CommitSync() (res types.Result) InitChainAsync(validators []*types.Validator) *ReqRes diff --git a/client/grpc_client.go b/client/grpc_client.go index 3654c47c..63fb16a4 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -8,8 +8,8 @@ import ( context "golang.org/x/net/context" grpc "google.golang.org/grpc" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) // A stripped copy of the remoteClient that makes @@ -182,7 +182,7 @@ func (cli *grpcClient) QueryAsync(query []byte) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_Query{res}}) } -func (cli *grpcClient) ProofAsync(key []byte, blockHeight int64) *ReqRes { +func (cli *grpcClient) ProofAsync(key []byte, blockHeight uint64) *ReqRes { req := types.ToRequestProof(key, blockHeight) res, err := cli.client.Proof(context.Background(), req.GetProof(), grpc.FailFast(true)) if err != nil { @@ -310,7 +310,7 @@ func (cli *grpcClient) CheckTxSync(tx []byte) (res types.Result) { return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } -func (cli *grpcClient) ProofSync(key []byte, blockHeight int64) (res types.Result) { +func (cli *grpcClient) ProofSync(key []byte, blockHeight uint64) (res types.Result) { reqres := cli.ProofAsync(key, blockHeight) if res := cli.checkErrGetResult(); res.IsErr() { return res diff --git a/client/local_client.go b/client/local_client.go index bdc59c5a..7450573e 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -3,8 +3,8 @@ package abcicli import ( "sync" - . "github.com/tendermint/go-common" types "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) type localClient struct { @@ -99,7 +99,7 @@ func (app *localClient) QueryAsync(tx []byte) *ReqRes { ) } -func (app *localClient) ProofAsync(key []byte, blockHeight int64) *ReqRes { +func (app *localClient) ProofAsync(key []byte, blockHeight uint64) *ReqRes { app.mtx.Lock() res := app.Application.Proof(key, blockHeight) app.mtx.Unlock() @@ -202,7 +202,7 @@ func (app *localClient) QuerySync(query []byte) (res types.Result) { return res } -func (app *localClient) ProofSync(key []byte, blockHeight int64) (res types.Result) { +func (app *localClient) ProofSync(key []byte, blockHeight uint64) (res types.Result) { app.mtx.Lock() res = app.Application.Proof(key, blockHeight) app.mtx.Unlock() diff --git a/client/socket_client.go b/client/socket_client.go index cacd67bf..04d07a55 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -10,8 +10,8 @@ import ( "sync" "time" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) const ( @@ -255,7 +255,7 @@ func (cli *socketClient) QueryAsync(query []byte) *ReqRes { return cli.queueRequest(types.ToRequestQuery(query)) } -func (cli *socketClient) ProofAsync(key []byte, blockHeight int64) *ReqRes { +func (cli *socketClient) ProofAsync(key []byte, blockHeight uint64) *ReqRes { return cli.queueRequest(types.ToRequestProof(key, blockHeight)) } @@ -349,7 +349,7 @@ func (cli *socketClient) QuerySync(query []byte) (res types.Result) { return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } -func (cli *socketClient) ProofSync(key []byte, blockHeight int64) (res types.Result) { +func (cli *socketClient) ProofSync(key []byte, blockHeight uint64) (res types.Result) { reqres := cli.queueRequest(types.ToRequestProof(key, blockHeight)) cli.FlushSync() if err := cli.Error(); err != nil { diff --git a/cmd/abci-cli/tmsp-cli.go b/cmd/abci-cli/tmsp-cli.go index 0eae4d85..ccdd41d4 100644 --- a/cmd/abci-cli/tmsp-cli.go +++ b/cmd/abci-cli/tmsp-cli.go @@ -324,9 +324,9 @@ func cmdProof(c *cli.Context) error { return err } - var height int64 + var height uint64 if len(args) == 2 { - height, _ = strconv.ParseInt(args[1], 10, 0) + height, _ = strconv.ParseUint(args[1], 10, 0) } res := client.ProofSync(keyBytes, height) rsp := newResponse(res, string(res.Data), true) diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index f335e543..361f2a07 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -3,9 +3,9 @@ package main import ( "flag" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func main() { @@ -61,7 +61,7 @@ func (app *ChainAwareApplication) Query(query []byte) types.Result { return types.NewResultOK([]byte(Fmt("%d,%d", app.beginCount, app.endCount)), "") } -func (app *ChainAwareApplication) Proof(key []byte, blockHeight int64) types.Result { +func (app *ChainAwareApplication) Proof(key []byte, blockHeight uint64) types.Result { return types.NewResultOK(nil, Fmt("Proof is not supported")) } diff --git a/example/counter/counter.go b/example/counter/counter.go index 9ffec400..62c10826 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -3,8 +3,8 @@ package counter import ( "encoding/binary" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) type CounterApplication struct { @@ -84,6 +84,6 @@ func (app *CounterApplication) Query(query []byte) types.Result { return types.ErrUnknownRequest.SetLog(Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr)) } -func (app *CounterApplication) Proof(key []byte, blockHeight int64) types.Result { +func (app *CounterApplication) Proof(key []byte, blockHeight uint64) types.Result { return types.NewResultOK(nil, Fmt("Proof is not supported")) } diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 39f54fc2..8f606f98 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -54,7 +54,7 @@ func (app *DummyApplication) Query(query []byte) types.Result { return types.NewResultOK(wire.JSONBytes(queryResult), "") } -func (app *DummyApplication) Proof(key []byte, blockHeight int64) types.Result { +func (app *DummyApplication) Proof(key []byte, blockHeight uint64) types.Result { // TODO: when go-merkle supports querying older blocks without possible panics, // we should store a cache and allow a query. But for now it is impossible. // And this is just a Dummy application anyway, what do you expect? ;) diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 3a1ce3b5..781e1aae 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -6,11 +6,11 @@ import ( "strconv" "strings" + "github.com/tendermint/abci/types" . "github.com/tendermint/go-common" dbm "github.com/tendermint/go-db" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" - "github.com/tendermint/abci/types" ) const ( @@ -93,7 +93,7 @@ func (app *PersistentDummyApplication) Query(query []byte) types.Result { return app.app.Query(query) } -func (app *PersistentDummyApplication) Proof(key []byte, blockHeight int64) types.Result { +func (app *PersistentDummyApplication) Proof(key []byte, blockHeight uint64) types.Result { return app.app.Proof(key, blockHeight) } diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index 1088ac96..694184a2 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -35,6 +35,6 @@ func (app *NilApplication) Query(query []byte) types.Result { return types.NewResultOK(nil, "") } -func (app *NilApplication) Proof(key []byte, blockHeight int64) types.Result { +func (app *NilApplication) Proof(key []byte, blockHeight uint64) types.Result { return types.NewResultOK(nil, "") } diff --git a/types/application.go b/types/application.go index 5ba440dd..4cea52ff 100644 --- a/types/application.go +++ b/types/application.go @@ -23,7 +23,7 @@ type Application interface { Query(query []byte) Result // Get proof for state - Proof(key []byte, blockHeight int64) Result + Proof(key []byte, blockHeight uint64) Result // Return the application Merkle root hash Commit() Result diff --git a/types/messages.go b/types/messages.go index 9e303a71..af79f7eb 100644 --- a/types/messages.go +++ b/types/messages.go @@ -55,7 +55,7 @@ func ToRequestQuery(queryBytes []byte) *Request { } } -func ToRequestProof(key []byte, blockHeight int64) *Request { +func ToRequestProof(key []byte, blockHeight uint64) *Request { return &Request{ Value: &Request_Proof{&RequestProof{key, blockHeight}}, } diff --git a/types/types.pb.go b/types/types.pb.go index 8467a78c..e53f877e 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -769,7 +769,7 @@ func (m *RequestQuery) GetQuery() []byte { type RequestProof struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` } func (m *RequestProof) Reset() { *m = RequestProof{} } @@ -784,7 +784,7 @@ func (m *RequestProof) GetKey() []byte { return nil } -func (m *RequestProof) GetHeight() int64 { +func (m *RequestProof) GetHeight() uint64 { if m != nil { return m.Height } @@ -2231,113 +2231,112 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1714 bytes of a gzipped FileDescriptorProto + // 1710 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0x5b, 0x6f, 0xe4, 0x48, - 0x15, 0x8e, 0xfb, 0xde, 0xa7, 0x93, 0x4e, 0xe5, 0xe4, 0xe6, 0x34, 0x3c,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 0xb7, 0x96, + 0xeb, 0xd8, 0x56, 0xec, 0x87, 0x91, 0xae, 0x3d, 0x5a, 0x3f, 0x1a, 0x1e, 0x33, 0x75, 0x12, 0x5f, + 0xa5, 0x0a, 0xb3, 0x60, 0x63, 0xbc, 0x86, 0xed, 0x07, 0x80, 0x40, 0x84, 0xf6, 0xd2, 0x8a, 0x96, + 0x6a, 0x59, 0xe2, 0x1b, 0x3f, 0xa0, 0x75, 0x59, 0x36, 0x0f, 0x55, 0xa9, 0x6f, 0xaa, 0xb0, 0x97, + 0x42, 0x68, 0x2a, 0xa5, 0xf1, 0x18, 0xb6, 0x2a, 0x28, 0x29, 0x64, 0xa4, 0x95, 0x32, 0xfa, 0x43, + 0x07, 0xfa, 0x26, 0x8f, 0x02, 0xdf, 0x8b, 0x38, 0xbe, 0x80, 0x01, 0xbf, 0x9b, 0x71, 0x59, 0xf0, + 0x5a, 0x05, 0xb0, 0xd2, 0xe6, 0x3c, 0xd5, 0x13, 0xd8, 0x33, 0x63, 0x7c, 0xac, 0xc8, 0xaa, 0xca, + 0x40, 0xca, 0xa9, 0xc8, 0x56, 0x4f, 0x53, 0xb6, 0x5a, 0xaf, 0x54, 0xab, 0xb4, 0xad, 0xd0, 0xd5, + 0x63, 0x45, 0x57, 0xed, 0xda, 0xc0, 0x25, 0xbe, 0x3a, 0x29, 0xf1, 0x55, 0xa7, 0x76, 0xf9, 0x0d, + 0x84, 0x75, 0x52, 0x22, 0xac, 0x6e, 0xad, 0x6b, 0x03, 0x63, 0x7d, 0x54, 0x60, 0xac, 0x5e, 0xa5, + 0x50, 0xa5, 0x63, 0x0d, 0x65, 0x3d, 0xcf, 0x28, 0xab, 0x5f, 0x21, 0x39, 0xe5, 0x52, 0xe5, 0xac, + 0xa7, 0x29, 0x90, 0x07, 0xb5, 0x9b, 0x56, 0x21, 0xad, 0x93, 0x12, 0x69, 0x41, 0x6d, 0x3a, 0x0d, + 0xac, 0xf5, 0x93, 0x32, 0x6b, 0x49, 0xea,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 0x5a, 0x62, 0xed, 0xc5, 0xfd, 0x04, 0x3a, 0x81, 0x15, 0xc6, 0x91, 0xba, 0x20, 0x53, 0x82, + 0xbb, 0xb2, 0x42, 0xea, 0x95, 0xd4, 0xf5, 0x2d, 0x4d, 0x8c, 0x13, 0xd8, 0x2c, 0xc9, 0x89, 0xd1, + 0x62, 0x3f, 0xb6, 0x5c, 0x75, 0x75, 0xcb, 0x41, 0x36, 0x4d, 0x2b, 0x9f, 0xc6, 0x38, 0x81, 0x41, + 0x76, 0x86, 0x74, 0x2c, 0x41, 0x72, 0xfd, 0x59, 0xd6, 0xd9, 0xa8, 0x11, 0x85, 0x0b, 0xfc, 0xaf, + 0x55, 0x0f, 0xd1, 0x36, 0xe5, 0xe0, 0xc9, 0x9f, 0x34, 0x18, 0x7e, 0x2e, 0x29, 0x90, 0xd0, 0x88, + 0x5b, 0x30, 0x7c, 0x9d, 0xb8, 0xae, 0x12, 0xb1, 0x35, 0xec, 0x43, 0x9b, 0x98, 0x93, 0x69, 0x38, + 0x80, 0x8e, 0x60, 0x46, 0xd6, 0x22, 0x21, 0x51, 0x22, 0x5b, 0xc7, 0x4d, 0x18, 0x64, 0x1c, 0xc4, + 0xda, 0x34, 0xcc, 0x28, 0x99, 0x75, 0x68, 0x98, 0x51, 0x0f, 0xdb, 0xc6, 0x21, 0xf4, 0x14, 0x53, + 0x30, 0x44, 0x80, 0xae, 0x3c, 0x29, 0xb6, 0x43, 0xa1, 0x45, 0x91, 0xb3, 0x5d, 0x72, 0xc9, 0xa0, + 0xcd, 0xf6, 0x70, 0x04, 0x90, 0x83, 0x9a, 0xed, 0xe3, 0x06, 0xf4, 0x53, 0x38, 0xb3, 0x03, 0xf2, + 0x13, 0x05, 0xcc, 0xf4, 0x27, 0xbf, 0xef, 0x40, 0x3f, 0xad, 0x29, 0xec, 0x42, 0xeb, 0xcd, 0x67, + 0x6c, 0x0d, 0xb7, 0x61, 0x73, 0xe2, 0xc5, 0x3c, 0xf4, 0x2c, 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 0x34, 0xbd, 0x0b, 0x8c, 0x1b, 0xfb, 0x6f, 0x7c, 0x91, 0xb1, + 0x07, 0xd6, 0xbf, 0x0e, 0x8c, 0x1b, 0x5a, 0x70, 0xda, 0x1e, 0xd9, 0x43, 0xd4, 0xfd, 0xe9, 0x1f, + 0xd7, 0x76, 0xd5, 0xe4, 0x23, 0x7b, 0x83, 0xba, 0x7f, 0xd3, 0xe3, 0xda, 0x56, 0x15, 0x3f, 0x4e, + 0x29, 0x0d, 0x6b, 0x1f, 0x23, 0xc6, 0xf5, 0xfd, 0x3e, 0x6d, 0x4c, 0xfe, 0x37, 0xb2, 0xe9, 0x95, + 0x61, 0xdc, 0xd8, 0xc9, 0xe3, 0x69, 0x91, 0x23, 0xb1, 0xf1, 0xad, 0x61, 0xdc, 0xdc, 0xcf, 0xe3, + 0x27, 0x39, 0xad, 0x62, 0xc3, 0x8b, 0xc3, 0xb8, 0xa9, 0xa5, 0xbf, 0xee, 0x8a, 0xc7, 0xac, 0x8f, + 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x2e, 0xe2, 0x17, 0xe1, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 16dc2856..045c2d68 100644 --- a/types/types.proto +++ b/types/types.proto @@ -11,63 +11,63 @@ package types; // so we don't have to type switch // (would be twice as fast, but we're talking about 15ns) enum MessageType { - NullMessage = 0x00; + NullMessage = 0x00; - Echo = 0x01; - Flush = 0x02; - Info = 0x03; - SetOption = 0x04; - Exception = 0x05; - DeliverTx = 0x11; - CheckTx = 0x12; - Commit = 0x13; - Query = 0x14; - InitChain = 0x15; - BeginBlock = 0x16; - EndBlock = 0x17; - Proof = 0x18; + Echo = 0x01; + Flush = 0x02; + Info = 0x03; + SetOption = 0x04; + Exception = 0x05; + DeliverTx = 0x11; + CheckTx = 0x12; + Commit = 0x13; + Query = 0x14; + InitChain = 0x15; + BeginBlock = 0x16; + EndBlock = 0x17; + Proof = 0x18; } //---------------------------------------- // 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; } @@ -87,7 +87,7 @@ message Request { RequestInitChain init_chain = 9; RequestBeginBlock begin_block = 10; RequestEndBlock end_block = 11; - RequestProof proof = 12; + RequestProof proof = 12; } } @@ -107,20 +107,20 @@ message RequestSetOption{ } message RequestDeliverTx{ - bytes tx = 1; + bytes tx = 1; } message RequestCheckTx{ - bytes tx = 1; + bytes tx = 1; } message RequestQuery{ - bytes query = 1; + bytes query = 1; } message RequestProof{ - bytes key = 1; - int64 height = 2; + bytes key = 1; + uint64 height = 2; } message RequestCommit{ @@ -157,7 +157,7 @@ message Response { ResponseInitChain init_chain = 10; ResponseBeginBlock begin_block = 11; ResponseEndBlock end_block = 12; - ResponseProof proof = 13; + ResponseProof proof = 13; } } @@ -202,9 +202,9 @@ message ResponseQuery{ } message ResponseProof{ - CodeType code = 1; - bytes data = 2; - string log = 3; + CodeType code = 1; + bytes data = 2; + string log = 3; } message ResponseCommit{ @@ -250,8 +250,8 @@ message PartSetHeader { } message Validator { - bytes pubKey = 1; - uint64 power = 2; + bytes pubKey = 1; + uint64 power = 2; } //---------------------------------------- @@ -265,7 +265,7 @@ service ABCIApplication { rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); rpc Query(RequestQuery) returns (ResponseQuery); - rpc Proof(RequestProof) returns (ResponseProof); + rpc Proof(RequestProof) returns (ResponseProof); rpc Commit(RequestCommit) returns (ResponseCommit); rpc InitChain(RequestInitChain) returns (ResponseInitChain); rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); From 4bdddf9829dce751b25b3166df604dd125cf4b80 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 23 Jan 2017 20:48:12 -0800 Subject: [PATCH 09/10] First commit to demonstrate change --- README.md | 10 +++++++--- types/types.proto | 33 +++++++++++---------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 23c1ac65..083b031c 100644 --- a/README.md +++ b/README.md @@ -85,16 +85,20 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil #### Query * __Arguments__: - * `Data ([]byte)`: The query request bytes + * `Query ([]byte)`: The query request bytes + * `Path (string)`: Path of request + * `Height (uint64)`: The block height for which you want the query (default=0 returns data for the latest committed block) + * `Prove (bool)`: Return Merkle proof with response * __Returns__: - * `Code (uint32)`: Response code * `Data ([]byte)`: The query response bytes * `Log (string)`: Debug or error message + * `Height (uint64)`: The block height from which data was derived + * `Proof ([]byte)`: Proof for the data, if requested #### Proof * __Arguments__: * `Key ([]byte)`: The key whose data you want to verifiably query - * `Height (int64)`: The block height for which you want the proof (default=0 returns the proof for last committed block) + * `Height (uint64)`: The block height for which you want the proof (default=0 returns the proof for last committed block) * __Returns__: * `Code (uint32)`: Response code * `Data ([]byte)`: The query response bytes diff --git a/types/types.proto b/types/types.proto index 045c2d68..14093476 100644 --- a/types/types.proto +++ b/types/types.proto @@ -18,14 +18,13 @@ enum MessageType { Info = 0x03; SetOption = 0x04; Exception = 0x05; - DeliverTx = 0x11; + DeliverTx = 0x11; CheckTx = 0x12; Commit = 0x13; Query = 0x14; InitChain = 0x15; BeginBlock = 0x16; EndBlock = 0x17; - Proof = 0x18; } //---------------------------------------- @@ -87,7 +86,6 @@ message Request { RequestInitChain init_chain = 9; RequestBeginBlock begin_block = 10; RequestEndBlock end_block = 11; - RequestProof proof = 12; } } @@ -107,20 +105,18 @@ message RequestSetOption{ } message RequestDeliverTx{ - bytes tx = 1; + bytes tx = 1; } message RequestCheckTx{ - bytes tx = 1; + bytes tx = 1; } message RequestQuery{ - bytes query = 1; -} - -message RequestProof{ - bytes key = 1; - uint64 height = 2; + bytes query = 1; + string path = 2; + uint64 height = 3; + bool prove = 4; } message RequestCommit{ @@ -157,7 +153,6 @@ message Response { ResponseInitChain init_chain = 10; ResponseBeginBlock begin_block = 11; ResponseEndBlock end_block = 12; - ResponseProof proof = 13; } } @@ -196,15 +191,10 @@ message ResponseCheckTx{ } message ResponseQuery{ - CodeType code = 1; - bytes data = 2; - string log = 3; -} - -message ResponseProof{ - CodeType code = 1; bytes data = 2; string log = 3; + uint64 height = 4; + bytes proof = 5; } message ResponseCommit{ @@ -250,8 +240,8 @@ message PartSetHeader { } message Validator { - bytes pubKey = 1; - uint64 power = 2; + bytes pubKey = 1; + uint64 power = 2; } //---------------------------------------- @@ -265,7 +255,6 @@ service ABCIApplication { rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); rpc Query(RequestQuery) returns (ResponseQuery); - rpc Proof(RequestProof) returns (ResponseProof); rpc Commit(RequestCommit) returns (ResponseCommit); rpc InitChain(RequestInitChain) returns (ResponseInitChain); rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); From 2a4894310d5b0c8f69e99782d7d905f21236f947 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 23 Jan 2017 23:42:09 -0800 Subject: [PATCH 10/10] Remove Proof message, replace with more flexible Query --- README.md | 27 +- client/client.go | 6 +- client/grpc_client.go | 36 +- client/local_client.go | 31 +- client/socket_client.go | 36 +- cmd/abci-cli/{tmsp-cli.go => abci-cli.go} | 144 ++++--- cmd/counter/main.go | 2 +- example/chain_aware/chain_aware_app.go | 10 +- example/chain_aware/chain_aware_test.go | 8 +- example/counter/counter.go | 15 +- example/dummy/dummy.go | 50 ++- example/dummy/dummy_test.go | 56 +-- example/dummy/persistent_dummy.go | 8 +- example/nil/nil_app.go | 8 +- glide.lock | 2 +- server/socket_server.go | 9 +- tests/test_cli/ex1.abci.out.new | 44 ++ types/application.go | 14 +- types/code.go | 3 + types/messages.go | 20 +- types/types.pb.go | 468 +++++++++------------- types/types.proto | 11 +- 22 files changed, 429 insertions(+), 579 deletions(-) rename cmd/abci-cli/{tmsp-cli.go => abci-cli.go} (78%) create mode 100644 tests/test_cli/ex1.abci.out.new create mode 100644 types/code.go diff --git a/README.md b/README.md index 083b031c..ec6db985 100644 --- a/README.md +++ b/README.md @@ -85,27 +85,20 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil #### Query * __Arguments__: - * `Query ([]byte)`: The query request bytes - * `Path (string)`: Path of request + * `Data ([]byte)`: Raw query bytes. Can be used with or in lieu of Path. + * `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) - * `Prove (bool)`: Return Merkle proof with response - * __Returns__: - * `Data ([]byte)`: The query response bytes - * `Log (string)`: Debug or error message - * `Height (uint64)`: The block height from which data was derived - * `Proof ([]byte)`: Proof for the data, if requested - -#### Proof - * __Arguments__: - * `Key ([]byte)`: The key whose data you want to verifiably query - * `Height (uint64)`: The block height for which you want the proof (default=0 returns the proof for last committed block) + * `Prove (bool)`: Return Merkle proof with response if possible * __Returns__: * `Code (uint32)`: Response code - * `Data ([]byte)`: The query response bytes + * `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 * `Log (string)`: Debug or error message - * __Usage__:
- Return a Merkle proof from the key/value pair back to the application hash.
- *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. Hopefully this will be improved soon(ish) + *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. Hopefully this will be improved soon(ish) #### Flush * __Usage__:
diff --git a/client/client.go b/client/client.go index bbd41398..25bb23ec 100644 --- a/client/client.go +++ b/client/client.go @@ -20,8 +20,7 @@ type Client interface { SetOptionAsync(key string, value string) *ReqRes DeliverTxAsync(tx []byte) *ReqRes CheckTxAsync(tx []byte) *ReqRes - QueryAsync(tx []byte) *ReqRes - ProofAsync(key []byte, blockHeight uint64) *ReqRes + QueryAsync(reqQuery types.RequestQuery) *ReqRes CommitAsync() *ReqRes FlushSync() error @@ -30,8 +29,7 @@ type Client interface { SetOptionSync(key string, value string) (res types.Result) DeliverTxSync(tx []byte) (res types.Result) CheckTxSync(tx []byte) (res types.Result) - QuerySync(tx []byte) (res types.Result) - ProofSync(key []byte, blockHeight uint64) (res types.Result) + QuerySync(reqQuery types.RequestQuery) (resQuery types.ResponseQuery, err error) CommitSync() (res types.Result) InitChainAsync(validators []*types.Validator) *ReqRes diff --git a/client/grpc_client.go b/client/grpc_client.go index 63fb16a4..1a48fed1 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -173,8 +173,8 @@ func (cli *grpcClient) CheckTxAsync(tx []byte) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_CheckTx{res}}) } -func (cli *grpcClient) QueryAsync(query []byte) *ReqRes { - req := types.ToRequestQuery(query) +func (cli *grpcClient) QueryAsync(reqQuery types.RequestQuery) *ReqRes { + req := types.ToRequestQuery(reqQuery) res, err := cli.client.Query(context.Background(), req.GetQuery(), grpc.FailFast(true)) if err != nil { cli.StopForError(err) @@ -182,15 +182,6 @@ func (cli *grpcClient) QueryAsync(query []byte) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_Query{res}}) } -func (cli *grpcClient) ProofAsync(key []byte, blockHeight uint64) *ReqRes { - req := types.ToRequestProof(key, blockHeight) - res, err := cli.client.Proof(context.Background(), req.GetProof(), grpc.FailFast(true)) - if err != nil { - cli.StopForError(err) - } - return cli.finishAsyncCall(req, &types.Response{&types.Response_Proof{res}}) -} - func (cli *grpcClient) CommitAsync() *ReqRes { req := types.ToRequestCommit() res, err := cli.client.Commit(context.Background(), req.GetCommit(), grpc.FailFast(true)) @@ -264,7 +255,7 @@ func (cli *grpcClient) EchoSync(msg string) (res types.Result) { return res } resp := reqres.Response.GetEcho() - return types.NewResultOK([]byte(resp.Message), LOG) + return types.NewResultOK([]byte(resp.Message), "") } func (cli *grpcClient) FlushSync() error { @@ -310,22 +301,15 @@ func (cli *grpcClient) CheckTxSync(tx []byte) (res types.Result) { return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } -func (cli *grpcClient) ProofSync(key []byte, blockHeight uint64) (res types.Result) { - reqres := cli.ProofAsync(key, blockHeight) - if res := cli.checkErrGetResult(); res.IsErr() { - return res +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 } - resp := reqres.Response.GetProof() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} -} - -func (cli *grpcClient) QuerySync(query []byte) (res types.Result) { - reqres := cli.QueryAsync(query) - if res := cli.checkErrGetResult(); res.IsErr() { - return res + if resQuery_ := reqres.Response.GetQuery(); resQuery_ != nil { + return *resQuery_, nil } - resp := reqres.Response.GetQuery() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} + return resQuery, nil } func (cli *grpcClient) CommitSync() (res types.Result) { diff --git a/client/local_client.go b/client/local_client.go index 7450573e..f056289c 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -89,23 +89,13 @@ func (app *localClient) CheckTxAsync(tx []byte) *ReqRes { ) } -func (app *localClient) QueryAsync(tx []byte) *ReqRes { +func (app *localClient) QueryAsync(reqQuery types.RequestQuery) *ReqRes { app.mtx.Lock() - res := app.Application.Query(tx) + resQuery := app.Application.Query(reqQuery) app.mtx.Unlock() return app.callback( - types.ToRequestQuery(tx), - types.ToResponseQuery(res.Code, res.Data, res.Log), - ) -} - -func (app *localClient) ProofAsync(key []byte, blockHeight uint64) *ReqRes { - app.mtx.Lock() - res := app.Application.Proof(key, blockHeight) - app.mtx.Unlock() - return app.callback( - types.ToRequestProof(key, blockHeight), - types.ToResponseQuery(res.Code, res.Data, res.Log), + types.ToRequestQuery(reqQuery), + types.ToResponseQuery(resQuery), ) } @@ -195,18 +185,11 @@ func (app *localClient) CheckTxSync(tx []byte) (res types.Result) { return res } -func (app *localClient) QuerySync(query []byte) (res types.Result) { +func (app *localClient) QuerySync(reqQuery types.RequestQuery) (resQuery types.ResponseQuery, err error) { app.mtx.Lock() - res = app.Application.Query(query) + resQuery = app.Application.Query(reqQuery) app.mtx.Unlock() - return res -} - -func (app *localClient) ProofSync(key []byte, blockHeight uint64) (res types.Result) { - app.mtx.Lock() - res = app.Application.Proof(key, blockHeight) - app.mtx.Unlock() - return res + return resQuery, nil } func (app *localClient) CommitSync() (res types.Result) { diff --git a/client/socket_client.go b/client/socket_client.go index 04d07a55..733aff4a 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -251,12 +251,8 @@ func (cli *socketClient) CheckTxAsync(tx []byte) *ReqRes { return cli.queueRequest(types.ToRequestCheckTx(tx)) } -func (cli *socketClient) QueryAsync(query []byte) *ReqRes { - return cli.queueRequest(types.ToRequestQuery(query)) -} - -func (cli *socketClient) ProofAsync(key []byte, blockHeight uint64) *ReqRes { - return cli.queueRequest(types.ToRequestProof(key, blockHeight)) +func (cli *socketClient) QueryAsync(reqQuery types.RequestQuery) *ReqRes { + return cli.queueRequest(types.ToRequestQuery(reqQuery)) } func (cli *socketClient) CommitAsync() *ReqRes { @@ -284,7 +280,7 @@ func (cli *socketClient) EchoSync(msg string) (res types.Result) { return types.ErrInternalError.SetLog(err.Error()) } resp := reqres.Response.GetEcho() - return types.Result{Code: OK, Data: []byte(resp.Message), Log: LOG} + return types.Result{Code: OK, Data: []byte(resp.Message)} } func (cli *socketClient) FlushSync() error { @@ -304,9 +300,8 @@ func (cli *socketClient) InfoSync() (resInfo types.ResponseInfo, err error) { } if resInfo_ := reqres.Response.GetInfo(); resInfo_ != nil { return *resInfo_, nil - } else { - return resInfo, nil } + return resInfo, nil } func (cli *socketClient) SetOptionSync(key string, value string) (res types.Result) { @@ -339,25 +334,18 @@ func (cli *socketClient) CheckTxSync(tx []byte) (res types.Result) { return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } -func (cli *socketClient) QuerySync(query []byte) (res types.Result) { - reqres := cli.queueRequest(types.ToRequestQuery(query)) +func (cli *socketClient) QuerySync(reqQuery types.RequestQuery) (resQuery types.ResponseQuery, err error) { + reqres := cli.queueRequest(types.ToRequestQuery(reqQuery)) cli.FlushSync() if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()) + return resQuery, err } - resp := reqres.Response.GetQuery() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} + if resQuery_ := reqres.Response.GetQuery(); resQuery_ != nil { + return *resQuery_, nil + } + return resQuery, nil } -func (cli *socketClient) ProofSync(key []byte, blockHeight uint64) (res types.Result) { - reqres := cli.queueRequest(types.ToRequestProof(key, blockHeight)) - cli.FlushSync() - if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()) - } - resp := reqres.Response.GetProof() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} -} func (cli *socketClient) CommitSync() (res types.Result) { reqres := cli.queueRequest(types.ToRequestCommit()) cli.FlushSync() @@ -450,8 +438,6 @@ func resMatchesReq(req *types.Request, res *types.Response) (ok bool) { _, ok = res.Value.(*types.Response_Commit) case *types.Request_Query: _, ok = res.Value.(*types.Response_Query) - case *types.Request_Proof: - _, ok = res.Value.(*types.Response_Proof) case *types.Request_InitChain: _, ok = res.Value.(*types.Response_InitChain) case *types.Request_BeginBlock: diff --git a/cmd/abci-cli/tmsp-cli.go b/cmd/abci-cli/abci-cli.go similarity index 78% rename from cmd/abci-cli/tmsp-cli.go rename to cmd/abci-cli/abci-cli.go index ccdd41d4..5c2b0051 100644 --- a/cmd/abci-cli/tmsp-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -7,7 +7,6 @@ import ( "fmt" "io" "os" - "strconv" "strings" "github.com/tendermint/abci/client" @@ -16,28 +15,15 @@ import ( "github.com/urfave/cli" ) -//structure for data passed to print response -// variables must be exposed for JSON to read +// Structure for data passed to print response. type response struct { - Res types.Result - Data string - PrintCode bool - Code string -} - -func newResponse(res types.Result, data string, printCode bool) *response { - rsp := &response{ - Res: res, - Data: data, - PrintCode: printCode, - Code: "", - } - - if printCode { - rsp.Code = res.Code.String() - } - - return rsp + Data []byte + Code types.CodeType + Key []byte + Value []byte + Log string + Height string + Proof []byte } // client is a global variable so it can be reused by the console @@ -132,13 +118,6 @@ func main() { return cmdQuery(c) }, }, - { - Name: "proof", - Usage: "Get proof for a key", - Action: func(c *cli.Context) error { - return cmdProof(c) - }, - }, } app.Before = before err := app.Run(os.Args) @@ -228,9 +207,10 @@ func cmdEcho(c *cli.Context) error { if len(args) != 1 { return errors.New("Command echo takes 1 argument") } - res := client.EchoSync(args[0]) - rsp := newResponse(res, string(res.Data), false) - printResponse(c, rsp) + resEcho := client.EchoSync(args[0]) + printResponse(c, response{ + Data: resEcho.Data, + }) return nil } @@ -240,8 +220,9 @@ func cmdInfo(c *cli.Context) error { if err != nil { return err } - rsp := newResponse(types.Result{}, string(resInfo.Data), false) - printResponse(c, rsp) + printResponse(c, response{ + Data: []byte(resInfo.Data), + }) return nil } @@ -251,9 +232,10 @@ func cmdSetOption(c *cli.Context) error { if len(args) != 2 { return errors.New("Command set_option takes 2 arguments (key, value)") } - res := client.SetOptionSync(args[0], args[1]) - rsp := newResponse(res, Fmt("%s=%s", args[0], args[1]), false) - printResponse(c, rsp) + resSetOption := client.SetOptionSync(args[0], args[1]) + printResponse(c, response{ + Log: resSetOption.Log, + }) return nil } @@ -268,8 +250,11 @@ func cmdDeliverTx(c *cli.Context) error { return err } res := client.DeliverTxSync(txBytes) - rsp := newResponse(res, string(res.Data), true) - printResponse(c, rsp) + printResponse(c, response{ + Code: res.Code, + Data: res.Data, + Log: res.Log, + }) return nil } @@ -284,20 +269,26 @@ func cmdCheckTx(c *cli.Context) error { return err } res := client.CheckTxSync(txBytes) - rsp := newResponse(res, string(res.Data), true) - printResponse(c, rsp) + printResponse(c, response{ + Code: res.Code, + Data: res.Data, + Log: res.Log, + }) return nil } // Get application Merkle root hash func cmdCommit(c *cli.Context) error { res := client.CommitSync() - rsp := newResponse(res, Fmt("0x%X", res.Data), false) - printResponse(c, rsp) + printResponse(c, response{ + Data: res.Data, + Log: res.Log, + }) return nil } // Query application state +// TODO: Make request and response support all fields. func cmdQuery(c *cli.Context) error { args := c.Args() if len(args) != 1 { @@ -307,36 +298,29 @@ func cmdQuery(c *cli.Context) error { if err != nil { return err } - res := client.QuerySync(queryBytes) - rsp := newResponse(res, string(res.Data), true) - printResponse(c, rsp) - return nil -} - -// Prove application state -func cmdProof(c *cli.Context) error { - args := c.Args() - if len(args) < 1 { - return errors.New("Command proof takes 1 or 2 arguments") - } - keyBytes, err := stringOrHexToBytes(c.Args()[0]) + resQuery, err := client.QuerySync(types.RequestQuery{ + Data: queryBytes, + Path: "/store", // TOOD expose + Height: 0, // TODO expose + Prove: true, // TODO expose + }) if err != nil { return err } - - var height uint64 - if len(args) == 2 { - height, _ = strconv.ParseUint(args[1], 10, 0) - } - res := client.ProofSync(keyBytes, height) - rsp := newResponse(res, string(res.Data), true) - printResponse(c, rsp) + printResponse(c, response{ + Code: resQuery.Code, + Key: resQuery.Key, + Value: resQuery.Value, + Log: resQuery.Log, + Height: fmt.Sprintf("%v", resQuery.Height), + Proof: resQuery.Proof, + }) return nil } //-------------------------------------------------------------------------------- -func printResponse(c *cli.Context, rsp *response) { +func printResponse(c *cli.Context, rsp response) { verbose := c.GlobalBool("verbose") @@ -344,19 +328,29 @@ func printResponse(c *cli.Context, rsp *response) { fmt.Println(">", c.Command.Name, strings.Join(c.Args(), " ")) } - if rsp.PrintCode { - fmt.Printf("-> code: %s\n", rsp.Code) + if rsp.Code != types.CodeType_OK { + fmt.Printf("-> code: %s\n", rsp.Code.String()) } - - //if pr.res.Error != "" { - // fmt.Printf("-> error: %s\n", pr.res.Error) - //} - - if rsp.Data != "" { + if len(rsp.Data) != 0 { fmt.Printf("-> data: %s\n", rsp.Data) + fmt.Printf("-> data.hex: %X\n", rsp.Data) } - if rsp.Res.Log != "" { - fmt.Printf("-> log: %s\n", rsp.Res.Log) + if len(rsp.Key) != 0 { + fmt.Printf("-> key: %s\n", rsp.Key) + fmt.Printf("-> key.hex: %X\n", rsp.Key) + } + if len(rsp.Value) != 0 { + fmt.Printf("-> value: %s\n", rsp.Value) + fmt.Printf("-> value.hex: %X\n", rsp.Value) + } + if rsp.Log != "" { + fmt.Printf("-> log: %s\n", rsp.Log) + } + if rsp.Height != "" { + fmt.Printf("-> height: %s\n", rsp.Height) + } + if rsp.Proof != nil { + fmt.Printf("-> proof: %X\n", rsp.Proof) } if verbose { diff --git a/cmd/counter/main.go b/cmd/counter/main.go index 218224a0..0714380b 100644 --- a/cmd/counter/main.go +++ b/cmd/counter/main.go @@ -3,9 +3,9 @@ package main import ( "flag" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/example/counter" "github.com/tendermint/abci/server" + . "github.com/tendermint/go-common" ) func main() { diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index 361f2a07..8bedfc61 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -57,12 +57,10 @@ func (app *ChainAwareApplication) Commit() types.Result { return types.NewResultOK([]byte("nil"), "") } -func (app *ChainAwareApplication) Query(query []byte) types.Result { - return types.NewResultOK([]byte(Fmt("%d,%d", app.beginCount, app.endCount)), "") -} - -func (app *ChainAwareApplication) Proof(key []byte, blockHeight uint64) types.Result { - return types.NewResultOK(nil, Fmt("Proof is not supported")) +func (app *ChainAwareApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { + return types.ResponseQuery{ + Value: []byte(Fmt("%d,%d", app.beginCount, app.endCount)), + } } func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) { diff --git a/example/chain_aware/chain_aware_test.go b/example/chain_aware/chain_aware_test.go index f5283a38..18fa8ea9 100644 --- a/example/chain_aware/chain_aware_test.go +++ b/example/chain_aware/chain_aware_test.go @@ -5,10 +5,10 @@ import ( "strings" "testing" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/client" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func TestChainAware(t *testing.T) { @@ -39,10 +39,10 @@ func TestChainAware(t *testing.T) { client.CommitSync() } - r := app.Query(nil) - spl := strings.Split(string(r.Data), ",") + 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.Data)) + t.Fatal("expected %d,%d ; got %s", n, n, string(r.Value)) } beginCount, _ := strconv.Atoi(spl[0]) endCount, _ := strconv.Atoi(spl[1]) diff --git a/example/counter/counter.go b/example/counter/counter.go index 62c10826..2f929c3e 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -71,19 +71,14 @@ func (app *CounterApplication) Commit() types.Result { } } -func (app *CounterApplication) Query(query []byte) types.Result { - queryStr := string(query) +func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { - switch queryStr { + switch reqQuery.Path { case "hash": - return types.NewResultOK(nil, Fmt("%v", app.hashCount)) + return types.ResponseQuery{Value: []byte(Fmt("%v", app.hashCount))} case "tx": - return types.NewResultOK(nil, Fmt("%v", app.txCount)) + return types.ResponseQuery{Value: []byte(Fmt("%v", app.txCount))} } - return types.ErrUnknownRequest.SetLog(Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr)) -} - -func (app *CounterApplication) Proof(key []byte, blockHeight uint64) types.Result { - return types.NewResultOK(nil, Fmt("Proof is not supported")) + return types.ResponseQuery{Log: Fmt("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} } diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 8f606f98..d37a1f76 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -1,13 +1,11 @@ package dummy import ( - "encoding/hex" "strings" "github.com/tendermint/abci/types" . "github.com/tendermint/go-common" "github.com/tendermint/go-merkle" - "github.com/tendermint/go-wire" ) type DummyApplication struct { @@ -47,30 +45,28 @@ func (app *DummyApplication) Commit() types.Result { return types.NewResultOK(hash, "") } -func (app *DummyApplication) Query(query []byte) types.Result { - index, value, exists := app.state.Get(query) - - queryResult := QueryResult{index, string(value), hex.EncodeToString(value), exists} - return types.NewResultOK(wire.JSONBytes(queryResult), "") -} - -func (app *DummyApplication) Proof(key []byte, blockHeight uint64) types.Result { - // TODO: when go-merkle supports querying older blocks without possible panics, - // we should store a cache and allow a query. But for now it is impossible. - // And this is just a Dummy application anyway, what do you expect? ;) - if blockHeight != 0 { - return types.ErrUnknownRequest +func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { + if reqQuery.Prove { + value, proof, exists := app.state.Proof(reqQuery.Data) + resQuery.Index = -1 // TODO make Proof return index + resQuery.Key = reqQuery.Data + resQuery.Value = value + resQuery.Proof = proof + if exists { + resQuery.Log = "exists" + } else { + resQuery.Log = "does not exist" + } + return + } else { + index, value, exists := app.state.Get(reqQuery.Data) + resQuery.Index = int64(index) + resQuery.Value = value + if exists { + resQuery.Log = "exists" + } else { + resQuery.Log = "does not exist" + } + return } - proof, exists := app.state.Proof(key) - if !exists { - return types.NewResultOK(nil, Fmt("Cannot find key = %v", key)) - } - return types.NewResultOK(proof, "Found the key") -} - -type QueryResult struct { - Index int `json:"index"` - Value string `json:"value"` - ValueHex string `json:"valueHex"` - Exists bool `json:"exists"` } diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index aa6c837d..b17192b4 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -6,7 +6,6 @@ import ( "sort" "testing" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" abcicli "github.com/tendermint/abci/client" "github.com/tendermint/abci/server" @@ -14,7 +13,6 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" merkle "github.com/tendermint/go-merkle" - "github.com/tendermint/go-wire" ) func testDummy(t *testing.T, app types.Application, tx []byte, key, value string) { @@ -25,21 +23,24 @@ func testDummy(t *testing.T, app types.Application, tx []byte, key, value string require.False(t, ar.IsErr(), ar) // make sure query is fine - r := app.Query([]byte(key)) - require.False(t, r.IsErr(), r) - q := new(QueryResult) - err := wire.ReadJSONBytes(r.Data, q) - require.Nil(t, err) - require.Equal(t, value, q.Value) + resQuery := app.Query(types.RequestQuery{ + Path: "/store", + Data: []byte(key), + }) + require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine - rp := app.Proof([]byte(key), 0) - require.False(t, rp.IsErr(), rp) - p, err := merkle.LoadProof(rp.Data) + resQuery = app.Query(types.RequestQuery{ + Path: "/store", + Data: []byte(key), + Prove: true, + }) + require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, value, string(resQuery.Value)) + proof, err := merkle.ReadProof(resQuery.Proof) require.Nil(t, err) - require.True(t, p.Valid()) - assert.Equal(t, []byte(key), p.Key()) - assert.Equal(t, []byte(value), p.Value()) + require.True(t, proof.Verify([]byte(key), resQuery.Value, proof.RootHash)) // NOTE: we have no way to verify the RootHash } func TestDummyKV(t *testing.T) { @@ -285,19 +286,24 @@ func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) require.False(t, ar.IsErr(), ar) // make sure query is fine - r := app.QuerySync([]byte(key)) - require.False(t, r.IsErr(), r) - q := new(QueryResult) - err := wire.ReadJSONBytes(r.Data, q) + resQuery, err := app.QuerySync(types.RequestQuery{ + Path: "/store", + Data: []byte(key), + }) require.Nil(t, err) - require.Equal(t, value, q.Value) + require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, value, string(resQuery.Value)) // make sure proof is fine - rp := app.ProofSync([]byte(key), 0) - require.False(t, rp.IsErr(), rp) - p, err := merkle.LoadProof(rp.Data) + resQuery, err = app.QuerySync(types.RequestQuery{ + Path: "/store", + Data: []byte(key), + Prove: true, + }) require.Nil(t, err) - require.True(t, p.Valid()) - assert.Equal(t, []byte(key), p.Key()) - assert.Equal(t, []byte(value), p.Value()) + require.Equal(t, types.CodeType_OK, resQuery.Code) + require.Equal(t, value, string(resQuery.Value)) + proof, err := merkle.ReadProof(resQuery.Proof) + require.Nil(t, err) + require.True(t, proof.Verify([]byte(key), resQuery.Value, proof.RootHash)) // NOTE: we have no way to verify the RootHash } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 781e1aae..2afb6c12 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -89,12 +89,8 @@ func (app *PersistentDummyApplication) Commit() types.Result { return types.NewResultOK(appHash, "") } -func (app *PersistentDummyApplication) Query(query []byte) types.Result { - return app.app.Query(query) -} - -func (app *PersistentDummyApplication) Proof(key []byte, blockHeight uint64) types.Result { - return app.app.Proof(key, blockHeight) +func (app *PersistentDummyApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { + return app.app.Query(reqQuery) } // Save the validators in the merkle tree diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index 694184a2..95ac8d59 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -31,10 +31,6 @@ func (app *NilApplication) Commit() types.Result { return types.NewResultOK([]byte("nil"), "") } -func (app *NilApplication) Query(query []byte) types.Result { - return types.NewResultOK(nil, "") -} - -func (app *NilApplication) Proof(key []byte, blockHeight uint64) types.Result { - return types.NewResultOK(nil, "") +func (app *NilApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { + return resQuery } diff --git a/glide.lock b/glide.lock index 4829e672..c67e08b3 100644 --- a/glide.lock +++ b/glide.lock @@ -53,7 +53,7 @@ imports: - name: github.com/tendermint/go-logger version: cefb3a45c0bf3c493a04e9bcd9b1540528be59f2 - name: github.com/tendermint/go-merkle - version: 7a86b4486f2cd84ac885c5bbc609fdee2905f5d1 + version: 653cb1f631528351ddbc359b994eb0c96f0341cd - name: github.com/tendermint/go-process version: b27edfd189b1a01a0b099f7e9f8263589cf04909 - name: github.com/tendermint/go-wire diff --git a/server/socket_server.go b/server/socket_server.go index 046b55ed..7832a900 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -8,8 +8,8 @@ import ( "strings" "sync" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) // var maxNumberConnections = 2 @@ -184,11 +184,8 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types res := s.app.Commit() responses <- types.ToResponseCommit(res.Code, res.Data, res.Log) case *types.Request_Query: - res := s.app.Query(r.Query.Query) - responses <- types.ToResponseQuery(res.Code, res.Data, res.Log) - case *types.Request_Proof: - res := s.app.Proof(r.Proof.Key, r.Proof.Height) - responses <- types.ToResponseProof(res.Code, res.Data, res.Log) + resQuery := s.app.Query(*r.Query) + responses <- types.ToResponseQuery(resQuery) case *types.Request_InitChain: if app, ok := s.app.(types.BlockchainAware); ok { app.InitChain(r.InitChain.Validators) diff --git a/tests/test_cli/ex1.abci.out.new b/tests/test_cli/ex1.abci.out.new new file mode 100644 index 00000000..aa8c5ae0 --- /dev/null +++ b/tests/test_cli/ex1.abci.out.new @@ -0,0 +1,44 @@ +> echo hello +-> data: hello +-> data.hex: 68656C6C6F + +> info +-> data: {"size":0} +-> data.hex: 7B2273697A65223A307D + +> commit + +> deliver_tx "abc" + +> info +-> data: {"size":1} +-> data.hex: 7B2273697A65223A317D + +> commit +-> data: uü~„»×ˆíX–$ðlú‡EÑ +-> data.hex: 750502FC7E84BBD788ED589624F06CFA871845D1 + +> query "abc" +-> key: abc +-> key.hex: 616263 +-> value: abc +-> value.hex: 616263 +-> log: exists +-> height: 0 +-> proof: 010114750502FC7E84BBD788ED589624F06CFA871845D1000114750502FC7E84BBD788ED589624F06CFA871845D1 + +> deliver_tx "def=xyz" + +> commit +-> data: v9;Š.E†°iLbžËQ²†ïÕ +-> data.hex: 76393B8A182E450286B0694C629ECB51B286EFD5 + +> query "def" +-> key: def +-> key.hex: 646566 +-> value: xyz +-> value.hex: 78797A +-> log: exists +-> height: 0 +-> proof: 010114C08027141879A7B95E1339565CE60D7DB7A115EB01010101020114750502FC7E84BBD788ED589624F06CFA871845D100011476393B8A182E450286B0694C629ECB51B286EFD5 + diff --git a/types/application.go b/types/application.go index 4cea52ff..404437fe 100644 --- a/types/application.go +++ b/types/application.go @@ -20,10 +20,7 @@ type Application interface { CheckTx(tx []byte) Result // Query for state - Query(query []byte) Result - - // Get proof for state - Proof(key []byte, blockHeight uint64) Result + Query(reqQuery RequestQuery) ResponseQuery // Return the application Merkle root hash Commit() Result @@ -81,13 +78,8 @@ func (app *GRPCApplication) CheckTx(ctx context.Context, req *RequestCheckTx) (* } func (app *GRPCApplication) Query(ctx context.Context, req *RequestQuery) (*ResponseQuery, error) { - r := app.app.Query(req.Query) - return &ResponseQuery{r.Code, r.Data, r.Log}, nil -} - -func (app *GRPCApplication) Proof(ctx context.Context, req *RequestProof) (*ResponseProof, error) { - r := app.app.Proof(req.Key, req.Height) - return &ResponseProof{r.Code, r.Data, r.Log}, nil + resQuery := app.app.Query(*req) + return &resQuery, nil } func (app *GRPCApplication) Commit(ctx context.Context, req *RequestCommit) (*ResponseCommit, error) { diff --git a/types/code.go b/types/code.go new file mode 100644 index 00000000..c99a0bbe --- /dev/null +++ b/types/code.go @@ -0,0 +1,3 @@ +package types + +func (c CodeType) IsOK() bool { return c == CodeType_OK } diff --git a/types/messages.go b/types/messages.go index af79f7eb..fe2d310a 100644 --- a/types/messages.go +++ b/types/messages.go @@ -49,15 +49,9 @@ func ToRequestCommit() *Request { } } -func ToRequestQuery(queryBytes []byte) *Request { +func ToRequestQuery(reqQuery RequestQuery) *Request { return &Request{ - Value: &Request_Query{&RequestQuery{queryBytes}}, - } -} - -func ToRequestProof(key []byte, blockHeight uint64) *Request { - return &Request{ - Value: &Request_Proof{&RequestProof{key, blockHeight}}, + Value: &Request_Query{&reqQuery}, } } @@ -129,15 +123,9 @@ func ToResponseCommit(code CodeType, data []byte, log string) *Response { } } -func ToResponseQuery(code CodeType, data []byte, log string) *Response { +func ToResponseQuery(resQuery ResponseQuery) *Response { return &Response{ - Value: &Response_Query{&ResponseQuery{code, data, log}}, - } -} - -func ToResponseProof(code CodeType, data []byte, log string) *Response { - return &Response{ - Value: &Response_Proof{&ResponseProof{code, data, log}}, + Value: &Response_Query{&resQuery}, } } diff --git a/types/types.pb.go b/types/types.pb.go index e53f877e..e0ae1076 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -17,7 +17,6 @@ It has these top-level messages: RequestDeliverTx RequestCheckTx RequestQuery - RequestProof RequestCommit RequestInitChain RequestBeginBlock @@ -31,7 +30,6 @@ It has these top-level messages: ResponseDeliverTx ResponseCheckTx ResponseQuery - ResponseProof ResponseCommit ResponseInitChain ResponseBeginBlock @@ -83,7 +81,6 @@ const ( MessageType_InitChain MessageType = 21 MessageType_BeginBlock MessageType = 22 MessageType_EndBlock MessageType = 23 - MessageType_Proof MessageType = 24 ) var MessageType_name = map[int32]string{ @@ -100,7 +97,6 @@ var MessageType_name = map[int32]string{ 21: "InitChain", 22: "BeginBlock", 23: "EndBlock", - 24: "Proof", } var MessageType_value = map[string]int32{ "NullMessage": 0, @@ -116,7 +112,6 @@ var MessageType_value = map[string]int32{ "InitChain": 21, "BeginBlock": 22, "EndBlock": 23, - "Proof": 24, } func (x MessageType) String() string { @@ -245,7 +240,6 @@ type Request struct { // *Request_InitChain // *Request_BeginBlock // *Request_EndBlock - // *Request_Proof Value isRequest_Value `protobuf_oneof:"value"` } @@ -291,9 +285,6 @@ type Request_BeginBlock struct { type Request_EndBlock struct { EndBlock *RequestEndBlock `protobuf:"bytes,11,opt,name=end_block,json=endBlock,oneof"` } -type Request_Proof struct { - Proof *RequestProof `protobuf:"bytes,12,opt,name=proof,oneof"` -} func (*Request_Echo) isRequest_Value() {} func (*Request_Flush) isRequest_Value() {} @@ -306,7 +297,6 @@ func (*Request_Query) isRequest_Value() {} func (*Request_InitChain) isRequest_Value() {} func (*Request_BeginBlock) isRequest_Value() {} func (*Request_EndBlock) isRequest_Value() {} -func (*Request_Proof) isRequest_Value() {} func (m *Request) GetValue() isRequest_Value { if m != nil { @@ -392,13 +382,6 @@ func (m *Request) GetEndBlock() *RequestEndBlock { return nil } -func (m *Request) GetProof() *RequestProof { - if x, ok := m.GetValue().(*Request_Proof); ok { - return x.Proof - } - return nil -} - // XXX_OneofFuncs is for the internal use of the proto package. func (*Request) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Request_OneofMarshaler, _Request_OneofUnmarshaler, _Request_OneofSizer, []interface{}{ @@ -413,7 +396,6 @@ func (*Request) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error (*Request_InitChain)(nil), (*Request_BeginBlock)(nil), (*Request_EndBlock)(nil), - (*Request_Proof)(nil), } } @@ -476,11 +458,6 @@ func _Request_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { if err := b.EncodeMessage(x.EndBlock); err != nil { return err } - case *Request_Proof: - b.EncodeVarint(12<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Proof); err != nil { - return err - } case nil: default: return fmt.Errorf("Request.Value has unexpected type %T", x) @@ -579,14 +556,6 @@ func _Request_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer err := b.DecodeMessage(msg) m.Value = &Request_EndBlock{msg} return true, err - case 12: // value.proof - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(RequestProof) - err := b.DecodeMessage(msg) - m.Value = &Request_Proof{msg} - return true, err default: return false, nil } @@ -651,11 +620,6 @@ func _Request_OneofSizer(msg proto.Message) (n int) { n += proto.SizeVarint(11<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s - case *Request_Proof: - s := proto.Size(x.Proof) - n += proto.SizeVarint(12<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -752,7 +716,10 @@ func (m *RequestCheckTx) GetTx() []byte { } type RequestQuery struct { - Query []byte `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + 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"` } func (m *RequestQuery) Reset() { *m = RequestQuery{} } @@ -760,44 +727,41 @@ func (m *RequestQuery) String() string { return proto.CompactTextStri func (*RequestQuery) ProtoMessage() {} func (*RequestQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } -func (m *RequestQuery) GetQuery() []byte { +func (m *RequestQuery) GetData() []byte { if m != nil { - return m.Query + return m.Data } return nil } -type RequestProof struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` -} - -func (m *RequestProof) Reset() { *m = RequestProof{} } -func (m *RequestProof) String() string { return proto.CompactTextString(m) } -func (*RequestProof) ProtoMessage() {} -func (*RequestProof) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } - -func (m *RequestProof) GetKey() []byte { +func (m *RequestQuery) GetPath() string { if m != nil { - return m.Key + return m.Path } - return nil + return "" } -func (m *RequestProof) GetHeight() uint64 { +func (m *RequestQuery) GetHeight() uint64 { if m != nil { return m.Height } return 0 } +func (m *RequestQuery) GetProve() bool { + if m != nil { + return m.Prove + } + return false +} + 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{9} } +func (*RequestCommit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } type RequestInitChain struct { Validators []*Validator `protobuf:"bytes,1,rep,name=validators" json:"validators,omitempty"` @@ -806,7 +770,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{10} } +func (*RequestInitChain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (m *RequestInitChain) GetValidators() []*Validator { if m != nil { @@ -823,7 +787,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{11} } +func (*RequestBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } func (m *RequestBeginBlock) GetHash() []byte { if m != nil { @@ -846,7 +810,7 @@ type RequestEndBlock struct { 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{12} } +func (*RequestEndBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } func (m *RequestEndBlock) GetHeight() uint64 { if m != nil { @@ -869,14 +833,13 @@ type Response struct { // *Response_InitChain // *Response_BeginBlock // *Response_EndBlock - // *Response_Proof Value isResponse_Value `protobuf_oneof:"value"` } 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{13} } +func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } type isResponse_Value interface { isResponse_Value() @@ -918,9 +881,6 @@ type Response_BeginBlock struct { type Response_EndBlock struct { EndBlock *ResponseEndBlock `protobuf:"bytes,12,opt,name=end_block,json=endBlock,oneof"` } -type Response_Proof struct { - Proof *ResponseProof `protobuf:"bytes,13,opt,name=proof,oneof"` -} func (*Response_Exception) isResponse_Value() {} func (*Response_Echo) isResponse_Value() {} @@ -934,7 +894,6 @@ func (*Response_Query) isResponse_Value() {} func (*Response_InitChain) isResponse_Value() {} func (*Response_BeginBlock) isResponse_Value() {} func (*Response_EndBlock) isResponse_Value() {} -func (*Response_Proof) isResponse_Value() {} func (m *Response) GetValue() isResponse_Value { if m != nil { @@ -1027,13 +986,6 @@ func (m *Response) GetEndBlock() *ResponseEndBlock { return nil } -func (m *Response) GetProof() *ResponseProof { - if x, ok := m.GetValue().(*Response_Proof); ok { - return x.Proof - } - return nil -} - // XXX_OneofFuncs is for the internal use of the proto package. func (*Response) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Response_OneofMarshaler, _Response_OneofUnmarshaler, _Response_OneofSizer, []interface{}{ @@ -1049,7 +1001,6 @@ func (*Response) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) erro (*Response_InitChain)(nil), (*Response_BeginBlock)(nil), (*Response_EndBlock)(nil), - (*Response_Proof)(nil), } } @@ -1117,11 +1068,6 @@ func _Response_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { if err := b.EncodeMessage(x.EndBlock); err != nil { return err } - case *Response_Proof: - b.EncodeVarint(13<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Proof); err != nil { - return err - } case nil: default: return fmt.Errorf("Response.Value has unexpected type %T", x) @@ -1228,14 +1174,6 @@ func _Response_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffe err := b.DecodeMessage(msg) m.Value = &Response_EndBlock{msg} return true, err - case 13: // value.proof - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ResponseProof) - err := b.DecodeMessage(msg) - m.Value = &Response_Proof{msg} - return true, err default: return false, nil } @@ -1305,11 +1243,6 @@ func _Response_OneofSizer(msg proto.Message) (n int) { n += proto.SizeVarint(12<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s - case *Response_Proof: - s := proto.Size(x.Proof) - n += proto.SizeVarint(13<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -1324,7 +1257,7 @@ type ResponseException struct { 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{14} } +func (*ResponseException) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } func (m *ResponseException) GetError() string { if m != nil { @@ -1340,7 +1273,7 @@ type ResponseEcho struct { 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{15} } +func (*ResponseEcho) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } func (m *ResponseEcho) GetMessage() string { if m != nil { @@ -1355,7 +1288,7 @@ 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{16} } +func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } type ResponseInfo struct { Data string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` @@ -1367,7 +1300,7 @@ type ResponseInfo struct { 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{17} } +func (*ResponseInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } func (m *ResponseInfo) GetData() string { if m != nil { @@ -1404,7 +1337,7 @@ type ResponseSetOption struct { 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{18} } +func (*ResponseSetOption) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } func (m *ResponseSetOption) GetLog() string { if m != nil { @@ -1422,7 +1355,7 @@ type ResponseDeliverTx struct { 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{19} } +func (*ResponseDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } func (m *ResponseDeliverTx) GetCode() CodeType { if m != nil { @@ -1454,7 +1387,7 @@ type ResponseCheckTx struct { 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{20} } +func (*ResponseCheckTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } func (m *ResponseCheckTx) GetCode() CodeType { if m != nil { @@ -1478,15 +1411,19 @@ func (m *ResponseCheckTx) GetLog() string { } type ResponseQuery 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"` + 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{} } func (m *ResponseQuery) String() string { return proto.CompactTextString(m) } func (*ResponseQuery) ProtoMessage() {} -func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } +func (*ResponseQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } func (m *ResponseQuery) GetCode() CodeType { if m != nil { @@ -1495,13 +1432,41 @@ func (m *ResponseQuery) GetCode() CodeType { return CodeType_OK } -func (m *ResponseQuery) GetData() []byte { +func (m *ResponseQuery) GetIndex() int64 { if m != nil { - return m.Data + return m.Index + } + 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 + } + return 0 +} + func (m *ResponseQuery) GetLog() string { if m != nil { return m.Log @@ -1509,38 +1474,6 @@ func (m *ResponseQuery) GetLog() string { return "" } -type ResponseProof 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"` -} - -func (m *ResponseProof) Reset() { *m = ResponseProof{} } -func (m *ResponseProof) String() string { return proto.CompactTextString(m) } -func (*ResponseProof) ProtoMessage() {} -func (*ResponseProof) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } - -func (m *ResponseProof) GetCode() CodeType { - if m != nil { - return m.Code - } - return CodeType_OK -} - -func (m *ResponseProof) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *ResponseProof) GetLog() string { - if m != nil { - return m.Log - } - return "" -} - 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"` @@ -1550,7 +1483,7 @@ type ResponseCommit struct { 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{23} } +func (*ResponseCommit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } func (m *ResponseCommit) GetCode() CodeType { if m != nil { @@ -1579,7 +1512,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{24} } +func (*ResponseInitChain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } type ResponseBeginBlock struct { } @@ -1587,7 +1520,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{25} } +func (*ResponseBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } type ResponseEndBlock struct { Diffs []*Validator `protobuf:"bytes,4,rep,name=diffs" json:"diffs,omitempty"` @@ -1596,7 +1529,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{26} } +func (*ResponseEndBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } func (m *ResponseEndBlock) GetDiffs() []*Validator { if m != nil { @@ -1620,7 +1553,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{27} } +func (*Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } func (m *Header) GetChainId() string { if m != nil { @@ -1693,7 +1626,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{28} } +func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } func (m *BlockID) GetHash() []byte { if m != nil { @@ -1717,7 +1650,7 @@ type PartSetHeader struct { 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{29} } +func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } func (m *PartSetHeader) GetTotal() uint64 { if m != nil { @@ -1741,7 +1674,7 @@ type Validator struct { 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{30} } +func (*Validator) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } func (m *Validator) GetPubKey() []byte { if m != nil { @@ -1766,7 +1699,6 @@ func init() { proto.RegisterType((*RequestDeliverTx)(nil), "types.RequestDeliverTx") proto.RegisterType((*RequestCheckTx)(nil), "types.RequestCheckTx") proto.RegisterType((*RequestQuery)(nil), "types.RequestQuery") - proto.RegisterType((*RequestProof)(nil), "types.RequestProof") proto.RegisterType((*RequestCommit)(nil), "types.RequestCommit") proto.RegisterType((*RequestInitChain)(nil), "types.RequestInitChain") proto.RegisterType((*RequestBeginBlock)(nil), "types.RequestBeginBlock") @@ -1780,7 +1712,6 @@ func init() { proto.RegisterType((*ResponseDeliverTx)(nil), "types.ResponseDeliverTx") proto.RegisterType((*ResponseCheckTx)(nil), "types.ResponseCheckTx") proto.RegisterType((*ResponseQuery)(nil), "types.ResponseQuery") - proto.RegisterType((*ResponseProof)(nil), "types.ResponseProof") proto.RegisterType((*ResponseCommit)(nil), "types.ResponseCommit") proto.RegisterType((*ResponseInitChain)(nil), "types.ResponseInitChain") proto.RegisterType((*ResponseBeginBlock)(nil), "types.ResponseBeginBlock") @@ -1811,7 +1742,6 @@ type ABCIApplicationClient interface { DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) - Proof(ctx context.Context, in *RequestProof, opts ...grpc.CallOption) (*ResponseProof, error) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error) @@ -1889,15 +1819,6 @@ func (c *aBCIApplicationClient) Query(ctx context.Context, in *RequestQuery, opt return out, nil } -func (c *aBCIApplicationClient) Proof(ctx context.Context, in *RequestProof, opts ...grpc.CallOption) (*ResponseProof, error) { - out := new(ResponseProof) - err := grpc.Invoke(ctx, "/types.ABCIApplication/Proof", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *aBCIApplicationClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) { out := new(ResponseCommit) err := grpc.Invoke(ctx, "/types.ABCIApplication/Commit", in, out, c.cc, opts...) @@ -1944,7 +1865,6 @@ type ABCIApplicationServer interface { DeliverTx(context.Context, *RequestDeliverTx) (*ResponseDeliverTx, error) CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error) Query(context.Context, *RequestQuery) (*ResponseQuery, error) - Proof(context.Context, *RequestProof) (*ResponseProof, error) Commit(context.Context, *RequestCommit) (*ResponseCommit, error) InitChain(context.Context, *RequestInitChain) (*ResponseInitChain, error) BeginBlock(context.Context, *RequestBeginBlock) (*ResponseBeginBlock, error) @@ -2081,24 +2001,6 @@ func _ABCIApplication_Query_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _ABCIApplication_Proof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestProof) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ABCIApplicationServer).Proof(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.ABCIApplication/Proof", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ABCIApplicationServer).Proof(ctx, req.(*RequestProof)) - } - return interceptor(ctx, in, info, handler) -} - func _ABCIApplication_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestCommit) if err := dec(in); err != nil { @@ -2203,10 +2105,6 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ MethodName: "Query", Handler: _ABCIApplication_Query_Handler, }, - { - MethodName: "Proof", - Handler: _ABCIApplication_Proof_Handler, - }, { MethodName: "Commit", Handler: _ABCIApplication_Commit_Handler, @@ -2231,112 +2129,112 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1710 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0x5b, 0x6f, 0xe4, 0x48, - 0x15, 0x8e, 0x3b, 0x7d, 0x3d, 0x9d, 0x74, 0x2a, 0x27, 0x37, 0xa7, 0xe1, 0x61, 0x64, 0x58, 0x36, - 0x33, 0x0c, 0x33, 0x28, 0xab, 0x45, 0x13, 0x16, 0x21, 0x25, 0x33, 0xd9, 0xa4, 0xb5, 0xda, 0x99, - 0xe0, 0x9d, 0xdd, 0x07, 0x40, 0xb4, 0x9c, 0x76, 0x75, 0xb7, 0x89, 0xdb, 0xf6, 0xf8, 0x92, 0x4d, - 0xf8, 0x23, 0xfc, 0x04, 0x7e, 0x01, 0x2f, 0x3c, 0xf1, 0x84, 0xc4, 0xfd, 0xf2, 0x57, 0xf8, 0x03, - 0xe8, 0x54, 0x95, 0xaf, 0xb1, 0x79, 0x9a, 0x7d, 0x69, 0xb9, 0xce, 0xad, 0xea, 0x54, 0x7d, 0xe7, - 0xab, 0xd3, 0x05, 0xdb, 0xf1, 0x7d, 0xc0, 0xa3, 0xe7, 0xe2, 0xf7, 0x59, 0x10, 0xfa, 0xb1, 0x8f, - 0x1d, 0x31, 0x30, 0xfe, 0xdb, 0x86, 0x9e, 0xc9, 0xdf, 0x25, 0x3c, 0x8a, 0xf1, 0x08, 0xda, 0x7c, - 0xb6, 0xf4, 0x75, 0xed, 0x91, 0x76, 0x34, 0x3c, 0xc6, 0x67, 0xd2, 0x5c, 0x69, 0xcf, 0x67, 0x4b, - 0xff, 0x72, 0xcd, 0x14, 0x16, 0xf8, 0x7d, 0xe8, 0xcc, 0xdd, 0x24, 0x5a, 0xea, 0x2d, 0x61, 0xba, - 0x53, 0x36, 0xfd, 0x94, 0x54, 0x97, 0x6b, 0xa6, 0xb4, 0xa1, 0xb0, 0x8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, 0x86, 0xed, 0x07, 0x80, 0x40, 0x84, 0xf6, 0xd2, 0x8a, 0x96, - 0x6a, 0x59, 0xe2, 0x1b, 0x3f, 0xa0, 0x75, 0x59, 0x36, 0x0f, 0x55, 0xa9, 0x6f, 0xaa, 0xb0, 0x97, - 0x42, 0x68, 0x2a, 0xa5, 0xf1, 0x18, 0xb6, 0x2a, 0x28, 0x29, 0x64, 0xa4, 0x95, 0x32, 0xfa, 0x43, - 0x07, 0xfa, 0x26, 0x8f, 0x02, 0xdf, 0x8b, 0x38, 0xbe, 0x80, 0x01, 0xbf, 0x9b, 0x71, 0x59, 0xf0, - 0x5a, 0x05, 0xb0, 0xd2, 0xe6, 0x3c, 0xd5, 0x13, 0xd8, 0x33, 0x63, 0x7c, 0xac, 0xc8, 0xaa, 0xca, - 0x40, 0xca, 0xa9, 0xc8, 0x56, 0x4f, 0x53, 0xb6, 0x5a, 0xaf, 0x54, 0xab, 0xb4, 0xad, 0xd0, 0xd5, - 0x63, 0x45, 0x57, 0xed, 0xda, 0xc0, 0x25, 0xbe, 0x3a, 0x29, 0xf1, 0x55, 0xa7, 0x76, 0xf9, 0x0d, - 0x84, 0x75, 0x52, 0x22, 0xac, 0x6e, 0xad, 0x6b, 0x03, 0x63, 0x7d, 0x54, 0x60, 0xac, 0x5e, 0xa5, - 0x50, 0xa5, 0x63, 0x0d, 0x65, 0x3d, 0xcf, 0x28, 0xab, 0x5f, 0x21, 0x39, 0xe5, 0x52, 0xe5, 0xac, - 0xa7, 0x29, 0x90, 0x07, 0xb5, 0x9b, 0x56, 0x21, 0xad, 0x93, 0x12, 0x69, 0x41, 0x6d, 0x3a, 0x0d, - 0xac, 0xf5, 0x93, 0x32, 0x6b, 0x49, 0xea, 0x39, 0xac, 0xf8, 0x36, 0xd2, 0xd6, 0x8f, 0x8a, 0xb4, - 0xb5, 0x51, 0x21, 0x4b, 0x85, 0x85, 0x3a, 0xde, 0x7a, 0x9a, 0xf2, 0xd6, 0x66, 0x6d, 0x7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x8c, 0x13, 0xd8, 0x2c, 0xc9, 0x89, 0xd1, - 0x62, 0x3f, 0xb6, 0x5c, 0x75, 0x75, 0xcb, 0x41, 0x36, 0x4d, 0x2b, 0x9f, 0xc6, 0x38, 0x81, 0x41, - 0x76, 0x86, 0x74, 0x2c, 0x41, 0x72, 0xfd, 0x59, 0xd6, 0xd9, 0xa8, 0x11, 0x85, 0x0b, 0xfc, 0xaf, - 0x55, 0x0f, 0xd1, 0x36, 0xe5, 0xe0, 0xc9, 0x9f, 0x34, 0x18, 0x7e, 0x2e, 0x29, 0x90, 0xd0, 0x88, - 0x5b, 0x30, 0x7c, 0x9d, 0xb8, 0xae, 0x12, 0xb1, 0x35, 0xec, 0x43, 0x9b, 0x98, 0x93, 0x69, 0x38, - 0x80, 0x8e, 0x60, 0x46, 0xd6, 0x22, 0x21, 0x51, 0x22, 0x5b, 0xc7, 0x4d, 0x18, 0x64, 0x1c, 0xc4, - 0xda, 0x34, 0xcc, 0x28, 0x99, 0x75, 0x68, 0x98, 0x51, 0x0f, 0xdb, 0xc6, 0x21, 0xf4, 0x14, 0x53, - 0x30, 0x44, 0x80, 0xae, 0x3c, 0x29, 0xb6, 0x43, 0xa1, 0x45, 0x91, 0xb3, 0x5d, 0x72, 0xc9, 0xa0, - 0xcd, 0xf6, 0x70, 0x04, 0x90, 0x83, 0x9a, 0xed, 0xe3, 0x06, 0xf4, 0x53, 0x38, 0xb3, 0x03, 0xf2, - 0x13, 0x05, 0xcc, 0xf4, 0x27, 0xbf, 0xef, 0x40, 0x3f, 0xad, 0x29, 0xec, 0x42, 0xeb, 0xcd, 0x67, - 0x6c, 0x0d, 0xb7, 0x61, 0x73, 0xe2, 0xc5, 0x3c, 0xf4, 0x2c, 0xf7, 0x9c, 0xee, 0x03, 0xa6, 0x91, - 0xe8, 0xdc, 0x9b, 0xf9, 0xb6, 0xe3, 0x2d, 0xa4, 0xa8, 0x45, 0x31, 0xcf, 0x2c, 0xfb, 0xb5, 0xef, - 0xcd, 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0xfd, 0xe9, 0x1f, - 0xd7, 0x76, 0xd5, 0xe4, 0x23, 0x7b, 0x83, 0xba, 0x7f, 0xd3, 0xe3, 0xda, 0x56, 0x15, 0x3f, 0x4e, - 0x29, 0x0d, 0x6b, 0x1f, 0x23, 0xc6, 0xf5, 0xfd, 0x3e, 0x6d, 0x4c, 0xfe, 0x37, 0xb2, 0xe9, 0x95, - 0x61, 0xdc, 0xd8, 0xc9, 0xe3, 0x69, 0x91, 0x23, 0xb1, 0xf1, 0xad, 0x61, 0xdc, 0xdc, 0xcf, 0xe3, - 0x27, 0x39, 0xad, 0x62, 0xc3, 0x8b, 0xc3, 0xb8, 0xa9, 0xa5, 0xbf, 0xee, 0x8a, 0xc7, 0xac, 0x8f, - 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x2e, 0xe2, 0x17, 0xe1, 0x12, 0x00, 0x00, + // 1711 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x4b, 0x6f, 0xe4, 0xc6, + 0x11, 0x16, 0xe7, 0x3d, 0x35, 0xd2, 0xa8, 0x55, 0x1a, 0x49, 0xd4, 0x24, 0x87, 0x05, 0x03, 0xc7, + 0xda, 0x8d, 0xb3, 0x1b, 0xc8, 0x70, 0xb0, 0x8a, 0x83, 0x00, 0xd2, 0xae, 0xbc, 0x1a, 0x18, 0xde, + 0x55, 0xe8, 0xb5, 0x2f, 0x09, 0x32, 0xa0, 0x86, 0x3d, 0x33, 0x8c, 0xa8, 0x26, 0x97, 0x6c, 0xca, + 0x52, 0x7e, 0x83, 0xef, 0xf9, 0x09, 0xb9, 0x07, 0xc8, 0x29, 0xf7, 0x00, 0x79, 0x3f, 0x7e, 0x51, + 0xd0, 0x0f, 0x3e, 0x45, 0x1a, 0x3e, 0xf8, 0x32, 0x60, 0x3d, 0xbb, 0xab, 0xba, 0xea, 0xeb, 0xea, + 0x81, 0x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0xdb, 0x3a, 0xef, 0x2f, 0x02, 0x97, 0xbe, 0xbd, + 0x0f, 0xa9, 0x2d, 0x85, 0x59, 0xa4, 0xad, 0x02, 0x2e, 0x6a, 0xff, 0xed, 0xdc, 0xff, 0xaf, 0x05, + 0x80, 0x94, 0xaa, 0xf7, 0xbb, 0xf4, 0xfe, 0x47, 0x23, 0x3f, 0x10, 0x85, 0xd6, 0xdf, 0xca, 0xf9, + 0x04, 0xba, 0x1e, 0x73, 0xe9, 0x9d, 0xf4, 0xde, 0xb6, 0x15, 0x91, 0x5e, 0x33, 0x6d, 0xb9, 0x62, + 0xf9, 0x9a, 0x51, 0x49, 0x56, 0x84, 0x06, 0xf4, 0x60, 0x29, 0x81, 0x61, 0xd3, 0x56, 0x44, 0x01, + 0x16, 0x7b, 0x25, 0xf8, 0xd7, 0x9b, 0xee, 0xe7, 0x9b, 0xfe, 0x95, 0xb8, 0x82, 0x8a, 0xdd, 0xf9, + 0x5d, 0x66, 0x64, 0x37, 0x3f, 0xcf, 0xac, 0x2f, 0xad, 0x09, 0xe0, 0xc3, 0x86, 0x53, 0x57, 0x6d, + 0xb9, 0x95, 0xf0, 0x87, 0xd0, 0x75, 0xbd, 0xe5, 0x32, 0x36, 0x3b, 0x0d, 0x97, 0x8d, 0x12, 0x5b, + 0x7f, 0x68, 0x41, 0x4f, 0x5d, 0x15, 0x78, 0x28, 0x60, 0xcb, 0xf1, 0xd8, 0xdc, 0x73, 0xd3, 0x76, + 0x91, 0xf4, 0xcc, 0x2d, 0xe4, 0xa4, 0x55, 0xca, 0x09, 0x42, 0x87, 0x7b, 0x37, 0x54, 0x57, 0xba, + 0xfc, 0xc6, 0x03, 0xe8, 0xb3, 0xe4, 0x66, 0xce, 0xef, 0x62, 0x99, 0xed, 0x8e, 0xdd, 0x63, 0xc9, + 0xcd, 0xdb, 0xbb, 0x18, 0x8f, 0x61, 0xab, 0x50, 0xf7, 0x9e, 0xab, 0xf1, 0x78, 0xac, 0xb7, 0x26, + 0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xe4, 0x7f, 0xc6, 0xf1, 0xd7, 0x5d, 0xd8, 0x3e, 0x3d, 0x7b, 0x31, 0x3b, 0x0d, 0xd5, + 0x02, 0xe2, 0xf6, 0x7e, 0xa6, 0x1a, 0x0d, 0x6b, 0x9e, 0xe6, 0xd3, 0xba, 0x41, 0x19, 0x8f, 0x75, + 0x3f, 0x62, 0xdd, 0x0b, 0x7d, 0x5a, 0x3b, 0x2f, 0x8b, 0x45, 0xd4, 0x20, 0xf3, 0xf0, 0xa1, 0x3e, + 0xad, 0x1b, 0x9a, 0xf1, 0x17, 0x85, 0xfe, 0xc6, 0xa6, 0xe7, 0xfa, 0xb4, 0x71, 0x7c, 0x16, 0xf6, + 0xf9, 0xe4, 0xd1, 0xf4, 0x68, 0x9f, 0x36, 0xce, 0xd0, 0xf8, 0x3c, 0x83, 0x0c, 0xac, 0x7f, 0xba, + 0x4f, 0x1b, 0xc6, 0x68, 0x91, 0x1e, 0x35, 0x34, 0xd4, 0xbd, 0xc8, 0xa7, 0xb5, 0x93, 0x31, 0x7e, + 0x94, 0x62, 0x12, 0xd6, 0xbe, 0xfa, 0xa7, 0xf5, 0xf3, 0xb7, 0x08, 0x32, 0x7f, 0xd6, 0x35, 0x3d, + 0xe7, 0xa7, 0x8d, 0x93, 0x35, 0x9e, 0x16, 0x41, 0x0e, 0x1b, 0x1f, 0xf5, 0xd3, 0xe6, 0xf9, 0x1a, + 0x3f, 0xce, 0x71, 0x11, 0x1b, 0x9e, 0xf6, 0xd3, 0xa6, 0x11, 0xfb, 0xaa, 0x27, 0xff, 0x35, 0xfa, + 0xf0, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x73, 0x34, 0x90, 0x2d, 0x4a, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 14093476..3eea82ea 100644 --- a/types/types.proto +++ b/types/types.proto @@ -113,7 +113,7 @@ message RequestCheckTx{ } message RequestQuery{ - bytes query = 1; + bytes data = 1; string path = 2; uint64 height = 3; bool prove = 4; @@ -191,10 +191,13 @@ message ResponseCheckTx{ } message ResponseQuery{ - bytes data = 2; - string log = 3; - uint64 height = 4; + CodeType code = 1; + int64 index = 2; + bytes key = 3; + bytes value = 4; bytes proof = 5; + uint64 height = 6; + string log = 7; } message ResponseCommit{