From 235b18d694a0da9cd904c234b216861d14770cba Mon Sep 17 00:00:00 2001 From: Tzu-Jung Lee Date: Mon, 16 Jan 2017 21:58:42 -0800 Subject: [PATCH 01/29] Makefile: add gmt and lint --- Makefile | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index d80410ff1..9e7039711 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,33 @@ -.PHONY: all test get_deps +.PHONY: all test fmt lint get_deps all: protoc install test NOVENDOR = go list github.com/tendermint/abci/... | grep -v /vendor/ protoc: - protoc --go_out=plugins=grpc:. types/*.proto + @ protoc --go_out=plugins=grpc:. types/*.proto install: - go install github.com/tendermint/abci/cmd/... + @ go install github.com/tendermint/abci/cmd/... test: - go test `${NOVENDOR}` - bash tests/test.sh + @ go test `${NOVENDOR}` + @ bash tests/test.sh + +fmt: + @ go fmt ./... + +lint: + @ go get -u github.com/golang/lint/golint + @ for file in $$(find "." -name '*.go' | grep -v '/vendor/' | grep -v '\.pb\.go'); do \ + golint -set_exit_status $${file}; \ + done; test_integrations: get_vendor_deps install test get_deps: - go get -d `${NOVENDOR}` + @ go get -d `${NOVENDOR}` get_vendor_deps: - go get github.com/Masterminds/glide - glide install + @ go get github.com/Masterminds/glide + @ glide install From aae3c91e88446f2b0244efefcd5a7ecb518eb877 Mon Sep 17 00:00:00 2001 From: Tzu-Jung Lee Date: Mon, 16 Jan 2017 22:03:27 -0800 Subject: [PATCH 02/29] fmt: run 'make fmt' --- client/client.go | 2 +- client/grpc_client.go | 2 +- client/local_client.go | 2 +- client/socket_client.go | 2 +- cmd/counter/main.go | 2 +- cmd/dummy/main.go | 2 +- example/chain_aware/chain_aware_app.go | 2 +- example/chain_aware/chain_aware_test.go | 2 +- example/counter/counter.go | 2 +- example/dummy/dummy_test.go | 2 +- example/dummy/persistent_dummy.go | 2 +- example/example_test.go | 2 +- server/grpc_server.go | 2 +- server/server.go | 2 +- server/socket_server.go | 2 +- tests/benchmarks/parallel/parallel.go | 2 +- tests/benchmarks/simple/simple.go | 2 +- tests/test_app/app.go | 4 ++-- testutil/messages.go | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/client/client.go b/client/client.go index 8ea295937..cdeb4db0f 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 { diff --git a/client/grpc_client.go b/client/grpc_client.go index 566ee183e..1a0e11d2e 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 diff --git a/client/local_client.go b/client/local_client.go index b787eb365..33dd619be 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 { diff --git a/client/socket_client.go b/client/socket_client.go index 9b4f9aed4..744b6c0c8 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 ( diff --git a/cmd/counter/main.go b/cmd/counter/main.go index 218224a0a..0714380b4 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/cmd/dummy/main.go b/cmd/dummy/main.go index aecb1138f..8167c3541 100644 --- a/cmd/dummy/main.go +++ b/cmd/dummy/main.go @@ -3,10 +3,10 @@ package main import ( "flag" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/example/dummy" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" + . "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 e3543f13c..85ea7129d 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() { diff --git a/example/chain_aware/chain_aware_test.go b/example/chain_aware/chain_aware_test.go index f5283a386..942c9ba9c 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) { diff --git a/example/counter/counter.go b/example/counter/counter.go index 90be6d92b..1249f667a 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 { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index d22943472..f745d2ead 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -6,10 +6,10 @@ import ( "sort" "testing" + "github.com/tendermint/abci/types" . "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" - "github.com/tendermint/abci/types" ) func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value string) { diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index fa730bcb5..550c5969f 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 ( diff --git a/example/example_test.go b/example/example_test.go index 1ddefddb5..fb15f503b 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -10,12 +10,12 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/client" "github.com/tendermint/abci/example/dummy" nilapp "github.com/tendermint/abci/example/nil" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func TestDummy(t *testing.T) { diff --git a/server/grpc_server.go b/server/grpc_server.go index 1acd45a36..07704c321 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -6,8 +6,8 @@ import ( "google.golang.org/grpc" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) // var maxNumberConnections = 2 diff --git a/server/server.go b/server/server.go index 496767470..6de8747b7 100644 --- a/server/server.go +++ b/server/server.go @@ -3,8 +3,8 @@ package server import ( "fmt" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func NewServer(protoAddr, transport string, app types.Application) (Service, error) { diff --git a/server/socket_server.go b/server/socket_server.go index bd26a18a8..1ef47859f 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 diff --git a/tests/benchmarks/parallel/parallel.go b/tests/benchmarks/parallel/parallel.go index 5960d529a..51d9a6366 100644 --- a/tests/benchmarks/parallel/parallel.go +++ b/tests/benchmarks/parallel/parallel.go @@ -5,8 +5,8 @@ import ( "fmt" //"encoding/hex" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func main() { diff --git a/tests/benchmarks/simple/simple.go b/tests/benchmarks/simple/simple.go index fb536730c..b1b71fb72 100644 --- a/tests/benchmarks/simple/simple.go +++ b/tests/benchmarks/simple/simple.go @@ -8,8 +8,8 @@ import ( "reflect" //"encoding/hex" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func main() { diff --git a/tests/test_app/app.go b/tests/test_app/app.go index 59d5b0e70..b84b9386f 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -5,10 +5,10 @@ import ( "os" "time" - . "github.com/tendermint/go-common" - "github.com/tendermint/go-process" "github.com/tendermint/abci/client" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" + "github.com/tendermint/go-process" ) //---------------------------------------- diff --git a/testutil/messages.go b/testutil/messages.go index 1036e48e4..0cdddb443 100644 --- a/testutil/messages.go +++ b/testutil/messages.go @@ -1,8 +1,8 @@ package testutil import ( - "github.com/tendermint/go-crypto" "github.com/tendermint/abci/types" + "github.com/tendermint/go-crypto" ) //---------------------------------------- From c65bb21a51c53bc2566a1eea95473e3c915c6c7b Mon Sep 17 00:00:00 2001 From: Tzu-Jung Lee Date: Mon, 16 Jan 2017 22:33:48 -0800 Subject: [PATCH 03/29] Makefile: add 'build' target --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9e7039711..45d0450a7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all test fmt lint get_deps +.PHONY: all build test fmt lint get_deps all: protoc install test @@ -10,6 +10,9 @@ protoc: install: @ go install github.com/tendermint/abci/cmd/... +build: + @ go build -i github.com/tendermint/abci/cmd/... + test: @ go test `${NOVENDOR}` @ bash tests/test.sh From fcaa545e1ef4d68ae35dc064693da7df9b832204 Mon Sep 17 00:00:00 2001 From: Tzu-Jung Lee Date: Mon, 16 Jan 2017 22:48:24 -0800 Subject: [PATCH 04/29] lint: remove dot import (go-common) Spell out the package explicitly. This commit is totally textual, and does not change any logic. The swiss-army knife package may serve a kick-start in early stage development. But as the codebase growing, we might want to retire it gradually: For simple wrapping functions, just inline it on the call site. For larger pice of code, make it an independent package. --- client/client.go | 4 ++-- client/grpc_client.go | 12 ++++++------ client/local_client.go | 6 +++--- client/socket_client.go | 16 ++++++++-------- cmd/abci-cli/tmsp-cli.go | 10 +++++----- cmd/counter/main.go | 6 +++--- cmd/dummy/main.go | 6 +++--- example/chain_aware/chain_aware_app.go | 8 ++++---- example/chain_aware/chain_aware_test.go | 4 ++-- example/counter/counter.go | 18 +++++++++--------- example/dummy/dummy.go | 4 ++-- example/dummy/dummy_test.go | 6 +++--- example/dummy/persistent_dummy.go | 18 +++++++++--------- example/example_test.go | 13 +++++++------ server/grpc_server.go | 8 ++++---- server/server.go | 6 +++--- server/socket_server.go | 10 +++++----- tests/benchmarks/parallel/parallel.go | 13 ++++++------- tests/benchmarks/simple/simple.go | 11 +++++------ tests/test_app/app.go | 18 +++++++++--------- 20 files changed, 98 insertions(+), 99 deletions(-) diff --git a/client/client.go b/client/client.go index cdeb4db0f..dc70645e4 100644 --- a/client/client.go +++ b/client/client.go @@ -5,11 +5,11 @@ import ( "sync" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) type Client interface { - Service + common.Service SetResponseCallback(Callback) Error() error diff --git a/client/grpc_client.go b/client/grpc_client.go index 1a0e11d2e..c48ebbcb5 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -9,13 +9,13 @@ import ( grpc "google.golang.org/grpc" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) // A stripped copy of the remoteClient that makes // synchronous calls using grpc type grpcClient struct { - BaseService + common.BaseService mustConnect bool client types.ABCIApplicationClient @@ -31,13 +31,13 @@ func NewGRPCClient(addr string, mustConnect bool) (*grpcClient, error) { addr: addr, mustConnect: mustConnect, } - cli.BaseService = *NewBaseService(nil, "grpcClient", cli) + cli.BaseService = *common.NewBaseService(nil, "grpcClient", cli) _, err := cli.Start() // Just start it, it's confusing for callers to remember to start. return cli, err } func dialerFunc(addr string, timeout time.Duration) (net.Conn, error) { - return Connect(addr) + return common.Connect(addr) } func (cli *grpcClient) OnStart() error { @@ -50,7 +50,7 @@ RETRY_LOOP: if cli.mustConnect { return err } else { - log.Warn(Fmt("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) + log.Warn(common.Fmt("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) time.Sleep(time.Second * 3) continue RETRY_LOOP } @@ -93,7 +93,7 @@ func (cli *grpcClient) StopForError(err error) { } cli.mtx.Unlock() - log.Warn(Fmt("Stopping abci.grpcClient for error: %v", err.Error())) + log.Warn(common.Fmt("Stopping abci.grpcClient for error: %v", err.Error())) cli.Stop() } diff --git a/client/local_client.go b/client/local_client.go index 33dd619be..235e3fce8 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -4,11 +4,11 @@ import ( "sync" types "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) type localClient struct { - BaseService + common.BaseService mtx *sync.Mutex types.Application Callback @@ -22,7 +22,7 @@ func NewLocalClient(mtx *sync.Mutex, app types.Application) *localClient { mtx: mtx, Application: app, } - cli.BaseService = *NewBaseService(log, "localClient", cli) + cli.BaseService = *common.NewBaseService(log, "localClient", cli) return cli } diff --git a/client/socket_client.go b/client/socket_client.go index 744b6c0c8..9309b67ad 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -11,7 +11,7 @@ import ( "time" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) const ( @@ -27,10 +27,10 @@ const flushThrottleMS = 20 // Don't wait longer than... // the application in general is not meant to be interfaced // with concurrent callers. type socketClient struct { - BaseService + common.BaseService reqQueue chan *ReqRes - flushTimer *ThrottleTimer + flushTimer *common.ThrottleTimer mustConnect bool mtx sync.Mutex @@ -45,14 +45,14 @@ type socketClient struct { func NewSocketClient(addr string, mustConnect bool) (*socketClient, error) { cli := &socketClient{ reqQueue: make(chan *ReqRes, reqQueueSize), - flushTimer: NewThrottleTimer("socketClient", flushThrottleMS), + flushTimer: common.NewThrottleTimer("socketClient", flushThrottleMS), mustConnect: mustConnect, addr: addr, reqSent: list.New(), resCb: nil, } - cli.BaseService = *NewBaseService(nil, "socketClient", cli) + cli.BaseService = *common.NewBaseService(nil, "socketClient", cli) _, err := cli.Start() // Just start it, it's confusing for callers to remember to start. return cli, err @@ -65,12 +65,12 @@ func (cli *socketClient) OnStart() error { var conn net.Conn RETRY_LOOP: for { - conn, err = Connect(cli.addr) + conn, err = common.Connect(cli.addr) if err != nil { if cli.mustConnect { return err } else { - log.Warn(Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr)) + log.Warn(common.Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr)) time.Sleep(time.Second * 3) continue RETRY_LOOP } @@ -109,7 +109,7 @@ func (cli *socketClient) StopForError(err error) { } cli.mtx.Unlock() - log.Warn(Fmt("Stopping abci.socketClient for error: %v", err.Error())) + log.Warn(common.Fmt("Stopping abci.socketClient for error: %v", err.Error())) cli.Stop() } diff --git a/cmd/abci-cli/tmsp-cli.go b/cmd/abci-cli/tmsp-cli.go index 39dace9f9..99d22a086 100644 --- a/cmd/abci-cli/tmsp-cli.go +++ b/cmd/abci-cli/tmsp-cli.go @@ -11,7 +11,7 @@ import ( "github.com/tendermint/abci/client" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" "github.com/urfave/cli" ) @@ -135,7 +135,7 @@ func main() { app.Before = before err := app.Run(os.Args) if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } } @@ -145,7 +145,7 @@ func before(c *cli.Context) error { var err error client, err = abcicli.NewClient(c.GlobalString("address"), c.GlobalString("abci"), false) if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } } return nil @@ -244,7 +244,7 @@ func cmdSetOption(c *cli.Context) error { 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) + rsp := newResponse(res, common.Fmt("%s=%s", args[0], args[1]), false) printResponse(c, rsp) return nil } @@ -284,7 +284,7 @@ func cmdCheckTx(c *cli.Context) error { // Get application Merkle root hash func cmdCommit(c *cli.Context) error { res := client.CommitSync() - rsp := newResponse(res, Fmt("0x%X", res.Data), false) + rsp := newResponse(res, common.Fmt("0x%X", res.Data), false) printResponse(c, rsp) return nil } diff --git a/cmd/counter/main.go b/cmd/counter/main.go index 0714380b4..24abc5deb 100644 --- a/cmd/counter/main.go +++ b/cmd/counter/main.go @@ -5,7 +5,7 @@ import ( "github.com/tendermint/abci/example/counter" "github.com/tendermint/abci/server" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) func main() { @@ -19,11 +19,11 @@ func main() { // Start the listener srv, err := server.NewServer(*addrPtr, *abciPtr, app) if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } // Wait forever - TrapSignal(func() { + common.TrapSignal(func() { // Cleanup srv.Stop() }) diff --git a/cmd/dummy/main.go b/cmd/dummy/main.go index 8167c3541..503cf73bc 100644 --- a/cmd/dummy/main.go +++ b/cmd/dummy/main.go @@ -6,7 +6,7 @@ import ( "github.com/tendermint/abci/example/dummy" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) func main() { @@ -27,11 +27,11 @@ func main() { // Start the listener srv, err := server.NewServer(*addrPtr, *abciPtr, app) if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } // Wait forever - TrapSignal(func() { + common.TrapSignal(func() { // Cleanup srv.Stop() }) diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index 85ea7129d..c0dc0d6e0 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -5,7 +5,7 @@ import ( "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) func main() { @@ -17,11 +17,11 @@ func main() { // Start the listener srv, err := server.NewServer(*addrPtr, *abciPtr, NewChainAwareApplication()) if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } // Wait forever - TrapSignal(func() { + common.TrapSignal(func() { // Cleanup srv.Stop() }) @@ -58,7 +58,7 @@ func (app *ChainAwareApplication) Commit() types.Result { } func (app *ChainAwareApplication) Query(query []byte) types.Result { - return types.NewResultOK([]byte(Fmt("%d,%d", app.beginCount, app.endCount)), "") + return types.NewResultOK([]byte(common.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 942c9ba9c..a19dd781a 100644 --- a/example/chain_aware/chain_aware_test.go +++ b/example/chain_aware/chain_aware_test.go @@ -8,7 +8,7 @@ import ( "github.com/tendermint/abci/client" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) func TestChainAware(t *testing.T) { @@ -25,7 +25,7 @@ func TestChainAware(t *testing.T) { // Connect to the socket client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { - Exit(Fmt("Error starting socket client: %v", err.Error())) + common.Exit(Fmt("Error starting socket client: %v", err.Error())) } client.Start() defer client.Stop() diff --git a/example/counter/counter.go b/example/counter/counter.go index 1249f667a..02ff00ee9 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) type CounterApplication struct { @@ -18,7 +18,7 @@ func NewCounterApplication(serial bool) *CounterApplication { } func (app *CounterApplication) Info() types.ResponseInfo { - return types.ResponseInfo{Data: Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} + return types.ResponseInfo{Data: common.Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} } func (app *CounterApplication) SetOption(key string, value string) (log string) { @@ -31,13 +31,13 @@ func (app *CounterApplication) SetOption(key string, value string) (log string) func (app *CounterApplication) DeliverTx(tx []byte) types.Result { if app.serial { if len(tx) > 8 { - return types.ErrEncodingError.SetLog(Fmt("Max tx size is 8 bytes, got %d", len(tx))) + return types.ErrEncodingError.SetLog(common.Fmt("Max tx size is 8 bytes, got %d", len(tx))) } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { - return types.ErrBadNonce.SetLog(Fmt("Invalid nonce. Expected %v, got %v", app.txCount, txValue)) + return types.ErrBadNonce.SetLog(common.Fmt("Invalid nonce. Expected %v, got %v", app.txCount, txValue)) } } app.txCount += 1 @@ -47,13 +47,13 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.Result { func (app *CounterApplication) CheckTx(tx []byte) types.Result { if app.serial { if len(tx) > 8 { - return types.ErrEncodingError.SetLog(Fmt("Max tx size is 8 bytes, got %d", len(tx))) + return types.ErrEncodingError.SetLog(common.Fmt("Max tx size is 8 bytes, got %d", len(tx))) } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { - return types.ErrBadNonce.SetLog(Fmt("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)) + return types.ErrBadNonce.SetLog(common.Fmt("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)) } } return types.OK @@ -76,10 +76,10 @@ func (app *CounterApplication) Query(query []byte) types.Result { switch queryStr { case "hash": - return types.NewResultOK(nil, Fmt("%v", app.hashCount)) + return types.NewResultOK(nil, common.Fmt("%v", app.hashCount)) case "tx": - return types.NewResultOK(nil, Fmt("%v", app.txCount)) + return types.NewResultOK(nil, common.Fmt("%v", app.txCount)) } - return types.ErrUnknownRequest.SetLog(Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr)) + return types.ErrUnknownRequest.SetLog(common.Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr)) } diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 6fdf87859..c49353e1b 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" ) @@ -20,7 +20,7 @@ func NewDummyApplication() *DummyApplication { } func (app *DummyApplication) Info() (resInfo types.ResponseInfo) { - return types.ResponseInfo{Data: Fmt("{\"size\":%v}", app.state.Size())} + return types.ResponseInfo{Data: common.Fmt("{\"size\":%v}", app.state.Size())} } func (app *DummyApplication) SetOption(key string, value string) (log string) { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index f745d2ead..9236068e8 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" ) @@ -107,8 +107,8 @@ func TestValSetChanges(t *testing.T) { 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() + pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(common.Fmt("test%d", i))).PubKey().Bytes() + power := common.RandInt() vals[i] = &types.Validator{pubkey, uint64(power)} } // iniitalize with the first nInit diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 550c5969f..b7c1eb4bb 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" dbm "github.com/tendermint/go-db" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" @@ -135,7 +135,7 @@ func LoadLastBlock(db dbm.DB) (lastBlock LastBlockInfo) { wire.ReadBinaryPtr(&lastBlock, r, 0, n, err) if *err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED - Exit(Fmt("Data has been corrupted or its spec has changed: %v\n", *err)) + common.Exit(common.Fmt("Data has been corrupted or its spec has changed: %v\n", *err)) } // TODO: ensure that buf is completely read. } @@ -149,7 +149,7 @@ func SaveLastBlock(db dbm.DB, lastBlock LastBlockInfo) { wire.WriteBinary(lastBlock, buf, n, err) if *err != nil { // TODO - PanicCrisis(*err) + common.PanicCrisis(*err) } db.Set(lastBlockKey, buf.Bytes()) } @@ -173,7 +173,7 @@ func (app *PersistentDummyApplication) Validators() (validators []*types.Validat } func MakeValSetChangeTx(pubkey []byte, power uint64) []byte { - return []byte(Fmt("val:%X/%d", pubkey, power)) + return []byte(common.Fmt("val:%X/%d", pubkey, power)) } func isValidatorTx(tx []byte) bool { @@ -188,16 +188,16 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Result { tx = tx[len(ValidatorSetChangePrefix):] pubKeyAndPower := strings.Split(string(tx), "/") if len(pubKeyAndPower) != 2 { - return types.ErrEncodingError.SetLog(Fmt("Expected 'pubkey/power'. Got %v", pubKeyAndPower)) + return types.ErrEncodingError.SetLog(common.Fmt("Expected 'pubkey/power'. Got %v", pubKeyAndPower)) } pubkeyS, powerS := pubKeyAndPower[0], pubKeyAndPower[1] pubkey, err := hex.DecodeString(pubkeyS) if err != nil { - return types.ErrEncodingError.SetLog(Fmt("Pubkey (%s) is invalid hex", pubkeyS)) + return types.ErrEncodingError.SetLog(common.Fmt("Pubkey (%s) is invalid hex", pubkeyS)) } power, err := strconv.Atoi(powerS) if err != nil { - return types.ErrEncodingError.SetLog(Fmt("Power (%s) is not an int", powerS)) + return types.ErrEncodingError.SetLog(common.Fmt("Power (%s) is not an int", powerS)) } // update @@ -210,14 +210,14 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types if v.Power == 0 { // remove validator if !app.app.state.Has(key) { - return types.ErrUnauthorized.SetLog(Fmt("Cannot remove non-existent validator %X", key)) + return types.ErrUnauthorized.SetLog(common.Fmt("Cannot remove non-existent validator %X", key)) } app.app.state.Remove(key) } else { // add or update validator value := bytes.NewBuffer(make([]byte, 0)) if err := types.WriteMessage(v, value); err != nil { - return types.ErrInternalError.SetLog(Fmt("Error encoding validator: %v", err)) + return types.ErrInternalError.SetLog(common.Fmt("Error encoding validator: %v", err)) } app.app.state.Set(key, value.Bytes()) } diff --git a/example/example_test.go b/example/example_test.go index fb15f503b..945499943 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -7,15 +7,16 @@ import ( "testing" "time" - "golang.org/x/net/context" "google.golang.org/grpc" + "golang.org/x/net/context" + "github.com/tendermint/abci/client" "github.com/tendermint/abci/example/dummy" nilapp "github.com/tendermint/abci/example/nil" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) func TestDummy(t *testing.T) { @@ -40,14 +41,14 @@ func testStream(t *testing.T, app types.Application) { // Start the listener server, err := server.NewSocketServer("unix://test.sock", app) if err != nil { - Exit(Fmt("Error starting socket server: %v", err.Error())) + common.Exit(common.Fmt("Error starting socket server: %v", err.Error())) } defer server.Stop() // Connect to the socket client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { - Exit(Fmt("Error starting socket client: %v", err.Error())) + common.Exit(common.Fmt("Error starting socket client: %v", err.Error())) } client.Start() defer client.Stop() @@ -113,14 +114,14 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { // Start the listener server, err := server.NewGRPCServer("unix://test.sock", app) if err != nil { - Exit(Fmt("Error starting GRPC server: %v", err.Error())) + common.Exit(common.Fmt("Error starting GRPC server: %v", err.Error())) } defer server.Stop() // Connect to the socket conn, err := grpc.Dial("unix://test.sock", grpc.WithInsecure(), grpc.WithDialer(dialerFunc)) if err != nil { - Exit(Fmt("Error dialing GRPC server: %v", err.Error())) + common.Exit(common.Fmt("Error dialing GRPC server: %v", err.Error())) } defer conn.Close() diff --git a/server/grpc_server.go b/server/grpc_server.go index 07704c321..3893b20b9 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -7,13 +7,13 @@ import ( "google.golang.org/grpc" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) // var maxNumberConnections = 2 type GRPCServer struct { - BaseService + common.BaseService proto string addr string @@ -23,7 +23,7 @@ type GRPCServer struct { app types.ABCIApplicationServer } -func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (Service, error) { +func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (common.Service, error) { parts := strings.SplitN(protoAddr, "://", 2) proto, addr := parts[0], parts[1] s := &GRPCServer{ @@ -32,7 +32,7 @@ func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (Service, listener: nil, app: app, } - s.BaseService = *NewBaseService(nil, "ABCIServer", s) + s.BaseService = *common.NewBaseService(nil, "ABCIServer", s) _, err := s.Start() // Just start it return s, err } diff --git a/server/server.go b/server/server.go index 6de8747b7..1d42e7d51 100644 --- a/server/server.go +++ b/server/server.go @@ -4,11 +4,11 @@ import ( "fmt" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) -func NewServer(protoAddr, transport string, app types.Application) (Service, error) { - var s Service +func NewServer(protoAddr, transport string, app types.Application) (common.Service, error) { + var s common.Service var err error switch transport { case "socket": diff --git a/server/socket_server.go b/server/socket_server.go index 1ef47859f..06bf03984 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -9,13 +9,13 @@ import ( "sync" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) // var maxNumberConnections = 2 type SocketServer struct { - BaseService + common.BaseService proto string addr string @@ -29,7 +29,7 @@ type SocketServer struct { app types.Application } -func NewSocketServer(protoAddr string, app types.Application) (Service, error) { +func NewSocketServer(protoAddr string, app types.Application) (common.Service, error) { parts := strings.SplitN(protoAddr, "://", 2) proto, addr := parts[0], parts[1] s := &SocketServer{ @@ -39,7 +39,7 @@ func NewSocketServer(protoAddr string, app types.Application) (Service, error) { app: app, conns: make(map[int]net.Conn), } - s.BaseService = *NewBaseService(nil, "ABCIServer", s) + s.BaseService = *common.NewBaseService(nil, "ABCIServer", s) _, err := s.Start() // Just start it return s, err } @@ -100,7 +100,7 @@ func (s *SocketServer) acceptConnectionsRoutine() { if !s.IsRunning() { return // Ignore error from listener closing. } - Exit("Failed to accept connection: " + err.Error()) + common.Exit("Failed to accept connection: " + err.Error()) } else { log.Notice("Accepted a new connection") } diff --git a/tests/benchmarks/parallel/parallel.go b/tests/benchmarks/parallel/parallel.go index 51d9a6366..9b7176f3e 100644 --- a/tests/benchmarks/parallel/parallel.go +++ b/tests/benchmarks/parallel/parallel.go @@ -3,17 +3,16 @@ package main import ( "bufio" "fmt" - //"encoding/hex" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) func main() { - conn, err := Connect("unix://test.sock") + conn, err := common.Connect("unix://test.sock") if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } // Read a bunch of responses @@ -23,7 +22,7 @@ func main() { var res = &types.Response{} err := types.ReadMessage(conn, res) if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } counter += 1 if counter%1000 == 0 { @@ -40,11 +39,11 @@ func main() { err := types.WriteMessage(req, bufWriter) if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } err = bufWriter.Flush() if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } counter += 1 diff --git a/tests/benchmarks/simple/simple.go b/tests/benchmarks/simple/simple.go index b1b71fb72..5076dc7a1 100644 --- a/tests/benchmarks/simple/simple.go +++ b/tests/benchmarks/simple/simple.go @@ -6,17 +6,16 @@ import ( "fmt" "net" "reflect" - //"encoding/hex" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" ) func main() { - conn, err := Connect("unix://test.sock") + conn, err := common.Connect("unix://test.sock") if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } // Make a bunch of requests @@ -25,7 +24,7 @@ func main() { req := types.ToRequestEcho("foobar") _, err := makeRequest(conn, req) if err != nil { - Exit(err.Error()) + common.Exit(err.Error()) } counter += 1 if counter%1000 == 0 { @@ -63,7 +62,7 @@ func makeRequest(conn net.Conn, req *types.Request) (*types.Response, error) { return nil, err } if _, ok := resFlush.Value.(*types.Response_Flush); !ok { - return nil, errors.New(Fmt("Expected flush response but got something else: %v", reflect.TypeOf(resFlush))) + return nil, errors.New(common.Fmt("Expected flush response but got something else: %v", reflect.TypeOf(resFlush))) } return res, nil diff --git a/tests/test_app/app.go b/tests/test_app/app.go index b84b9386f..ef9322788 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -7,7 +7,7 @@ import ( "github.com/tendermint/abci/client" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + common "github.com/tendermint/go-common" "github.com/tendermint/go-process" ) @@ -46,7 +46,7 @@ func SetOption(client abcicli.Client, key, value string) { res := client.SetOptionSync(key, value) _, _, log := res.Code, res.Data, res.Log if res.IsErr() { - panic(Fmt("setting %v=%v: \nlog: %v", key, value, log)) + panic(common.Fmt("setting %v=%v: \nlog: %v", key, value, log)) } } @@ -54,10 +54,10 @@ func Commit(client abcicli.Client, hashExp []byte) { res := client.CommitSync() _, data, log := res.Code, res.Data, res.Log if res.IsErr() { - panic(Fmt("committing %v\nlog: %v", log)) + panic(common.Fmt("committing %v\nlog: %v", log)) } if !bytes.Equal(res.Data, hashExp) { - panic(Fmt("Commit hash was unexpected. Got %X expected %X", + panic(common.Fmt("Commit hash was unexpected. Got %X expected %X", data, hashExp)) } } @@ -66,11 +66,11 @@ func DeliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, da res := client.DeliverTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if code != codeExp { - panic(Fmt("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", + panic(common.Fmt("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", code, codeExp, log)) } if !bytes.Equal(data, dataExp) { - panic(Fmt("DeliverTx response data was unexpected. Got %X expected %X", + panic(common.Fmt("DeliverTx response data was unexpected. Got %X expected %X", data, dataExp)) } } @@ -79,14 +79,14 @@ func CheckTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, data res := client.CheckTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if res.IsErr() { - panic(Fmt("checking tx %X: %v\nlog: %v", txBytes, log)) + panic(common.Fmt("checking tx %X: %v\nlog: %v", txBytes, log)) } if code != codeExp { - panic(Fmt("CheckTx response code was unexpected. Got %v expected %v. Log: %v", + panic(common.Fmt("CheckTx response code was unexpected. Got %v expected %v. Log: %v", code, codeExp, log)) } if !bytes.Equal(data, dataExp) { - panic(Fmt("CheckTx response data was unexpected. Got %X expected %X", + panic(common.Fmt("CheckTx response data was unexpected. Got %X expected %X", data, dataExp)) } } From 1150bbfe367cc4596e4fe4d15c8e7d2ff9c61670 Mon Sep 17 00:00:00 2001 From: Tzu-Jung Lee Date: Mon, 16 Jan 2017 22:59:46 -0800 Subject: [PATCH 05/29] lint: s/common.Fmt/fmt.Sprintf --- client/grpc_client.go | 5 +++-- client/socket_client.go | 4 ++-- cmd/abci-cli/tmsp-cli.go | 4 ++-- example/chain_aware/chain_aware_app.go | 3 ++- example/counter/counter.go | 18 +++++++++--------- example/dummy/dummy.go | 4 ++-- example/dummy/dummy_test.go | 3 ++- example/dummy/persistent_dummy.go | 15 ++++++++------- example/example_test.go | 8 ++++---- tests/benchmarks/simple/simple.go | 2 +- tests/test_app/app.go | 16 ++++++++-------- 11 files changed, 43 insertions(+), 39 deletions(-) diff --git a/client/grpc_client.go b/client/grpc_client.go index c48ebbcb5..3f568ac28 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -1,6 +1,7 @@ package abcicli import ( + "fmt" "net" "sync" "time" @@ -50,7 +51,7 @@ RETRY_LOOP: if cli.mustConnect { return err } else { - log.Warn(common.Fmt("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) + log.Warn(fmt.Sprintf("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) time.Sleep(time.Second * 3) continue RETRY_LOOP } @@ -93,7 +94,7 @@ func (cli *grpcClient) StopForError(err error) { } cli.mtx.Unlock() - log.Warn(common.Fmt("Stopping abci.grpcClient for error: %v", err.Error())) + log.Warn(fmt.Sprintf("Stopping abci.grpcClient for error: %v", err.Error())) cli.Stop() } diff --git a/client/socket_client.go b/client/socket_client.go index 9309b67ad..2ed51ef42 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -70,7 +70,7 @@ RETRY_LOOP: if cli.mustConnect { return err } else { - log.Warn(common.Fmt("abci.socketClient failed to connect to %v. Retrying...", cli.addr)) + log.Warn(fmt.Sprintf("abci.socketClient failed to connect to %v. Retrying...", cli.addr)) time.Sleep(time.Second * 3) continue RETRY_LOOP } @@ -109,7 +109,7 @@ func (cli *socketClient) StopForError(err error) { } cli.mtx.Unlock() - log.Warn(common.Fmt("Stopping abci.socketClient for error: %v", err.Error())) + log.Warn(fmt.Sprintf("Stopping abci.socketClient for error: %v", err.Error())) cli.Stop() } diff --git a/cmd/abci-cli/tmsp-cli.go b/cmd/abci-cli/tmsp-cli.go index 99d22a086..d2227a68d 100644 --- a/cmd/abci-cli/tmsp-cli.go +++ b/cmd/abci-cli/tmsp-cli.go @@ -244,7 +244,7 @@ func cmdSetOption(c *cli.Context) error { return errors.New("Command set_option takes 2 arguments (key, value)") } res := client.SetOptionSync(args[0], args[1]) - rsp := newResponse(res, common.Fmt("%s=%s", args[0], args[1]), false) + rsp := newResponse(res, fmt.Sprintf("%s=%s", args[0], args[1]), false) printResponse(c, rsp) return nil } @@ -284,7 +284,7 @@ func cmdCheckTx(c *cli.Context) error { // Get application Merkle root hash func cmdCommit(c *cli.Context) error { res := client.CommitSync() - rsp := newResponse(res, common.Fmt("0x%X", res.Data), false) + rsp := newResponse(res, fmt.Sprintf("0x%X", res.Data), false) printResponse(c, rsp) return nil } diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index c0dc0d6e0..534135d1b 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" @@ -58,7 +59,7 @@ func (app *ChainAwareApplication) Commit() types.Result { } func (app *ChainAwareApplication) Query(query []byte) types.Result { - return types.NewResultOK([]byte(common.Fmt("%d,%d", app.beginCount, app.endCount)), "") + return types.NewResultOK([]byte(fmt.Sprintf("%d,%d", app.beginCount, app.endCount)), "") } func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) { diff --git a/example/counter/counter.go b/example/counter/counter.go index 02ff00ee9..03861d0f7 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -2,9 +2,9 @@ package counter import ( "encoding/binary" + "fmt" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" ) type CounterApplication struct { @@ -18,7 +18,7 @@ func NewCounterApplication(serial bool) *CounterApplication { } func (app *CounterApplication) Info() types.ResponseInfo { - return types.ResponseInfo{Data: common.Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} + return types.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} } func (app *CounterApplication) SetOption(key string, value string) (log string) { @@ -31,13 +31,13 @@ func (app *CounterApplication) SetOption(key string, value string) (log string) func (app *CounterApplication) DeliverTx(tx []byte) types.Result { if app.serial { if len(tx) > 8 { - return types.ErrEncodingError.SetLog(common.Fmt("Max tx size is 8 bytes, got %d", len(tx))) + return types.ErrEncodingError.SetLog(fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))) } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { - return types.ErrBadNonce.SetLog(common.Fmt("Invalid nonce. Expected %v, got %v", app.txCount, txValue)) + return types.ErrBadNonce.SetLog(fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)) } } app.txCount += 1 @@ -47,13 +47,13 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.Result { func (app *CounterApplication) CheckTx(tx []byte) types.Result { if app.serial { if len(tx) > 8 { - return types.ErrEncodingError.SetLog(common.Fmt("Max tx size is 8 bytes, got %d", len(tx))) + return types.ErrEncodingError.SetLog(fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))) } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { - return types.ErrBadNonce.SetLog(common.Fmt("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)) + return types.ErrBadNonce.SetLog(fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)) } } return types.OK @@ -76,10 +76,10 @@ func (app *CounterApplication) Query(query []byte) types.Result { switch queryStr { case "hash": - return types.NewResultOK(nil, common.Fmt("%v", app.hashCount)) + return types.NewResultOK(nil, fmt.Sprintf("%v", app.hashCount)) case "tx": - return types.NewResultOK(nil, common.Fmt("%v", app.txCount)) + return types.NewResultOK(nil, fmt.Sprintf("%v", app.txCount)) } - return types.ErrUnknownRequest.SetLog(common.Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr)) + return types.ErrUnknownRequest.SetLog(fmt.Sprintf("Invalid nonce. Expected hash or tx, got %v", queryStr)) } diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index c49353e1b..b514e43c3 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -2,10 +2,10 @@ package dummy import ( "encoding/hex" + "fmt" "strings" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" ) @@ -20,7 +20,7 @@ func NewDummyApplication() *DummyApplication { } func (app *DummyApplication) Info() (resInfo types.ResponseInfo) { - return types.ResponseInfo{Data: common.Fmt("{\"size\":%v}", app.state.Size())} + return types.ResponseInfo{Data: fmt.Sprintf("{\"size\":%v}", app.state.Size())} } func (app *DummyApplication) SetOption(key string, value string) (log string) { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 9236068e8..ca1ec7f92 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -2,6 +2,7 @@ package dummy import ( "bytes" + "fmt" "io/ioutil" "sort" "testing" @@ -107,7 +108,7 @@ func TestValSetChanges(t *testing.T) { nInit := 5 vals := make([]*types.Validator, total) for i := 0; i < total; i++ { - pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(common.Fmt("test%d", i))).PubKey().Bytes() + pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(fmt.Sprintf("test%d", i))).PubKey().Bytes() power := common.RandInt() vals[i] = &types.Validator{pubkey, uint64(power)} } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index b7c1eb4bb..f7302b9de 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -3,6 +3,7 @@ package dummy import ( "bytes" "encoding/hex" + "fmt" "strconv" "strings" @@ -135,7 +136,7 @@ func LoadLastBlock(db dbm.DB) (lastBlock LastBlockInfo) { wire.ReadBinaryPtr(&lastBlock, r, 0, n, err) if *err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED - common.Exit(common.Fmt("Data has been corrupted or its spec has changed: %v\n", *err)) + common.Exit(fmt.Sprintf("Data has been corrupted or its spec has changed: %v\n", *err)) } // TODO: ensure that buf is completely read. } @@ -173,7 +174,7 @@ func (app *PersistentDummyApplication) Validators() (validators []*types.Validat } func MakeValSetChangeTx(pubkey []byte, power uint64) []byte { - return []byte(common.Fmt("val:%X/%d", pubkey, power)) + return []byte(fmt.Sprintf("val:%X/%d", pubkey, power)) } func isValidatorTx(tx []byte) bool { @@ -188,16 +189,16 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Result { tx = tx[len(ValidatorSetChangePrefix):] pubKeyAndPower := strings.Split(string(tx), "/") if len(pubKeyAndPower) != 2 { - return types.ErrEncodingError.SetLog(common.Fmt("Expected 'pubkey/power'. Got %v", pubKeyAndPower)) + return types.ErrEncodingError.SetLog(fmt.Sprintf("Expected 'pubkey/power'. Got %v", pubKeyAndPower)) } pubkeyS, powerS := pubKeyAndPower[0], pubKeyAndPower[1] pubkey, err := hex.DecodeString(pubkeyS) if err != nil { - return types.ErrEncodingError.SetLog(common.Fmt("Pubkey (%s) is invalid hex", pubkeyS)) + return types.ErrEncodingError.SetLog(fmt.Sprintf("Pubkey (%s) is invalid hex", pubkeyS)) } power, err := strconv.Atoi(powerS) if err != nil { - return types.ErrEncodingError.SetLog(common.Fmt("Power (%s) is not an int", powerS)) + return types.ErrEncodingError.SetLog(fmt.Sprintf("Power (%s) is not an int", powerS)) } // update @@ -210,14 +211,14 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types if v.Power == 0 { // remove validator if !app.app.state.Has(key) { - return types.ErrUnauthorized.SetLog(common.Fmt("Cannot remove non-existent validator %X", key)) + return types.ErrUnauthorized.SetLog(fmt.Sprintf("Cannot remove non-existent validator %X", key)) } app.app.state.Remove(key) } else { // add or update validator value := bytes.NewBuffer(make([]byte, 0)) if err := types.WriteMessage(v, value); err != nil { - return types.ErrInternalError.SetLog(common.Fmt("Error encoding validator: %v", err)) + return types.ErrInternalError.SetLog(fmt.Sprintf("Error encoding validator: %v", err)) } app.app.state.Set(key, value.Bytes()) } diff --git a/example/example_test.go b/example/example_test.go index 945499943..f47962fb1 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -41,14 +41,14 @@ func testStream(t *testing.T, app types.Application) { // Start the listener server, err := server.NewSocketServer("unix://test.sock", app) if err != nil { - common.Exit(common.Fmt("Error starting socket server: %v", err.Error())) + common.Exit(fmt.Sprintf("Error starting socket server: %v", err.Error())) } defer server.Stop() // Connect to the socket client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { - common.Exit(common.Fmt("Error starting socket client: %v", err.Error())) + common.Exit(fmt.Sprintf("Error starting socket client: %v", err.Error())) } client.Start() defer client.Stop() @@ -114,14 +114,14 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { // Start the listener server, err := server.NewGRPCServer("unix://test.sock", app) if err != nil { - common.Exit(common.Fmt("Error starting GRPC server: %v", err.Error())) + common.Exit(fmt.Sprintf("Error starting GRPC server: %v", err.Error())) } defer server.Stop() // Connect to the socket conn, err := grpc.Dial("unix://test.sock", grpc.WithInsecure(), grpc.WithDialer(dialerFunc)) if err != nil { - common.Exit(common.Fmt("Error dialing GRPC server: %v", err.Error())) + common.Exit(fmt.Sprintf("Error dialing GRPC server: %v", err.Error())) } defer conn.Close() diff --git a/tests/benchmarks/simple/simple.go b/tests/benchmarks/simple/simple.go index 5076dc7a1..d99c1b561 100644 --- a/tests/benchmarks/simple/simple.go +++ b/tests/benchmarks/simple/simple.go @@ -62,7 +62,7 @@ func makeRequest(conn net.Conn, req *types.Request) (*types.Response, error) { return nil, err } if _, ok := resFlush.Value.(*types.Response_Flush); !ok { - return nil, errors.New(common.Fmt("Expected flush response but got something else: %v", reflect.TypeOf(resFlush))) + return nil, errors.New(fmt.Sprintf("Expected flush response but got something else: %v", reflect.TypeOf(resFlush))) } return res, nil diff --git a/tests/test_app/app.go b/tests/test_app/app.go index ef9322788..8651cd4ba 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -46,7 +46,7 @@ func SetOption(client abcicli.Client, key, value string) { res := client.SetOptionSync(key, value) _, _, log := res.Code, res.Data, res.Log if res.IsErr() { - panic(common.Fmt("setting %v=%v: \nlog: %v", key, value, log)) + panic(fmt.Sprintf("setting %v=%v: \nlog: %v", key, value, log)) } } @@ -54,10 +54,10 @@ func Commit(client abcicli.Client, hashExp []byte) { res := client.CommitSync() _, data, log := res.Code, res.Data, res.Log if res.IsErr() { - panic(common.Fmt("committing %v\nlog: %v", log)) + panic(fmt.Sprintf("committing %v\nlog: %v", log)) } if !bytes.Equal(res.Data, hashExp) { - panic(common.Fmt("Commit hash was unexpected. Got %X expected %X", + panic(fmt.Sprintf("Commit hash was unexpected. Got %X expected %X", data, hashExp)) } } @@ -66,11 +66,11 @@ func DeliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, da res := client.DeliverTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if code != codeExp { - panic(common.Fmt("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", + panic(fmt.Sprintf("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", code, codeExp, log)) } if !bytes.Equal(data, dataExp) { - panic(common.Fmt("DeliverTx response data was unexpected. Got %X expected %X", + panic(fmt.Sprintf("DeliverTx response data was unexpected. Got %X expected %X", data, dataExp)) } } @@ -79,14 +79,14 @@ func CheckTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, data res := client.CheckTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if res.IsErr() { - panic(common.Fmt("checking tx %X: %v\nlog: %v", txBytes, log)) + panic(fmt.Sprintf("checking tx %X: %v\nlog: %v", txBytes, log)) } if code != codeExp { - panic(common.Fmt("CheckTx response code was unexpected. Got %v expected %v. Log: %v", + panic(fmt.Sprintf("CheckTx response code was unexpected. Got %v expected %v. Log: %v", code, codeExp, log)) } if !bytes.Equal(data, dataExp) { - panic(common.Fmt("CheckTx response data was unexpected. Got %X expected %X", + panic(fmt.Sprintf("CheckTx response data was unexpected. Got %X expected %X", data, dataExp)) } } From 9134905f42da8fd5829fbcfe33907b9f35d8fd43 Mon Sep 17 00:00:00 2001 From: Tzu-Jung Lee Date: Mon, 16 Jan 2017 23:09:33 -0800 Subject: [PATCH 06/29] cleanup: replace common.Exit with log.Crit or log.Fatal Later we can pick another logger that has fatal, like zap? --- cmd/abci-cli/tmsp-cli.go | 6 +++--- cmd/counter/main.go | 3 ++- cmd/dummy/main.go | 3 ++- example/chain_aware/chain_aware_app.go | 3 ++- example/chain_aware/chain_aware_test.go | 5 +++-- example/dummy/persistent_dummy.go | 2 +- example/example_test.go | 11 ++++++----- server/socket_server.go | 2 +- tests/benchmarks/parallel/parallel.go | 9 +++++---- tests/benchmarks/simple/simple.go | 5 +++-- 10 files changed, 28 insertions(+), 21 deletions(-) diff --git a/cmd/abci-cli/tmsp-cli.go b/cmd/abci-cli/tmsp-cli.go index d2227a68d..a5e32d0ed 100644 --- a/cmd/abci-cli/tmsp-cli.go +++ b/cmd/abci-cli/tmsp-cli.go @@ -6,12 +6,12 @@ import ( "errors" "fmt" "io" + "log" "os" "strings" "github.com/tendermint/abci/client" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" "github.com/urfave/cli" ) @@ -135,7 +135,7 @@ func main() { app.Before = before err := app.Run(os.Args) if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } } @@ -145,7 +145,7 @@ func before(c *cli.Context) error { var err error client, err = abcicli.NewClient(c.GlobalString("address"), c.GlobalString("abci"), false) if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } } return nil diff --git a/cmd/counter/main.go b/cmd/counter/main.go index 24abc5deb..c547d372e 100644 --- a/cmd/counter/main.go +++ b/cmd/counter/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "log" "github.com/tendermint/abci/example/counter" "github.com/tendermint/abci/server" @@ -19,7 +20,7 @@ func main() { // Start the listener srv, err := server.NewServer(*addrPtr, *abciPtr, app) if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } // Wait forever diff --git a/cmd/dummy/main.go b/cmd/dummy/main.go index 503cf73bc..71102e1aa 100644 --- a/cmd/dummy/main.go +++ b/cmd/dummy/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "log" "github.com/tendermint/abci/example/dummy" "github.com/tendermint/abci/server" @@ -27,7 +28,7 @@ func main() { // Start the listener srv, err := server.NewServer(*addrPtr, *abciPtr, app) if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } // Wait forever diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index 534135d1b..92fdad3df 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -3,6 +3,7 @@ package main import ( "flag" "fmt" + "log" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" @@ -18,7 +19,7 @@ func main() { // Start the listener srv, err := server.NewServer(*addrPtr, *abciPtr, NewChainAwareApplication()) if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } // Wait forever diff --git a/example/chain_aware/chain_aware_test.go b/example/chain_aware/chain_aware_test.go index a19dd781a..d3ece608c 100644 --- a/example/chain_aware/chain_aware_test.go +++ b/example/chain_aware/chain_aware_test.go @@ -1,6 +1,8 @@ package main import ( + "fmt" + "log" "strconv" "strings" "testing" @@ -8,7 +10,6 @@ import ( "github.com/tendermint/abci/client" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" ) func TestChainAware(t *testing.T) { @@ -25,7 +26,7 @@ func TestChainAware(t *testing.T) { // Connect to the socket client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { - common.Exit(Fmt("Error starting socket client: %v", err.Error())) + log.Fatal(fmt.Sprintf("Error starting socket client: %v", err.Error())) } client.Start() defer client.Stop() diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index f7302b9de..40c85aea9 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -136,7 +136,7 @@ func LoadLastBlock(db dbm.DB) (lastBlock LastBlockInfo) { wire.ReadBinaryPtr(&lastBlock, r, 0, n, err) if *err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED - common.Exit(fmt.Sprintf("Data has been corrupted or its spec has changed: %v\n", *err)) + log.Crit(fmt.Sprintf("Data has been corrupted or its spec has changed: %v\n", *err)) } // TODO: ensure that buf is completely read. } diff --git a/example/example_test.go b/example/example_test.go index f47962fb1..f31b39744 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -2,6 +2,7 @@ package example import ( "fmt" + "log" "net" "reflect" "testing" @@ -41,14 +42,14 @@ func testStream(t *testing.T, app types.Application) { // Start the listener server, err := server.NewSocketServer("unix://test.sock", app) if err != nil { - common.Exit(fmt.Sprintf("Error starting socket server: %v", err.Error())) + log.Fatal(fmt.Sprintf("Error starting socket server: %v", err.Error())) } defer server.Stop() // Connect to the socket client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { - common.Exit(fmt.Sprintf("Error starting socket client: %v", err.Error())) + log.Fatal(fmt.Sprintf("Error starting socket client: %v", err.Error())) } client.Start() defer client.Stop() @@ -104,7 +105,7 @@ func testStream(t *testing.T, app types.Application) { // test grpc func dialerFunc(addr string, timeout time.Duration) (net.Conn, error) { - return Connect(addr) + return common.Connect(addr) } func testGRPCSync(t *testing.T, app *types.GRPCApplication) { @@ -114,14 +115,14 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { // Start the listener server, err := server.NewGRPCServer("unix://test.sock", app) if err != nil { - common.Exit(fmt.Sprintf("Error starting GRPC server: %v", err.Error())) + log.Fatal(fmt.Sprintf("Error starting GRPC server: %v", err.Error())) } defer server.Stop() // Connect to the socket conn, err := grpc.Dial("unix://test.sock", grpc.WithInsecure(), grpc.WithDialer(dialerFunc)) if err != nil { - common.Exit(fmt.Sprintf("Error dialing GRPC server: %v", err.Error())) + log.Fatal(fmt.Sprintf("Error dialing GRPC server: %v", err.Error())) } defer conn.Close() diff --git a/server/socket_server.go b/server/socket_server.go index 06bf03984..8fe445cdb 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -100,7 +100,7 @@ func (s *SocketServer) acceptConnectionsRoutine() { if !s.IsRunning() { return // Ignore error from listener closing. } - common.Exit("Failed to accept connection: " + err.Error()) + log.Crit("Failed to accept connection: " + err.Error()) } else { log.Notice("Accepted a new connection") } diff --git a/tests/benchmarks/parallel/parallel.go b/tests/benchmarks/parallel/parallel.go index 9b7176f3e..88d19f325 100644 --- a/tests/benchmarks/parallel/parallel.go +++ b/tests/benchmarks/parallel/parallel.go @@ -3,6 +3,7 @@ package main import ( "bufio" "fmt" + "log" "github.com/tendermint/abci/types" common "github.com/tendermint/go-common" @@ -12,7 +13,7 @@ func main() { conn, err := common.Connect("unix://test.sock") if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } // Read a bunch of responses @@ -22,7 +23,7 @@ func main() { var res = &types.Response{} err := types.ReadMessage(conn, res) if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } counter += 1 if counter%1000 == 0 { @@ -39,11 +40,11 @@ func main() { err := types.WriteMessage(req, bufWriter) if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } err = bufWriter.Flush() if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } counter += 1 diff --git a/tests/benchmarks/simple/simple.go b/tests/benchmarks/simple/simple.go index d99c1b561..bd97567da 100644 --- a/tests/benchmarks/simple/simple.go +++ b/tests/benchmarks/simple/simple.go @@ -4,6 +4,7 @@ import ( "bufio" "errors" "fmt" + "log" "net" "reflect" @@ -15,7 +16,7 @@ func main() { conn, err := common.Connect("unix://test.sock") if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } // Make a bunch of requests @@ -24,7 +25,7 @@ func main() { req := types.ToRequestEcho("foobar") _, err := makeRequest(conn, req) if err != nil { - common.Exit(err.Error()) + log.Fatal(err.Error()) } counter += 1 if counter%1000 == 0 { From af2a66b2263425461fc955fe9cb3726a0693caef Mon Sep 17 00:00:00 2001 From: Tzu-Jung Lee Date: Mon, 16 Jan 2017 23:23:06 -0800 Subject: [PATCH 07/29] test_app: unexport internal function. This reverts commit 24c9b2761d7da5ab5084310f0cb3e51c7fc9738d. --- tests/test_app/app.go | 16 +++++++--------- tests/test_app/main.go | 30 +++++++++++++++--------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/tests/test_app/app.go b/tests/test_app/app.go index 8651cd4ba..87b74ead0 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -2,18 +2,16 @@ package main import ( "bytes" + "fmt" "os" "time" "github.com/tendermint/abci/client" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" "github.com/tendermint/go-process" ) -//---------------------------------------- - -func StartApp(abciApp string) *process.Process { +func startApp(abciApp string) *process.Process { // Start the app //outBuf := NewBufferCloser(nil) proc, err := process.StartProcess("abci_app", @@ -33,7 +31,7 @@ func StartApp(abciApp string) *process.Process { return proc } -func StartClient(abciType string) abcicli.Client { +func startClient(abciType string) abcicli.Client { // Start client client, err := abcicli.NewClient("tcp://127.0.0.1:46658", abciType, true) if err != nil { @@ -42,7 +40,7 @@ func StartClient(abciType string) abcicli.Client { return client } -func SetOption(client abcicli.Client, key, value string) { +func setOption(client abcicli.Client, key, value string) { res := client.SetOptionSync(key, value) _, _, log := res.Code, res.Data, res.Log if res.IsErr() { @@ -50,7 +48,7 @@ func SetOption(client abcicli.Client, key, value string) { } } -func Commit(client abcicli.Client, hashExp []byte) { +func commit(client abcicli.Client, hashExp []byte) { res := client.CommitSync() _, data, log := res.Code, res.Data, res.Log if res.IsErr() { @@ -62,7 +60,7 @@ func Commit(client abcicli.Client, hashExp []byte) { } } -func DeliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { +func deliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { res := client.DeliverTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if code != codeExp { @@ -75,7 +73,7 @@ func DeliverTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, da } } -func CheckTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { +func checkTx(client abcicli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { res := client.CheckTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if res.IsErr() { diff --git a/tests/test_app/main.go b/tests/test_app/main.go index 05f66b07f..376c02fe5 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -27,22 +27,22 @@ func testCounter() { } fmt.Printf("Running %s test with abci=%s\n", abciApp, abciType) - appProc := StartApp(abciApp) + appProc := startApp(abciApp) defer appProc.StopProcess(true) - client := StartClient(abciType) + client := startClient(abciType) defer client.Stop() - SetOption(client, "serial", "on") - Commit(client, nil) - DeliverTx(client, []byte("abc"), types.CodeType_BadNonce, nil) - Commit(client, nil) - DeliverTx(client, []byte{0x00}, types.CodeType_OK, nil) - Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) - DeliverTx(client, []byte{0x00}, types.CodeType_BadNonce, nil) - DeliverTx(client, []byte{0x01}, types.CodeType_OK, nil) - DeliverTx(client, []byte{0x00, 0x02}, types.CodeType_OK, nil) - DeliverTx(client, []byte{0x00, 0x03}, types.CodeType_OK, nil) - DeliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeType_OK, nil) - DeliverTx(client, []byte{0x00, 0x00, 0x06}, types.CodeType_BadNonce, nil) - Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5}) + setOption(client, "serial", "on") + commit(client, nil) + deliverTx(client, []byte("abc"), types.CodeType_BadNonce, nil) + commit(client, nil) + deliverTx(client, []byte{0x00}, types.CodeType_OK, nil) + commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) + deliverTx(client, []byte{0x00}, types.CodeType_BadNonce, nil) + deliverTx(client, []byte{0x01}, types.CodeType_OK, nil) + deliverTx(client, []byte{0x00, 0x02}, types.CodeType_OK, nil) + deliverTx(client, []byte{0x00, 0x03}, types.CodeType_OK, nil) + deliverTx(client, []byte{0x00, 0x00, 0x04}, types.CodeType_OK, nil) + deliverTx(client, []byte{0x00, 0x00, 0x06}, types.CodeType_BadNonce, nil) + commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 5}) } From 55cb08722df2e06ecad6a66ddb0b43f3c791aa71 Mon Sep 17 00:00:00 2001 From: Tzu-Jung Lee Date: Tue, 17 Jan 2017 00:26:32 -0800 Subject: [PATCH 08/29] lint: s/+=1/++, remove else clauses --- client/grpc_client.go | 21 +++++++++------------ client/socket_client.go | 22 +++++++++------------- example/chain_aware/chain_aware_app.go | 4 ++-- example/counter/counter.go | 12 +++++------- example/example_test.go | 4 ++-- server/socket_server.go | 2 +- tests/benchmarks/parallel/parallel.go | 4 ++-- tests/benchmarks/simple/simple.go | 5 ++--- 8 files changed, 32 insertions(+), 42 deletions(-) diff --git a/client/grpc_client.go b/client/grpc_client.go index 3f568ac28..ec6dcdb71 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -50,11 +50,10 @@ RETRY_LOOP: if err != nil { if cli.mustConnect { return err - } else { - log.Warn(fmt.Sprintf("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) - time.Sleep(time.Second * 3) - continue RETRY_LOOP } + log.Warn(fmt.Sprintf("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) + time.Sleep(time.Second * 3) + continue RETRY_LOOP } client := types.NewABCIApplicationClient(conn) @@ -268,11 +267,10 @@ func (cli *grpcClient) InfoSync() (resInfo types.ResponseInfo, err error) { if err = cli.Error(); err != nil { return resInfo, err } - if resInfo_ := reqres.Response.GetInfo(); resInfo_ != nil { - return *resInfo_, nil - } else { - return resInfo, nil + if info := reqres.Response.GetInfo(); info != nil { + return *info, nil } + return resInfo, nil } func (cli *grpcClient) SetOptionSync(key string, value string) (res types.Result) { @@ -335,9 +333,8 @@ func (cli *grpcClient) EndBlockSync(height uint64) (resEndBlock types.ResponseEn if err := cli.Error(); err != nil { return resEndBlock, err } - if resEndBlock_ := reqres.Response.GetEndBlock(); resEndBlock_ != nil { - return *resEndBlock_, nil - } else { - return resEndBlock, nil + if blk := reqres.Response.GetEndBlock(); blk != nil { + return *blk, nil } + return resEndBlock, nil } diff --git a/client/socket_client.go b/client/socket_client.go index 2ed51ef42..a0def2352 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -69,11 +69,10 @@ RETRY_LOOP: if err != nil { if cli.mustConnect { return err - } else { - log.Warn(fmt.Sprintf("abci.socketClient failed to connect to %v. Retrying...", cli.addr)) - time.Sleep(time.Second * 3) - continue RETRY_LOOP } + log.Warn(fmt.Sprintf("abci.socketClient failed to connect to %v. Retrying...", cli.addr)) + time.Sleep(time.Second * 3) + continue RETRY_LOOP } cli.conn = conn @@ -82,7 +81,6 @@ RETRY_LOOP: return nil } - return nil // never happens } func (cli *socketClient) OnStop() { @@ -298,11 +296,10 @@ func (cli *socketClient) InfoSync() (resInfo types.ResponseInfo, err error) { if err := cli.Error(); err != nil { return resInfo, err } - if resInfo_ := reqres.Response.GetInfo(); resInfo_ != nil { - return *resInfo_, nil - } else { - return resInfo, nil + if info := reqres.Response.GetInfo(); info != nil { + return *info, nil } + return resInfo, nil } func (cli *socketClient) SetOptionSync(key string, value string) (res types.Result) { @@ -379,11 +376,10 @@ func (cli *socketClient) EndBlockSync(height uint64) (resEndBlock types.Response if err := cli.Error(); err != nil { return resEndBlock, err } - if resEndBlock_ := reqres.Response.GetEndBlock(); resEndBlock_ != nil { - return *resEndBlock_, nil - } else { - return resEndBlock, nil + if blk := reqres.Response.GetEndBlock(); blk != nil { + return *blk, nil } + return resEndBlock, nil } //---------------------------------------- diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index 92fdad3df..a9a23375a 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -64,12 +64,12 @@ func (app *ChainAwareApplication) Query(query []byte) types.Result { } func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) { - app.beginCount += 1 + app.beginCount++ return } func (app *ChainAwareApplication) EndBlock(height uint64) (resEndBlock types.ResponseEndBlock) { - app.endCount += 1 + app.endCount++ return } diff --git a/example/counter/counter.go b/example/counter/counter.go index 03861d0f7..00e71f389 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -40,7 +40,7 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.Result { return types.ErrBadNonce.SetLog(fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)) } } - app.txCount += 1 + app.txCount++ return types.OK } @@ -60,15 +60,13 @@ func (app *CounterApplication) CheckTx(tx []byte) types.Result { } func (app *CounterApplication) Commit() types.Result { - app.hashCount += 1 - + app.hashCount++ if app.txCount == 0 { return types.OK - } else { - hash := make([]byte, 8) - binary.BigEndian.PutUint64(hash, uint64(app.txCount)) - return types.NewResultOK(hash, "") } + hash := make([]byte, 8) + binary.BigEndian.PutUint64(hash, uint64(app.txCount)) + return types.NewResultOK(hash, "") } func (app *CounterApplication) Query(query []byte) types.Result { diff --git a/example/example_test.go b/example/example_test.go index f31b39744..b60fc2763 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -60,7 +60,7 @@ func testStream(t *testing.T, app types.Application) { // Process response switch r := res.Value.(type) { case *types.Response_DeliverTx: - counter += 1 + counter++ if r.DeliverTx.Code != types.CodeType_OK { t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code) } @@ -135,7 +135,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { if err != nil { t.Fatalf("Error in GRPC DeliverTx: %v", err.Error()) } - counter += 1 + counter++ if response.Code != types.CodeType_OK { t.Error("DeliverTx failed with ret_code", response.Code) } diff --git a/server/socket_server.go b/server/socket_server.go index 8fe445cdb..070fba8cb 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -72,7 +72,7 @@ func (s *SocketServer) addConn(conn net.Conn) int { defer s.connsMtx.Unlock() connID := s.nextConnID - s.nextConnID += 1 + s.nextConnID++ s.conns[connID] = conn return connID diff --git a/tests/benchmarks/parallel/parallel.go b/tests/benchmarks/parallel/parallel.go index 88d19f325..ac8d4e9e9 100644 --- a/tests/benchmarks/parallel/parallel.go +++ b/tests/benchmarks/parallel/parallel.go @@ -25,7 +25,7 @@ func main() { if err != nil { log.Fatal(err.Error()) } - counter += 1 + counter++ if counter%1000 == 0 { fmt.Println("Read", counter) } @@ -47,7 +47,7 @@ func main() { log.Fatal(err.Error()) } - counter += 1 + counter++ if counter%1000 == 0 { fmt.Println("Write", counter) } diff --git a/tests/benchmarks/simple/simple.go b/tests/benchmarks/simple/simple.go index bd97567da..75b669238 100644 --- a/tests/benchmarks/simple/simple.go +++ b/tests/benchmarks/simple/simple.go @@ -2,7 +2,6 @@ package main import ( "bufio" - "errors" "fmt" "log" "net" @@ -27,7 +26,7 @@ func main() { if err != nil { log.Fatal(err.Error()) } - counter += 1 + counter++ if counter%1000 == 0 { fmt.Println(counter) } @@ -63,7 +62,7 @@ func makeRequest(conn net.Conn, req *types.Request) (*types.Response, error) { return nil, err } if _, ok := resFlush.Value.(*types.Response_Flush); !ok { - return nil, errors.New(fmt.Sprintf("Expected flush response but got something else: %v", reflect.TypeOf(resFlush))) + return nil, fmt.Errorf("Expected flush response but got something else: %v", reflect.TypeOf(resFlush)) } return res, nil From 98c4679f39414a3ff7a1896aab6884f54f7d820b Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 10 Jan 2017 15:29:47 +0100 Subject: [PATCH 09/29] Fixed Makefile to cleanup after run --- .gitignore | 1 + Makefile | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d2d414be4..920af7622 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.swp *.swo *.pyc +vendor diff --git a/Makefile b/Makefile index d80410ff1..4db16ccdd 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 10/29] 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 8ea295937..a8bc8ea89 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 566ee183e..740623c66 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 b787eb365..8c092cec8 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 9b4f9aed4..252c8777b 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 39dace9f9..d40b510b4 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 e3543f13c..387a88e8b 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 90be6d92b..e5b179922 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 6fdf87859..2336add8a 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 fa730bcb5..bb8783ee1 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 cd57f0d98..a4d181c08 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 bd26a18a8..046b55edc 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 4da5e6f76..95f35d4a2 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 84e6ee0b3..b445c5351 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 b3ff1655e..09a2af8ff 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 11/29] 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 4db16ccdd..740bce9bc 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 387a88e8b..f335e543f 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 e5b179922..9ffec4001 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 2336add8a..ebce10990 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 bb8783ee1..70c0e667f 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 a4d181c08..1088ac964 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 95f35d4a2..5ba440dd8 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 b445c5351..9e303a71f 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 6cae54339..8467a78cd 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, 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, 0x71, 0x47, 0xb2, 0x48, 0x9e, 0x1a, 0x64, 0x50, 0x9a, 0x46, - 0xee, 0x47, 0x34, 0x52, 0xcd, 0x95, 0x91, 0xf0, 0xcd, 0xf1, 0xc8, 0x8e, 0xe4, 0x91, 0x5a, 0x61, - 0xe2, 0x0c, 0x91, 0xec, 0x67, 0x88, 0xa4, 0x5e, 0x38, 0xfd, 0x12, 0x26, 0xd9, 0xcf, 0x30, 0x49, - 0xa3, 0x30, 0xb4, 0x84, 0x4a, 0x1e, 0xa5, 0xa8, 0xa4, 0x99, 0xab, 0x20, 0x11, 0x58, 0xc0, 0x25, - 0x0f, 0x63, 0x2e, 0x69, 0xe5, 0xd8, 0x47, 0x86, 0xe4, 0xc9, 0xe4, 0x7e, 0x04, 0xc7, 0x76, 0xe1, - 0xa6, 0xe5, 0xd8, 0x64, 0x3f, 0xc3, 0x26, 0x50, 0xb8, 0x9c, 0x12, 0x3a, 0xf9, 0x4b, 0x96, 0x4e, - 0x04, 0x27, 0x6c, 0xe5, 0x62, 0x4b, 0xf9, 0xe4, 0x4f, 0x69, 0x3e, 0x59, 0xce, 0xb1, 0x98, 0xc4, - 0xc2, 0x27, 0x09, 0x65, 0x87, 0x55, 0x42, 0x0e, 0x69, 0xac, 0x16, 0xa9, 0xe7, 0x39, 0x9e, 0xe4, - 0x02, 0x21, 0xa8, 0xdb, 0xac, 0x62, 0x13, 0x7c, 0x7d, 0x82, 0x7c, 0x78, 0xd5, 0xa6, 0xd0, 0xa5, - 0xfe, 0x57, 0x49, 0x62, 0x19, 0x84, 0x58, 0xad, 0x19, 0x7a, 0xa0, 0xcb, 0x40, 0xfe, 0xcd, 0xf2, - 0x5d, 0x51, 0xcf, 0x67, 0x58, 0x12, 0x7c, 0x13, 0x89, 0xb8, 0x0b, 0xab, 0x96, 0xee, 0x07, 0x62, - 0x99, 0x63, 0x59, 0x56, 0x55, 0x5e, 0x56, 0x3d, 0x66, 0x10, 0xeb, 0xe3, 0x6a, 0xfc, 0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5, 0x8c, 0xd2, 0xb4, 0x67, 0xe7, 0xac, 0xe4, 0xc8, 0xcf, - 0xca, 0xde, 0xc7, 0x3a, 0xf4, 0x0e, 0x0e, 0x8f, 0x46, 0x07, 0xae, 0x18, 0x80, 0x5d, 0xb2, 0x0f, - 0x45, 0xa1, 0x61, 0xc1, 0x0b, 0x78, 0x58, 0xd4, 0xcf, 0xe2, 0x9e, 0xac, 0x47, 0x2c, 0x7a, 0x08, - 0x0f, 0x0b, 0xdb, 0x5a, 0x36, 0x88, 0xe8, 0x37, 0x6e, 0xbf, 0x87, 0x87, 0x45, 0xbd, 0x2d, 0xfe, - 0x35, 0x55, 0xdf, 0x58, 0xf6, 0x2a, 0x1e, 0x96, 0x76, 0xb9, 0x2c, 0x3e, 0x69, 0x10, 0xca, 0xde, - 0xc6, 0xc3, 0xd2, 0x56, 0x17, 0x9f, 0xc4, 0x94, 0x81, 0xc5, 0x2f, 0xe4, 0x61, 0x49, 0xb7, 0xcb, - 0xb6, 0x47, 0x5c, 0xee, 0x45, 0x0f, 0xdf, 0x61, 0x61, 0x03, 0x8b, 0x8f, 0x23, 0x4e, 0xc2, 0xc2, - 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,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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, 0xcf, 0x28, 0x6b, 0x50, 0x21, 0x39, 0xe5, 0x52, 0xe5, + 0xac, 0xa7, 0x29, 0x90, 0x87, 0xb5, 0x9b, 0x56, 0x21, 0xad, 0xe3, 0x12, 0x69, 0x41, 0x6d, 0x3a, + 0x0d, 0xac, 0xf5, 0x93, 0x32, 0x6b, 0x49, 0xea, 0x39, 0xa8, 0xf8, 0x36, 0xd2, 0xd6, 0x8f, 0x8a, + 0xb4, 0xb5, 0x5e, 0x21, 0x4b, 0x85, 0x85, 0x3a, 0xde, 0x7a, 0x9a, 0xf2, 0xd6, 0x46, 0x6d, 0x7a, + 0x4d, 0xc4, 0xf5, 0x98, 0xea, 0xa6, 0x82, 0x4b, 0xaa, 0x79, 0x1e, 0x86, 0x7e, 0xa8, 0x38, 0x47, + 0x0e, 0x8c, 0x43, 0xaa,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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 09a2af8ff..16dc28568 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 12/29] 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 a8bc8ea89..fd31b21ae 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 740623c66..3654c47cf 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 8c092cec8..bdc59c5ac 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 252c8777b..cacd67bff 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 d40b510b4..0eae4d85c 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, err := stringOrHexToBytes(c.Args()[0]) + if err != nil { + return err } - keyBytes := stringOrHexToBytes(c.Args()[0]) - res := client.ProofSync(keyBytes) - printResponse(c, res, string(res.Data), true) + + 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 ebce10990..fcf067dc2 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 d22943472..8cd999c08 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 70c0e667f..3a1ce3b50 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 13/29] 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 ea09fa7c2..3a9b27cb1 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 8cd999c08..aa6c837df 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 000000000..5cf7eee7b --- /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 42776a3a6..4829e672f 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 295b3d3ec..af1743876 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 14/29] 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 3a9b27cb1..23c1ac656 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 fcf067dc2..39f54fc28 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 15/29] Improve Makefile --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 740bce9bc..5cbe0b626 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 16/29] 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 | 128 +++++++-------- 14 files changed, 197 insertions(+), 198 deletions(-) diff --git a/client/client.go b/client/client.go index fd31b21ae..bbd41398c 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 3654c47cf..63fb16a41 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 bdc59c5ac..7450573ec 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 cacd67bff..04d07a553 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 0eae4d85c..ccdd41d4c 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 f335e543f..361f2a076 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 9ffec4001..62c10826e 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 39f54fc28..8f606f989 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 3a1ce3b50..781e1aae9 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 1088ac964..694184a29 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 5ba440dd8..4cea52ff0 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 9e303a71f..af79f7eb1 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 8467a78cd..e53f877ef 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, 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, 0x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, 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, 0x7a, 0x4d, + 0xc4, 0xf5, 0x98, 0xea, 0xa6, 0x82, 0x4b, 0xaa, 0x79, 0x1e, 0x86, 0x7e, 0xa8, 0x38, 0x47, 0x0e, + 0x8c, 0x23, 0xaa, 0xf9, 0x1c, 0x8d, 0xff, 0x87, 0xe4, 0x44, 0x8d, 0x17, 0xb0, 0x68, 0xfc, 0x56, + 0xcb, 0x7d, 0x09, 0x70, 0x54, 0x99, 0xb6, 0x15, 0x5b, 0xca, 0x51, 0x7c, 0x53, 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ad, 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 16dc28568..045c2d683 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; - - 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; + 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; } //---------------------------------------- // Code types enum CodeType { - OK = 0; - - // General response codes, 0 ~ 99 - InternalError = 1; - EncodingError = 2; - BadNonce = 3; - Unauthorized = 4; - InsufficientFunds = 5; - UnknownRequest = 6; - - // Reserved for basecoin, 100 ~ 199 - BaseDuplicateAddress = 101; - BaseEncodingError = 102; - BaseInsufficientFees = 103; - BaseInsufficientFunds = 104; - BaseInsufficientGasPrice = 105; - BaseInvalidInput = 106; - BaseInvalidOutput = 107; - BaseInvalidPubKey = 108; - BaseInvalidSequence = 109; - BaseInvalidSignature = 110; - BaseUnknownAddress = 111; - BaseUnknownPubKey = 112; - BaseUnknownPlugin = 113; - - // Reserved for governance, 200 ~ 299 - GovUnknownEntity = 201; - GovUnknownGroup = 202; - GovUnknownProposal = 203; - GovDuplicateGroup = 204; - GovDuplicateMember = 205; - GovDuplicateProposal = 206; - GovDuplicateVote = 207; - GovInvalidMember = 208; - GovInvalidVote = 209; - GovInvalidVotingPower = 210; + OK = 0; + + // General response codes, 0 ~ 99 + InternalError = 1; + EncodingError = 2; + BadNonce = 3; + Unauthorized = 4; + InsufficientFunds = 5; + UnknownRequest = 6; + + // Reserved for basecoin, 100 ~ 199 + BaseDuplicateAddress = 101; + BaseEncodingError = 102; + BaseInsufficientFees = 103; + BaseInsufficientFunds = 104; + BaseInsufficientGasPrice = 105; + BaseInvalidInput = 106; + BaseInvalidOutput = 107; + BaseInvalidPubKey = 108; + BaseInvalidSequence = 109; + BaseInvalidSignature = 110; + BaseUnknownAddress = 111; + BaseUnknownPubKey = 112; + BaseUnknownPlugin = 113; + + // Reserved for governance, 200 ~ 299 + GovUnknownEntity = 201; + GovUnknownGroup = 202; + GovUnknownProposal = 203; + GovDuplicateGroup = 204; + GovDuplicateMember = 205; + GovDuplicateProposal = 206; + GovDuplicateVote = 207; + GovInvalidMember = 208; + GovInvalidVote = 209; + GovInvalidVotingPower = 210; } @@ -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 9745f07beeb2cccd9047d0e7a5bdcf230f9fef24 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 23 Jan 2017 20:26:17 -0800 Subject: [PATCH 17/29] common -> cmn --- client/client.go | 4 ++-- client/grpc_client.go | 8 ++++---- client/local_client.go | 6 +++--- client/socket_client.go | 12 ++++++------ cmd/counter/main.go | 4 ++-- cmd/dummy/main.go | 4 ++-- example/chain_aware/chain_aware_app.go | 4 ++-- example/dummy/dummy_test.go | 4 ++-- example/dummy/persistent_dummy.go | 4 ++-- example/example_test.go | 4 ++-- server/grpc_server.go | 8 ++++---- server/server.go | 6 +++--- server/socket_server.go | 8 ++++---- tests/benchmarks/parallel/parallel.go | 4 ++-- tests/benchmarks/simple/simple.go | 4 ++-- 15 files changed, 42 insertions(+), 42 deletions(-) diff --git a/client/client.go b/client/client.go index dc70645e4..9b3d1a750 100644 --- a/client/client.go +++ b/client/client.go @@ -5,11 +5,11 @@ import ( "sync" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) type Client interface { - common.Service + cmn.Service SetResponseCallback(Callback) Error() error diff --git a/client/grpc_client.go b/client/grpc_client.go index ec6dcdb71..fc67b8b9c 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -10,13 +10,13 @@ import ( grpc "google.golang.org/grpc" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) // A stripped copy of the remoteClient that makes // synchronous calls using grpc type grpcClient struct { - common.BaseService + cmn.BaseService mustConnect bool client types.ABCIApplicationClient @@ -32,13 +32,13 @@ func NewGRPCClient(addr string, mustConnect bool) (*grpcClient, error) { addr: addr, mustConnect: mustConnect, } - cli.BaseService = *common.NewBaseService(nil, "grpcClient", cli) + cli.BaseService = *cmn.NewBaseService(nil, "grpcClient", cli) _, err := cli.Start() // Just start it, it's confusing for callers to remember to start. return cli, err } func dialerFunc(addr string, timeout time.Duration) (net.Conn, error) { - return common.Connect(addr) + return cmn.Connect(addr) } func (cli *grpcClient) OnStart() error { diff --git a/client/local_client.go b/client/local_client.go index 235e3fce8..459f42233 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -4,11 +4,11 @@ import ( "sync" types "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) type localClient struct { - common.BaseService + cmn.BaseService mtx *sync.Mutex types.Application Callback @@ -22,7 +22,7 @@ func NewLocalClient(mtx *sync.Mutex, app types.Application) *localClient { mtx: mtx, Application: app, } - cli.BaseService = *common.NewBaseService(log, "localClient", cli) + cli.BaseService = *cmn.NewBaseService(log, "localClient", cli) return cli } diff --git a/client/socket_client.go b/client/socket_client.go index a0def2352..d5335d8ee 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -11,7 +11,7 @@ import ( "time" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) const ( @@ -27,10 +27,10 @@ const flushThrottleMS = 20 // Don't wait longer than... // the application in general is not meant to be interfaced // with concurrent callers. type socketClient struct { - common.BaseService + cmn.BaseService reqQueue chan *ReqRes - flushTimer *common.ThrottleTimer + flushTimer *cmn.ThrottleTimer mustConnect bool mtx sync.Mutex @@ -45,14 +45,14 @@ type socketClient struct { func NewSocketClient(addr string, mustConnect bool) (*socketClient, error) { cli := &socketClient{ reqQueue: make(chan *ReqRes, reqQueueSize), - flushTimer: common.NewThrottleTimer("socketClient", flushThrottleMS), + flushTimer: cmn.NewThrottleTimer("socketClient", flushThrottleMS), mustConnect: mustConnect, addr: addr, reqSent: list.New(), resCb: nil, } - cli.BaseService = *common.NewBaseService(nil, "socketClient", cli) + cli.BaseService = *cmn.NewBaseService(nil, "socketClient", cli) _, err := cli.Start() // Just start it, it's confusing for callers to remember to start. return cli, err @@ -65,7 +65,7 @@ func (cli *socketClient) OnStart() error { var conn net.Conn RETRY_LOOP: for { - conn, err = common.Connect(cli.addr) + conn, err = cmn.Connect(cli.addr) if err != nil { if cli.mustConnect { return err diff --git a/cmd/counter/main.go b/cmd/counter/main.go index c547d372e..6858fc43e 100644 --- a/cmd/counter/main.go +++ b/cmd/counter/main.go @@ -6,7 +6,7 @@ import ( "github.com/tendermint/abci/example/counter" "github.com/tendermint/abci/server" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) func main() { @@ -24,7 +24,7 @@ func main() { } // Wait forever - common.TrapSignal(func() { + cmn.TrapSignal(func() { // Cleanup srv.Stop() }) diff --git a/cmd/dummy/main.go b/cmd/dummy/main.go index 71102e1aa..b48a15c7a 100644 --- a/cmd/dummy/main.go +++ b/cmd/dummy/main.go @@ -7,7 +7,7 @@ import ( "github.com/tendermint/abci/example/dummy" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) func main() { @@ -32,7 +32,7 @@ func main() { } // Wait forever - common.TrapSignal(func() { + cmn.TrapSignal(func() { // Cleanup srv.Stop() }) diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index a9a23375a..766f570c4 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -7,7 +7,7 @@ import ( "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) func main() { @@ -23,7 +23,7 @@ func main() { } // Wait forever - common.TrapSignal(func() { + cmn.TrapSignal(func() { // Cleanup srv.Stop() }) diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index ca1ec7f92..49dce9207 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" ) @@ -109,7 +109,7 @@ func TestValSetChanges(t *testing.T) { vals := make([]*types.Validator, total) for i := 0; i < total; i++ { pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(fmt.Sprintf("test%d", i))).PubKey().Bytes() - power := common.RandInt() + power := cmn.RandInt() vals[i] = &types.Validator{pubkey, uint64(power)} } // iniitalize with the first nInit diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 40c85aea9..547fc1eb0 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" dbm "github.com/tendermint/go-db" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" @@ -150,7 +150,7 @@ func SaveLastBlock(db dbm.DB, lastBlock LastBlockInfo) { wire.WriteBinary(lastBlock, buf, n, err) if *err != nil { // TODO - common.PanicCrisis(*err) + cmn.PanicCrisis(*err) } db.Set(lastBlockKey, buf.Bytes()) } diff --git a/example/example_test.go b/example/example_test.go index b60fc2763..26921083a 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -17,7 +17,7 @@ import ( nilapp "github.com/tendermint/abci/example/nil" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) func TestDummy(t *testing.T) { @@ -105,7 +105,7 @@ func testStream(t *testing.T, app types.Application) { // test grpc func dialerFunc(addr string, timeout time.Duration) (net.Conn, error) { - return common.Connect(addr) + return cmn.Connect(addr) } func testGRPCSync(t *testing.T, app *types.GRPCApplication) { diff --git a/server/grpc_server.go b/server/grpc_server.go index 3893b20b9..944d4e42c 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -7,13 +7,13 @@ import ( "google.golang.org/grpc" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) // var maxNumberConnections = 2 type GRPCServer struct { - common.BaseService + cmn.BaseService proto string addr string @@ -23,7 +23,7 @@ type GRPCServer struct { app types.ABCIApplicationServer } -func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (common.Service, error) { +func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (cmn.Service, error) { parts := strings.SplitN(protoAddr, "://", 2) proto, addr := parts[0], parts[1] s := &GRPCServer{ @@ -32,7 +32,7 @@ func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (common.Se listener: nil, app: app, } - s.BaseService = *common.NewBaseService(nil, "ABCIServer", s) + s.BaseService = *cmn.NewBaseService(nil, "ABCIServer", s) _, err := s.Start() // Just start it return s, err } diff --git a/server/server.go b/server/server.go index 1d42e7d51..eb71b1325 100644 --- a/server/server.go +++ b/server/server.go @@ -4,11 +4,11 @@ import ( "fmt" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) -func NewServer(protoAddr, transport string, app types.Application) (common.Service, error) { - var s common.Service +func NewServer(protoAddr, transport string, app types.Application) (cmn.Service, error) { + var s cmn.Service var err error switch transport { case "socket": diff --git a/server/socket_server.go b/server/socket_server.go index 070fba8cb..76185505c 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -9,13 +9,13 @@ import ( "sync" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) // var maxNumberConnections = 2 type SocketServer struct { - common.BaseService + cmn.BaseService proto string addr string @@ -29,7 +29,7 @@ type SocketServer struct { app types.Application } -func NewSocketServer(protoAddr string, app types.Application) (common.Service, error) { +func NewSocketServer(protoAddr string, app types.Application) (cmn.Service, error) { parts := strings.SplitN(protoAddr, "://", 2) proto, addr := parts[0], parts[1] s := &SocketServer{ @@ -39,7 +39,7 @@ func NewSocketServer(protoAddr string, app types.Application) (common.Service, e app: app, conns: make(map[int]net.Conn), } - s.BaseService = *common.NewBaseService(nil, "ABCIServer", s) + s.BaseService = *cmn.NewBaseService(nil, "ABCIServer", s) _, err := s.Start() // Just start it return s, err } diff --git a/tests/benchmarks/parallel/parallel.go b/tests/benchmarks/parallel/parallel.go index ac8d4e9e9..f01fba4c9 100644 --- a/tests/benchmarks/parallel/parallel.go +++ b/tests/benchmarks/parallel/parallel.go @@ -6,12 +6,12 @@ import ( "log" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) func main() { - conn, err := common.Connect("unix://test.sock") + conn, err := cmn.Connect("unix://test.sock") if err != nil { log.Fatal(err.Error()) } diff --git a/tests/benchmarks/simple/simple.go b/tests/benchmarks/simple/simple.go index 75b669238..498aac341 100644 --- a/tests/benchmarks/simple/simple.go +++ b/tests/benchmarks/simple/simple.go @@ -8,12 +8,12 @@ import ( "reflect" "github.com/tendermint/abci/types" - common "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) func main() { - conn, err := common.Connect("unix://test.sock") + conn, err := cmn.Connect("unix://test.sock") if err != nil { log.Fatal(err.Error()) } From 4bdddf9829dce751b25b3166df604dd125cf4b80 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 23 Jan 2017 20:48:12 -0800 Subject: [PATCH 18/29] 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 23c1ac656..083b031c6 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 045c2d683..140934762 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 19/29] 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 | 444 +++++++++------------- types/types.proto | 11 +- 22 files changed, 417 insertions(+), 567 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 083b031c6..ec6db9859 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 bbd41398c..25bb23ecd 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 63fb16a41..1a48fed1c 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 7450573ec..f056289c8 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 04d07a553..733aff4a0 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} -} - -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()) + if resQuery_ := reqres.Response.GetQuery(); resQuery_ != nil { + return *resQuery_, nil } - resp := reqres.Response.GetProof() - return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} + return resQuery, nil } + 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 ccdd41d4c..5c2b0051f 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 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.Res.Log != "" { - fmt.Printf("-> log: %s\n", rsp.Res.Log) + 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 218224a0a..0714380b4 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 361f2a076..8bedfc611 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 f5283a386..18fa8ea9d 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 62c10826e..2f929c3e0 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 8f606f989..d37a1f768 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 - } - proof, exists := app.state.Proof(key) - if !exists { - return types.NewResultOK(nil, Fmt("Cannot find key = %v", key)) +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 } - 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 aa6c837df..b17192b45 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.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 } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 781e1aae9..2afb6c12b 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 694184a29..95ac8d598 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 4829e672f..c67e08b3f 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 046b55edc..7832a9008 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 000000000..aa8c5ae0c --- /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 4cea52ff0..404437fed 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 000000000..c99a0bbe1 --- /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 af79f7eb1..fe2d310ac 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 { - return &Response{ - Value: &Response_Query{&ResponseQuery{code, data, log}}, - } -} - -func ToResponseProof(code CodeType, data []byte, log string) *Response { +func ToResponseQuery(resQuery ResponseQuery) *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 e53f877ef..e0ae1076b 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,46 +1432,42 @@ 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 nil + return 0 } -func (m *ResponseQuery) GetLog() string { +func (m *ResponseQuery) GetKey() []byte { if m != nil { - return m.Log + return m.Key } - return "" + return nil } -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 *ResponseQuery) GetValue() []byte { + if m != nil { + return m.Value + } + return nil } -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 { +func (m *ResponseQuery) GetProof() []byte { if m != nil { - return m.Code + return m.Proof } - return CodeType_OK + return nil } -func (m *ResponseProof) GetData() []byte { +func (m *ResponseQuery) GetHeight() uint64 { if m != nil { - return m.Data + return m.Height } - return nil + return 0 } -func (m *ResponseProof) GetLog() string { +func (m *ResponseQuery) GetLog() string { if m != nil { return m.Log } @@ -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, 0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 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, 0x7a, 0x4d, - 0xc4, 0xf5, 0x98, 0xea, 0xa6, 0x82, 0x4b, 0xaa, 0x79, 0x1e, 0x86, 0x7e, 0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3, 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, 0x1d, 0x7e, 0x1f, 0xd2, 0xf8, 0x99, 0xfc, 0x7d, 0x1a, 0x46, 0x01, 0x0f, 0xb0, 0x2b,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, 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, + 0xf7, 0x3d, 0x7b, 0x69, 0x8f, 0xb2, 0x0e, 0x98, 0xb9, 0x78, 0x04, 0xb2, 0x21, 0xe6, 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d5, + 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 140934762..3eea82ea6 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{ From b025c13f67cb3c26d015d8f8dc0bac910855a39d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 6 Feb 2017 19:08:37 -0500 Subject: [PATCH 20/29] drop BlockchainAware --- client/local_client.go | 25 ++----- .../block_aware_app.go} | 0 .../block_aware_test.go} | 0 example/counter/counter.go | 10 +++ example/dummy/dummy.go | 10 +++ example/dummy/dummy_test.go | 5 +- example/nil/nil_app.go | 10 +++ server/socket_server.go | 16 ++--- types/application.go | 68 ++++++------------- 9 files changed, 64 insertions(+), 80 deletions(-) rename example/{chain_aware/chain_aware_app.go => block_aware/block_aware_app.go} (100%) rename example/{chain_aware/chain_aware_test.go => block_aware/block_aware_test.go} (100%) diff --git a/client/local_client.go b/client/local_client.go index a34fde10d..1150db4a1 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -111,9 +111,7 @@ func (app *localClient) CommitAsync() *ReqRes { func (app *localClient) InitChainAsync(validators []*types.Validator) *ReqRes { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.InitChain(validators) - } + app.Application.InitChain(validators) reqRes := app.callback( types.ToRequestInitChain(validators), types.ToResponseInitChain(), @@ -124,9 +122,7 @@ func (app *localClient) InitChainAsync(validators []*types.Validator) *ReqRes { func (app *localClient) BeginBlockAsync(hash []byte, header *types.Header) *ReqRes { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.BeginBlock(hash, header) - } + app.Application.BeginBlock(hash, header) app.mtx.Unlock() return app.callback( types.ToRequestBeginBlock(hash, header), @@ -136,10 +132,7 @@ func (app *localClient) BeginBlockAsync(hash []byte, header *types.Header) *ReqR func (app *localClient) EndBlockAsync(height uint64) *ReqRes { app.mtx.Lock() - var resEndBlock types.ResponseEndBlock - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - resEndBlock = bcApp.EndBlock(height) - } + resEndBlock := app.Application.EndBlock(height) app.mtx.Unlock() return app.callback( types.ToRequestEndBlock(height), @@ -201,27 +194,21 @@ func (app *localClient) CommitSync() (res types.Result) { func (app *localClient) InitChainSync(validators []*types.Validator) (err error) { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.InitChain(validators) - } + app.Application.InitChain(validators) app.mtx.Unlock() return nil } func (app *localClient) BeginBlockSync(hash []byte, header *types.Header) (err error) { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.BeginBlock(hash, header) - } + app.Application.BeginBlock(hash, header) app.mtx.Unlock() return nil } func (app *localClient) EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) { app.mtx.Lock() - if bcApp, ok := app.Application.(types.BlockchainAware); ok { - resEndBlock = bcApp.EndBlock(height) - } + resEndBlock = app.Application.EndBlock(height) app.mtx.Unlock() return resEndBlock, nil } diff --git a/example/chain_aware/chain_aware_app.go b/example/block_aware/block_aware_app.go similarity index 100% rename from example/chain_aware/chain_aware_app.go rename to example/block_aware/block_aware_app.go diff --git a/example/chain_aware/chain_aware_test.go b/example/block_aware/block_aware_test.go similarity index 100% rename from example/chain_aware/chain_aware_test.go rename to example/block_aware/block_aware_test.go diff --git a/example/counter/counter.go b/example/counter/counter.go index a55a1fd1b..8fce72e2a 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -80,3 +80,13 @@ func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.Response return types.ResponseQuery{Log: Fmt("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} } } + +func (app *CounterApplication) InitChain(validators []*types.Validator) { +} + +func (app *CounterApplication) BeginBlock(hash []byte, header *types.Header) { +} + +func (app *CounterApplication) EndBlock(height uint64) types.ResponseEndBlock { + return types.ResponseEndBlock{} +} diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index ac2bd4623..73c938e79 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -70,3 +70,13 @@ func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types. return } } + +func (app *DummyApplication) InitChain(validators []*types.Validator) { +} + +func (app *DummyApplication) BeginBlock(hash []byte, header *types.Header) { +} + +func (app *DummyApplication) EndBlock(height uint64) types.ResponseEndBlock { + return types.ResponseEndBlock{} +} diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 7ca12a6e5..fbbf97a59 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -180,14 +180,13 @@ func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff [ Height: height, } - dummyChain := dummy.(types.BlockchainAware) // hmm... - dummyChain.BeginBlock(hash, header) + dummy.BeginBlock(hash, header) for _, tx := range txs { if r := dummy.DeliverTx(tx); r.IsErr() { t.Fatal(r) } } - resEndBlock := dummyChain.EndBlock(height) + resEndBlock := dummy.EndBlock(height) dummy.Commit() valsEqual(t, diff, resEndBlock.Diffs) diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index 95ac8d598..5285cc39a 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -34,3 +34,13 @@ func (app *NilApplication) Commit() types.Result { func (app *NilApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { return resQuery } + +func (app *NilApplication) InitChain(validators []*types.Validator) { +} + +func (app *NilApplication) BeginBlock(hash []byte, header *types.Header) { +} + +func (app *NilApplication) EndBlock(height uint64) types.ResponseEndBlock { + return types.ResponseEndBlock{} +} diff --git a/server/socket_server.go b/server/socket_server.go index 46114027b..bc1980e2d 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -187,22 +187,14 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types 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) - } + s.app.InitChain(r.InitChain.Validators) responses <- types.ToResponseInitChain() case *types.Request_BeginBlock: - if app, ok := s.app.(types.BlockchainAware); ok { - app.BeginBlock(r.BeginBlock.Hash, r.BeginBlock.Header) - } + s.app.BeginBlock(r.BeginBlock.Hash, r.BeginBlock.Header) responses <- types.ToResponseBeginBlock() case *types.Request_EndBlock: - if app, ok := s.app.(types.BlockchainAware); ok { - resEndBlock := app.EndBlock(r.EndBlock.Height) - responses <- types.ToResponseEndBlock(resEndBlock) - } else { - responses <- types.ToResponseEndBlock(types.ResponseEndBlock{}) - } + resEndBlock := s.app.EndBlock(r.EndBlock.Height) + responses <- types.ToResponseEndBlock(resEndBlock) default: responses <- types.ToResponseException("Unknown request") } diff --git a/types/application.go b/types/application.go index 404437fed..b45305f8d 100644 --- a/types/application.go +++ b/types/application.go @@ -6,42 +6,25 @@ import ( // Applications type Application interface { - - // Return application info - Info() ResponseInfo - - // Set application option (e.g. mode=mempool, mode=consensus) - SetOption(key string, value string) (log string) - - // Deliver a tx - DeliverTx(tx []byte) Result - - // Validate a tx for the mempool - CheckTx(tx []byte) Result - - // Query for state - Query(reqQuery RequestQuery) ResponseQuery - - // Return the application Merkle root hash - Commit() Result -} - -// Some applications can choose to implement BlockchainAware -type BlockchainAware interface { - - // Initialize blockchain - // validators: genesis validators from TendermintCore - InitChain(validators []*Validator) - - // Signals the beginning of a block - BeginBlock(hash []byte, header *Header) - - // Signals the end of a block - // diffs: changed validators from app to TendermintCore - EndBlock(height uint64) ResponseEndBlock + // Info/Query Connection + Info() ResponseInfo // Return application info + SetOption(key string, value string) (log string) // Set application option + Query(reqQuery RequestQuery) ResponseQuery // Query for state + + // Mempool Connection + CheckTx(tx []byte) Result // Validate a tx for the mempool + + // Consensus Connection + InitChain(validators []*Validator) // Initialize blockchain with validators from TendermintCore + BeginBlock(hash []byte, header *Header) // Signals the beginning of a block + DeliverTx(tx []byte) Result // Deliver a tx for full processing + EndBlock(height uint64) ResponseEndBlock // Signals the end of a block, returns changes to the validator set + Commit() Result // Commit the state and return the application Merkle root hash } //------------------------------------ + +// GRPC wrapper for application type GRPCApplication struct { app Application } @@ -88,23 +71,16 @@ func (app *GRPCApplication) Commit(ctx context.Context, req *RequestCommit) (*Re } func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain) (*ResponseInitChain, error) { - if chainAware, ok := app.app.(BlockchainAware); ok { - chainAware.InitChain(req.Validators) - } - return &ResponseInitChain{}, nil + app.app.InitChain(req.Validators) + return &ResponseInitChain{}, nil // NOTE: empty return } func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*ResponseBeginBlock, error) { - if chainAware, ok := app.app.(BlockchainAware); ok { - chainAware.BeginBlock(req.Hash, req.Header) - } - return &ResponseBeginBlock{}, nil + app.app.BeginBlock(req.Hash, req.Header) + return &ResponseBeginBlock{}, nil // NOTE: empty return } func (app *GRPCApplication) EndBlock(ctx context.Context, req *RequestEndBlock) (*ResponseEndBlock, error) { - if chainAware, ok := app.app.(BlockchainAware); ok { - resEndBlock := chainAware.EndBlock(req.Height) - return &resEndBlock, nil - } - return &ResponseEndBlock{}, nil + resEndBlock := app.app.EndBlock(req.Height) + return &resEndBlock, nil } From 5d673ecf314e27c57b69e7882921914a2eb5749a Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sun, 12 Feb 2017 18:38:10 -0800 Subject: [PATCH 21/29] Fix comment for BeginBlock hash --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c002b1416..11d790f40 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil #### BeginBlock * __Arguments__: - * `Hash ([]byte)`: The block height that is starting + * `Hash ([]byte)`: The block's hash. This can be derived from the block header. * `Header (struct{})`: The block header * __Usage__:
Signals the beginning of a new block. Called prior to any DeliverTxs. The header is expected to at least contain the Height. From b6afa8d85bab43b65c628d5416a48905e7450396 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 6 Feb 2017 19:20:33 -0500 Subject: [PATCH 22/29] Query: Height -> LastHeight --- README.md | 6 +- cmd/abci-cli/abci-cli.go | 34 +++--- types/types.pb.go | 247 ++++++++++++++++++++------------------- types/types.proto | 6 +- 4 files changed, 147 insertions(+), 146 deletions(-) diff --git a/README.md b/README.md index c002b1416..af66fecc0 100644 --- a/README.md +++ b/README.md @@ -76,16 +76,16 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil * `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) + * `LastHeight (uint64)`: The block height for which you want the query (default=0 returns data for the latest committed block). Note that the corresponding Merkle root hash will only be included in the header of the next block (ie. `LastHeight + 1`) * `Prove (bool)`: Return Merkle proof with response if possible * __Returns__: * `Code (uint32)`: Response code * `Key ([]byte)`: The key of the matching data * `Value ([]byte)`: The value of the matching data * `Proof ([]byte)`: Proof for the data, if requested - * `Height (uint64)`: The block height from which data was derived + * `LastHeight (uint64)`: The block height from which data was derived. The Merkle root for the proof is included in block `LastHeight + 1` * `Log (string)`: Debug or error message - *Please note* The current implementation of go-merkle doesn't support querying proofs from past blocks, so for the present moment, any height other than 0 will return an error. 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 (recall height=0 defaults to latest block). Hopefully this will be improved soon(ish) #### Info * __Returns__: diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 0168bea4a..e4fd50be0 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -17,13 +17,13 @@ import ( // Structure for data passed to print response. type response struct { - Data []byte - Code types.CodeType - Key []byte - Value []byte - Log string - Height string - Proof []byte + Data []byte + Code types.CodeType + Key []byte + Value []byte + Log string + LastHeight string + Proof []byte } // client is a global variable so it can be reused by the console @@ -299,20 +299,20 @@ func cmdQuery(c *cli.Context) error { return err } resQuery, err := client.QuerySync(types.RequestQuery{ - Data: queryBytes, - Path: "/store", // TOOD expose - Height: 0, // TODO expose + Data: queryBytes, + Path: "/store", // TOOD expose + LastHeight: 0, // TODO expose //Prove: true, // TODO expose }) if err != nil { return err } printResponse(c, response{ - Code: resQuery.Code, - Key: resQuery.Key, - Value: resQuery.Value, - Log: resQuery.Log, - Height: fmt.Sprintf("%v", resQuery.Height), + Code: resQuery.Code, + Key: resQuery.Key, + Value: resQuery.Value, + Log: resQuery.Log, + LastHeight: fmt.Sprintf("%v", resQuery.LastHeight), //Proof: resQuery.Proof, }) return nil @@ -346,8 +346,8 @@ func printResponse(c *cli.Context, rsp response) { if rsp.Log != "" { fmt.Printf("-> log: %s\n", rsp.Log) } - if rsp.Height != "" { - fmt.Printf("-> height: %s\n", rsp.Height) + if rsp.LastHeight != "" { + fmt.Printf("-> height: %s\n", rsp.LastHeight) } if rsp.Proof != nil { fmt.Printf("-> proof: %X\n", rsp.Proof) diff --git a/types/types.pb.go b/types/types.pb.go index e0ae1076b..3458c27c1 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -716,10 +716,10 @@ func (m *RequestCheckTx) GetTx() []byte { } type RequestQuery struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - Height uint64 `protobuf:"varint,3,opt,name=height" json:"height,omitempty"` - Prove bool `protobuf:"varint,4,opt,name=prove" json:"prove,omitempty"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` + LastHeight uint64 `protobuf:"varint,3,opt,name=last_height,json=lastHeight" json:"last_height,omitempty"` + Prove bool `protobuf:"varint,4,opt,name=prove" json:"prove,omitempty"` } func (m *RequestQuery) Reset() { *m = RequestQuery{} } @@ -741,9 +741,9 @@ func (m *RequestQuery) GetPath() string { return "" } -func (m *RequestQuery) GetHeight() uint64 { +func (m *RequestQuery) GetLastHeight() uint64 { if m != nil { - return m.Height + return m.LastHeight } return 0 } @@ -1411,13 +1411,13 @@ func (m *ResponseCheckTx) GetLog() string { } type ResponseQuery struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - Height uint64 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"` - Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` + Code 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"` + LastHeight uint64 `protobuf:"varint,6,opt,name=last_height,json=lastHeight" json:"last_height,omitempty"` + Log string `protobuf:"bytes,7,opt,name=log" json:"log,omitempty"` } func (m *ResponseQuery) Reset() { *m = ResponseQuery{} } @@ -1460,9 +1460,9 @@ func (m *ResponseQuery) GetProof() []byte { return nil } -func (m *ResponseQuery) GetHeight() uint64 { +func (m *ResponseQuery) GetLastHeight() uint64 { if m != nil { - return m.Height + return m.LastHeight } return 0 } @@ -2129,112 +2129,113 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1711 bytes of a gzipped FileDescriptor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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, + // 1723 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x5b, 0x6f, 0xe3, 0xc6, + 0x15, 0x36, 0x75, 0xd7, 0x91, 0x2d, 0x8f, 0x8f, 0x65, 0x5b, 0x56, 0x0b, 0x74, 0xc1, 0x22, 0x8d, + 0x77, 0x9b, 0xee, 0x16, 0x0e, 0x52, 0xac, 0x9b, 0xa2, 0x80, 0xbd, 0xeb, 0xac, 0x85, 0x20, 0xbb, + 0x2e, 0xb3, 0xc9, 0x4b, 0x8b, 0x0a, 0xb4, 0x38, 0x92, 0x58, 0x4b, 0x24, 0x97, 0x1c, 0x3a, 0x72, + 0x7f, 0x43, 0xde, 0xfb, 0x13, 0xfa, 0x0b, 0xfa, 0x94, 0xf7, 0x02, 0xbd, 0x5f, 0x7e, 0x51, 0x71, + 0x66, 0x86, 0x57, 0x53, 0x41, 0x1f, 0xf2, 0x22, 0xf0, 0x5c, 0x67, 0xce, 0xcc, 0x39, 0xdf, 0x39, + 0x23, 0xd8, 0x13, 0xf7, 0x01, 0x8f, 0x9e, 0xc9, 0xdf, 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, 0xd4, 0xaa, 0x34, 0xdd, 0x80, 0x49, 0x1f, + 0xe6, 0x30, 0xa9, 0x5d, 0x2a, 0x45, 0x65, 0x58, 0x01, 0x4a, 0xcf, 0x52, 0x50, 0xea, 0x94, 0x60, + 0x4c, 0x9b, 0x94, 0x51, 0xe9, 0x83, 0x04, 0x95, 0xba, 0x95, 0x87, 0x56, 0x82, 0xa5, 0xb3, 0x02, + 0x2c, 0x41, 0x65, 0x38, 0x1b, 0x70, 0xe9, 0x17, 0x45, 0x5c, 0x52, 0xe0, 0x72, 0x5c, 0xb2, 0xdd, + 0x08, 0x4c, 0x3f, 0xcb, 0x03, 0xd3, 0x76, 0x09, 0x0e, 0x75, 0x2e, 0x7c, 0x2b, 0x32, 0x3d, 0xa6, + 0x4a, 0x28, 0x65, 0x1a, 0xd5, 0x22, 0x0f, 0x43, 0x3f, 0xd4, 0xa0, 0xa2, 0x08, 0xf3, 0x84, 0x4a, + 0x3f, 0xcb, 0xaf, 0x6f, 0x41, 0x31, 0x59, 0xb5, 0xb9, 0xec, 0x32, 0xff, 0x60, 0x64, 0xb6, 0x94, + 0x42, 0x05, 0xd8, 0xe8, 0x6a, 0xd8, 0x18, 0x42, 0xfb, 0x8e, 0x87, 0x11, 0xe5, 0x92, 0x42, 0x8e, + 0x84, 0xc4, 0x27, 0xb0, 0x27, 0xc1, 0x43, 0x86, 0x59, 0x84, 0x90, 0x5d, 0x12, 0xa8, 0xf8, 0x14, + 0x8e, 0xfc, 0x04, 0xf6, 0x73, 0xba, 0x76, 0x10, 0x4c, 0x64, 0x51, 0x37, 0x64, 0x51, 0xb3, 0x54, + 0xfb, 0x3c, 0x08, 0xae, 0xec, 0x68, 0x61, 0xbe, 0x97, 0xc5, 0x5f, 0x80, 0xd4, 0xa5, 0x3f, 0x4f, + 0x20, 0x75, 0xe9, 0xcf, 0xcd, 0xdf, 0x66, 0x6a, 0x19, 0x7a, 0xfe, 0x10, 0x1a, 0x53, 0xdf, 0x51, + 0xd1, 0x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0xcd, 0xaf, 0xa9, 0xe4, 0xd8, 0x7f, 0x8d, + 0xd3, 0xaf, 0x9b, 0xb0, 0x7b, 0x7e, 0xf1, 0x62, 0x7c, 0x1e, 0xa8, 0x05, 0xa8, 0x8d, 0x3f, 0x53, + 0x85, 0x86, 0x15, 0x8f, 0xf5, 0x51, 0xd5, 0xc4, 0x8c, 0xa7, 0xba, 0x1e, 0xb1, 0xea, 0xcd, 0x3e, + 0xaa, 0x1c, 0x9c, 0x69, 0x11, 0x35, 0xd1, 0x3c, 0x7c, 0xba, 0x8f, 0xaa, 0xa6, 0x67, 0xfc, 0x65, + 0xae, 0xbe, 0x71, 0xd3, 0x03, 0x7e, 0xb4, 0x71, 0x8e, 0x26, 0xfb, 0x6c, 0x04, 0xd9, 0xf4, 0x8c, + 0x1f, 0x6d, 0x1c, 0xa6, 0xf1, 0x79, 0x0a, 0x19, 0x58, 0xfd, 0x98, 0x1f, 0x6d, 0x98, 0xa7, 0xe9, + 0x78, 0xd4, 0xf4, 0x50, 0xf5, 0x46, 0x1f, 0x55, 0x8e, 0xc8, 0xf8, 0x51, 0x82, 0x49, 0x58, 0xf9, + 0x3f, 0xc0, 0xa8, 0x7a, 0x10, 0xa7, 0x20, 0xb3, 0xf7, 0xdd, 0xa6, 0x07, 0xfe, 0x68, 0xe3, 0x88, + 0x8d, 0xe7, 0x79, 0x90, 0xc3, 0x8d, 0xcf, 0xfc, 0xd1, 0xe6, 0x41, 0x1b, 0x3f, 0xce, 0x70, 0x11, + 0x37, 0x3c, 0xf6, 0x47, 0x9b, 0x66, 0xed, 0x9b, 0x96, 0xfc, 0x1f, 0xe9, 0xc3, 0xff, 0x05, 0x00, + 0x00, 0xff, 0xff, 0x3a, 0x61, 0xc1, 0xbf, 0x5c, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 3eea82ea6..67cd32499 100644 --- a/types/types.proto +++ b/types/types.proto @@ -115,7 +115,7 @@ message RequestCheckTx{ message RequestQuery{ bytes data = 1; string path = 2; - uint64 height = 3; + uint64 last_height = 3; bool prove = 4; } @@ -192,11 +192,11 @@ message ResponseCheckTx{ message ResponseQuery{ CodeType code = 1; - int64 index = 2; + int64 index = 2; bytes key = 3; bytes value = 4; bytes proof = 5; - uint64 height = 6; + uint64 last_height = 6; string log = 7; } From e909cafa0bc208a9bc14d599c955d1bb6e8ff94e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 13 Feb 2017 18:48:59 -0500 Subject: [PATCH 23/29] BaseApplication --- example/block_aware/block_aware_app.go | 26 ++------------- example/counter/counter.go | 12 ++----- example/dummy/dummy.go | 16 ++------- example/example_test.go | 9 +++-- example/nil/nil_app.go | 46 -------------------------- types/base_app.go | 42 +++++++++++++++++++++++ 6 files changed, 52 insertions(+), 99 deletions(-) delete mode 100644 example/nil/nil_app.go create mode 100644 types/base_app.go diff --git a/example/block_aware/block_aware_app.go b/example/block_aware/block_aware_app.go index 90a7a4402..454c3560b 100644 --- a/example/block_aware/block_aware_app.go +++ b/example/block_aware/block_aware_app.go @@ -30,6 +30,8 @@ func main() { } type ChainAwareApplication struct { + types.BaseApplication + beginCount int endCount int } @@ -38,26 +40,6 @@ func NewChainAwareApplication() *ChainAwareApplication { return &ChainAwareApplication{} } -func (app *ChainAwareApplication) Info() types.ResponseInfo { - return types.ResponseInfo{} -} - -func (app *ChainAwareApplication) SetOption(key string, value string) (log string) { - return "" -} - -func (app *ChainAwareApplication) DeliverTx(tx []byte) types.Result { - return types.NewResultOK(nil, "") -} - -func (app *ChainAwareApplication) CheckTx(tx []byte) types.Result { - return types.NewResultOK(nil, "") -} - -func (app *ChainAwareApplication) Commit() types.Result { - return types.NewResultOK([]byte("nil"), "") -} - func (app *ChainAwareApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { return types.ResponseQuery{ Value: []byte(cmn.Fmt("%d,%d", app.beginCount, app.endCount)), @@ -73,7 +55,3 @@ func (app *ChainAwareApplication) EndBlock(height uint64) (resEndBlock types.Res app.endCount++ return } - -func (app *ChainAwareApplication) InitChain(vals []*types.Validator) { - return -} diff --git a/example/counter/counter.go b/example/counter/counter.go index 8fce72e2a..fa0bab58c 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -9,6 +9,8 @@ import ( ) type CounterApplication struct { + types.BaseApplication + hashCount int txCount int serial bool @@ -80,13 +82,3 @@ func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.Response return types.ResponseQuery{Log: Fmt("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} } } - -func (app *CounterApplication) InitChain(validators []*types.Validator) { -} - -func (app *CounterApplication) BeginBlock(hash []byte, header *types.Header) { -} - -func (app *CounterApplication) EndBlock(height uint64) types.ResponseEndBlock { - return types.ResponseEndBlock{} -} diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 73c938e79..fd66250bb 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -9,6 +9,8 @@ import ( ) type DummyApplication struct { + types.BaseApplication + state merkle.Tree } @@ -21,10 +23,6 @@ func (app *DummyApplication) Info() (resInfo types.ResponseInfo) { return types.ResponseInfo{Data: fmt.Sprintf("{\"size\":%v}", app.state.Size())} } -func (app *DummyApplication) SetOption(key string, value string) (log string) { - return "" -} - // tx is either "key=value" or just arbitrary bytes func (app *DummyApplication) DeliverTx(tx []byte) types.Result { parts := strings.Split(string(tx), "=") @@ -70,13 +68,3 @@ func (app *DummyApplication) Query(reqQuery types.RequestQuery) (resQuery types. return } } - -func (app *DummyApplication) InitChain(validators []*types.Validator) { -} - -func (app *DummyApplication) BeginBlock(hash []byte, header *types.Header) { -} - -func (app *DummyApplication) EndBlock(height uint64) types.ResponseEndBlock { - return types.ResponseEndBlock{} -} diff --git a/example/example_test.go b/example/example_test.go index 26921083a..9f18c421e 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -14,7 +14,6 @@ import ( "github.com/tendermint/abci/client" "github.com/tendermint/abci/example/dummy" - nilapp "github.com/tendermint/abci/example/nil" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" cmn "github.com/tendermint/go-common" @@ -25,14 +24,14 @@ func TestDummy(t *testing.T) { testStream(t, dummy.NewDummyApplication()) } -func TestNilApp(t *testing.T) { - fmt.Println("### Testing NilApp") - testStream(t, nilapp.NewNilApplication()) +func TestBaseApp(t *testing.T) { + fmt.Println("### Testing BaseApp") + testStream(t, types.NewBaseApplication()) } func TestGRPC(t *testing.T) { fmt.Println("### Testing GRPC") - testGRPCSync(t, types.NewGRPCApplication(nilapp.NewNilApplication())) + testGRPCSync(t, types.NewGRPCApplication(types.NewBaseApplication())) } func testStream(t *testing.T, app types.Application) { diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go deleted file mode 100644 index 5285cc39a..000000000 --- a/example/nil/nil_app.go +++ /dev/null @@ -1,46 +0,0 @@ -package nilapp - -import ( - "github.com/tendermint/abci/types" -) - -type NilApplication struct { -} - -func NewNilApplication() *NilApplication { - return &NilApplication{} -} - -func (app *NilApplication) Info() (resInfo types.ResponseInfo) { - return -} - -func (app *NilApplication) SetOption(key string, value string) (log string) { - return "" -} - -func (app *NilApplication) DeliverTx(tx []byte) types.Result { - return types.NewResultOK(nil, "") -} - -func (app *NilApplication) CheckTx(tx []byte) types.Result { - return types.NewResultOK(nil, "") -} - -func (app *NilApplication) Commit() types.Result { - return types.NewResultOK([]byte("nil"), "") -} - -func (app *NilApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) { - return resQuery -} - -func (app *NilApplication) InitChain(validators []*types.Validator) { -} - -func (app *NilApplication) BeginBlock(hash []byte, header *types.Header) { -} - -func (app *NilApplication) EndBlock(height uint64) types.ResponseEndBlock { - return types.ResponseEndBlock{} -} diff --git a/types/base_app.go b/types/base_app.go new file mode 100644 index 000000000..1d4f84b8a --- /dev/null +++ b/types/base_app.go @@ -0,0 +1,42 @@ +package types + +type BaseApplication struct { +} + +func NewBaseApplication() *BaseApplication { + return &BaseApplication{} +} + +func (app *BaseApplication) Info() (resInfo ResponseInfo) { + return +} + +func (app *BaseApplication) SetOption(key string, value string) (log string) { + return "" +} + +func (app *BaseApplication) DeliverTx(tx []byte) Result { + return NewResultOK(nil, "") +} + +func (app *BaseApplication) CheckTx(tx []byte) Result { + return NewResultOK(nil, "") +} + +func (app *BaseApplication) Commit() Result { + return NewResultOK([]byte("nil"), "") +} + +func (app *BaseApplication) Query(reqQuery RequestQuery) (resQuery ResponseQuery) { + return +} + +func (app *BaseApplication) InitChain(validators []*Validator) { +} + +func (app *BaseApplication) BeginBlock(hash []byte, header *Header) { +} + +func (app *BaseApplication) EndBlock(height uint64) (resEndBlock ResponseEndBlock) { + return +} From 31bdda27ad80e47d372e4b9e4acfd4c0ef81d3e4 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 14 Feb 2017 16:53:21 -0500 Subject: [PATCH 24/29] Query: LastHeight -> Height :) --- README.md | 4 +- cmd/abci-cli/abci-cli.go | 34 +++--- glide.lock | 35 +++--- glide.yaml | 3 + types/types.pb.go | 247 +++++++++++++++++++-------------------- types/types.proto | 4 +- 6 files changed, 161 insertions(+), 166 deletions(-) diff --git a/README.md b/README.md index 43b19f137..f732b82cf 100644 --- a/README.md +++ b/README.md @@ -76,14 +76,14 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil * `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/...' - * `LastHeight (uint64)`: The block height for which you want the query (default=0 returns data for the latest committed block). Note that the corresponding Merkle root hash will only be included in the header of the next block (ie. `LastHeight + 1`) + * `Height (uint64)`: The block height for which you want the query (default=0 returns data for the latest committed block). Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1 * `Prove (bool)`: Return Merkle proof with response if possible * __Returns__: * `Code (uint32)`: Response code * `Key ([]byte)`: The key of the matching data * `Value ([]byte)`: The value of the matching data * `Proof ([]byte)`: Proof for the data, if requested - * `LastHeight (uint64)`: The block height from which data was derived. The Merkle root for the proof is included in block `LastHeight + 1` + * `Height (uint64)`: The block height from which data was derived. Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1 * `Log (string)`: Debug or error message *Please note* The current implementation of go-merkle doesn't support querying proofs from past blocks, so for the present moment, any height other than 0 will return an error (recall height=0 defaults to latest block). Hopefully this will be improved soon(ish) diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index e4fd50be0..0168bea4a 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -17,13 +17,13 @@ import ( // Structure for data passed to print response. type response struct { - Data []byte - Code types.CodeType - Key []byte - Value []byte - Log string - LastHeight string - Proof []byte + 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 @@ -299,20 +299,20 @@ func cmdQuery(c *cli.Context) error { return err } resQuery, err := client.QuerySync(types.RequestQuery{ - Data: queryBytes, - Path: "/store", // TOOD expose - LastHeight: 0, // TODO expose + Data: queryBytes, + Path: "/store", // TOOD expose + Height: 0, // TODO expose //Prove: true, // TODO expose }) if err != nil { return err } printResponse(c, response{ - Code: resQuery.Code, - Key: resQuery.Key, - Value: resQuery.Value, - Log: resQuery.Log, - LastHeight: fmt.Sprintf("%v", resQuery.LastHeight), + Code: resQuery.Code, + Key: resQuery.Key, + Value: resQuery.Value, + Log: resQuery.Log, + Height: fmt.Sprintf("%v", resQuery.Height), //Proof: resQuery.Proof, }) return nil @@ -346,8 +346,8 @@ func printResponse(c *cli.Context, rsp response) { if rsp.Log != "" { fmt.Printf("-> log: %s\n", rsp.Log) } - if rsp.LastHeight != "" { - fmt.Printf("-> height: %s\n", rsp.LastHeight) + if rsp.Height != "" { + fmt.Printf("-> height: %s\n", rsp.Height) } if rsp.Proof != nil { fmt.Printf("-> proof: %X\n", rsp.Proof) diff --git a/glide.lock b/glide.lock index c67e08b3f..5e06cad2a 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ -hash: febff7f2646081f635b5dc2a0a672d9b8e42eb59241269e6658eec916cd2a5a4 -updated: 2017-01-13T00:24:02.377918976-05:00 +hash: 54e49c7cb920a3390f631de12e38226494920bbc5e0c369514df18fe0ab5b693 +updated: 2017-02-14T16:51:55.592202262-05:00 imports: - name: github.com/btcsuite/btcd - version: 153dca5c1e4b5d1ea1523592495e5bedfa503391 + version: d06c0bb181529331be8f8d9350288c420d9e60e4 subpackages: - btcec - name: github.com/go-stack/stack @@ -12,13 +12,13 @@ imports: subpackages: - proto - name: github.com/golang/snappy - version: d9eb7a3d35ec988b8585d4a0068e462c27d28380 + version: 7db9049039a047d955fe8c19b83c8ff5abd765c7 - name: github.com/jmhodges/levigo version: c42d9e0ca023e2198120196f842701bb4c55d7b9 - name: github.com/mattn/go-colorable - version: d228849504861217f796da67fae4f6e347643f15 + version: 5411d3eea5978e6cdc258b30de592b60df6aba96 - name: github.com/mattn/go-isatty - version: 30a891c33c7cde7b02a981314b4228ec99380cca + version: 281032e84ae07510239465db46bf442aa44b953a - name: github.com/stretchr/testify version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0 subpackages: @@ -45,7 +45,7 @@ imports: - edwards25519 - extra25519 - name: github.com/tendermint/go-common - version: e289af53b6bf6af28da129d9ef64389a4cf7987f + version: 339e135776142939d82bc8e699db0bf391fd938d - name: github.com/tendermint/go-crypto version: 4b11d62bdb324027ea01554e5767b71174680ba0 - name: github.com/tendermint/go-db @@ -53,19 +53,19 @@ imports: - name: github.com/tendermint/go-logger version: cefb3a45c0bf3c493a04e9bcd9b1540528be59f2 - name: github.com/tendermint/go-merkle - version: 653cb1f631528351ddbc359b994eb0c96f0341cd + version: 9f20e80cb188d07860caa70196dd7700659ec4a4 - name: github.com/tendermint/go-process version: b27edfd189b1a01a0b099f7e9f8263589cf04909 - name: github.com/tendermint/go-wire - version: 2f3b7aafe21c80b19b6ee3210ecb3e3d07c7a471 + version: 3216ec9d47bbdf8d4fc27d22169ea86a6688bc15 - name: github.com/tendermint/log15 version: ae0f3d6450da9eac7074b439c8e1c3cabf0d5ce6 subpackages: - term - name: github.com/urfave/cli - version: 8ef3805c9de2519805c3f060524b695bba2cd715 + version: 347a9884a87374d000eec7e6445a34487c1f4a2b - name: golang.org/x/crypto - version: 7c6cc321c680f03b9ef0764448e780704f486b51 + version: 453249f01cfeb54c3d549ddb75ff152ca243f9d8 subpackages: - nacl/secretbox - openpgp/armor @@ -74,7 +74,7 @@ imports: - ripemd160 - salsa20/salsa - name: golang.org/x/net - version: 60c41d1de8da134c05b7b40154a9a82bf5b7edb9 + version: 61557ac0112b576429a0df080e1c2cef5dfbb642 subpackages: - context - http2 @@ -84,18 +84,11 @@ imports: - lex/httplex - trace - name: golang.org/x/sys - version: d75a52659825e75fff6158388dddc6a5b04f9ba5 + version: e24f485414aeafb646f6fca458b0bf869c0880a1 subpackages: - unix -- name: golang.org/x/text - version: 44f4f658a783b0cee41fe0a23b8fc91d9c120558 - subpackages: - - secure/bidirule - - transform - - unicode/bidi - - unicode/norm - name: google.golang.org/grpc - version: 50955793b0183f9de69bd78e2ec251cf20aab121 + version: cbcceb2942a489498cf22b2f918536e819d33f0a subpackages: - codes - credentials diff --git a/glide.yaml b/glide.yaml index af1743876..2b19d8723 100644 --- a/glide.yaml +++ b/glide.yaml @@ -4,10 +4,13 @@ import: subpackages: - proto - package: github.com/tendermint/go-common + version: develop - package: github.com/tendermint/go-crypto + version: develop - package: github.com/tendermint/go-logger - package: github.com/tendermint/go-db - package: github.com/tendermint/go-merkle + version: develop - package: github.com/tendermint/go-process - package: github.com/tendermint/go-wire - package: github.com/urfave/cli diff --git a/types/types.pb.go b/types/types.pb.go index 3458c27c1..f59664530 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -716,10 +716,10 @@ func (m *RequestCheckTx) GetTx() []byte { } type RequestQuery struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - LastHeight uint64 `protobuf:"varint,3,opt,name=last_height,json=lastHeight" json:"last_height,omitempty"` - Prove bool `protobuf:"varint,4,opt,name=prove" json:"prove,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{} } @@ -741,9 +741,9 @@ func (m *RequestQuery) GetPath() string { return "" } -func (m *RequestQuery) GetLastHeight() uint64 { +func (m *RequestQuery) GetHeight() uint64 { if m != nil { - return m.LastHeight + return m.Height } return 0 } @@ -1411,13 +1411,13 @@ func (m *ResponseCheckTx) GetLog() string { } type ResponseQuery struct { - Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` - Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - LastHeight uint64 `protobuf:"varint,6,opt,name=last_height,json=lastHeight" json:"last_height,omitempty"` - Log string `protobuf:"bytes,7,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{} } @@ -1460,9 +1460,9 @@ func (m *ResponseQuery) GetProof() []byte { return nil } -func (m *ResponseQuery) GetLastHeight() uint64 { +func (m *ResponseQuery) GetHeight() uint64 { if m != nil { - return m.LastHeight + return m.Height } return 0 } @@ -2129,113 +2129,112 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1723 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x5b, 0x6f, 0xe3, 0xc6, - 0x15, 0x36, 0x75, 0xd7, 0x91, 0x2d, 0x8f, 0x8f, 0x65, 0x5b, 0x56, 0x0b, 0x74, 0xc1, 0x22, 0x8d, - 0x77, 0x9b, 0xee, 0x16, 0x0e, 0x52, 0xac, 0x9b, 0xa2, 0x80, 0xbd, 0xeb, 0xac, 0x85, 0x20, 0xbb, - 0x2e, 0xb3, 0xc9, 0x4b, 0x8b, 0x0a, 0xb4, 0x38, 0x92, 0x58, 0x4b, 0x24, 0x97, 0x1c, 0x3a, 0x72, - 0x7f, 0x43, 0xde, 0xfb, 0x13, 0xfa, 0x0b, 0xfa, 0x94, 0xf7, 0x02, 0xbd, 0x5f, 0x7e, 0x51, 0x71, - 0x66, 0x86, 0x57, 0x53, 0x41, 0x1f, 0xf2, 0x22, 0xf0, 0x5c, 0x67, 0xce, 0xcc, 0x39, 0xdf, 0x39, - 0x23, 0xd8, 0x13, 0xf7, 0x01, 0x8f, 0x9e, 0xc9, 0xdf, 0xa7, 0x41, 0xe8, 0x0b, 0x1f, 0x9b, 0x92, - 0x30, 0xff, 0xdc, 0x80, 0xb6, 0xc5, 0xdf, 0xc5, 0x3c, 0x12, 0x78, 0x02, 0x0d, 0x3e, 0x5d,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 0x3f, 0x53, - 0x85, 0x86, 0x15, 0x8f, 0xf5, 0x51, 0xd5, 0xc4, 0x8c, 0xa7, 0xba, 0x1e, 0xb1, 0xea, 0xcd, 0x3e, - 0xaa, 0x1c, 0x9c, 0x69, 0x11, 0x35, 0xd1, 0x3c, 0x7c, 0xba, 0x8f, 0xaa, 0xa6, 0x67, 0xfc, 0x65, - 0xae, 0xbe, 0x71, 0xd3, 0x03, 0x7e, 0xb4, 0x71, 0x8e, 0x26, 0xfb, 0x6c, 0x04, 0xd9, 0xf4, 0x8c, - 0x1f, 0x6d, 0x1c, 0xa6, 0xf1, 0x79, 0x0a, 0x19, 0x58, 0xfd, 0x98, 0x1f, 0x6d, 0x98, 0xa7, 0xe9, - 0x78, 0xd4, 0xf4, 0x50, 0xf5, 0x46, 0x1f, 0x55, 0x8e, 0xc8, 0xf8, 0x51, 0x82, 0x49, 0x58, 0xf9, - 0x3f, 0xc0, 0xa8, 0x7a, 0x10, 0xa7, 0x20, 0xb3, 0xf7, 0xdd, 0xa6, 0x07, 0xfe, 0x68, 0xe3, 0x88, - 0x8d, 0xe7, 0x79, 0x90, 0xc3, 0x8d, 0xcf, 0xfc, 0xd1, 0xe6, 0x41, 0x1b, 0x3f, 0xce, 0x70, 0x11, - 0x37, 0x3c, 0xf6, 0x47, 0x9b, 0x66, 0xed, 0x9b, 0x96, 0xfc, 0x1f, 0xe9, 0xc3, 0xff, 0x05, 0x00, - 0x00, 0xff, 0xff, 0x3a, 0x61, 0xc1, 0xbf, 0x5c, 0x12, 0x00, 0x00, + // 1697 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x4b, 0x6f, 0x1b, 0x47, + 0x12, 0xf6, 0xf0, 0xcd, 0xa6, 0x44, 0xb6, 0x5a, 0x92, 0x4d, 0x73, 0xf7, 0x60, 0xcc, 0xc2, 0x6b, + 0x49, 0xeb, 0xb5, 0x17, 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, 0xcb, 0x2c, 0x1f, 0x48, 0xf9, 0xcb, + 0x73, 0xb4, 0xb4, 0x62, 0x82, 0x6d, 0x93, 0xce, 0x74, 0xce, 0xa7, 0x27, 0x68, 0xd7, 0x12, 0x76, + 0xeb, 0x79, 0xbb, 0x7d, 0x94, 0x0a, 0xab, 0xf6, 0x54, 0x7e, 0xb2, 0x3b, 0xa4, 0x35, 0x75, 0x4f, + 0x4f, 0xed, 0x70, 0xd8, 0x16, 0x16, 0x6b, 0x05, 0x0b, 0x21, 0x03, 0x03, 0xa5, 0x85, 0xc7, 0x05, + 0x02, 0xff, 0x62, 0xd8, 0x29, 0x3b, 0xae, 0x0f, 0x51, 0x84, 0xc7, 0x25, 0x74, 0x30, 0x14, 0xdb, + 0xb1, 0xc3, 0xc9, 0x74, 0x6e, 0xda, 0xce, 0xb0, 0x5b, 0x16, 0xca, 0x18, 0xe4, 0xfb, 0x28, 0xc6, + 0x50, 0xec, 0x98, 0x60, 0xf7, 0x49, 0xef, 0x88, 0x1f, 0xdb, 0xce, 0xe4, 0x68, 0xe1, 0x4e, 0x4f, + 0x86, 0x44, 0x98, 0x0e, 0xf3, 0xa6, 0x7b, 0xa8, 0xb0, 0x87, 0x72, 0xb0, 0x25, 0x47, 0x09, 0xc5, + 0xfe, 0x4d, 0xba, 0xdc, 0xb1, 0x94, 0x69, 0x4f, 0x98, 0x5e, 0x2d, 0x54, 0x80, 0x63, 0xc5, 0x86, + 0x1d, 0xae, 0xbe, 0xf7, 0xda, 0xa4, 0x79, 0x66, 0x2e, 0x22, 0xae, 0xdf, 0x22, 0xbd, 0x4c, 0xa5, + 0xb0, 0x21, 0x69, 0x9f, 0xf2, 0x20, 0x30, 0x8f, 0xb9, 0x28, 0xa7, 0xae, 0x11, 0x93, 0x7a, 0x9f, + 0x2c, 0x65, 0xeb, 0x44, 0x5f, 0x4e, 0x0c, 0xb1, 0x16, 0xf4, 0xff, 0x11, 0x5a, 0x4c, 0x35, 0xa3, + 0xa4, 0x7e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, 0xb6, 0x67, 0x02, 0xc2, 0x46, 0xde, 0xc2, 0x9e, 0x9a, 0x21, 0xdf, 0xb5, + 0x2c, 0x1f, 0xce, 0x8f, 0x72, 0x74, 0x82, 0x92, 0xfc, 0xda, 0xb3, 0xd8, 0x20, 0xe7, 0x9f, 0xf3, + 0x80, 0x1e, 0x43, 0xa9, 0xad, 0x5f, 0x92, 0x88, 0x95, 0xe7, 0xec, 0xaf, 0x64, 0x58, 0x14, 0x3d, + 0x32, 0x83, 0x43, 0xdf, 0x86, 0x00, 0x6c, 0xc8, 0x2e, 0x95, 0x52, 0x51, 0xbb, 0x63, 0xc7, 0x8b, + 0x42, 0xfa, 0x69, 0xbc, 0xbe, 0xe2, 0x3e, 0x8f, 0x42, 0x64, 0x9f, 0x14, 0xd8, 0x87, 0xa2, 0x3e, + 0xe8, 0x02, 0x9a, 0x74, 0x35, 0xc3, 0x7e, 0x81, 0xf1, 0xe1, 0xe9, 0x9c, 0xa6, 0xfb, 0x95, 0x02, + 0xfb, 0xd8, 0x31, 0xc3, 0xc8, 0xe7, 0xd4, 0x81, 0x62, 0x63, 0x28, 0x51, 0x47, 0x12, 0x07, 0xee, + 0xc6, 0x2b, 0x28, 0xbe, 0x5a, 0xc1, 0x2b, 0xb2, 0x17, 0x11, 0x64, 0x96, 0xbe, 0x01, 0x36, 0x7d, + 0xe4, 0x9e, 0x29, 0xee, 0x81, 0x13, 0xda, 0xe1, 0x05, 0xfd, 0x4e, 0x83, 0x98, 0x06, 0x29, 0xfb, + 0x91, 0xef, 0x46, 0x1e, 0xfd, 0x5e, 0x83, 0x5d, 0xb2, 0x94, 0x7b, 0xe8, 0xbb, 0x9e, 0x1b, 0x98, + 0x0b, 0xfa, 0x83, 0x06, 0x7b, 0x59, 0x01, 0x41, 0x92, 0x05, 0x69, 0xf0, 0x63, 0x6c, 0x90, 0xf0, + 0x9f, 0xf2, 0xd3, 0x23, 0xee, 0xd3, 0x9f, 0x34, 0x38, 0xec, 0xb5, 0xac,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 0x1a, 0xdd, 0xfb, 0x23, 0x00, 0x00, 0xff, 0xff, 0x73, 0x34, 0x90, 0x2d, 0x4a, 0x12, 0x00, + 0x00, } diff --git a/types/types.proto b/types/types.proto index 67cd32499..85ec434da 100644 --- a/types/types.proto +++ b/types/types.proto @@ -115,7 +115,7 @@ message RequestCheckTx{ message RequestQuery{ bytes data = 1; string path = 2; - uint64 last_height = 3; + uint64 height = 3; bool prove = 4; } @@ -196,7 +196,7 @@ message ResponseQuery{ bytes key = 3; bytes value = 4; bytes proof = 5; - uint64 last_height = 6; + uint64 height = 6; string log = 7; } From b350b08021d3f51a9a45b84629fcead0e51ca0ac Mon Sep 17 00:00:00 2001 From: Agnieszka Kramarek <4gn3s@users.noreply.github.com> Date: Mon, 20 Feb 2017 13:49:52 +0100 Subject: [PATCH 25/29] Update README.md Typo fixed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f732b82cf..96c958268 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil Validate a mempool transaction, prior to broadcasting or proposing. This message should not mutate the main state, but application developers may want to keep a separate CheckTx state that gets reset upon Commit. - CheckTx can happen interspersed with DeliverTx, but they happen on different connections - CheckTx from the mempool connection, and DeliverTx from the consensus connection. During Commit, the mempool is locked, so you can reset the mempool state to the latest state after running all those delivertxs, and then the mempool will re run whatever txs it has against that latest mempool stte + CheckTx can happen interspersed with DeliverTx, but they happen on different connections - CheckTx from the mempool connection, and DeliverTx from the consensus connection. During Commit, the mempool is locked, so you can reset the mempool state to the latest state after running all those delivertxs, and then the mempool will re-run whatever txs it has against that latest mempool state. Transactions are first run through CheckTx before broadcast to peers in the mempool layer. You can make CheckTx semi-stateful and clear the state upon `Commit` or `BeginBlock`, From eaeb2658ea7cb14c643707dccce6db41d1d37e58 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 3 Mar 2017 18:39:10 -0500 Subject: [PATCH 26/29] fixes from review --- cmd/abci-cli/abci-cli.go | 58 +++--- example/counter/counter.go | 19 +- example/dummy/dummy.go | 4 +- example/dummy/dummy_test.go | 5 +- example/dummy/dummy_test.go.orig | 321 ------------------------------ example/dummy/persistent_dummy.go | 15 +- example/example_test.go | 8 +- tests/test_cli/ex1.abci.out | 8 +- 8 files changed, 62 insertions(+), 376 deletions(-) delete mode 100644 example/dummy/dummy_test.go.orig diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 0168bea4a..1b08b76ab 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -17,12 +17,18 @@ import ( // Structure for data passed to print response. type response struct { - Data []byte - Code types.CodeType + // generic abci response + Data []byte + Code types.CodeType + Log string + + Query *queryResponse +} + +type queryResponse struct { Key []byte Value []byte - Log string - Height string + Height uint64 Proof []byte } @@ -281,6 +287,7 @@ func cmdCheckTx(c *cli.Context) error { func cmdCommit(c *cli.Context) error { res := client.CommitSync() printResponse(c, response{ + Code: res.Code, Data: res.Data, Log: res.Log, }) @@ -308,12 +315,14 @@ func cmdQuery(c *cli.Context) error { return err } printResponse(c, response{ - Code: resQuery.Code, - Key: resQuery.Key, - Value: resQuery.Value, - Log: resQuery.Log, - Height: fmt.Sprintf("%v", resQuery.Height), - //Proof: resQuery.Proof, + Code: resQuery.Code, + Log: resQuery.Log, + Query: &queryResponse{ + Key: resQuery.Key, + Value: resQuery.Value, + Height: resQuery.Height, + Proof: resQuery.Proof, + }, }) return nil } @@ -328,29 +337,30 @@ func printResponse(c *cli.Context, rsp response) { fmt.Println(">", c.Command.Name, strings.Join(c.Args(), " ")) } - if rsp.Code != types.CodeType_OK { + if !rsp.Code.IsOK() { fmt.Printf("-> code: %s\n", rsp.Code.String()) } if len(rsp.Data) != 0 { fmt.Printf("-> data: %s\n", rsp.Data) fmt.Printf("-> data.hex: %X\n", rsp.Data) } - 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 rsp.Query != nil { + fmt.Printf("-> height: %d\n", rsp.Query.Height) + if rsp.Query.Key != nil { + fmt.Printf("-> key: %s\n", rsp.Query.Key) + fmt.Printf("-> key.hex: %X\n", rsp.Query.Key) + } + if rsp.Query.Value != nil { + fmt.Printf("-> value: %s\n", rsp.Query.Value) + fmt.Printf("-> value.hex: %X\n", rsp.Query.Value) + } + if rsp.Query.Proof != nil { + fmt.Printf("-> proof: %X\n", rsp.Query.Proof) + } } if verbose { diff --git a/example/counter/counter.go b/example/counter/counter.go index fa0bab58c..c40541ed9 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -2,10 +2,9 @@ package counter import ( "encoding/binary" - "fmt" "github.com/tendermint/abci/types" - . "github.com/tendermint/go-common" + cmn "github.com/tendermint/go-common" ) type CounterApplication struct { @@ -21,7 +20,7 @@ func NewCounterApplication(serial bool) *CounterApplication { } func (app *CounterApplication) Info() types.ResponseInfo { - return types.ResponseInfo{Data: fmt.Sprintf("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} + return types.ResponseInfo{Data: cmn.Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} } func (app *CounterApplication) SetOption(key string, value string) (log string) { @@ -34,13 +33,13 @@ func (app *CounterApplication) SetOption(key string, value string) (log string) func (app *CounterApplication) DeliverTx(tx []byte) types.Result { if app.serial { if len(tx) > 8 { - return types.ErrEncodingError.SetLog(fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))) + return types.ErrEncodingError.SetLog(cmn.Fmt("Max tx size is 8 bytes, got %d", len(tx))) } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { - return types.ErrBadNonce.SetLog(fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue)) + return types.ErrBadNonce.SetLog(cmn.Fmt("Invalid nonce. Expected %v, got %v", app.txCount, txValue)) } } app.txCount++ @@ -50,13 +49,13 @@ func (app *CounterApplication) DeliverTx(tx []byte) types.Result { func (app *CounterApplication) CheckTx(tx []byte) types.Result { if app.serial { if len(tx) > 8 { - return types.ErrEncodingError.SetLog(fmt.Sprintf("Max tx size is 8 bytes, got %d", len(tx))) + return types.ErrEncodingError.SetLog(cmn.Fmt("Max tx size is 8 bytes, got %d", len(tx))) } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { - return types.ErrBadNonce.SetLog(fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)) + return types.ErrBadNonce.SetLog(cmn.Fmt("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)) } } return types.OK @@ -75,10 +74,10 @@ func (app *CounterApplication) Commit() types.Result { func (app *CounterApplication) Query(reqQuery types.RequestQuery) types.ResponseQuery { switch reqQuery.Path { case "hash": - return types.ResponseQuery{Value: []byte(Fmt("%v", app.hashCount))} + return types.ResponseQuery{Value: []byte(cmn.Fmt("%v", app.hashCount))} case "tx": - return types.ResponseQuery{Value: []byte(Fmt("%v", app.txCount))} + return types.ResponseQuery{Value: []byte(cmn.Fmt("%v", app.txCount))} default: - return types.ResponseQuery{Log: Fmt("Invalid query path. Expected hash or tx, got %v", reqQuery.Path)} + return types.ResponseQuery{Log: cmn.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 fd66250bb..f88b1b20e 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -1,10 +1,10 @@ package dummy import ( - "fmt" "strings" "github.com/tendermint/abci/types" + cmn "github.com/tendermint/go-common" "github.com/tendermint/go-merkle" ) @@ -20,7 +20,7 @@ func NewDummyApplication() *DummyApplication { } func (app *DummyApplication) Info() (resInfo types.ResponseInfo) { - return types.ResponseInfo{Data: fmt.Sprintf("{\"size\":%v}", app.state.Size())} + return types.ResponseInfo{Data: cmn.Fmt("{\"size\":%v}", app.state.Size())} } // tx is either "key=value" or just arbitrary bytes diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index fbbf97a59..879cf3c4a 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -2,7 +2,6 @@ package dummy import ( "bytes" - "fmt" "io/ioutil" "sort" "testing" @@ -13,7 +12,7 @@ import ( "github.com/tendermint/abci/types" cmn "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" - merkle "github.com/tendermint/go-merkle" + "github.com/tendermint/go-merkle" ) func testDummy(t *testing.T, app types.Application, tx []byte, key, value string) { @@ -115,7 +114,7 @@ func TestValSetChanges(t *testing.T) { nInit := 5 vals := make([]*types.Validator, total) for i := 0; i < total; i++ { - pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(fmt.Sprintf("test%d", i))).PubKey().Bytes() + pubkey := crypto.GenPrivKeyEd25519FromSecret([]byte(cmn.Fmt("test%d", i))).PubKey().Bytes() power := cmn.RandInt() vals[i] = &types.Validator{pubkey, uint64(power)} } diff --git a/example/dummy/dummy_test.go.orig b/example/dummy/dummy_test.go.orig deleted file mode 100644 index 5cf7eee7b..000000000 --- a/example/dummy/dummy_test.go.orig +++ /dev/null @@ -1,321 +0,0 @@ -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/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 73366c7e7..48eff420d 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -3,7 +3,6 @@ package dummy import ( "bytes" "encoding/hex" - "fmt" "strconv" "strings" @@ -136,7 +135,7 @@ func LoadLastBlock(db dbm.DB) (lastBlock LastBlockInfo) { wire.ReadBinaryPtr(&lastBlock, r, 0, n, err) if *err != nil { // DATA HAS BEEN CORRUPTED OR THE SPEC HAS CHANGED - log.Crit(fmt.Sprintf("Data has been corrupted or its spec has changed: %v\n", *err)) + log.Crit(cmn.Fmt("Data has been corrupted or its spec has changed: %v\n", *err)) } // TODO: ensure that buf is completely read. } @@ -174,7 +173,7 @@ func (app *PersistentDummyApplication) Validators() (validators []*types.Validat } func MakeValSetChangeTx(pubkey []byte, power uint64) []byte { - return []byte(fmt.Sprintf("val:%X/%d", pubkey, power)) + return []byte(cmn.Fmt("val:%X/%d", pubkey, power)) } func isValidatorTx(tx []byte) bool { @@ -189,16 +188,16 @@ func (app *PersistentDummyApplication) execValidatorTx(tx []byte) types.Result { tx = tx[len(ValidatorSetChangePrefix):] pubKeyAndPower := strings.Split(string(tx), "/") if len(pubKeyAndPower) != 2 { - return types.ErrEncodingError.SetLog(fmt.Sprintf("Expected 'pubkey/power'. Got %v", pubKeyAndPower)) + return types.ErrEncodingError.SetLog(cmn.Fmt("Expected 'pubkey/power'. Got %v", pubKeyAndPower)) } pubkeyS, powerS := pubKeyAndPower[0], pubKeyAndPower[1] pubkey, err := hex.DecodeString(pubkeyS) if err != nil { - return types.ErrEncodingError.SetLog(fmt.Sprintf("Pubkey (%s) is invalid hex", pubkeyS)) + return types.ErrEncodingError.SetLog(cmn.Fmt("Pubkey (%s) is invalid hex", pubkeyS)) } power, err := strconv.Atoi(powerS) if err != nil { - return types.ErrEncodingError.SetLog(fmt.Sprintf("Power (%s) is not an int", powerS)) + return types.ErrEncodingError.SetLog(cmn.Fmt("Power (%s) is not an int", powerS)) } // update @@ -211,14 +210,14 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types if v.Power == 0 { // remove validator if !app.app.state.Has(key) { - return types.ErrUnauthorized.SetLog(fmt.Sprintf("Cannot remove non-existent validator %X", key)) + return types.ErrUnauthorized.SetLog(cmn.Fmt("Cannot remove non-existent validator %X", key)) } app.app.state.Remove(key) } else { // add or update validator value := bytes.NewBuffer(make([]byte, 0)) if err := types.WriteMessage(v, value); err != nil { - return types.ErrInternalError.SetLog(fmt.Sprintf("Error encoding validator: %v", err)) + return types.ErrInternalError.SetLog(cmn.Fmt("Error encoding validator: %v", err)) } app.app.state.Set(key, value.Bytes()) } diff --git a/example/example_test.go b/example/example_test.go index 9f18c421e..034331d62 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -41,14 +41,14 @@ func testStream(t *testing.T, app types.Application) { // Start the listener server, err := server.NewSocketServer("unix://test.sock", app) if err != nil { - log.Fatal(fmt.Sprintf("Error starting socket server: %v", err.Error())) + log.Fatal(cmn.Fmt("Error starting socket server: %v", err.Error())) } defer server.Stop() // Connect to the socket client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { - log.Fatal(fmt.Sprintf("Error starting socket client: %v", err.Error())) + log.Fatal(cmn.Fmt("Error starting socket client: %v", err.Error())) } client.Start() defer client.Stop() @@ -114,14 +114,14 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { // Start the listener server, err := server.NewGRPCServer("unix://test.sock", app) if err != nil { - log.Fatal(fmt.Sprintf("Error starting GRPC server: %v", err.Error())) + log.Fatal(cmn.Fmt("Error starting GRPC server: %v", err.Error())) } defer server.Stop() // Connect to the socket conn, err := grpc.Dial("unix://test.sock", grpc.WithInsecure(), grpc.WithDialer(dialerFunc)) if err != nil { - log.Fatal(fmt.Sprintf("Error dialing GRPC server: %v", err.Error())) + log.Fatal(cmn.Fmt("Error dialing GRPC server: %v", err.Error())) } defer conn.Close() diff --git a/tests/test_cli/ex1.abci.out b/tests/test_cli/ex1.abci.out index e1e21d24a..e434944a4 100644 --- a/tests/test_cli/ex1.abci.out +++ b/tests/test_cli/ex1.abci.out @@ -19,10 +19,10 @@ -> data.hex: 750502FC7E84BBD788ED589624F06CFA871845D1 > query "abc" --> value: abc --> value.hex: 616263 -> log: exists -> height: 0 +-> value: abc +-> value.hex: 616263 > deliver_tx "def=xyz" @@ -31,8 +31,8 @@ -> data.hex: 76393B8A182E450286B0694C629ECB51B286EFD5 > query "def" --> value: xyz --> value.hex: 78797A -> log: exists -> height: 0 +-> value: xyz +-> value.hex: 78797A From 0b1ee4b67318047d20a90bc6a8b0119a15c7c771 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 3 Mar 2017 18:43:05 -0500 Subject: [PATCH 27/29] version bump to 0.4.0 --- cmd/abci-cli/abci-cli.go | 3 ++- version/version.go | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 version/version.go diff --git a/cmd/abci-cli/abci-cli.go b/cmd/abci-cli/abci-cli.go index 1b08b76ab..accae9d1e 100644 --- a/cmd/abci-cli/abci-cli.go +++ b/cmd/abci-cli/abci-cli.go @@ -12,6 +12,7 @@ import ( "github.com/tendermint/abci/client" "github.com/tendermint/abci/types" + "github.com/tendermint/abci/version" "github.com/urfave/cli" ) @@ -43,7 +44,7 @@ func main() { app := cli.NewApp() app.Name = "abci-cli" app.Usage = "abci-cli [command] [args...]" - app.Version = "0.3.0" // hex handling + app.Version = version.Version app.Flags = []cli.Flag{ cli.StringFlag{ Name: "address", diff --git a/version/version.go b/version/version.go new file mode 100644 index 000000000..04695d9b8 --- /dev/null +++ b/version/version.go @@ -0,0 +1,9 @@ +package version + +// NOTE: we should probably be versioning the ABCI and the abci-cli separately + +const Maj = "0" +const Min = "4" +const Fix = "0" + +const Version = "0.4.0" // new Query args and response (with proof!) From 700a62c22e5868e6075eb97a57b6d69ab6346f26 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 6 Mar 2017 02:53:15 -0500 Subject: [PATCH 28/29] CHANGELOG --- CHANGELOG.md | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..7586c9067 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,169 @@ +# Changelog + +## 0.4.0 (March 6, 2017) + +BREAKING CHANGES: + +- Query takes RequestQuery and returns ResponseQuery, with more specificity over keys, paths, and proofs: + +``` +message RequestQuery{ + bytes data = 1; + string path = 2; + uint64 height = 3; + bool prove = 4; +} + +message ResponseQuery{ + CodeType code = 1; + int64 index = 2; + bytes key = 3; + bytes value = 4; + bytes proof = 5; + uint64 height = 6; + string log = 7; +} +``` + +IMPROVEMENTS: + +- Updates to Makefile +- Various cleanup +- BaseApplication can be embedded by new apps to avoid implementing empty methods +- Drop BlockchainAware and make BeginBlock/EndBlock part of the `type Application interface` + +## 0.3.0 (January 12, 2017) + +BREAKING CHANGES: + +- TMSP is now ABCI (Application/Asynchronous/A BlockChain Interface or Atomic BroadCast Interface) +- AppendTx is now DeliverTx (conforms to the literature) +- BeginBlock takes a Header: + +``` +message RequestBeginBlock{ + bytes hash = 1; + Header header = 2; +} +``` + +- Info returns a ResponseInfo, containing last block height and app hash:o + +``` +message ResponseInfo { + string data = 1; + string version = 2; + uint64 last_block_height = 3; + bytes last_block_app_hash = 4; +} +``` + +- EndBlock returns a ResponseEndBlock, containing the changed validators: + +``` +message ResponseEndBlock{ + repeated Validator diffs = 4; +} +``` + +- Hex strings are 0x-prefixed in the CLI +- Query on the Dummy app now uses hex-strings + +FEATURES: + +- New app, PersistentDummy, uses Info/BeginBlock to recover from failures and supports validator set changes +- New message types for blockchain data: + +``` +//---------------------------------------- +// Blockchain Types + +message Header { + string chain_id = 1; + uint64 height = 2; + uint64 time = 3; + uint64 num_txs = 4; + BlockID last_block_id = 5; + bytes last_commit_hash = 6; + bytes data_hash = 7; + bytes validators_hash = 8; + bytes app_hash = 9; +} + +message BlockID { + bytes hash = 1; + PartSetHeader parts = 2; +} + +message PartSetHeader { + uint64 total = 1; + bytes hash = 2; +} + +message Validator { + bytes pubKey = 1; + uint64 power = 2; +} +``` + +- Add support for Query to Counter app + +IMPROVEMENT: + +- Don't exit the tmsp-cli console on bad args + +BUG FIXES: + +- Fix parsing in the Counter app to handle invalid transactions + + +## 0.2.1 (September 12, 2016) + +IMPROVEMENTS + +- Better error handling in console + + +## 0.2.0 (July 23, 2016) + +BREAKING CHANGES: + +- Use `oneof` types in protobuf + +FEATURES: + +- GRPC support + + +## PreHistory + +##### Mar 26h, 2016 +* Introduce BeginBlock + +##### Mar 6th, 2016 + +* Added InitChain, EndBlock + +##### Feb 14th, 2016 + +* s/GetHash/Commit/g +* Document Protobuf request/response fields + +##### Jan 23th, 2016 + +* Added CheckTx/Query ABCI message types +* Added Result/Log fields to DeliverTx/CheckTx/SetOption +* Removed Listener messages +* Removed Code from ResponseSetOption and ResponseGetHash +* Made examples BigEndian + +##### Jan 12th, 2016 + +* Added "RetCodeBadNonce = 0x06" return code + +##### Jan 8th, 2016 + +* Tendermint/ABCI now comes to consensus on the order first before DeliverTx. + + + From be5a4345a3283450f57451912be0f390f4286128 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 6 Mar 2017 02:58:26 -0500 Subject: [PATCH 29/29] formatting and update CHANGELOG --- CHANGELOG.md | 8 +++++--- types/types.proto | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7586c9067..6f5cf42cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,9 @@ BREAKING CHANGES: -- Query takes RequestQuery and returns ResponseQuery, with more specificity over keys, paths, and proofs: +- Query takes RequestQuery and returns ResponseQuery. The request is split into `data` and `path`, +can specify a height to query the state from, and whether or not the response should come with a proof. +The response returns the corresponding key-value pair, with proof if requested. ``` message RequestQuery{ @@ -20,7 +22,7 @@ message ResponseQuery{ bytes key = 3; bytes value = 4; bytes proof = 5; - uint64 height = 6; + uint64 height = 6; string log = 7; } ``` @@ -47,7 +49,7 @@ message RequestBeginBlock{ } ``` -- Info returns a ResponseInfo, containing last block height and app hash:o +- Info returns a ResponseInfo, containing last block height and app hash: ``` message ResponseInfo { diff --git a/types/types.proto b/types/types.proto index 85ec434da..0c741d3d0 100644 --- a/types/types.proto +++ b/types/types.proto @@ -196,7 +196,7 @@ message ResponseQuery{ bytes key = 3; bytes value = 4; bytes proof = 5; - uint64 height = 6; + uint64 height = 6; string log = 7; } @@ -214,7 +214,7 @@ message ResponseBeginBlock{ } message ResponseEndBlock{ - repeated Validator diffs = 4; + repeated Validator diffs = 1; } //----------------------------------------