From 7998ba668ab8d11448f46925b7d8c6c8165a2126 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 28 Oct 2016 12:06:40 -0700 Subject: [PATCH 01/40] QuitService->BaseService --- README.md | 6 +++++- client/grpc_client.go | 8 ++++---- client/socket_client.go | 10 +++++----- server/grpc_server.go | 8 ++++---- server/socket_server.go | 8 ++++---- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d034a6b16..d6f1e53a8 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,11 @@ TMSP requests/responses are simple Protobuf messages. Check out the [schema fil * `Data ([]byte)`: Result bytes, if any * `Log (string)`: Debug or error message * __Usage__:
- Validate a transaction. This message should not mutate the state. + 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 AppendTx, but they happen on different connections - CheckTx from the mempool connection, and AppendTx 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 appendtxs, and then the mempool will re run whatever txs it has against that latest mempool stte + 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`, to allow for dependent sequences of transactions in the same block. diff --git a/client/grpc_client.go b/client/grpc_client.go index 771302c19..0c1ecf1c5 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -15,7 +15,7 @@ import ( // A stripped copy of the remoteClient that makes // synchronous calls using grpc type grpcClient struct { - QuitService + BaseService mustConnect bool client types.TMSPApplicationClient @@ -31,7 +31,7 @@ func NewGRPCClient(addr string, mustConnect bool) (*grpcClient, error) { addr: addr, mustConnect: mustConnect, } - cli.QuitService = *NewQuitService(nil, "grpcClient", cli) + cli.BaseService = *NewBaseService(nil, "grpcClient", cli) _, err := cli.Start() // Just start it, it's confusing for callers to remember to start. return cli, err } @@ -41,7 +41,7 @@ func dialerFunc(addr string, timeout time.Duration) (net.Conn, error) { } func (cli *grpcClient) OnStart() error { - cli.QuitService.OnStart() + cli.BaseService.OnStart() RETRY_LOOP: for { @@ -73,7 +73,7 @@ RETRY_LOOP: } func (cli *grpcClient) OnStop() { - cli.QuitService.OnStop() + cli.BaseService.OnStop() cli.mtx.Lock() defer cli.mtx.Unlock() // TODO: how to close conn? its not a net.Conn and grpc doesn't expose a Close() diff --git a/client/socket_client.go b/client/socket_client.go index 27e74787c..0b7be91d9 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -27,7 +27,7 @@ const flushThrottleMS = 20 // Don't wait longer than... // the application in general is not meant to be interfaced // with concurrent callers. type socketClient struct { - QuitService + BaseService reqQueue chan *ReqRes flushTimer *ThrottleTimer @@ -52,14 +52,14 @@ func NewSocketClient(addr string, mustConnect bool) (*socketClient, error) { reqSent: list.New(), resCb: nil, } - cli.QuitService = *NewQuitService(nil, "socketClient", cli) + cli.BaseService = *NewBaseService(nil, "socketClient", cli) _, err := cli.Start() // Just start it, it's confusing for callers to remember to start. return cli, err } func (cli *socketClient) OnStart() error { - cli.QuitService.OnStart() + cli.BaseService.OnStart() var err error var conn net.Conn @@ -86,7 +86,7 @@ RETRY_LOOP: } func (cli *socketClient) OnStop() { - cli.QuitService.OnStop() + cli.BaseService.OnStop() cli.mtx.Lock() defer cli.mtx.Unlock() @@ -140,7 +140,7 @@ func (cli *socketClient) sendRequestsRoutine(conn net.Conn) { default: // Probably will fill the buffer, or retry later. } - case <-cli.QuitService.Quit: + case <-cli.BaseService.Quit: return case reqres := <-cli.reqQueue: cli.willSendReq(reqres) diff --git a/server/grpc_server.go b/server/grpc_server.go index 02f6fa3f8..472da25dd 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -13,7 +13,7 @@ import ( // var maxNumberConnections = 2 type GRPCServer struct { - QuitService + BaseService proto string addr string @@ -32,13 +32,13 @@ func NewGRPCServer(protoAddr string, app types.TMSPApplicationServer) (Service, listener: nil, app: app, } - s.QuitService = *NewQuitService(nil, "TMSPServer", s) + s.BaseService = *NewBaseService(nil, "TMSPServer", s) _, err := s.Start() // Just start it return s, err } func (s *GRPCServer) OnStart() error { - s.QuitService.OnStart() + s.BaseService.OnStart() ln, err := net.Listen(s.proto, s.addr) if err != nil { return err @@ -51,6 +51,6 @@ func (s *GRPCServer) OnStart() error { } func (s *GRPCServer) OnStop() { - s.QuitService.OnStop() + s.BaseService.OnStop() s.server.Stop() } diff --git a/server/socket_server.go b/server/socket_server.go index ff01a9082..3eec302fb 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -15,7 +15,7 @@ import ( // var maxNumberConnections = 2 type SocketServer struct { - QuitService + BaseService proto string addr string @@ -39,13 +39,13 @@ func NewSocketServer(protoAddr string, app types.Application) (Service, error) { app: app, conns: make(map[int]net.Conn), } - s.QuitService = *NewQuitService(nil, "TMSPServer", s) + s.BaseService = *NewBaseService(nil, "TMSPServer", s) _, err := s.Start() // Just start it return s, err } func (s *SocketServer) OnStart() error { - s.QuitService.OnStart() + s.BaseService.OnStart() ln, err := net.Listen(s.proto, s.addr) if err != nil { return err @@ -56,7 +56,7 @@ func (s *SocketServer) OnStart() error { } func (s *SocketServer) OnStop() { - s.QuitService.OnStop() + s.BaseService.OnStop() s.listener.Close() s.connsMtx.Lock() From 6aa85b642e4691dc9c57b2ba2d23a46972378175 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 3 Nov 2016 19:50:57 -0400 Subject: [PATCH 02/40] BeginBlock --- client/socket_client.go | 2 + example/chain_aware/chain_aware_app.go | 75 +++++++++++++++++++++++++ example/chain_aware/chain_aware_test.go | 50 +++++++++++++++++ example/dummy/dummy.go | 1 + server/socket_server.go | 7 +++ 5 files changed, 135 insertions(+) create mode 100644 example/chain_aware/chain_aware_app.go create mode 100644 example/chain_aware/chain_aware_test.go diff --git a/client/socket_client.go b/client/socket_client.go index 0b7be91d9..f650bd5c9 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -432,6 +432,8 @@ func resMatchesReq(req *types.Request, res *types.Response) (ok bool) { _, ok = res.Value.(*types.Response_Query) case *types.Request_InitChain: _, ok = res.Value.(*types.Response_InitChain) + case *types.Request_BeginBlock: + _, ok = res.Value.(*types.Response_BeginBlock) case *types.Request_EndBlock: _, ok = res.Value.(*types.Response_EndBlock) } diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go new file mode 100644 index 000000000..df18891b5 --- /dev/null +++ b/example/chain_aware/chain_aware_app.go @@ -0,0 +1,75 @@ +package main + +import ( + "flag" + + . "github.com/tendermint/go-common" + "github.com/tendermint/tmsp/server" + "github.com/tendermint/tmsp/types" +) + +func main() { + + addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address") + tmspPtr := flag.String("tmsp", "socket", "socket | grpc") + flag.Parse() + + // Start the listener + _, err := server.NewServer(*addrPtr, *tmspPtr, NewChainAwareApplication()) + if err != nil { + Exit(err.Error()) + } + + // Wait forever + TrapSignal(func() { + // Cleanup + }) + +} + +type ChainAwareApplication struct { + beginCount int + endCount int +} + +func NewChainAwareApplication() *ChainAwareApplication { + return &ChainAwareApplication{} +} + +func (app *ChainAwareApplication) Info() string { + return "nil" +} + +func (app *ChainAwareApplication) SetOption(key string, value string) (log string) { + return "" +} + +func (app *ChainAwareApplication) AppendTx(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(query []byte) types.Result { + return types.NewResultOK([]byte(Fmt("%d,%d", app.beginCount, app.endCount)), "") +} + +func (app *ChainAwareApplication) BeginBlock(height uint64) { + app.beginCount += 1 + return +} + +func (app *ChainAwareApplication) EndBlock(height uint64) []*types.Validator { + app.endCount += 1 + return nil +} + +func (app *ChainAwareApplication) InitChain(vals []*types.Validator) { + return +} diff --git a/example/chain_aware/chain_aware_test.go b/example/chain_aware/chain_aware_test.go new file mode 100644 index 000000000..21eb1b3f9 --- /dev/null +++ b/example/chain_aware/chain_aware_test.go @@ -0,0 +1,50 @@ +package main + +import ( + "strconv" + "strings" + "testing" + + . "github.com/tendermint/go-common" + "github.com/tendermint/tmsp/client" + "github.com/tendermint/tmsp/server" +) + +func TestChainAware(t *testing.T) { + + app := NewChainAwareApplication() + + // Start the listener + _, err := server.NewServer("unix://test.sock", "socket", app) + if err != nil { + t.Fatal(err) + } + + // Connect to the socket + client, err := tmspcli.NewSocketClient("unix://test.sock", false) + if err != nil { + Exit(Fmt("Error starting socket client: %v", err.Error())) + } + client.Start() + defer client.Stop() + + n := uint64(5) + for i := uint64(0); i < n; i++ { + client.BeginBlockSync(i) + client.EndBlockSync(i) + client.CommitSync() + } + + r := app.Query(nil) + spl := strings.Split(string(r.Data), ",") + if len(spl) != 2 { + t.Fatal("expected %d,%d ; got %s", n, n, string(r.Data)) + } + beginCount, _ := strconv.Atoi(spl[0]) + endCount, _ := strconv.Atoi(spl[1]) + if uint64(beginCount) != n { + t.Fatalf("expected beginCount of %d, got %d", n, beginCount) + } else if uint64(endCount) != n { + t.Fatalf("expected endCount of %d, got %d", n, endCount) + } +} diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index ca3a8c03a..21f7c7718 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -1,6 +1,7 @@ package dummy import ( + "fmt" "strings" . "github.com/tendermint/go-common" diff --git a/server/socket_server.go b/server/socket_server.go index 3eec302fb..12d39fefa 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -193,6 +193,13 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types } else { responses <- types.ToResponseInitChain() } + case *types.Request_BeginBlock: + if app, ok := s.app.(types.BlockchainAware); ok { + app.BeginBlock(r.BeginBlock.Height) + responses <- types.ToResponseBeginBlock() + } else { + responses <- types.ToResponseBeginBlock() + } case *types.Request_EndBlock: if app, ok := s.app.(types.BlockchainAware); ok { validators := app.EndBlock(r.EndBlock.Height) From 1dafd3a89b632487f3bac2c44fd54cc141ec27e4 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 4 Nov 2016 06:41:51 -0700 Subject: [PATCH 03/40] Remove spurious fmt call --- example/dummy/dummy.go | 1 - 1 file changed, 1 deletion(-) diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 21f7c7718..ca3a8c03a 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -1,7 +1,6 @@ package dummy import ( - "fmt" "strings" . "github.com/tendermint/go-common" From eece35eeebacee1ab94b8338e77e0d1c2d880ecc Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 15 Nov 2016 14:47:39 -0500 Subject: [PATCH 04/40] glide: update go-common --- glide.lock | 6 +++--- glide.yaml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/glide.lock b/glide.lock index a87f5dc18..9171ff8d7 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 65769cd1c6d94a9733e9109e1bd7004f31b8df60c6d2cd47d9d8aecb9a94ffc2 -updated: 2016-11-15T14:05:15.057591061-05:00 +hash: 603c43870dfc63a3113a3d13ae799038206bd77889e2e9596a860d3644b8fb67 +updated: 2016-11-15T14:46:00.011667442-05:00 imports: - name: github.com/btcsuite/btcd version: d9a674e1b7bc09d0830d6986c71cf5f535d753c3 @@ -40,7 +40,7 @@ imports: - edwards25519 - extra25519 - name: github.com/tendermint/go-common - version: 1c62bb6dadc6269aeecad5f9e7b153d950a54362 + version: fa3daa7abc253264c916c12fecce3effa01a1287 - name: github.com/tendermint/go-crypto version: 4b11d62bdb324027ea01554e5767b71174680ba0 - name: github.com/tendermint/go-db diff --git a/glide.yaml b/glide.yaml index f39ae801e..bc1ad142f 100644 --- a/glide.yaml +++ b/glide.yaml @@ -4,6 +4,7 @@ import: subpackages: - proto - package: github.com/tendermint/go-common + version: develop - package: github.com/tendermint/go-crypto - package: github.com/tendermint/go-logger - package: github.com/tendermint/go-merkle From debbf122db0a4cfc90f73ed2421e333822283451 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 22 Aug 2016 14:01:26 -0400 Subject: [PATCH 05/40] add version/block/config to Info. add header to BeginBlock --- client/client.go | 6 +- client/grpc_client.go | 12 +- client/local_client.go | 22 +- client/socket_client.go | 14 +- cmd/tmsp-cli/tmsp-cli.go | 2 +- example/counter/counter.go | 4 +- example/dummy/dummy.go | 4 +- example/nil/nil_app.go | 4 +- server/socket_server.go | 13 +- types/application.go | 9 +- types/messages.go | 8 +- types/types.pb.go | 420 ++++++++++++++++++++++++++++--------- types/types.proto | 45 +++- 13 files changed, 414 insertions(+), 149 deletions(-) diff --git a/client/client.go b/client/client.go index 291c4863a..be1383e4b 100644 --- a/client/client.go +++ b/client/client.go @@ -25,7 +25,7 @@ type Client interface { FlushSync() error EchoSync(msg string) (res types.Result) - InfoSync() (res types.Result) + InfoSync() (types.Result, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) SetOptionSync(key string, value string) (res types.Result) AppendTxSync(tx []byte) (res types.Result) CheckTxSync(tx []byte) (res types.Result) @@ -33,11 +33,11 @@ type Client interface { CommitSync() (res types.Result) InitChainAsync(validators []*types.Validator) *ReqRes - BeginBlockAsync(height uint64) *ReqRes + BeginBlockAsync(header *types.Header) *ReqRes EndBlockAsync(height uint64) *ReqRes InitChainSync(validators []*types.Validator) (err error) - BeginBlockSync(height uint64) (err error) + BeginBlockSync(header *types.Header) (err error) EndBlockSync(height uint64) (changedValidators []*types.Validator, err error) } diff --git a/client/grpc_client.go b/client/grpc_client.go index 0c1ecf1c5..f7a802689 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -200,8 +200,8 @@ func (cli *grpcClient) InitChainAsync(validators []*types.Validator) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_InitChain{res}}) } -func (cli *grpcClient) BeginBlockAsync(height uint64) *ReqRes { - req := types.ToRequestBeginBlock(height) +func (cli *grpcClient) BeginBlockAsync(header *types.Header) *ReqRes { + req := types.ToRequestBeginBlock(header) res, err := cli.client.BeginBlock(context.Background(), req.GetBeginBlock(), grpc.FailFast(true)) if err != nil { cli.StopForError(err) @@ -262,13 +262,13 @@ func (cli *grpcClient) FlushSync() error { return nil } -func (cli *grpcClient) InfoSync() (res types.Result) { +func (cli *grpcClient) InfoSync() (types.Result, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { reqres := cli.InfoAsync() if res := cli.checkErrGetResult(); res.IsErr() { return res } resp := reqres.Response.GetInfo() - return types.NewResultOK([]byte(resp.Info), LOG) + return types.NewResultOK([]byte(resp.Info), LOG), r.TmspInfo, r.LastBlock, r.Config } func (cli *grpcClient) SetOptionSync(key string, value string) (res types.Result) { @@ -321,8 +321,8 @@ func (cli *grpcClient) InitChainSync(validators []*types.Validator) (err error) return cli.Error() } -func (cli *grpcClient) BeginBlockSync(height uint64) (err error) { - cli.BeginBlockAsync(height) +func (cli *grpcClient) BeginBlockSync(header *types.Header) (err error) { + cli.BeginBlockAsync(header) return cli.Error() } diff --git a/client/local_client.go b/client/local_client.go index ce17f6c07..0ce735c80 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -51,11 +51,11 @@ func (app *localClient) EchoAsync(msg string) *ReqRes { func (app *localClient) InfoAsync() *ReqRes { app.mtx.Lock() - info := app.Application.Info() + info, tmspInfo, blockInfo, configInfo := app.Application.Info() app.mtx.Unlock() return app.callback( types.ToRequestInfo(), - types.ToResponseInfo(info), + types.ToResponseInfo(info, tmspInfo, blockInfo, configInfo), ) } @@ -122,14 +122,14 @@ func (app *localClient) InitChainAsync(validators []*types.Validator) *ReqRes { return reqRes } -func (app *localClient) BeginBlockAsync(height uint64) *ReqRes { +func (app *localClient) BeginBlockAsync(header *types.Header) *ReqRes { app.mtx.Lock() if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.BeginBlock(height) + bcApp.BeginBlock(header) } app.mtx.Unlock() return app.callback( - types.ToRequestBeginBlock(height), + types.ToRequestBeginBlock(header), types.ToResponseBeginBlock(), ) } @@ -157,11 +157,11 @@ func (app *localClient) EchoSync(msg string) (res types.Result) { return types.OK.SetData([]byte(msg)) } -func (app *localClient) InfoSync() (res types.Result) { +func (app *localClient) InfoSync() (types.Result, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { app.mtx.Lock() - info := app.Application.Info() - app.mtx.Unlock() - return types.OK.SetData([]byte(info)) + defer app.mtx.Unlock() + info, tmspInfo, blockInfo, configInfo := app.Application.Info() + return types.OK.SetData([]byte(info)), tmspInfo, blockInfo, configInfo } func (app *localClient) SetOptionSync(key string, value string) (res types.Result) { @@ -208,10 +208,10 @@ func (app *localClient) InitChainSync(validators []*types.Validator) (err error) return nil } -func (app *localClient) BeginBlockSync(height uint64) (err error) { +func (app *localClient) BeginBlockSync(header *types.Header) (err error) { app.mtx.Lock() if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.BeginBlock(height) + bcApp.BeginBlock(header) } app.mtx.Unlock() return nil diff --git a/client/socket_client.go b/client/socket_client.go index f650bd5c9..18dc0b0e4 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -263,8 +263,8 @@ func (cli *socketClient) InitChainAsync(validators []*types.Validator) *ReqRes { return cli.queueRequest(types.ToRequestInitChain(validators)) } -func (cli *socketClient) BeginBlockAsync(height uint64) *ReqRes { - return cli.queueRequest(types.ToRequestBeginBlock(height)) +func (cli *socketClient) BeginBlockAsync(header *types.Header) *ReqRes { + return cli.queueRequest(types.ToRequestBeginBlock(header)) } func (cli *socketClient) EndBlockAsync(height uint64) *ReqRes { @@ -292,14 +292,14 @@ func (cli *socketClient) FlushSync() error { return cli.Error() } -func (cli *socketClient) InfoSync() (res types.Result) { +func (cli *socketClient) InfoSync() (types.Result, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { reqres := cli.queueRequest(types.ToRequestInfo()) cli.FlushSync() if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()) + return types.ErrInternalError.SetLog(err.Error()), nil, nil, nil } resp := reqres.Response.GetInfo() - return types.Result{Code: OK, Data: []byte(resp.Info), Log: LOG} + return types.Result{Code: OK, Data: []byte(resp.Info), Log: LOG}, resp.TmspInfo, resp.LastBlock, resp.Config } func (cli *socketClient) SetOptionSync(key string, value string) (res types.Result) { @@ -361,8 +361,8 @@ func (cli *socketClient) InitChainSync(validators []*types.Validator) (err error return nil } -func (cli *socketClient) BeginBlockSync(height uint64) (err error) { - cli.queueRequest(types.ToRequestBeginBlock(height)) +func (cli *socketClient) BeginBlockSync(header *types.Header) (err error) { + cli.queueRequest(types.ToRequestBeginBlock(header)) cli.FlushSync() if err := cli.Error(); err != nil { return err diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index 084241290..fe6dbd451 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -191,7 +191,7 @@ func cmdEcho(c *cli.Context) error { // Get some info from the application func cmdInfo(c *cli.Context) error { - res := client.InfoSync() + res, _, _, _ := client.InfoSync() printResponse(c, res, string(res.Data), false) return nil } diff --git a/example/counter/counter.go b/example/counter/counter.go index 711ddc3f4..2596eb107 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -18,8 +18,8 @@ func NewCounterApplication(serial bool) *CounterApplication { return &CounterApplication{serial: serial} } -func (app *CounterApplication) Info() string { - return Fmt("hashes:%v, txs:%v", app.hashCount, app.txCount) +func (app *CounterApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { + return Fmt("hashes:%v, txs:%v", app.hashCount, app.txCount), nil, nil, nil } func (app *CounterApplication) SetOption(key string, value string) (log string) { diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index ca3a8c03a..5bf52a78a 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -20,8 +20,8 @@ func NewDummyApplication() *DummyApplication { return &DummyApplication{state: state} } -func (app *DummyApplication) Info() string { - return Fmt("size:%v", app.state.Size()) +func (app *DummyApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { + return Fmt("size:%v", app.state.Size()), nil, nil, nil } func (app *DummyApplication) SetOption(key string, value string) (log string) { diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index 40474a9f2..05b5c7883 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -11,8 +11,8 @@ func NewNilApplication() *NilApplication { return &NilApplication{} } -func (app *NilApplication) Info() string { - return "nil" +func (app *NilApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { + return "nil", nil, nil, nil } func (app *NilApplication) SetOption(key string, value string) (log string) { diff --git a/server/socket_server.go b/server/socket_server.go index 12d39fefa..fb141aa9e 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -168,8 +168,7 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types case *types.Request_Flush: responses <- types.ToResponseFlush() case *types.Request_Info: - data := s.app.Info() - responses <- types.ToResponseInfo(data) + responses <- types.ToResponseInfo(s.app.Info()) case *types.Request_SetOption: so := r.SetOption logStr := s.app.SetOption(so.Key, so.Value) @@ -189,17 +188,13 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types case *types.Request_InitChain: if app, ok := s.app.(types.BlockchainAware); ok { app.InitChain(r.InitChain.Validators) - responses <- types.ToResponseInitChain() - } else { - responses <- types.ToResponseInitChain() } + responses <- types.ToResponseInitChain() case *types.Request_BeginBlock: if app, ok := s.app.(types.BlockchainAware); ok { - app.BeginBlock(r.BeginBlock.Height) - responses <- types.ToResponseBeginBlock() - } else { - responses <- types.ToResponseBeginBlock() + app.BeginBlock(r.BeginBlock.Header) } + responses <- types.ToResponseBeginBlock() case *types.Request_EndBlock: if app, ok := s.app.(types.BlockchainAware); ok { validators := app.EndBlock(r.EndBlock.Height) diff --git a/types/application.go b/types/application.go index c6e6f24b8..ba6565f54 100644 --- a/types/application.go +++ b/types/application.go @@ -8,7 +8,7 @@ import ( type Application interface { // Return application info - Info() (info string) + Info() (string, *TMSPInfo, *LastBlockInfo, *ConfigInfo) // Set application option (e.g. mode=mempool, mode=consensus) SetOption(key string, value string) (log string) @@ -34,7 +34,7 @@ type BlockchainAware interface { InitChain(validators []*Validator) // Signals the beginning of a block - BeginBlock(height uint64) + BeginBlock(header *Header) // Signals the end of a block // diffs: changed validators from app to TendermintCore @@ -59,7 +59,8 @@ func (app *GRPCApplication) Flush(ctx context.Context, req *RequestFlush) (*Resp } func (app *GRPCApplication) Info(ctx context.Context, req *RequestInfo) (*ResponseInfo, error) { - return &ResponseInfo{app.app.Info()}, nil + info, tmspInfo, blockInfo, configInfo := app.app.Info() + return &ResponseInfo{info, tmspInfo, blockInfo, configInfo}, nil } func (app *GRPCApplication) SetOption(ctx context.Context, req *RequestSetOption) (*ResponseSetOption, error) { @@ -95,7 +96,7 @@ func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*ResponseBeginBlock, error) { if chainAware, ok := app.app.(BlockchainAware); ok { - chainAware.BeginBlock(req.Height) + chainAware.BeginBlock(req.Header) } return &ResponseBeginBlock{}, nil } diff --git a/types/messages.go b/types/messages.go index 6b047d47b..304289e47 100644 --- a/types/messages.go +++ b/types/messages.go @@ -61,9 +61,9 @@ func ToRequestInitChain(validators []*Validator) *Request { } } -func ToRequestBeginBlock(height uint64) *Request { +func ToRequestBeginBlock(header *Header) *Request { return &Request{ - Value: &Request_BeginBlock{&RequestBeginBlock{height}}, + Value: &Request_BeginBlock{&RequestBeginBlock{header}}, } } @@ -93,9 +93,9 @@ func ToResponseFlush() *Response { } } -func ToResponseInfo(info string) *Response { +func ToResponseInfo(info string, tmspInfo *TMSPInfo, blockInfo *LastBlockInfo, configInfo *ConfigInfo) *Response { return &Response{ - Value: &Response_Info{&ResponseInfo{info}}, + Value: &Response_Info{&ResponseInfo{info, tmspInfo, blockInfo, configInfo}}, } } diff --git a/types/types.pb.go b/types/types.pb.go index 40630bf2c..d8251961b 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -34,6 +34,11 @@ It has these top-level messages: ResponseInitChain ResponseBeginBlock ResponseEndBlock + TMSPInfo + LastBlockInfo + ConfigInfo + Header + PartSetHeader Validator */ package types @@ -753,7 +758,7 @@ func (m *RequestInitChain) GetValidators() []*Validator { } type RequestBeginBlock struct { - Height uint64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"` + Header *Header `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } @@ -761,11 +766,11 @@ func (m *RequestBeginBlock) String() string { return proto.CompactTex func (*RequestBeginBlock) ProtoMessage() {} func (*RequestBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } -func (m *RequestBeginBlock) GetHeight() uint64 { +func (m *RequestBeginBlock) GetHeader() *Header { if m != nil { - return m.Height + return m.Header } - return 0 + return nil } type RequestEndBlock struct { @@ -1256,7 +1261,10 @@ func (*ResponseFlush) ProtoMessage() {} func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } type ResponseInfo struct { - Info string `protobuf:"bytes,1,opt,name=info" json:"info,omitempty"` + Info string `protobuf:"bytes,1,opt,name=info" json:"info,omitempty"` + TmspInfo *TMSPInfo `protobuf:"bytes,2,opt,name=tmsp_info,json=tmspInfo" json:"tmsp_info,omitempty"` + LastBlock *LastBlockInfo `protobuf:"bytes,3,opt,name=last_block,json=lastBlock" json:"last_block,omitempty"` + Config *ConfigInfo `protobuf:"bytes,4,opt,name=config" json:"config,omitempty"` } func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } @@ -1271,6 +1279,27 @@ func (m *ResponseInfo) GetInfo() string { return "" } +func (m *ResponseInfo) GetTmspInfo() *TMSPInfo { + if m != nil { + return m.TmspInfo + } + return nil +} + +func (m *ResponseInfo) GetLastBlock() *LastBlockInfo { + if m != nil { + return m.LastBlock + } + return nil +} + +func (m *ResponseInfo) GetConfig() *ConfigInfo { + if m != nil { + return m.Config + } + return nil +} + type ResponseSetOption struct { Log string `protobuf:"bytes,1,opt,name=log" json:"log,omitempty"` } @@ -1447,6 +1476,182 @@ func (m *ResponseEndBlock) GetDiffs() []*Validator { return nil } +type TMSPInfo struct { + Version string `protobuf:"bytes,1,opt,name=Version" json:"Version,omitempty"` +} + +func (m *TMSPInfo) Reset() { *m = TMSPInfo{} } +func (m *TMSPInfo) String() string { return proto.CompactTextString(m) } +func (*TMSPInfo) ProtoMessage() {} +func (*TMSPInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *TMSPInfo) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +type LastBlockInfo struct { + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight" json:"block_height,omitempty"` + BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` +} + +func (m *LastBlockInfo) Reset() { *m = LastBlockInfo{} } +func (m *LastBlockInfo) String() string { return proto.CompactTextString(m) } +func (*LastBlockInfo) ProtoMessage() {} +func (*LastBlockInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +func (m *LastBlockInfo) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *LastBlockInfo) GetBlockHash() []byte { + if m != nil { + return m.BlockHash + } + return nil +} + +func (m *LastBlockInfo) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil +} + +type ConfigInfo struct { + MaxBlockSize uint64 `protobuf:"varint,1,opt,name=max_block_size,json=maxBlockSize" json:"max_block_size,omitempty"` +} + +func (m *ConfigInfo) Reset() { *m = ConfigInfo{} } +func (m *ConfigInfo) String() string { return proto.CompactTextString(m) } +func (*ConfigInfo) ProtoMessage() {} +func (*ConfigInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } + +func (m *ConfigInfo) GetMaxBlockSize() uint64 { + if m != nil { + return m.MaxBlockSize + } + return 0 +} + +type Header struct { + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` + Time uint64 `protobuf:"varint,3,opt,name=time" json:"time,omitempty"` + NumTxs uint64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs" json:"num_txs,omitempty"` + LastBlockHash []byte `protobuf:"bytes,5,opt,name=last_block_hash,json=lastBlockHash,proto3" json:"last_block_hash,omitempty"` + LastBlockParts *PartSetHeader `protobuf:"bytes,6,opt,name=last_block_parts,json=lastBlockParts" json:"last_block_parts,omitempty"` + LastCommitHash []byte `protobuf:"bytes,7,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` + DataHash []byte `protobuf:"bytes,8,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` + ValidatorsHash []byte `protobuf:"bytes,9,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` + AppHash []byte `protobuf:"bytes,10,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` +} + +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{28} } + +func (m *Header) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *Header) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Header) GetTime() uint64 { + if m != nil { + return m.Time + } + return 0 +} + +func (m *Header) GetNumTxs() uint64 { + if m != nil { + return m.NumTxs + } + return 0 +} + +func (m *Header) GetLastBlockHash() []byte { + if m != nil { + return m.LastBlockHash + } + return nil +} + +func (m *Header) GetLastBlockParts() *PartSetHeader { + if m != nil { + return m.LastBlockParts + } + return nil +} + +func (m *Header) GetLastCommitHash() []byte { + if m != nil { + return m.LastCommitHash + } + return nil +} + +func (m *Header) GetDataHash() []byte { + if m != nil { + return m.DataHash + } + return nil +} + +func (m *Header) GetValidatorsHash() []byte { + if m != nil { + return m.ValidatorsHash + } + return nil +} + +func (m *Header) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil +} + +type PartSetHeader struct { + Total uint64 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } +func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } +func (*PartSetHeader) ProtoMessage() {} +func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } + +func (m *PartSetHeader) GetTotal() uint64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *PartSetHeader) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + type Validator struct { PubKey []byte `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"` Power uint64 `protobuf:"varint,2,opt,name=power" json:"power,omitempty"` @@ -1455,7 +1660,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{25} } +func (*Validator) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } func (m *Validator) GetPubKey() []byte { if m != nil { @@ -1497,6 +1702,11 @@ func init() { proto.RegisterType((*ResponseInitChain)(nil), "types.ResponseInitChain") proto.RegisterType((*ResponseBeginBlock)(nil), "types.ResponseBeginBlock") proto.RegisterType((*ResponseEndBlock)(nil), "types.ResponseEndBlock") + proto.RegisterType((*TMSPInfo)(nil), "types.TMSPInfo") + proto.RegisterType((*LastBlockInfo)(nil), "types.LastBlockInfo") + proto.RegisterType((*ConfigInfo)(nil), "types.ConfigInfo") + proto.RegisterType((*Header)(nil), "types.Header") + proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") proto.RegisterType((*Validator)(nil), "types.Validator") proto.RegisterEnum("types.MessageType", MessageType_name, MessageType_value) proto.RegisterEnum("types.CodeType", CodeType_name, CodeType_value) @@ -1907,93 +2117,113 @@ var _TMSPApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1393 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x57, 0x59, 0x53, 0xdc, 0xc6, - 0x16, 0x1e, 0xc1, 0xac, 0x67, 0x60, 0x68, 0x0e, 0x03, 0xc8, 0x53, 0xf7, 0xc1, 0x57, 0xf7, 0x26, - 0x01, 0xdb, 0x65, 0xa7, 0x70, 0xd9, 0x65, 0xc7, 0xa9, 0x54, 0x81, 0x8d, 0x81, 0x72, 0xd9, 0x26, - 0xf2, 0xf2, 0x90, 0xa5, 0x28, 0xa1, 0xe9, 0x99, 0x51, 0x18, 0xba, 0x65, 0x2d, 0x18, 0xf2, 0x0f, - 0xfc, 0x83, 0xf2, 0x92, 0xd7, 0x3c, 0x65, 0x5f, 0x7e, 0x51, 0xaa, 0x17, 0x49, 0x23, 0x21, 0xf9, - 0xc9, 0x2f, 0x53, 0xdd, 0x67, 0xeb, 0x9e, 0x73, 0xbe, 0xf3, 0xe9, 0x34, 0x2c, 0x47, 0x17, 0x3e, - 0x0d, 0x6f, 0xc9, 0xdf, 0x9b, 0x7e, 0xc0, 0x23, 0x8e, 0x0d, 0xb9, 0xb1, 0x7e, 0xaa, 0x43, 0xcb, - 0xa6, 0x6f, 0x62, 0x1a, 0x46, 0xb8, 0x01, 0x75, 0xea, 0x4e, 0xb8, 0x69, 0x5c, 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0xa1, 0x16, 0x19, 0xf0, 0x92, 0x0d, 0x3e, 0x80, 0xee, 0x31, 0x1d, 0x7b, 0xec, 0xe8, 0x78, - 0xca, 0xdd, 0x13, 0x13, 0xa4, 0xab, 0x99, 0x77, 0xdd, 0x11, 0x06, 0x3b, 0x42, 0xbf, 0x5f, 0xb3, - 0xe1, 0x38, 0xdd, 0x89, 0xf4, 0x89, 0xdc, 0x29, 0xd7, 0x6e, 0x59, 0xfa, 0x76, 0xd9, 0x30, 0x71, - 0x6c, 0x53, 0xbd, 0xde, 0x69, 0x41, 0xe3, 0xcc, 0x99, 0xc6, 0xd4, 0xfa, 0x04, 0xba, 0x33, 0x30, - 0x41, 0x13, 0x5a, 0xa7, 0x34, 0x0c, 0x9d, 0x31, 0x95, 0x58, 0xea, 0xd8, 0xc9, 0xd6, 0xea, 0xc1, - 0xc2, 0x2c, 0x48, 0xac, 0xc5, 0xd4, 0x51, 0x00, 0xc1, 0xfa, 0x0c, 0x48, 0xb1, 0xce, 0x48, 0x60, - 0xfe, 0x84, 0x5e, 0xe8, 0x40, 0x62, 0x89, 0x7d, 0x7d, 0xac, 0x44, 0x5f, 0xc7, 0xd6, 0x77, 0xf8, - 0x2f, 0x2c, 0x15, 0x4a, 0x8d, 0x3d, 0x98, 0x8b, 0xce, 0xa5, 0xe7, 0x82, 0x3d, 0x17, 0x9d, 0x5b, - 0x57, 0xa1, 0x97, 0xaf, 0xeb, 0x25, 0x8b, 0xff, 0xa7, 0xf7, 0x93, 0x85, 0x11, 0x47, 0xa9, 0xe2, - 0x29, 0x13, 0xb5, 0xb1, 0x96, 0x60, 0x31, 0x57, 0x6d, 0xeb, 0x51, 0x7a, 0xef, 0xb4, 0x3a, 0xf8, - 0x29, 0xc0, 0x99, 0x33, 0xf5, 0x86, 0x4e, 0xc4, 0x83, 0xd0, 0x34, 0xae, 0xce, 0x6f, 0x74, 0xb7, - 0x88, 0x4e, 0xea, 0xeb, 0x44, 0x61, 0xcf, 0xd8, 0x58, 0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0x89, 0x81, 0x1d, 0x68, 0x48, 0x58, 0x92, 0x39, 0x21, 0x14, 0x80, 0x24, - 0xf3, 0xb8, 0x08, 0x9d, 0x14, 0x76, 0xa4, 0x2e, 0xb6, 0x69, 0x3f, 0x90, 0x06, 0x2e, 0x40, 0x3b, - 0x41, 0x1b, 0x59, 0xc6, 0x2e, 0xb4, 0x34, 0x38, 0x08, 0x22, 0x40, 0x53, 0xe5, 0x9b, 0xac, 0x88, - 0xc8, 0xb2, 0xae, 0xa4, 0x2f, 0x02, 0xa4, 0x99, 0x22, 0xab, 0xd8, 0x03, 0xc8, 0x72, 0x44, 0xd6, - 0x44, 0xc0, 0x24, 0x3b, 0x64, 0xfd, 0xda, 0x0f, 0x0d, 0x68, 0x27, 0x75, 0xc1, 0x26, 0xcc, 0x3d, - 0x7f, 0x42, 0x6a, 0xb8, 0x0c, 0x8b, 0x07, 0x2c, 0xa2, 0x01, 0x73, 0xa6, 0xbb, 0xa2, 0x01, 0x89, - 0x21, 0x44, 0xbb, 0xcc, 0xe5, 0x43, 0x8f, 0x8d, 0x95, 0x68, 0x4e, 0x04, 0xda, 0x71, 0x86, 0xcf, - 0x38, 0x73, 0x29, 0x99, 0x47, 0x02, 0x0b, 0xaf, 0x98, 0x13, 0x47, 0x13, 0x1e, 0x78, 0xdf, 0xd3, - 0x21, 0xa9, 0xe3, 0x2a, 0x2c, 0x1f, 0xb0, 0x30, 0x1e, 0x8d, 0x3c, 0xd7, 0xa3, 0x2c, 0x7a, 0x1c, - 0xb3, 0x61, 0x48, 0x1a, 0x88, 0xd0, 0x7b, 0xc5, 0x4e, 0x18, 0x7f, 0xcb, 0xf4, 0x57, 0x8b, 0x34, - 0xd1, 0x84, 0xfe, 0x8e, 0x13, 0xd2, 0x47, 0xb1, 0x3f, 0xf5, 0x5c, 0x27, 0xa2, 0xdb, 0xc3, 0x61, - 0x40, 0xc3, 0x90, 0x50, 0x11, 0x44, 0x68, 0xf2, 0x67, 0x8f, 0x12, 0x87, 0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 0x32, 0x70, 0x05, 0x7a, 0x99, 0x58, 0xda, 0xfe, 0x6d, 0xe0, 0x00, 0x56, 0x73, 0x42, 0x8f, - 0x8d, 0x0f, 0x45, 0xc7, 0x91, 0x7f, 0x8c, 0xad, 0x77, 0x0d, 0x58, 0x7a, 0xf9, 0xf4, 0xc5, 0xe1, - 0xb6, 0xaf, 0x0e, 0x10, 0x94, 0x7d, 0x4b, 0xf5, 0x19, 0x96, 0xbc, 0x57, 0x06, 0x65, 0x43, 0x0a, - 0x6e, 0xe9, 0x76, 0xc4, 0xb2, 0x67, 0xcb, 0xa0, 0x74, 0x56, 0x11, 0x87, 0xa8, 0x0f, 0xc9, 0xe5, - 0xd7, 0xcb, 0xa0, 0x6c, 0x60, 0xc1, 0x2f, 0x66, 0xda, 0x1b, 0xab, 0xde, 0x30, 0x83, 0xca, 0xd1, - 0x05, 0x1f, 0x64, 0x04, 0x80, 0x15, 0x2f, 0x99, 0x41, 0xd5, 0xf8, 0x82, 0xf7, 0x52, 0xbe, 0xc0, - 0xf2, 0xf7, 0xcc, 0xa0, 0x62, 0x84, 0x11, 0xb9, 0x51, 0x1f, 0x8a, 0xb2, 0x67, 0xca, 0xa0, 0x74, - 0x2a, 0xc1, 0x3b, 0x09, 0x21, 0x61, 0xe9, 0x53, 0x68, 0x50, 0x3e, 0xfb, 0x88, 0x0c, 0x65, 0xc3, - 0x72, 0xd5, 0x1b, 0x67, 0x50, 0x39, 0xd5, 0xe0, 0xf6, 0x2c, 0xc3, 0x61, 0xe5, 0x4b, 0x67, 0x50, - 0x3d, 0xdb, 0x88, 0x24, 0x67, 0xc3, 0x73, 0xf9, 0x7b, 0x67, 0x50, 0x35, 0xde, 0x1c, 0x37, 0xe5, - 0x3b, 0xfa, 0xf6, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xac, 0x2d, 0x4b, 0x5c, 0x0f, 0x00, - 0x00, + // 1721 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08,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x91, 0x9d, 0x62, 0xa3, + 0x26, 0x91, 0xba, 0x57, 0xfa, 0xa8, 0x76, 0x0a, 0xc7, 0x4f, 0x53, 0x40, 0xc2, 0xda, 0x7f, 0x02, + 0x46, 0xf5, 0xb3, 0x3e, 0x45, 0x28, 0x7f, 0x2b, 0xae, 0x7a, 0xe2, 0x8f, 0x56, 0x4e, 0xf1, 0xf8, + 0xb8, 0x88, 0x70, 0xb8, 0xf2, 0xa1, 0x3f, 0x5a, 0x3d, 0xcb, 0x53, 0x90, 0xf3, 0xc7, 0x62, 0xfd, + 0x73, 0x7f, 0xb4, 0x6a, 0x9c, 0xbf, 0x6c, 0xcb, 0xbf, 0x91, 0x1e, 0xfc, 0x3f, 0x00, 0x00, 0xff, + 0xff, 0x89, 0x5e, 0xff, 0xe3, 0x5b, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index cb3d82c1a..e2c7d9b4a 100644 --- a/types/types.proto +++ b/types/types.proto @@ -124,7 +124,7 @@ message RequestInitChain{ } message RequestBeginBlock{ - uint64 height = 1; + Header header = 1; } message RequestEndBlock{ @@ -164,7 +164,11 @@ message ResponseFlush{ } message ResponseInfo { - string info = 1; + string info = 1; // backwards compatible + + TMSPInfo tmsp_info = 2; + LastBlockInfo last_block = 3; + ConfigInfo config = 4; } message ResponseSetOption{ @@ -207,7 +211,42 @@ message ResponseEndBlock{ } //---------------------------------------- -// Misc types +// Info types + +message TMSPInfo { + string Version = 1; +} + +message LastBlockInfo { + uint64 block_height = 1; + bytes block_hash = 2; + bytes app_hash = 3; +} + +message ConfigInfo { + uint64 max_block_size = 1; +} + +//---------------------------------------- +// Blockchain Types + +message Header { + string chain_id = 1; + uint64 height = 2; + uint64 time = 3; + uint64 num_txs = 4; + bytes last_block_hash = 5; + PartSetHeader last_block_parts = 6; + bytes last_commit_hash = 7; + bytes data_hash = 8; + bytes validators_hash = 9; + bytes app_hash = 10; +} + +message PartSetHeader { + uint64 total = 1; + bytes hash = 2; +} message Validator { bytes pubKey = 1; From 7901825ad93a69556cb33e63b295555cd01d1306 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 24 Aug 2016 01:42:57 -0400 Subject: [PATCH 06/40] persistent dummy --- client/grpc_client.go | 4 +- cmd/dummy/main.go | 12 ++- example/dummy/dummy.go | 1 + example/dummy/log.go | 7 ++ example/dummy/persistent_dummy.go | 117 ++++++++++++++++++++++++++++++ 5 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 example/dummy/log.go create mode 100644 example/dummy/persistent_dummy.go diff --git a/client/grpc_client.go b/client/grpc_client.go index f7a802689..36589322a 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -265,10 +265,10 @@ func (cli *grpcClient) FlushSync() error { func (cli *grpcClient) InfoSync() (types.Result, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { reqres := cli.InfoAsync() if res := cli.checkErrGetResult(); res.IsErr() { - return res + return res, nil, nil, nil } resp := reqres.Response.GetInfo() - return types.NewResultOK([]byte(resp.Info), LOG), r.TmspInfo, r.LastBlock, r.Config + return types.NewResultOK([]byte(resp.Info), LOG), resp.TmspInfo, resp.LastBlock, resp.Config } func (cli *grpcClient) SetOptionSync(key string, value string) (res types.Result) { diff --git a/cmd/dummy/main.go b/cmd/dummy/main.go index 8efa69e6b..8a1465c49 100644 --- a/cmd/dummy/main.go +++ b/cmd/dummy/main.go @@ -6,16 +6,26 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/tmsp/example/dummy" "github.com/tendermint/tmsp/server" + "github.com/tendermint/tmsp/types" ) func main() { addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address") tmspPtr := flag.String("tmsp", "socket", "socket | grpc") + persistencePtr := flag.String("persist", "", "directory to use for a database") flag.Parse() + // Create the application - in memory or persisted to disk + var app types.Application + if *persistencePtr == "" { + app = dummy.NewDummyApplication() + } else { + app = dummy.NewPersistentDummyApplication(*persistencePtr) + } + // Start the listener - _, err := server.NewServer(*addrPtr, *tmspPtr, dummy.NewDummyApplication()) + _, err := server.NewServer(*addrPtr, *tmspPtr, app) if err != nil { Exit(err.Error()) } diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 5bf52a78a..0c6a90893 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -50,6 +50,7 @@ func (app *DummyApplication) Commit() types.Result { func (app *DummyApplication) Query(query []byte) types.Result { index, value, exists := app.state.Get(query) + resStr := Fmt("Index=%v value=%v exists=%v", index, string(value), exists) return types.NewResultOK([]byte(resStr), "") } diff --git a/example/dummy/log.go b/example/dummy/log.go new file mode 100644 index 000000000..8571fa01e --- /dev/null +++ b/example/dummy/log.go @@ -0,0 +1,7 @@ +package dummy + +import ( + "github.com/tendermint/go-logger" +) + +var log = logger.New("module", "dummy") diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go new file mode 100644 index 000000000..60e677e99 --- /dev/null +++ b/example/dummy/persistent_dummy.go @@ -0,0 +1,117 @@ +package dummy + +import ( + "bytes" + + . "github.com/tendermint/go-common" + dbm "github.com/tendermint/go-db" + "github.com/tendermint/go-merkle" + "github.com/tendermint/go-wire" + "github.com/tendermint/tmsp/types" +) + +//----------------------------------------- +// persist the last block info + +var lastBlockKey = []byte("lastblock") + +// Get the last block from the db +func LoadLastBlock(db dbm.DB) (lastBlock types.LastBlockInfo) { + buf := db.Get(lastBlockKey) + if len(buf) != 0 { + r, n, err := bytes.NewReader(buf), new(int), new(error) + 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)) + } + // TODO: ensure that buf is completely read. + } + + return lastBlock +} + +func SaveLastBlock(db dbm.DB, lastBlock types.LastBlockInfo) { + log.Notice("Saving block", "height", lastBlock.BlockHeight, "hash", lastBlock.BlockHash, "root", lastBlock.AppHash) + buf, n, err := new(bytes.Buffer), new(int), new(error) + wire.WriteBinary(lastBlock, buf, n, err) + if *err != nil { + // TODO + PanicCrisis(*err) + } + db.Set(lastBlockKey, buf.Bytes()) +} + +//----------------------------------------- + +type PersistentDummyApplication struct { + app *DummyApplication + db dbm.DB +} + +func NewPersistentDummyApplication(dbDir string) *PersistentDummyApplication { + db := dbm.NewDB("dummy", "leveldb", dbDir) + lastBlock := LoadLastBlock(db) + + stateTree := merkle.NewIAVLTree( + 0, + db, + ) + stateTree.Load(lastBlock.AppHash) + + log.Notice("Loaded state", "block", lastBlock.BlockHeight, "root", stateTree.Hash()) + + return &PersistentDummyApplication{ + app: &DummyApplication{state: stateTree}, + db: db, + } +} + +func (app *PersistentDummyApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { + s, _, _, _ := app.app.Info() + lastBlock := LoadLastBlock(app.db) + return s, nil, &lastBlock, nil +} + +func (app *PersistentDummyApplication) SetOption(key string, value string) (log string) { + return app.app.SetOption(key, value) +} + +// tx is either "key=value" or just arbitrary bytes +func (app *PersistentDummyApplication) AppendTx(tx []byte) types.Result { + return app.app.AppendTx(tx) +} + +func (app *PersistentDummyApplication) CheckTx(tx []byte) types.Result { + return app.app.CheckTx(tx) +} + +func (app *PersistentDummyApplication) Commit() types.Result { + // Save + hash := app.app.state.Save() + log.Info("Saved state", "root", hash) + return types.NewResultOK(hash, "") +} + +func (app *PersistentDummyApplication) Query(query []byte) types.Result { + return app.app.Query(query) +} + +func (app *PersistentDummyApplication) InitChain(validators []*types.Validator) { + return +} + +func (app *PersistentDummyApplication) BeginBlock(header *types.Header) { + // we commit the previous block state on BeginBlock because thats + // when we get the prev block hash and the app hash + lastBlock := types.LastBlockInfo{ + BlockHeight: header.Height - 1, + BlockHash: header.LastBlockHash, + AppHash: header.AppHash, + } + SaveLastBlock(app.db, lastBlock) +} + +func (app *PersistentDummyApplication) EndBlock(height uint64) (diffs []*types.Validator) { + return nil +} From ddb2b0163184704756299198758789eb654c77ca Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 9 Sep 2016 23:01:53 -0400 Subject: [PATCH 07/40] BeginBlock(hash, header) --- client/client.go | 4 +- client/grpc_client.go | 8 +- client/local_client.go | 10 +- client/socket_client.go | 8 +- example/dummy/persistent_dummy.go | 29 ++-- server/socket_server.go | 2 +- types/application.go | 4 +- types/messages.go | 4 +- types/types.pb.go | 229 ++++++++++++++++-------------- types/types.proto | 3 +- 10 files changed, 158 insertions(+), 143 deletions(-) diff --git a/client/client.go b/client/client.go index be1383e4b..d1954e3fe 100644 --- a/client/client.go +++ b/client/client.go @@ -33,11 +33,11 @@ type Client interface { CommitSync() (res types.Result) InitChainAsync(validators []*types.Validator) *ReqRes - BeginBlockAsync(header *types.Header) *ReqRes + BeginBlockAsync(hash []byte, header *types.Header) *ReqRes EndBlockAsync(height uint64) *ReqRes InitChainSync(validators []*types.Validator) (err error) - BeginBlockSync(header *types.Header) (err error) + BeginBlockSync(hash []byte, header *types.Header) (err error) EndBlockSync(height uint64) (changedValidators []*types.Validator, err error) } diff --git a/client/grpc_client.go b/client/grpc_client.go index 36589322a..1e0169738 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -200,8 +200,8 @@ func (cli *grpcClient) InitChainAsync(validators []*types.Validator) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_InitChain{res}}) } -func (cli *grpcClient) BeginBlockAsync(header *types.Header) *ReqRes { - req := types.ToRequestBeginBlock(header) +func (cli *grpcClient) BeginBlockAsync(hash []byte, header *types.Header) *ReqRes { + req := types.ToRequestBeginBlock(hash, header) res, err := cli.client.BeginBlock(context.Background(), req.GetBeginBlock(), grpc.FailFast(true)) if err != nil { cli.StopForError(err) @@ -321,8 +321,8 @@ func (cli *grpcClient) InitChainSync(validators []*types.Validator) (err error) return cli.Error() } -func (cli *grpcClient) BeginBlockSync(header *types.Header) (err error) { - cli.BeginBlockAsync(header) +func (cli *grpcClient) BeginBlockSync(hash []byte, header *types.Header) (err error) { + cli.BeginBlockAsync(hash, header) return cli.Error() } diff --git a/client/local_client.go b/client/local_client.go index 0ce735c80..e50763a8d 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -122,14 +122,14 @@ func (app *localClient) InitChainAsync(validators []*types.Validator) *ReqRes { return reqRes } -func (app *localClient) BeginBlockAsync(header *types.Header) *ReqRes { +func (app *localClient) BeginBlockAsync(hash []byte, header *types.Header) *ReqRes { app.mtx.Lock() if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.BeginBlock(header) + bcApp.BeginBlock(hash, header) } app.mtx.Unlock() return app.callback( - types.ToRequestBeginBlock(header), + types.ToRequestBeginBlock(hash, header), types.ToResponseBeginBlock(), ) } @@ -208,10 +208,10 @@ func (app *localClient) InitChainSync(validators []*types.Validator) (err error) return nil } -func (app *localClient) BeginBlockSync(header *types.Header) (err error) { +func (app *localClient) BeginBlockSync(hash []byte, header *types.Header) (err error) { app.mtx.Lock() if bcApp, ok := app.Application.(types.BlockchainAware); ok { - bcApp.BeginBlock(header) + bcApp.BeginBlock(hash, header) } app.mtx.Unlock() return nil diff --git a/client/socket_client.go b/client/socket_client.go index 18dc0b0e4..01a330366 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -263,8 +263,8 @@ func (cli *socketClient) InitChainAsync(validators []*types.Validator) *ReqRes { return cli.queueRequest(types.ToRequestInitChain(validators)) } -func (cli *socketClient) BeginBlockAsync(header *types.Header) *ReqRes { - return cli.queueRequest(types.ToRequestBeginBlock(header)) +func (cli *socketClient) BeginBlockAsync(hash []byte, header *types.Header) *ReqRes { + return cli.queueRequest(types.ToRequestBeginBlock(hash, header)) } func (cli *socketClient) EndBlockAsync(height uint64) *ReqRes { @@ -361,8 +361,8 @@ func (cli *socketClient) InitChainSync(validators []*types.Validator) (err error return nil } -func (cli *socketClient) BeginBlockSync(header *types.Header) (err error) { - cli.queueRequest(types.ToRequestBeginBlock(header)) +func (cli *socketClient) BeginBlockSync(hash []byte, header *types.Header) (err error) { + cli.queueRequest(types.ToRequestBeginBlock(hash, header)) cli.FlushSync() if err := cli.Error(); err != nil { return err diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 60e677e99..df46b8d14 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -47,6 +47,10 @@ func SaveLastBlock(db dbm.DB, lastBlock types.LastBlockInfo) { type PersistentDummyApplication struct { app *DummyApplication db dbm.DB + + // latest received + blockHash []byte + blockHeader *types.Header } func NewPersistentDummyApplication(dbDir string) *PersistentDummyApplication { @@ -88,9 +92,16 @@ func (app *PersistentDummyApplication) CheckTx(tx []byte) types.Result { func (app *PersistentDummyApplication) Commit() types.Result { // Save - hash := app.app.state.Save() - log.Info("Saved state", "root", hash) - return types.NewResultOK(hash, "") + appHash := app.app.state.Save() + log.Info("Saved state", "root", appHash) + + lastBlock := types.LastBlockInfo{ + BlockHeight: app.blockHeader.Height, + BlockHash: app.blockHash, + AppHash: appHash, // this hash will be in the next block header + } + SaveLastBlock(app.db, lastBlock) + return types.NewResultOK(appHash, "") } func (app *PersistentDummyApplication) Query(query []byte) types.Result { @@ -101,15 +112,9 @@ func (app *PersistentDummyApplication) InitChain(validators []*types.Validator) return } -func (app *PersistentDummyApplication) BeginBlock(header *types.Header) { - // we commit the previous block state on BeginBlock because thats - // when we get the prev block hash and the app hash - lastBlock := types.LastBlockInfo{ - BlockHeight: header.Height - 1, - BlockHash: header.LastBlockHash, - AppHash: header.AppHash, - } - SaveLastBlock(app.db, lastBlock) +func (app *PersistentDummyApplication) BeginBlock(hash []byte, header *types.Header) { + app.blockHash = hash + app.blockHeader = header } func (app *PersistentDummyApplication) EndBlock(height uint64) (diffs []*types.Validator) { diff --git a/server/socket_server.go b/server/socket_server.go index fb141aa9e..43b4ed638 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -192,7 +192,7 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types responses <- types.ToResponseInitChain() case *types.Request_BeginBlock: if app, ok := s.app.(types.BlockchainAware); ok { - app.BeginBlock(r.BeginBlock.Header) + app.BeginBlock(r.BeginBlock.Hash, r.BeginBlock.Header) } responses <- types.ToResponseBeginBlock() case *types.Request_EndBlock: diff --git a/types/application.go b/types/application.go index ba6565f54..0137f1e1a 100644 --- a/types/application.go +++ b/types/application.go @@ -34,7 +34,7 @@ type BlockchainAware interface { InitChain(validators []*Validator) // Signals the beginning of a block - BeginBlock(header *Header) + BeginBlock(hash []byte, header *Header) // Signals the end of a block // diffs: changed validators from app to TendermintCore @@ -96,7 +96,7 @@ func (app *GRPCApplication) InitChain(ctx context.Context, req *RequestInitChain func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlock) (*ResponseBeginBlock, error) { if chainAware, ok := app.app.(BlockchainAware); ok { - chainAware.BeginBlock(req.Header) + chainAware.BeginBlock(req.Hash, req.Header) } return &ResponseBeginBlock{}, nil } diff --git a/types/messages.go b/types/messages.go index 304289e47..16e4fbd2b 100644 --- a/types/messages.go +++ b/types/messages.go @@ -61,9 +61,9 @@ func ToRequestInitChain(validators []*Validator) *Request { } } -func ToRequestBeginBlock(header *Header) *Request { +func ToRequestBeginBlock(hash []byte, header *Header) *Request { return &Request{ - Value: &Request_BeginBlock{&RequestBeginBlock{header}}, + Value: &Request_BeginBlock{&RequestBeginBlock{hash, header}}, } } diff --git a/types/types.pb.go b/types/types.pb.go index d8251961b..3eafb4832 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -758,7 +758,8 @@ func (m *RequestInitChain) GetValidators() []*Validator { } type RequestBeginBlock struct { - Header *Header `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Header *Header `protobuf:"bytes,2,opt,name=header" json:"header,omitempty"` } func (m *RequestBeginBlock) Reset() { *m = RequestBeginBlock{} } @@ -766,6 +767,13 @@ func (m *RequestBeginBlock) String() string { return proto.CompactTex func (*RequestBeginBlock) ProtoMessage() {} func (*RequestBeginBlock) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } +func (m *RequestBeginBlock) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + func (m *RequestBeginBlock) GetHeader() *Header { if m != nil { return m.Header @@ -2117,113 +2125,114 @@ var _TMSPApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1721 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x5b, 0x73, 0xdb, 0xc6, - 0x15, 0x16, 0x25, 0xde, 0x70, 0x48, 0x51, 0xab, 0xa3, 0x1b, 0xcd, 0xb6, 0x33, 0x0e, 0xea, 0x24, - 0x52, 0xea, 0xb1, 0x3b, 0xf2, 0x24, 0x63, 0x27, 0x9d, 0xcc, 0x58, 0x8e, 0x62, 0x69, 0x52, 0xc7, - 0x2a, 0xec, 0xf8, 0xa1, 0x97, 0xe1, 0x40, 0xc4, 0x92, 0x44, 0x05, 0x02, 0x30, 0xb0, 0x70, 0x28, - 0xff, 0x83, 0xfc, 0x9b, 0xbe, 0xf4, 0xa5, 0xaf, 0x7d, 0xea, 0xfd, 0xf2, 0xda, 0x3f, 0xd3, 0x39, - 0xbb, 0x8b, 0xab, 0x40, 0x3f, 0xf9, 0x85, 0x83, 0x73, 0xdd, 0xdd, 0x73, 0xf9, 0xf6, 0x2c, 0x61, - 0x5b, 0x5c, 0x87, 0x3c, 0xbe, 0x2f, 0x7f, 0xef, 0x85, 0x51, 0x20, 0x02, 0x6c, 0x49, 0xc2, 0xfc, - 0x73, 0x13, 0x3a, 0x16, 0x7f, 0x9d, 0xf0, 0x58, 0xe0, 0x21, 0x34, 0xf9, 0x64, 0x1e, 0x0c, 0x1b, - 0xb7, 0x1b, 0x87, 0xbd, 0x63, 0xbc, 0xa7, 0xd4, 0xb5, 0xf4, 0x74, 0x32,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x54, 0x3b, - 0x9b, 0xd3, 0x22, 0x6a, 0x6e, 0xba, 0xf9, 0x78, 0x1f, 0xd5, 0x0d, 0xe8, 0xf8, 0x65, 0xa1, 0xbd, - 0x71, 0xd5, 0x13, 0x7e, 0xb4, 0x72, 0x54, 0xc7, 0x2f, 0x72, 0x00, 0xc0, 0x15, 0x0f, 0xf9, 0xd1, - 0xaa, 0x71, 0x1d, 0x1f, 0x66, 0x78, 0x81, 0xf5, 0xcf, 0xf9, 0xd1, 0x8a, 0x91, 0x9d, 0x62, 0xa3, - 0x26, 0x91, 0xba, 0x57, 0xfa, 0xa8, 0x76, 0x0a, 0xc7, 0x4f, 0x53, 0x40, 0xc2, 0xda, 0x7f, 0x02, - 0x46, 0xf5, 0xb3, 0x3e, 0x45, 0x28, 0x7f, 0x2b, 0xae, 0x7a, 0xe2, 0x8f, 0x56, 0x4e, 0xf1, 0xf8, - 0xb8, 0x88, 0x70, 0xb8, 0xf2, 0xa1, 0x3f, 0x5a, 0x3d, 0xcb, 0x53, 0x90, 0xf3, 0xc7, 0x62, 0xfd, - 0x73, 0x7f, 0xb4, 0x6a, 0x9c, 0xbf, 0x6c, 0xcb, 0xbf, 0x91, 0x1e, 0xfc, 0x3f, 0x00, 0x00, 0xff, - 0xff, 0x89, 0x5e, 0xff, 0xe3, 0x5b, 0x12, 0x00, 0x00, + // 1732 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x49, 0x73, 0x1b, 0xc7, + 0x15, 0x26, 0x40, 0xac, 0x0f, 0x20, 0xd8, 0x7c, 0xdc, 0x20, 0x24, 0xa9, 0x92, 0x27, 0xb2, 0x4d, + 0x3a, 0x2a, 0x29, 0x45, 0x95, 0x5d, 0x52, 0x9c, 0x72, 0x95, 0x28, 0xd3, 0x02, 0xcb, 0x91, 0xc4, + 0x8c, 0x64, 0x1d, 0xb2, 0x14, 0x6a, 0x88, 0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b8, 0xf6, 0xf1, + 0x3f, 0x5a, 0x3f, 0xcb, 0x53, 0x90, 0xb3, 0xc7, 0x62, 0xf5, 0x5f, 0x00, 0xa3, 0x75, 0xe3, 0xfc, + 0x65, 0x4b, 0xfe, 0xb5, 0xf4, 0xe0, 0xfb, 0x00, 0x00, 0x00, 0xff, 0xff, 0x70, 0x47, 0x17, 0xd1, + 0x6f, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index e2c7d9b4a..7b6a7915a 100644 --- a/types/types.proto +++ b/types/types.proto @@ -124,7 +124,8 @@ message RequestInitChain{ } message RequestBeginBlock{ - Header header = 1; + bytes hash = 1; + Header header = 2; } message RequestEndBlock{ From df299d03c4a3c151a4afa949e45d7e5f3e43d08e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 6 Nov 2016 02:02:08 +0000 Subject: [PATCH 08/40] block_height is int32 --- example/dummy/persistent_dummy.go | 64 +++++++++++++++---------------- types/types.proto | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index df46b8d14..cb2171f55 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -10,38 +10,6 @@ import ( "github.com/tendermint/tmsp/types" ) -//----------------------------------------- -// persist the last block info - -var lastBlockKey = []byte("lastblock") - -// Get the last block from the db -func LoadLastBlock(db dbm.DB) (lastBlock types.LastBlockInfo) { - buf := db.Get(lastBlockKey) - if len(buf) != 0 { - r, n, err := bytes.NewReader(buf), new(int), new(error) - 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)) - } - // TODO: ensure that buf is completely read. - } - - return lastBlock -} - -func SaveLastBlock(db dbm.DB, lastBlock types.LastBlockInfo) { - log.Notice("Saving block", "height", lastBlock.BlockHeight, "hash", lastBlock.BlockHash, "root", lastBlock.AppHash) - buf, n, err := new(bytes.Buffer), new(int), new(error) - wire.WriteBinary(lastBlock, buf, n, err) - if *err != nil { - // TODO - PanicCrisis(*err) - } - db.Set(lastBlockKey, buf.Bytes()) -} - //----------------------------------------- type PersistentDummyApplication struct { @@ -120,3 +88,35 @@ func (app *PersistentDummyApplication) BeginBlock(hash []byte, header *types.Hea func (app *PersistentDummyApplication) EndBlock(height uint64) (diffs []*types.Validator) { return nil } + +//----------------------------------------- +// persist the last block info + +var lastBlockKey = []byte("lastblock") + +// Get the last block from the db +func LoadLastBlock(db dbm.DB) (lastBlock types.LastBlockInfo) { + buf := db.Get(lastBlockKey) + if len(buf) != 0 { + r, n, err := bytes.NewReader(buf), new(int), new(error) + 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)) + } + // TODO: ensure that buf is completely read. + } + + return lastBlock +} + +func SaveLastBlock(db dbm.DB, lastBlock types.LastBlockInfo) { + log.Notice("Saving block", "height", lastBlock.BlockHeight, "hash", lastBlock.BlockHash, "root", lastBlock.AppHash) + buf, n, err := new(bytes.Buffer), new(int), new(error) + wire.WriteBinary(lastBlock, buf, n, err) + if *err != nil { + // TODO + PanicCrisis(*err) + } + db.Set(lastBlockKey, buf.Bytes()) +} diff --git a/types/types.proto b/types/types.proto index 7b6a7915a..6633d4e3c 100644 --- a/types/types.proto +++ b/types/types.proto @@ -219,7 +219,7 @@ message TMSPInfo { } message LastBlockInfo { - uint64 block_height = 1; + int32 block_height = 1; bytes block_hash = 2; bytes app_hash = 3; } From 60e0842ef9a87c840d0bf95eea7b54a1e3d312b3 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 16 Nov 2016 16:11:36 -0500 Subject: [PATCH 09/40] Header.LastBlockID --- types/types.pb.go | 287 ++++++++++++++++++++++++---------------------- types/types.proto | 18 +-- 2 files changed, 164 insertions(+), 141 deletions(-) diff --git a/types/types.pb.go b/types/types.pb.go index 3eafb4832..0b3248a35 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -38,6 +38,7 @@ It has these top-level messages: LastBlockInfo ConfigInfo Header + BlockID PartSetHeader Validator */ @@ -1501,7 +1502,7 @@ func (m *TMSPInfo) GetVersion() string { } type LastBlockInfo struct { - BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight" json:"block_height,omitempty"` + BlockHeight int32 `protobuf:"varint,1,opt,name=block_height,json=blockHeight" json:"block_height,omitempty"` BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` } @@ -1511,7 +1512,7 @@ func (m *LastBlockInfo) String() string { return proto.CompactTextStr func (*LastBlockInfo) ProtoMessage() {} func (*LastBlockInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } -func (m *LastBlockInfo) GetBlockHeight() uint64 { +func (m *LastBlockInfo) GetBlockHeight() int32 { if m != nil { return m.BlockHeight } @@ -1549,16 +1550,15 @@ func (m *ConfigInfo) GetMaxBlockSize() uint64 { } type Header struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` - Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` - Time uint64 `protobuf:"varint,3,opt,name=time" json:"time,omitempty"` - NumTxs uint64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs" json:"num_txs,omitempty"` - LastBlockHash []byte `protobuf:"bytes,5,opt,name=last_block_hash,json=lastBlockHash,proto3" json:"last_block_hash,omitempty"` - LastBlockParts *PartSetHeader `protobuf:"bytes,6,opt,name=last_block_parts,json=lastBlockParts" json:"last_block_parts,omitempty"` - LastCommitHash []byte `protobuf:"bytes,7,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` - DataHash []byte `protobuf:"bytes,8,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` - ValidatorsHash []byte `protobuf:"bytes,9,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` - AppHash []byte `protobuf:"bytes,10,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` + Height int32 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` + Time uint64 `protobuf:"varint,3,opt,name=time" json:"time,omitempty"` + NumTxs uint64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs" json:"num_txs,omitempty"` + LastBlockId *BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId" json:"last_block_id,omitempty"` + LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` + DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` + ValidatorsHash []byte `protobuf:"bytes,8,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` + AppHash []byte `protobuf:"bytes,9,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` } func (m *Header) Reset() { *m = Header{} } @@ -1573,7 +1573,7 @@ func (m *Header) GetChainId() string { return "" } -func (m *Header) GetHeight() uint64 { +func (m *Header) GetHeight() int32 { if m != nil { return m.Height } @@ -1594,16 +1594,9 @@ func (m *Header) GetNumTxs() uint64 { return 0 } -func (m *Header) GetLastBlockHash() []byte { +func (m *Header) GetLastBlockId() *BlockID { if m != nil { - return m.LastBlockHash - } - return nil -} - -func (m *Header) GetLastBlockParts() *PartSetHeader { - if m != nil { - return m.LastBlockParts + return m.LastBlockId } return nil } @@ -1636,6 +1629,30 @@ func (m *Header) GetAppHash() []byte { return nil } +type BlockID struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Parts *PartSetHeader `protobuf:"bytes,2,opt,name=parts" json:"parts,omitempty"` +} + +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{29} } + +func (m *BlockID) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *BlockID) GetParts() *PartSetHeader { + if m != nil { + return m.Parts + } + return nil +} + type PartSetHeader struct { Total uint64 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` @@ -1644,7 +1661,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{30} } func (m *PartSetHeader) GetTotal() uint64 { if m != nil { @@ -1668,7 +1685,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{31} } func (m *Validator) GetPubKey() []byte { if m != nil { @@ -1714,6 +1731,7 @@ func init() { proto.RegisterType((*LastBlockInfo)(nil), "types.LastBlockInfo") proto.RegisterType((*ConfigInfo)(nil), "types.ConfigInfo") proto.RegisterType((*Header)(nil), "types.Header") + proto.RegisterType((*BlockID)(nil), "types.BlockID") proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") proto.RegisterType((*Validator)(nil), "types.Validator") proto.RegisterEnum("types.MessageType", MessageType_name, MessageType_value) @@ -2125,114 +2143,115 @@ var _TMSPApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1732 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x49, 0x73, 0x1b, 0xc7, - 0x15, 0x26, 0x40, 0xac, 0x0f, 0x20, 0xd8, 0x7c, 0xdc, 0x20, 0x24, 0xa9, 0x92, 0x27, 0xb2, 0x4d, - 0x3a, 0x2a, 0x29, 0x45, 0x95, 0x5d, 0x52, 0x9c, 0x72, 0x95, 0x28, 0xd3, 0x02, 0xcb, 0x91, 0xc4, - 0x8c, 0x64, 0x1d, 0xb2, 0x14, 0x6a, 0x88, 0x69, 0x00, 0x13, 0x0e, 0x66, 0x46, 0x33, 0x3d, 0x32, - 0xa8, 0x7f, 0xe0, 0x7f, 0x93, 0x4b, 0x2e, 0xb9, 0xe6, 0x94, 0x7d, 0xb9, 0xe6, 0xcf, 0xb8, 0x5e, - 0x77, 0xcf, 0xca, 0x81, 0x4f, 0xba, 0xa0, 0xe6, 0xad, 0xdd, 0xfd, 0x96, 0xaf, 0x5f, 0x03, 0x76, - 0xc4, 0x75, 0xc0, 0xa3, 0xfb, 0xf2, 0xf7, 0x5e, 0x10, 0xfa, 0xc2, 0xc7, 0xa6, 0x24, 0x8c, 0xbf, - 0x34, 0xa0, 0x6d, 0xf2, 0x37, 0x31, 0x8f, 0x04, 0x1e, 0x41, 0x83, 0x4f, 0x17, 0xfe, 0xb0, 0x76, - 0xbb, 0x76, 0xd4, 0x3b, 0xc1, 0x7b, 0x4a, 0x5d, 0x4b, 0xcf, 0xa6, 0x0b, 0x7f, 0xbc, 0x61, 0x4a, - 0x0d, 0xfc, 0x19, 0x34, 0x67, 0x6e, 0x1c, 0x2d, 0x86, 0x75, 0xa9, 0xba, 0x5b, 0x54, 0xfd, 0x8a, - 0x44, 0xe3, 0x0d, 0x53, 0xe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- 0xec, 0xe1, 0x01, 0x59, 0x3a, 0xf3, 0x85, 0x90, 0xfe, 0x1a, 0xa6, 0xa6, 0x8c, 0xef, 0x9a, 0xd0, - 0x31, 0x79, 0x14, 0xf8, 0x5e, 0xc4, 0xf1, 0x21, 0x74, 0xf9, 0x6a, 0xca, 0x55, 0x17, 0xd6, 0x4a, - 0x85, 0xa4, 0x74, 0xce, 0x12, 0x39, 0x15, 0x61, 0xaa, 0x8c, 0xc7, 0x1a, 0x41, 0xca, 0xb0, 0xa0, - 0x8d, 0xf2, 0x10, 0x72, 0x37, 0x81, 0x90, 0xcd, 0x52, 0x17, 0x29, 0xdd, 0x12, 0x86, 0x1c, 0x6b, - 0x0c, 0x69, 0x54, 0x3a, 0x2e, 0x80, 0xc8, 0xa3, 0x02, 0x88, 0x34, 0x2b, 0xb7, 0xbf, 0x06, 0x45, - 0x3e, 0xcb, 0xa3, 0x48, 0xab, 0xd4, 0x7c, 0xca, 0xb2, 0x12, 0x46, 0x1e, 0xe4, 0x60, 0xa4, 0x5d, - 0xea, 0x1e, 0x65, 0x56, 0x81, 0x23, 0xf7, 0x53, 0x1c, 0xe9, 0x94, 0x90, 0x47, 0x9b, 0x94, 0x81, - 0xe4, 0x6e, 0x52, 0x8b, 0xdd, 0xca, 0x88, 0x95, 0x90, 0xe4, 0x51, 0x01, 0x49, 0xa0, 0x32, 0x0c, - 0x6b, 0xa0, 0xe4, 0x97, 0x45, 0x28, 0x51, 0x78, 0x70, 0xab, 0x64, 0xbb, 0x16, 0x4b, 0x3e, 0xcb, - 0x63, 0x49, 0xbf, 0x32, 0x88, 0x3f, 0x0c, 0x26, 0xc7, 0xd4, 0x06, 0xa5, 0x32, 0xa3, 0x46, 0xe4, - 0x61, 0xe8, 0x87, 0x1a, 0x07, 0x14, 0x61, 0x1c, 0x51, 0xbb, 0x66, 0xc5, 0xf5, 0x03, 0xc0, 0x23, - 0x5b, 0x36, 0x57, 0x5a, 0xc6, 0x1f, 0x6b, 0x99, 0x2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0x6a, 0xa1, 0xb6, 0x5c, 0x48, 0x6a, 0x6a, 0x3c, 0xa7, 0x95, - 0x7e, 0x04, 0x5d, 0xaa, 0x22, 0xa5, 0xd2, 0x91, 0x2a, 0x1d, 0x62, 0x48, 0xe1, 0xc7, 0xb0, 0x9d, - 0xcd, 0x04, 0x4a, 0xa5, 0xab, 0xbc, 0x64, 0xec, 0x1b, 0x19, 0x81, 0x62, 0x46, 0x1e, 0xc1, 0x56, - 0x61, 0xaf, 0x04, 0x9f, 0xc2, 0x17, 0x96, 0xab, 0x73, 0xa1, 0x88, 0x74, 0xb6, 0xa8, 0x67, 0xb3, - 0x85, 0xf1, 0x08, 0xba, 0x69, 0xd1, 0x51, 0xfc, 0x83, 0xf8, 0xf2, 0x6b, 0x9e, 0xcc, 0x3f, 0x9a, - 0x22, 0x77, 0x81, 0xff, 0xad, 0x9e, 0x3f, 0x1a, 0xa6, 0x22, 0x3e, 0xf9, 0x73, 0x0d, 0x7a, 0xcf, - 0x14, 0xde, 0x52, 0xfb, 0xe0, 0x36, 0xf4, 0x9e, 0xc7, 0xae, 0xab, 0x59, 0x6c, 0x03, 0x3b, 0xd0, - 0x20, 0x98, 0x66, 0x35, 0xec, 0x42, 0x53, 0xc2, 0x30, 0xab, 0x13, 0x93, 0xea, 0x86, 0x6d, 0xe2, - 0x16, 0x74, 0x53, 0x5c, 0x63, 0x0d, 0x22, 0x53, 0xfc, 0x67, 0x4d, 0xec, 0x43, 0x27, 0x81, 0x33, - 0xb6, 0x83, 0x3d, 0x68, 0x6b, 0xf4, 0x61, 0x88, 0x00, 0x2d, 0x15, 0x5d, 0xb6, 0x4b, 0x9e, 0x25, - 0x70, 0xb0, 0x3d, 0x72, 0x90, 0xb6, 0x22, 0xdb, 0xc7, 0x01, 0x40, 0xd6, 0x84, 0xec, 0x80, 0x1c, - 0x26, 0xed, 0xc7, 0x0e, 0x3f, 0xf9, 0x53, 0x13, 0x3a, 0x49, 0xe3, 0x63, 0x0b, 0xea, 0x2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, 0x45, 0xae, 0xbd, 0x71, 0xdd, 0xb3, 0x7e, 0xb4, 0x76, - 0x54, 0xc7, 0xcf, 0x33, 0x00, 0xc0, 0x35, 0x8f, 0xfb, 0xd1, 0xba, 0x71, 0x1d, 0x1f, 0xa6, 0x78, - 0x81, 0xd5, 0x4f, 0xfc, 0xd1, 0x9a, 0x91, 0x9d, 0x62, 0xa3, 0x26, 0x91, 0xaa, 0x97, 0xfb, 0xa8, - 0x72, 0x0a, 0xc7, 0x4f, 0x13, 0x40, 0xc2, 0xca, 0x7f, 0x07, 0x46, 0xd5, 0xb3, 0x3e, 0x45, 0x28, - 0x7b, 0x3f, 0xae, 0x7b, 0xf6, 0x8f, 0xd6, 0x4e, 0xf1, 0xf8, 0x38, 0x8f, 0x70, 0xb8, 0xf6, 0xf1, - 0x3f, 0x5a, 0x3f, 0xcb, 0x53, 0x90, 0xb3, 0xc7, 0x62, 0xf5, 0x5f, 0x00, 0xa3, 0x75, 0xe3, 0xfc, - 0x65, 0x4b, 0xfe, 0xb5, 0xf4, 0xe0, 0xfb, 0x00, 0x00, 0x00, 0xff, 0xff, 0x70, 0x47, 0x17, 0xd1, - 0x6f, 0x12, 0x00, 0x00, + // 1746 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x49, 0x73, 0xdb, 0xc8, + 0x15, 0x16, 0x29, 0x6e, 0x78, 0xa4, 0xa8, 0xd6, 0xd3, 0x46, 0x33, 0x49, 0x95, 0x07, 0xf1, 0x64, + 0x24, 0xc7, 0x65, 0xa7, 0xe4, 0x9a, 0x29, 0x3b, 0x93, 0x4a, 0x95, 0x65, 0x6b, 0x2c, 0xd5, 0xc4, + 0xb6, 0x02, 0x7b, 0x7c, 0xc8, 0x52, 0x2c, 0x88, 0x68, 0x92, 0x88, 0x40, 0x00, 0x06, 0x1a, 0x1a, + 0xca, 0xff, 0x60, 0x7e, 0x49, 0xae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x2c, 0x23, 0x1c, 0xae, 0xfc, 0x4f, 0x60, 0xb8, + 0x7a, 0xc4, 0xa7, 0x20, 0xe7, 0x6f, 0xc8, 0xea, 0x7f, 0x06, 0x86, 0xab, 0xa6, 0xfc, 0x8b, 0x96, + 0xfc, 0xc7, 0xe9, 0xe1, 0xf7, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x0f, 0x72, 0x7a, 0x86, 0x12, + 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 6633d4e3c..db25fbba3 100644 --- a/types/types.proto +++ b/types/types.proto @@ -233,15 +233,19 @@ message ConfigInfo { message Header { string chain_id = 1; - uint64 height = 2; + int32 height = 2; uint64 time = 3; uint64 num_txs = 4; - bytes last_block_hash = 5; - PartSetHeader last_block_parts = 6; - bytes last_commit_hash = 7; - bytes data_hash = 8; - bytes validators_hash = 9; - bytes app_hash = 10; + 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 { From 0bdb3b887e70b1ef16d32eece0248ec071fd8490 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 16 Nov 2016 16:22:52 -0500 Subject: [PATCH 10/40] fix chain_aware app --- example/chain_aware/chain_aware_app.go | 6 +++--- example/chain_aware/chain_aware_test.go | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index df18891b5..aec7fe1b2 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -36,8 +36,8 @@ func NewChainAwareApplication() *ChainAwareApplication { return &ChainAwareApplication{} } -func (app *ChainAwareApplication) Info() string { - return "nil" +func (app *ChainAwareApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { + return "nil", nil, nil, nil } func (app *ChainAwareApplication) SetOption(key string, value string) (log string) { @@ -60,7 +60,7 @@ func (app *ChainAwareApplication) Query(query []byte) types.Result { return types.NewResultOK([]byte(Fmt("%d,%d", app.beginCount, app.endCount)), "") } -func (app *ChainAwareApplication) BeginBlock(height uint64) { +func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) { app.beginCount += 1 return } diff --git a/example/chain_aware/chain_aware_test.go b/example/chain_aware/chain_aware_test.go index 21eb1b3f9..bad7c8120 100644 --- a/example/chain_aware/chain_aware_test.go +++ b/example/chain_aware/chain_aware_test.go @@ -8,6 +8,7 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/tmsp/client" "github.com/tendermint/tmsp/server" + "github.com/tendermint/tmsp/types" ) func TestChainAware(t *testing.T) { @@ -29,8 +30,10 @@ func TestChainAware(t *testing.T) { defer client.Stop() n := uint64(5) + hash := []byte("fake block hash") + header := &types.Header{} for i := uint64(0); i < n; i++ { - client.BeginBlockSync(i) + client.BeginBlockSync(hash, header) client.EndBlockSync(i) client.CommitSync() } From 9a2d3e51ede632cd1aeafb9835e6050a5a946ebe Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 22 Nov 2016 13:59:27 -0500 Subject: [PATCH 11/40] heights are uint64 --- types/types.pb.go | 115 +++++++++++++++++++++++----------------------- types/types.proto | 4 +- 2 files changed, 59 insertions(+), 60 deletions(-) diff --git a/types/types.pb.go b/types/types.pb.go index 0b3248a35..7204767eb 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -1502,7 +1502,7 @@ func (m *TMSPInfo) GetVersion() string { } type LastBlockInfo struct { - BlockHeight int32 `protobuf:"varint,1,opt,name=block_height,json=blockHeight" json:"block_height,omitempty"` + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight" json:"block_height,omitempty"` BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` } @@ -1512,7 +1512,7 @@ func (m *LastBlockInfo) String() string { return proto.CompactTextStr func (*LastBlockInfo) ProtoMessage() {} func (*LastBlockInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } -func (m *LastBlockInfo) GetBlockHeight() int32 { +func (m *LastBlockInfo) GetBlockHeight() uint64 { if m != nil { return m.BlockHeight } @@ -1551,7 +1551,7 @@ func (m *ConfigInfo) GetMaxBlockSize() uint64 { type Header struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` - Height int32 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` Time uint64 `protobuf:"varint,3,opt,name=time" json:"time,omitempty"` NumTxs uint64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs" json:"num_txs,omitempty"` LastBlockId *BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId" json:"last_block_id,omitempty"` @@ -1573,7 +1573,7 @@ func (m *Header) GetChainId() string { return "" } -func (m *Header) GetHeight() int32 { +func (m *Header) GetHeight() uint64 { if m != nil { return m.Height } @@ -2143,7 +2143,7 @@ var _TMSPApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1746 bytes of a gzipped FileDescriptorProto + // 1743 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x49, 0x73, 0xdb, 0xc8, 0x15, 0x16, 0x29, 0x6e, 0x78, 0xa4, 0xa8, 0xd6, 0xd3, 0x46, 0x33, 0x49, 0x95, 0x07, 0xf1, 0x64, 0x24, 0xc7, 0x65, 0xa7, 0xe4, 0x9a, 0x29, 0x3b, 0x93, 0x4a, 0x95, 0x65, 0x6b, 0x2c, 0xd5, 0xc4, @@ -2201,57 +2201,56 @@ var fileD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x26, 0x79, 0x8a, 0x8d, 0x1a, 0x50, 0xaa, 0x1e, 0xf4, 0xc3, 0xca, 0xe1, 0x1c, 0x3f, 0x4f, 0x01, + 0x09, 0x2b, 0xff, 0x34, 0x18, 0x56, 0x3f, 0x01, 0x28, 0x42, 0xf9, 0xb3, 0x72, 0xd5, 0xbf, 0x01, + 0xc3, 0x95, 0xc3, 0x3d, 0x3e, 0x59, 0x46, 0x38, 0x5c, 0xf9, 0x9f, 0xc0, 0x70, 0xf5, 0x88, 0x4f, + 0x41, 0xce, 0xdf, 0x90, 0xd5, 0xff, 0x0c, 0x0c, 0x57, 0x4d, 0xf9, 0x17, 0x2d, 0xf9, 0x8f, 0xd3, + 0xc3, 0xef, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa2, 0x81, 0xd5, 0x01, 0x86, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index db25fbba3..3e9ebfe59 100644 --- a/types/types.proto +++ b/types/types.proto @@ -219,7 +219,7 @@ message TMSPInfo { } message LastBlockInfo { - int32 block_height = 1; + uint64 block_height = 1; bytes block_hash = 2; bytes app_hash = 3; } @@ -233,7 +233,7 @@ message ConfigInfo { message Header { string chain_id = 1; - int32 height = 2; + uint64 height = 2; uint64 time = 3; uint64 num_txs = 4; BlockID last_block_id = 5; From b200b82418ead1effd488e80bba19532bebce2ac Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 21 Nov 2016 23:42:42 -0500 Subject: [PATCH 12/40] dummy: valset changes and tests --- example/counter/counter.go | 15 +-- example/dummy/README.md | 31 +++++ example/dummy/dummy.go | 11 +- example/dummy/dummy_test.go | 203 ++++++++++++++++++++++++++++++ example/dummy/persistent_dummy.go | 110 +++++++++++++++- types/validators.go | 24 ++++ 6 files changed, 378 insertions(+), 16 deletions(-) create mode 100644 example/dummy/README.md create mode 100644 example/dummy/dummy_test.go create mode 100644 types/validators.go diff --git a/example/counter/counter.go b/example/counter/counter.go index 2596eb107..230556e18 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -2,7 +2,6 @@ package counter import ( "encoding/binary" - "fmt" . "github.com/tendermint/go-common" "github.com/tendermint/tmsp/types" @@ -35,11 +34,7 @@ func (app *CounterApplication) AppendTx(tx []byte) types.Result { copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue != uint64(app.txCount) { - return types.Result{ - Code: types.CodeType_BadNonce, - Data: nil, - Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue), - } + return types.ErrBadNonce.SetLog(Fmt("Invalid nonce. Expected %v, got %v", app.txCount, txValue)) } } app.txCount += 1 @@ -52,11 +47,7 @@ func (app *CounterApplication) CheckTx(tx []byte) types.Result { copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) if txValue < uint64(app.txCount) { - return types.Result{ - Code: types.CodeType_BadNonce, - Data: nil, - Log: fmt.Sprintf("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue), - } + return types.ErrBadNonce.SetLog(Fmt("Invalid nonce. Expected >= %v, got %v", app.txCount, txValue)) } } return types.OK @@ -75,5 +66,5 @@ func (app *CounterApplication) Commit() types.Result { } func (app *CounterApplication) Query(query []byte) types.Result { - return types.NewResultOK(nil, fmt.Sprintf("Query is not supported")) + return types.NewResultOK(nil, Fmt("Query is not supported")) } diff --git a/example/dummy/README.md b/example/dummy/README.md new file mode 100644 index 000000000..19f82fda6 --- /dev/null +++ b/example/dummy/README.md @@ -0,0 +1,31 @@ +# Dummy + +There are two app's here: the DummyApplication and the PersistentDummyApplication. + +## DummyApplication + +The DummyApplication is a simple merkle key-value store. +Transactions of the form `key=value` are stored as key-value pairs in the tree. +Transactions without an `=` sign set the value to the key. +The app has no replay protection (other than what the mempool provides). + +## PersistentDummyApplication + +The PersistentDummyApplication wraps the DummyApplication +and provides two additional features: + +1) persistence of state across app restarts (using Tendermint's TMSP-Handshake mechanism) +2) validator set changes + +The state is persisted in leveldb along with the last block committed, +and the Handshake allows any necessary blocks to be replayed. +Validator set changes are effected using the following transaction format: + +``` +val:pubkey1/power1,addr2/power2,addr3/power3" +``` + +where `power1` is the new voting power for the validator with `pubkey1` (possibly a new one). +There is no sybil protection against new validators joining. +Validators can be removed by setting their power to `0`. + diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 0c6a90893..9bed40895 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -5,6 +5,7 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-merkle" + "github.com/tendermint/go-wire" "github.com/tendermint/tmsp/types" ) @@ -51,6 +52,12 @@ func (app *DummyApplication) Commit() types.Result { func (app *DummyApplication) Query(query []byte) types.Result { index, value, exists := app.state.Get(query) - resStr := Fmt("Index=%v value=%v exists=%v", index, string(value), exists) - return types.NewResultOK([]byte(resStr), "") + queryResult := QueryResult{index, string(value), exists} + return types.NewResultOK(wire.JSONBytes(queryResult), "") +} + +type QueryResult struct { + Index int `json:"index"` + Value string `json:"value"` + Exists bool `json:"exists"` } diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go new file mode 100644 index 000000000..e284f1258 --- /dev/null +++ b/example/dummy/dummy_test.go @@ -0,0 +1,203 @@ +package dummy + +import ( + "bytes" + "io/ioutil" + "sort" + "testing" + + . "github.com/tendermint/go-common" + "github.com/tendermint/go-crypto" + "github.com/tendermint/go-wire" + "github.com/tendermint/tmsp/types" +) + +func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value string) { + if r := dummy.AppendTx(tx); r.IsErr() { + t.Fatal(r) + } + if r := dummy.AppendTx(tx); r.IsErr() { + t.Fatal(r) + } + + r := dummy.Query([]byte(key)) + if r.IsErr() { + t.Fatal(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) + } + +} + +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", "tmsp-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", "tmsp-dummy-test") // TODO + if err != nil { + t.Fatal(err) + } + dummy := NewPersistentDummyApplication(dir) + height := uint64(0) + + _, _, lastBlockInfo, _ := dummy.Info() + if lastBlockInfo.BlockHeight != height { + t.Fatalf("expected height of %d, got %d", height, lastBlockInfo.BlockHeight) + } + + // 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() + + _, _, lastBlockInfo, _ = dummy.Info() + if lastBlockInfo.BlockHeight != height { + t.Fatalf("expected height of %d, got %d", height, lastBlockInfo.BlockHeight) + } + +} + +// add a validator, remove a validator, update a validator +func TestValSetChanges(t *testing.T) { + dir, err := ioutil.TempDir("/tmp", "tmsp-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.AppendTx(tx); r.IsErr() { + t.Fatal(r) + } + } + diff2 := dummyChain.EndBlock(height) + dummy.Commit() + + valsEqual(t, diff, diff2) + +} + +// 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) + } + } +} diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index cb2171f55..7fdb0a248 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -2,6 +2,9 @@ package dummy import ( "bytes" + "encoding/hex" + "strconv" + "strings" . "github.com/tendermint/go-common" dbm "github.com/tendermint/go-db" @@ -10,6 +13,10 @@ import ( "github.com/tendermint/tmsp/types" ) +const ( + ValidatorSetChangePrefix string = "val:" +) + //----------------------------------------- type PersistentDummyApplication struct { @@ -17,8 +24,12 @@ type PersistentDummyApplication struct { db dbm.DB // latest received + // TODO: move to merkle tree? blockHash []byte blockHeader *types.Header + + // validator set + changes []*types.Validator } func NewPersistentDummyApplication(dbDir string) *PersistentDummyApplication { @@ -51,6 +62,15 @@ func (app *PersistentDummyApplication) SetOption(key string, value string) (log // tx is either "key=value" or just arbitrary bytes func (app *PersistentDummyApplication) AppendTx(tx []byte) types.Result { + // if it starts with "val:", update the validator set + // format is "val:pubkey/power" + if isValidatorTx(tx) { + // update validators in the merkle tree + // and in app.changes + return app.execValidatorTx(tx) + } + + // otherwise, update the key-value store return app.app.AppendTx(tx) } @@ -76,17 +96,29 @@ func (app *PersistentDummyApplication) Query(query []byte) types.Result { return app.app.Query(query) } +// Save the validators in the merkle tree func (app *PersistentDummyApplication) InitChain(validators []*types.Validator) { - return + for _, v := range validators { + r := app.updateValidator(v) + if r.IsErr() { + log.Error("Error updating validators", "r", r) + } + } } +// Track the block hash and header information func (app *PersistentDummyApplication) BeginBlock(hash []byte, header *types.Header) { + // update latest block info app.blockHash = hash app.blockHeader = header + + // reset valset changes + app.changes = make([]*types.Validator, 0) } +// Update the validator set func (app *PersistentDummyApplication) EndBlock(height uint64) (diffs []*types.Validator) { - return nil + return app.changes } //----------------------------------------- @@ -120,3 +152,77 @@ func SaveLastBlock(db dbm.DB, lastBlock types.LastBlockInfo) { } db.Set(lastBlockKey, buf.Bytes()) } + +//--------------------------------------------- +// update validators + +func (app *PersistentDummyApplication) Validators() (validators []*types.Validator) { + app.app.state.Iterate(func(key, value []byte) bool { + if isValidatorTx(key) { + validator := new(types.Validator) + err := types.ReadMessage(bytes.NewBuffer(value), validator) + if err != nil { + panic(err) + } + validators = append(validators, validator) + } + return false + }) + return +} + +func MakeValSetChangeTx(pubkey []byte, power uint64) []byte { + return []byte(Fmt("val:%X/%d", pubkey, power)) +} + +func isValidatorTx(tx []byte) bool { + if strings.HasPrefix(string(tx), ValidatorSetChangePrefix) { + return true + } + return false +} + +// format is "val:pubkey1/power1,addr2/power2,addr3/power3"tx +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)) + } + 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)) + } + power, err := strconv.Atoi(powerS) + if err != nil { + return types.ErrEncodingError.SetLog(Fmt("Power (%s) is not an int", powerS)) + } + + // update + return app.updateValidator(&types.Validator{pubkey, uint64(power)}) +} + +// add, update, or remove a validator +func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types.Result { + key := []byte("val:" + string(v.PubKey)) + if v.Power == 0 { + // remove validator + if !app.app.state.Has(key) { + return types.ErrUnauthorized.SetLog(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)) + } + app.app.state.Set(key, value.Bytes()) + } + + // we only update the changes array if we succesfully updated the tree + app.changes = append(app.changes, v) + + return types.OK +} diff --git a/types/validators.go b/types/validators.go new file mode 100644 index 000000000..6494394ee --- /dev/null +++ b/types/validators.go @@ -0,0 +1,24 @@ +package types + +import ( + "bytes" +) + +// validators implements sort + +type Validators []*Validator + +func (v Validators) Len() int { + return len(v) +} + +// XXX: doesn't distinguish same validator with different power +func (v Validators) Less(i, j int) bool { + return bytes.Compare(v[i].PubKey, v[j].PubKey) <= 0 +} + +func (v Validators) Swap(i, j int) { + v1 := v[i] + v[i] = v[j] + v[j] = v1 +} From dc13ec05a1500651d6156d10f29a34099a41f5e2 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 22 Nov 2016 20:44:41 -0500 Subject: [PATCH 13/40] NewIAVLTree takes waldir --- example/dummy/dummy.go | 5 +---- example/dummy/persistent_dummy.go | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 9bed40895..80c1ad9d0 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -14,10 +14,7 @@ type DummyApplication struct { } func NewDummyApplication() *DummyApplication { - state := merkle.NewIAVLTree( - 0, - nil, - ) + state := merkle.NewIAVLTree(0, ".", nil) return &DummyApplication{state: state} } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 7fdb0a248..230e537a8 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -36,10 +36,7 @@ func NewPersistentDummyApplication(dbDir string) *PersistentDummyApplication { db := dbm.NewDB("dummy", "leveldb", dbDir) lastBlock := LoadLastBlock(db) - stateTree := merkle.NewIAVLTree( - 0, - db, - ) + stateTree := merkle.NewIAVLTree(0, ".", db) stateTree.Load(lastBlock.AppHash) log.Notice("Loaded state", "block", lastBlock.BlockHeight, "root", stateTree.Hash()) From ef3eb4a30e09713f87d041fa6110f4e1cc0a74a3 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 22 Nov 2016 21:06:39 -0500 Subject: [PATCH 14/40] update glide --- glide.lock | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/glide.lock b/glide.lock index 9171ff8d7..e82a60d46 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ hash: 603c43870dfc63a3113a3d13ae799038206bd77889e2e9596a860d3644b8fb67 -updated: 2016-11-15T14:46:00.011667442-05:00 +updated: 2016-11-22T20:57:55.984772241-05:00 imports: - name: github.com/btcsuite/btcd - version: d9a674e1b7bc09d0830d6986c71cf5f535d753c3 + version: afec1bd1245a4a19e6dfe1306974b733e7cbb9b8 subpackages: - btcec - name: github.com/btcsuite/fastsha256 @@ -10,7 +10,7 @@ imports: - name: github.com/go-stack/stack version: 100eb0c0a9c5b306ca2fb4f165df21d80ada4b82 - name: github.com/golang/protobuf - version: da116c3771bf4a398a43f44e069195ef1c9688ef + version: 8ee79997227bf9b34611aee7946ae64735e6fd93 subpackages: - proto - name: github.com/golang/snappy @@ -39,8 +39,10 @@ imports: subpackages: - edwards25519 - extra25519 +- name: github.com/tendermint/go-autofile + version: 63186e34b33d78ae47fb0d25e5717b307fdf3603 - name: github.com/tendermint/go-common - version: fa3daa7abc253264c916c12fecce3effa01a1287 + version: 6b4160f2a57487f277c42bf06fd280195dfdb278 - name: github.com/tendermint/go-crypto version: 4b11d62bdb324027ea01554e5767b71174680ba0 - name: github.com/tendermint/go-db @@ -48,7 +50,7 @@ imports: - name: github.com/tendermint/go-logger version: cefb3a45c0bf3c493a04e9bcd9b1540528be59f2 - name: github.com/tendermint/go-merkle - version: 05042c6ab9cad51d12e4cecf717ae68e3b1409a8 + version: bfc4afe28c7a50045d4d1eb043e67460f8a51a4f - name: github.com/tendermint/go-process version: ba01cfbb58d446673beff17e72883cb49c835fb9 - name: github.com/tendermint/go-wire @@ -58,9 +60,9 @@ imports: subpackages: - term - name: github.com/urfave/cli - version: b4f4786f378c0c1d3336b5bb798094b166edf5a9 + version: 0bdeddeeb0f650497d603c4ad7b20cfe685682f6 - name: golang.org/x/crypto - version: 9477e0b78b9ac3d0b03822fd95422e2fe07627cd + version: ede567c8e044a5913dad1d1af3696d9da953104c subpackages: - nacl/secretbox - openpgp/armor @@ -69,7 +71,7 @@ imports: - ripemd160 - salsa20/salsa - name: golang.org/x/net - version: cac22060de4e495155959e69adcb4b45763ccb10 + version: 4971afdc2f162e82d185353533d3cf16188a9f4e subpackages: - context - http2 @@ -79,11 +81,11 @@ imports: - lex/httplex - trace - name: golang.org/x/sys - version: b699b7032584f0953262cb2788a0ca19bb494703 + version: 30237cf4eefd639b184d1f2cb77a581ea0be8947 subpackages: - unix - name: google.golang.org/grpc - version: 0d9891286aca15aeb2b0a73be9f5946c3cfefa85 + version: 63bd55dfbf781b183216d2dd4433a659c947648a subpackages: - codes - credentials From 37b5cca87c37a8ac90bc8d369a6ed489442c29cb Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 22 Nov 2016 21:06:50 -0500 Subject: [PATCH 15/40] update cli example for new query result format --- tests/test_cli/ex1.tmsp.out | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_cli/ex1.tmsp.out b/tests/test_cli/ex1.tmsp.out index 89bd61c2f..836df8aeb 100644 --- a/tests/test_cli/ex1.tmsp.out +++ b/tests/test_cli/ex1.tmsp.out @@ -17,7 +17,7 @@ > query abc -> code: OK --> data: {Index=0 value=abc exists=true} +-> data: {{"index":0,"value":"abc","exists":true}} > append_tx def=xyz -> code: OK @@ -27,5 +27,5 @@ > query def -> code: OK --> data: {Index=1 value=xyz exists=true} +-> data: {{"index":1,"value":"xyz","exists":true}} From e813b8c71d3953c0c77e50e877dc4891d1a52de9 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 23 Nov 2016 18:22:22 -0500 Subject: [PATCH 16/40] counter: fix tx buffer overflow --- example/counter/counter.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/counter/counter.go b/example/counter/counter.go index 230556e18..ef57d8407 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -30,6 +30,9 @@ func (app *CounterApplication) SetOption(key string, value string) (log string) func (app *CounterApplication) AppendTx(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))) + } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) @@ -43,6 +46,9 @@ func (app *CounterApplication) AppendTx(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))) + } tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) From 2dce41ad6a517548f2b7fc44c191df18b11c2e67 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 23 Nov 2016 18:22:44 -0500 Subject: [PATCH 17/40] types: pretty print validators --- types/validators.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/types/validators.go b/types/validators.go index 6494394ee..185355d15 100644 --- a/types/validators.go +++ b/types/validators.go @@ -2,6 +2,8 @@ package types import ( "bytes" + + "github.com/tendermint/go-wire" ) // validators implements sort @@ -22,3 +24,18 @@ func (v Validators) Swap(i, j int) { v[i] = v[j] v[j] = v1 } + +//------------------------------------- + +type validatorPretty struct { + PubKey []byte `json:"pub_key"` + Power uint64 `json:"power"` +} + +func ValidatorsString(vs Validators) string { + s := make([]validatorPretty, len(vs)) + for i, v := range vs { + s[i] = validatorPretty{v.PubKey, v.Power} + } + return string(wire.JSONBytes(s)) +} From 40448a3897dc870cc8e57a41a1e2872e976de539 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 23 Nov 2016 18:23:35 -0500 Subject: [PATCH 18/40] types: update LastBlockInfo and ConfigInfo --- example/dummy/persistent_dummy.go | 5 +- types/types.pb.go | 254 ++++++++++++++++-------------- types/types.proto | 7 +- 3 files changed, 137 insertions(+), 129 deletions(-) diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 230e537a8..ed2326f17 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -25,7 +25,6 @@ type PersistentDummyApplication struct { // latest received // TODO: move to merkle tree? - blockHash []byte blockHeader *types.Header // validator set @@ -82,7 +81,6 @@ func (app *PersistentDummyApplication) Commit() types.Result { lastBlock := types.LastBlockInfo{ BlockHeight: app.blockHeader.Height, - BlockHash: app.blockHash, AppHash: appHash, // this hash will be in the next block header } SaveLastBlock(app.db, lastBlock) @@ -106,7 +104,6 @@ func (app *PersistentDummyApplication) InitChain(validators []*types.Validator) // Track the block hash and header information func (app *PersistentDummyApplication) BeginBlock(hash []byte, header *types.Header) { // update latest block info - app.blockHash = hash app.blockHeader = header // reset valset changes @@ -140,7 +137,7 @@ func LoadLastBlock(db dbm.DB) (lastBlock types.LastBlockInfo) { } func SaveLastBlock(db dbm.DB, lastBlock types.LastBlockInfo) { - log.Notice("Saving block", "height", lastBlock.BlockHeight, "hash", lastBlock.BlockHash, "root", lastBlock.AppHash) + log.Notice("Saving block", "height", lastBlock.BlockHeight, "root", lastBlock.AppHash) buf, n, err := new(bytes.Buffer), new(int), new(error) wire.WriteBinary(lastBlock, buf, n, err) if *err != nil { diff --git a/types/types.pb.go b/types/types.pb.go index 7204767eb..5dc576d01 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -1503,8 +1503,7 @@ func (m *TMSPInfo) GetVersion() string { type LastBlockInfo struct { BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight" json:"block_height,omitempty"` - BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` - AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + AppHash []byte `protobuf:"bytes,2,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` } func (m *LastBlockInfo) Reset() { *m = LastBlockInfo{} } @@ -1519,13 +1518,6 @@ func (m *LastBlockInfo) GetBlockHeight() uint64 { return 0 } -func (m *LastBlockInfo) GetBlockHash() []byte { - if m != nil { - return m.BlockHash - } - return nil -} - func (m *LastBlockInfo) GetAppHash() []byte { if m != nil { return m.AppHash @@ -1534,7 +1526,9 @@ func (m *LastBlockInfo) GetAppHash() []byte { } type ConfigInfo struct { - MaxBlockSize uint64 `protobuf:"varint,1,opt,name=max_block_size,json=maxBlockSize" json:"max_block_size,omitempty"` + MaxBlockSizeBytes uint64 `protobuf:"varint,1,opt,name=max_block_size_bytes,json=maxBlockSizeBytes" json:"max_block_size_bytes,omitempty"` + MaxBlockSizeTxs uint64 `protobuf:"varint,2,opt,name=max_block_size_txs,json=maxBlockSizeTxs" json:"max_block_size_txs,omitempty"` + MaxTxSize uint64 `protobuf:"varint,3,opt,name=max_tx_size,json=maxTxSize" json:"max_tx_size,omitempty"` } func (m *ConfigInfo) Reset() { *m = ConfigInfo{} } @@ -1542,9 +1536,23 @@ func (m *ConfigInfo) String() string { return proto.CompactTextString func (*ConfigInfo) ProtoMessage() {} func (*ConfigInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } -func (m *ConfigInfo) GetMaxBlockSize() uint64 { +func (m *ConfigInfo) GetMaxBlockSizeBytes() uint64 { if m != nil { - return m.MaxBlockSize + return m.MaxBlockSizeBytes + } + return 0 +} + +func (m *ConfigInfo) GetMaxBlockSizeTxs() uint64 { + if m != nil { + return m.MaxBlockSizeTxs + } + return 0 +} + +func (m *ConfigInfo) GetMaxTxSize() uint64 { + if m != nil { + return m.MaxTxSize } return 0 } @@ -2143,114 +2151,116 @@ var _TMSPApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1743 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x49, 0x73, 0xdb, 0xc8, - 0x15, 0x16, 0x29, 0x6e, 0x78, 0xa4, 0xa8, 0xd6, 0xd3, 0x46, 0x33, 0x49, 0x95, 0x07, 0xf1, 0x64, - 0x24, 0xc7, 0x65, 0xa7, 0xe4, 0x9a, 0x29, 0x3b, 0x93, 0x4a, 0x95, 0x65, 0x6b, 0x2c, 0xd5, 0xc4, - 0xb6, 0x02, 0x7b, 0x7c, 0xc8, 0x52, 0x2c, 0x88, 0x68, 0x92, 0x88, 0x40, 0x00, 0x06, 0x1a, 0x1a, - 0xca, 0xff, 0x60, 0x7e, 0x49, 0xae, 0xb9, 0xe4, 0x92, 0x6b, 0x4e, 0xd9, 0x97, 0x5f, 0x34, 0xf5, - 0xba, 0x1b, 0x00, 0x01, 0x81, 0x3e, 0xf9, 0xc2, 0xc2, 0x5b, 0xbb, 0xfb, 0x2d, 0x5f, 0xbf, 0x26, - 0x6c, 0x89, 0xeb, 0x90, 0xc7, 0x0f, 0xe4, 0xef, 0xfd, 0x30, 0x0a, 0x44, 0x80, 0x4d, 0x49, 0x98, - 0x7f, 0x6d, 0x40, 0xdb, 0xe2, 0xef, 0x12, 0x1e, 0x0b, 0x3c, 0x80, 0x06, 0x1f, 0xcf, 0x82, 0x41, - 0xed, 0x76, 0xed, 0xa0, 0x7b, 0x84, 0xf7, 0x95, 0xba, 0x96, 0x9e, 0x8c, 0x67, 0xc1, 0xe9, 0x9a, - 0x25, 0x35, 0xf0, 0xa7, 0xd0, 0x9c, 0x78, 0x49, 0x3c, 0x1b, 0xd4, 0xa5, 0xea, 0x76, 0x51, 0xf5, - 0x2b, 0x12, 0x9d, 0xae, 0x59, 0x4a, 0x87, 0xdc, 0xba, 0xfe, 0x24, 0x18, 0xac, 0x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 0x43, 0x0c, 0x29, 0xfc, 0x0c, 0x36, - 0xf3, 0xfb, 0x5d, 0xa9, 0x74, 0x94, 0x97, 0x9c, 0x7d, 0x23, 0xba, 0x46, 0x31, 0xba, 0x67, 0xd0, - 0xd6, 0x5b, 0xac, 0x9c, 0x05, 0xee, 0x42, 0x33, 0xb4, 0x23, 0x11, 0x6b, 0x78, 0x4a, 0xf1, 0xe6, - 0xdc, 0x8e, 0x68, 0x86, 0xd2, 0x13, 0x81, 0x52, 0x31, 0x1f, 0xc3, 0x46, 0x81, 0x4f, 0xa8, 0x2a, - 0x02, 0x61, 0x7b, 0x3a, 0x45, 0x8a, 0xc8, 0x96, 0xa9, 0xe7, 0xcb, 0x98, 0x8f, 0xc1, 0xc8, 0x6a, - 0x91, 0xd2, 0x12, 0x26, 0x17, 0x5f, 0xf3, 0x74, 0x2c, 0xd2, 0x14, 0xb9, 0x0b, 0x83, 0x6f, 0xf5, - 0x58, 0xd2, 0xb0, 0x14, 0x71, 0xf7, 0x2f, 0x35, 0xe8, 0xbe, 0x50, 0x30, 0x4c, 0x5d, 0x85, 0x9b, - 0xd0, 0x7d, 0x99, 0x78, 0x9e, 0x66, 0xb1, 0x35, 0xec, 0x40, 0x83, 0xd0, 0x9b, 0xd5, 0xd0, 0x80, - 0xa6, 0x44, 0x67, 0x56, 0x27, 0x26, 0x95, 0x13, 0x5b, 0xc7, 0x0d, 0x30, 0x32, 0xb8, 0x63, 0x0d, - 0x22, 0xb3, 0x6b, 0x81, 0x35, 0xb1, 0x07, 0x9d, 0x14, 0xe5, 0xd8, 0x16, 0x76, 0xa1, 0xad, 0x41, - 0x89, 0x21, 0x02, 0xb4, 0x54, 0xa2, 0xd8, 0x36, 0x79, 0x96, 0x78, 0xc2, 0x76, 0xc8, 0x41, 0xd6, - 0xa1, 0x6c, 0x17, 0xfb, 0x00, 0x79, 0x6f, 0xb2, 0x3d, 0x72, 0x98, 0x76, 0x25, 0xdb, 0xbf, 0xfb, - 0xe7, 0x26,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f, 0x56, 0xcd, 0xed, - 0xf8, 0xcb, 0xa5, 0xf6, 0xc6, 0x55, 0xaf, 0xfd, 0xe1, 0xca, 0x09, 0x1e, 0xbf, 0xcc, 0x01, 0x00, - 0x57, 0xbc, 0xf9, 0x87, 0xab, 0xa6, 0x78, 0x7c, 0x94, 0xe1, 0x05, 0x56, 0xbf, 0xfc, 0x87, 0x2b, - 0x26, 0x79, 0x8a, 0x8d, 0x1a, 0x50, 0xaa, 0x1e, 0xf4, 0xc3, 0xca, 0xe1, 0x1c, 0x3f, 0x4f, 0x01, - 0x09, 0x2b, 0xff, 0x34, 0x18, 0x56, 0x3f, 0x01, 0x28, 0x42, 0xf9, 0xb3, 0x72, 0xd5, 0xbf, 0x01, - 0xc3, 0x95, 0xc3, 0x3d, 0x3e, 0x59, 0x46, 0x38, 0x5c, 0xf9, 0x9f, 0xc0, 0x70, 0xf5, 0x88, 0x4f, - 0x41, 0xce, 0xdf, 0x90, 0xd5, 0xff, 0x0c, 0x0c, 0x57, 0x4d, 0xf9, 0x17, 0x2d, 0xf9, 0x8f, 0xd3, - 0xc3, 0xef, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa2, 0x81, 0xd5, 0x01, 0x86, 0x12, 0x00, 0x00, + // 1774 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x4b, 0x73, 0xdb, 0xc8, + 0x11, 0x16, 0x24, 0x3e, 0x9b, 0x12, 0x35, 0x6a, 0x51, 0x12, 0xcd, 0xa4, 0x52, 0x5e, 0x64, 0x37, + 0x2b, 0x79, 0x5d, 0x76, 0x4a, 0xae, 0xdd, 0xb2, 0xb3, 0xa9, 0x54, 0x59, 0xb6, 0xd6, 0x54, 0x6d, + 0x6c, 0x2b, 0xb0, 0xd6, 0x87, 0x3c, 0x8a, 0x05, 0x11, 0x43, 0x12, 0x11, 0x09, 0xc0, 0xc0, 0xc0, + 0x4b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 0xe5, + 0xbe, 0xe3, 0x27, 0xa4, 0xc0, 0xcf, 0x00, 0x4b, 0x0e, 0x62, 0x19, 0xc9, 0x49, 0x6a, 0xd6, 0x76, + 0xde, 0xfc, 0x62, 0x19, 0xe1, 0x8f, 0xa0, 0x43, 0xc6, 0x62, 0x29, 0x2d, 0x65, 0x8a, 0x6b, 0x56, + 0x7b, 0x61, 0x2f, 0x2f, 0x96, 0x64, 0x62, 0xfe, 0x71, 0x1d, 0x1a, 0xea, 0xa0, 0xa3, 0x25, 0x4b, + 0x7a, 0x1b, 0xb9, 0x4e, 0x92, 0x01, 0x39, 0x3e, 0x73, 0x72, 0x07, 0xdd, 0x7a, 0xfe, 0xa0, 0xa3, + 0x62, 0x0a, 0x77, 0x91, 0x84, 0x95, 0xff, 0xf1, 0x00, 0x9a, 0x5e, 0xbc, 0x90, 0x6b, 0xaa, 0x29, + 0x63, 0x2f, 0x5e, 0xd0, 0x52, 0x8e, 0x61, 0x2b, 0x6b, 0x68, 0x9a, 0x44, 0x9d, 0x26, 0x5d, 0x5d, + 0x1c, 0x95, 0xde, 0xa7, 0x56, 0x27, 0xed, 0xe6, 0x33, 0x07, 0x0f, 0x81, 0x49, 0x1f, 0x45, 0xda, + 0x2a, 0x9d, 0x0d, 0x99, 0xce, 0x2e, 0xc9, 0x35, 0xab, 0xd3, 0x29, 0xfe, 0x03, 0x68, 0x13, 0x96, + 0x94, 0x49, 0x53, 0x9a, 0xb4, 0x48, 0x20, 0x95, 0x9f, 0xc2, 0x76, 0x76, 0x33, 0x50, 0x26, 0x2d, + 0x15, 0x25, 0x13, 0x4b, 0xc3, 0x7c, 0xd9, 0xda, 0xc5, 0xb2, 0x9d, 0x41, 0x53, 0x2f, 0xb1, 0xf2, + 0x16, 0x71, 0x07, 0xea, 0x81, 0x1d, 0x8a, 0x48, 0x13, 0x5b, 0xc2, 0x54, 0xe7, 0x76, 0x48, 0xb7, + 0x2f, 0x7d, 0x97, 0x50, 0x26, 0xe6, 0x23, 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, 0xd7, 0x7a, 0xfc, 0x3c, 0x21, 0x24, + 0xac, 0x7c, 0x6e, 0x18, 0x54, 0x7f, 0x3c, 0x50, 0x86, 0xb2, 0x0f, 0xd2, 0x55, 0xef, 0x08, 0x83, + 0x95, 0x9f, 0x05, 0xf8, 0x38, 0xcf, 0x70, 0xb8, 0xf2, 0x35, 0x61, 0xb0, 0xfa, 0xe3, 0x80, 0x92, + 0x9c, 0x7d, 0x7d, 0x56, 0xbf, 0x29, 0x0c, 0x56, 0x7d, 0x1f, 0x5c, 0x36, 0xe4, 0x5b, 0xd5, 0x83, + 0xef, 0x03, 0x00, 0x00, 0xff, 0xff, 0x7e, 0xa9, 0x42, 0xf7, 0xc0, 0x12, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 3e9ebfe59..f18391ee7 100644 --- a/types/types.proto +++ b/types/types.proto @@ -220,12 +220,13 @@ message TMSPInfo { message LastBlockInfo { uint64 block_height = 1; - bytes block_hash = 2; - bytes app_hash = 3; + bytes app_hash = 2; } message ConfigInfo { - uint64 max_block_size = 1; + uint64 max_block_size_bytes = 1; + uint64 max_block_size_txs = 2; + uint64 max_tx_size = 3; } //---------------------------------------- From 5e83e481bf4583f432e89805bd7486ef63f3d08f Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 6 Dec 2016 02:15:32 -0800 Subject: [PATCH 19/40] Fix tests; Update go-merkle API --- example/dummy/dummy.go | 2 +- example/dummy/persistent_dummy.go | 2 +- tests/test_app/app.go | 1 + tests/test_cli/ex1.tmsp.out | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 80c1ad9d0..daed7a935 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -14,7 +14,7 @@ type DummyApplication struct { } func NewDummyApplication() *DummyApplication { - state := merkle.NewIAVLTree(0, ".", nil) + state := merkle.NewIAVLTree(0, nil) return &DummyApplication{state: state} } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index ed2326f17..1fe40fc29 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -35,7 +35,7 @@ func NewPersistentDummyApplication(dbDir string) *PersistentDummyApplication { db := dbm.NewDB("dummy", "leveldb", dbDir) lastBlock := LoadLastBlock(db) - stateTree := merkle.NewIAVLTree(0, ".", db) + stateTree := merkle.NewIAVLTree(0, db) stateTree.Load(lastBlock.AppHash) log.Notice("Loaded state", "block", lastBlock.BlockHeight, "root", stateTree.Hash()) diff --git a/tests/test_app/app.go b/tests/test_app/app.go index 2a1bf15ad..44e36eebc 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -17,6 +17,7 @@ func StartApp(tmspApp string) *process.Process { // Start the app //outBuf := NewBufferCloser(nil) proc, err := process.StartProcess("tmsp_app", + "", "bash", []string{"-c", tmspApp}, nil, diff --git a/tests/test_cli/ex1.tmsp.out b/tests/test_cli/ex1.tmsp.out index 836df8aeb..89bd61c2f 100644 --- a/tests/test_cli/ex1.tmsp.out +++ b/tests/test_cli/ex1.tmsp.out @@ -17,7 +17,7 @@ > query abc -> code: OK --> data: {{"index":0,"value":"abc","exists":true}} +-> data: {Index=0 value=abc exists=true} > append_tx def=xyz -> code: OK @@ -27,5 +27,5 @@ > query def -> code: OK --> data: {{"index":1,"value":"xyz","exists":true}} +-> data: {Index=1 value=xyz exists=true} From b3e5d0afa1dea4d4131cd4faba6491abe271f7da Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 6 Dec 2016 03:22:53 -0800 Subject: [PATCH 20/40] Update glide.* --- glide.lock | 16 ++++++++-------- glide.yaml | 5 +++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/glide.lock b/glide.lock index e82a60d46..15fbcd45b 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 603c43870dfc63a3113a3d13ae799038206bd77889e2e9596a860d3644b8fb67 -updated: 2016-11-22T20:57:55.984772241-05:00 +hash: 0644029071e51c40b7b4f9b3b3c14fce59e6dadd42897ea20d7eaf049104969e +updated: 2016-12-06T03:21:00.488564175-08:00 imports: - name: github.com/btcsuite/btcd version: afec1bd1245a4a19e6dfe1306974b733e7cbb9b8 @@ -15,6 +15,8 @@ imports: - proto - name: github.com/golang/snappy version: d9eb7a3d35ec988b8585d4a0068e462c27d28380 +- name: github.com/jmhodges/levigo + version: c42d9e0ca023e2198120196f842701bb4c55d7b9 - name: github.com/mattn/go-colorable version: d228849504861217f796da67fae4f6e347643f15 - name: github.com/mattn/go-isatty @@ -39,20 +41,18 @@ imports: subpackages: - edwards25519 - extra25519 -- name: github.com/tendermint/go-autofile - version: 63186e34b33d78ae47fb0d25e5717b307fdf3603 - name: github.com/tendermint/go-common - version: 6b4160f2a57487f277c42bf06fd280195dfdb278 + version: 70e694ee76f09058ea38c9ba81b4aa621bd54df1 - name: github.com/tendermint/go-crypto version: 4b11d62bdb324027ea01554e5767b71174680ba0 - name: github.com/tendermint/go-db - version: 31fdd21c7eaeed53e0ea7ca597fb1e960e2988a5 + version: 5e2a1d3e300743380a329499804dde6bfb0af7d5 - name: github.com/tendermint/go-logger version: cefb3a45c0bf3c493a04e9bcd9b1540528be59f2 - name: github.com/tendermint/go-merkle - version: bfc4afe28c7a50045d4d1eb043e67460f8a51a4f + version: 8bbe6968f21c1c8a3dcdd2f1ca2a87009a9ec912 - name: github.com/tendermint/go-process - version: ba01cfbb58d446673beff17e72883cb49c835fb9 + version: 7f507d69fa4c13b34e7a17ff5c87d1eaaa759145 - name: github.com/tendermint/go-wire version: 287d8caeae91d21686340f5f87170560531681e6 - name: github.com/tendermint/log15 diff --git a/glide.yaml b/glide.yaml index bc1ad142f..440d47cc0 100644 --- a/glide.yaml +++ b/glide.yaml @@ -7,9 +7,14 @@ import: version: develop - package: github.com/tendermint/go-crypto - package: github.com/tendermint/go-logger +- package: github.com/tendermint/go-db + version: develop - package: github.com/tendermint/go-merkle + version: develop - package: github.com/tendermint/go-process + version: develop - package: github.com/tendermint/go-wire + version: develop - package: github.com/urfave/cli - package: golang.org/x/net subpackages: From c5f008d60fe9213482debdac4685e973c05b71fc Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Tue, 6 Dec 2016 03:57:09 -0800 Subject: [PATCH 21/40] Fix TMSP tutorial outputs --- cmd/tmsp-cli/tmsp-cli.go | 4 ++-- example/counter/counter.go | 2 +- example/dummy/dummy.go | 2 +- tests/test_cli/ex1.tmsp.out | 15 ++++++++------- tests/test_cli/ex2.tmsp.out | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index fe6dbd451..219d89dfb 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -234,7 +234,7 @@ func cmdCheckTx(c *cli.Context) error { // Get application Merkle root hash func cmdCommit(c *cli.Context) error { res := client.CommitSync() - printResponse(c, res, Fmt("%X", res.Data), false) + printResponse(c, res, Fmt("0x%X", res.Data), false) return nil } @@ -264,7 +264,7 @@ func printResponse(c *cli.Context, res types.Result, s string, printCode bool) { fmt.Printf("-> error: %s\n", res.Error) }*/ if s != "" { - fmt.Printf("-> data: {%s}\n", s) + fmt.Printf("-> data: %s\n", s) } if res.Log != "" { fmt.Printf("-> log: %s\n", res.Log) diff --git a/example/counter/counter.go b/example/counter/counter.go index ef57d8407..3252f9437 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -18,7 +18,7 @@ func NewCounterApplication(serial bool) *CounterApplication { } func (app *CounterApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { - return Fmt("hashes:%v, txs:%v", app.hashCount, app.txCount), nil, nil, nil + return Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount), nil, nil, nil } func (app *CounterApplication) SetOption(key string, value string) (log string) { diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index daed7a935..438de6a4c 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -19,7 +19,7 @@ func NewDummyApplication() *DummyApplication { } func (app *DummyApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { - return Fmt("size:%v", app.state.Size()), nil, nil, nil + return Fmt("{\"size\":%v}", app.state.Size()), nil, nil, nil } func (app *DummyApplication) SetOption(key string, value string) (log string) { diff --git a/tests/test_cli/ex1.tmsp.out b/tests/test_cli/ex1.tmsp.out index 89bd61c2f..eabeabd1f 100644 --- a/tests/test_cli/ex1.tmsp.out +++ b/tests/test_cli/ex1.tmsp.out @@ -1,31 +1,32 @@ > echo hello --> data: {hello} +-> data: hello > info --> data: {size:0} +-> data: {"size":0} > commit +-> data: 0x > append_tx abc -> code: OK > info --> data: {size:1} +-> data: {"size":1} > commit --> data: {750502FC7E84BBD788ED589624F06CFA871845D1} +-> data: 0x750502FC7E84BBD788ED589624F06CFA871845D1 > query abc -> code: OK --> data: {Index=0 value=abc exists=true} +-> data: {"index":0,"value":"abc","exists":true} > append_tx def=xyz -> code: OK > commit --> data: {76393B8A182E450286B0694C629ECB51B286EFD5} +-> data: 0x76393B8A182E450286B0694C629ECB51B286EFD5 > query def -> code: OK --> data: {Index=1 value=xyz exists=true} +-> data: {"index":1,"value":"xyz","exists":true} diff --git a/tests/test_cli/ex2.tmsp.out b/tests/test_cli/ex2.tmsp.out index 3aa7744bb..84e4ad4f7 100644 --- a/tests/test_cli/ex2.tmsp.out +++ b/tests/test_cli/ex2.tmsp.out @@ -1,5 +1,5 @@ > set_option serial on --> data: {serial=on} +-> data: serial=on > check_tx 0x00 -> code: OK @@ -22,5 +22,5 @@ -> log: Invalid nonce. Expected 2, got 4 > info --> data: {hashes:0, txs:2} +-> data: {"hashes":0,"txs":2} From 5f6ad831b05ae4b4f1bf9941f46c0a92719a0183 Mon Sep 17 00:00:00 2001 From: jac Date: Thu, 15 Dec 2016 14:47:31 +0100 Subject: [PATCH 22/40] link to TMSP Blog post --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d6f1e53a8..b4af06f08 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Blockchains are a system for creating shared multi-master application state. **TMSP** 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 TMSP, motivations, and tutorials, please visit [our blog post](http://tendermint.com/posts/tendermint-socket-protocol/). +For more information on TMSP, motivations, and tutorials, please visit [our blog post](http://tendermint.com/blog/tmsp-the-tendermint-socket-protocol/). Other implementations: * [cpp-tmsp](https://github.com/mdyring/cpp-tmsp) by Martin Dyring-Andersen From 75ea378a6a5d3abd73e31c8e5a7f4e1c609c5474 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Mon, 2 Jan 2017 18:10:12 -0800 Subject: [PATCH 23/40] Encode dummy query values as hex strings --- example/dummy/dummy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 438de6a4c..34ba63ecc 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -1,6 +1,7 @@ package dummy import ( + "encoding/hex" "strings" . "github.com/tendermint/go-common" @@ -48,8 +49,7 @@ 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), exists} + queryResult := QueryResult{index, hex.EncodeToString(value), exists} return types.NewResultOK(wire.JSONBytes(queryResult), "") } From ab211d2dbeab48bb3f5c064199b51cd64af28d24 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Mon, 2 Jan 2017 18:20:30 -0800 Subject: [PATCH 24/40] Include 'value' and 'valueHex' fields in dummy query response --- example/dummy/dummy.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 34ba63ecc..086aee18f 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -49,12 +49,13 @@ func (app *DummyApplication) Commit() types.Result { func (app *DummyApplication) Query(query []byte) types.Result { index, value, exists := app.state.Get(query) - queryResult := QueryResult{index, hex.EncodeToString(value), exists} + queryResult := QueryResult{index, string(value), hex.EncodeToString(value), exists} return types.NewResultOK(wire.JSONBytes(queryResult), "") } type QueryResult struct { - Index int `json:"index"` - Value string `json:"value"` - Exists bool `json:"exists"` + Index int `json:"index"` + Value string `json:"value"` + ValueHex string `json:"valueHex"` + Exists bool `json:"exists"` } From 115e6939d01909567f7f19b956b17cf9d313c246 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Mon, 2 Jan 2017 18:28:47 -0800 Subject: [PATCH 25/40] Require quotes or 0x for string args --- cmd/tmsp-cli/tmsp-cli.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index 219d89dfb..5b74f8f91 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -285,5 +285,13 @@ func stringOrHexToBytes(s string) []byte { } return b } + + if !strings.HasPrefix(s, "\"") || !strings.HasSuffix(s, "\"") { + fmt.Printf("Invalid string arg: \"%s\". Must be quoted or a \"0x\"-prefixed hex string\n", s) + return []byte{} + } + + // TODO: return errors + return []byte(s) } From e748127b7f4a8ee489dec5228bbd083533af89b1 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Mon, 2 Jan 2017 18:49:10 -0800 Subject: [PATCH 26/40] Don't include quotes in quoted string args --- cmd/tmsp-cli/tmsp-cli.go | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index 5b74f8f91..cfc56d1e9 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -213,7 +213,11 @@ func cmdAppendTx(c *cli.Context) error { if len(args) != 1 { return errors.New("Command append_tx takes 1 argument") } - txBytes := stringOrHexToBytes(c.Args()[0]) + txBytes, err := stringOrHexToBytes(c.Args()[0]) + if err != nil { + fmt.Println(err.Error()) + return nil + } res := client.AppendTxSync(txBytes) printResponse(c, res, string(res.Data), true) return nil @@ -225,7 +229,11 @@ func cmdCheckTx(c *cli.Context) error { if len(args) != 1 { return errors.New("Command check_tx takes 1 argument") } - txBytes := stringOrHexToBytes(c.Args()[0]) + txBytes, err := stringOrHexToBytes(c.Args()[0]) + if err != nil { + fmt.Println(err.Error()) + return nil + } res := client.CheckTxSync(txBytes) printResponse(c, res, string(res.Data), true) return nil @@ -244,7 +252,11 @@ func cmdQuery(c *cli.Context) error { if len(args) != 1 { return errors.New("Command query takes 1 argument") } - queryBytes := stringOrHexToBytes(c.Args()[0]) + queryBytes, err := stringOrHexToBytes(c.Args()[0]) + if err != nil { + fmt.Println(err.Error()) + return nil + } res := client.QuerySync(queryBytes) printResponse(c, res, string(res.Data), true) return nil @@ -277,21 +289,22 @@ func printResponse(c *cli.Context, res types.Result, s string, printCode bool) { } // NOTE: s is interpreted as a string unless prefixed with 0x -func stringOrHexToBytes(s string) []byte { - if len(s) > 2 && s[:2] == "0x" { +func stringOrHexToBytes(s string) ([]byte, error) { + fmt.Printf("string: %s %x\n", s, []byte(s)) + + if len(s) > 2 && strings.ToLower(s[:2]) == "0x" { b, err := hex.DecodeString(s[2:]) if err != nil { - fmt.Println("Error decoding hex argument:", err.Error()) + err = fmt.Errorf("Error decoding hex argument: %s", err.Error()) + return nil, err } - return b + return b, nil } if !strings.HasPrefix(s, "\"") || !strings.HasSuffix(s, "\"") { - fmt.Printf("Invalid string arg: \"%s\". Must be quoted or a \"0x\"-prefixed hex string\n", s) - return []byte{} + err := fmt.Errorf("Invalid string arg: \"%s\". Must be quoted or a \"0x\"-prefixed hex string", s) + return nil, err } - // TODO: return errors - - return []byte(s) + return []byte(s[1 : len(s)-1]), nil } From 86a6deba3feef1c5c5df09ddc72979318450b2a4 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Mon, 2 Jan 2017 18:49:54 -0800 Subject: [PATCH 27/40] Remove debug printing --- cmd/tmsp-cli/tmsp-cli.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index cfc56d1e9..2fab906a0 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -290,8 +290,6 @@ func printResponse(c *cli.Context, res types.Result, s string, printCode bool) { // NOTE: s is interpreted as a string unless prefixed with 0x func stringOrHexToBytes(s string) ([]byte, error) { - fmt.Printf("string: %s %x\n", s, []byte(s)) - if len(s) > 2 && strings.ToLower(s[:2]) == "0x" { b, err := hex.DecodeString(s[2:]) if err != nil { From cd6fa3018c537f8145c490eab918b394443dd54a Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 3 Jan 2017 10:53:14 -0800 Subject: [PATCH 28/40] Return errors from cmd functions instead of printing --- cmd/tmsp-cli/tmsp-cli.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index 2fab906a0..50e954d9f 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -215,8 +215,7 @@ func cmdAppendTx(c *cli.Context) error { } txBytes, err := stringOrHexToBytes(c.Args()[0]) if err != nil { - fmt.Println(err.Error()) - return nil + return err } res := client.AppendTxSync(txBytes) printResponse(c, res, string(res.Data), true) @@ -231,8 +230,7 @@ func cmdCheckTx(c *cli.Context) error { } txBytes, err := stringOrHexToBytes(c.Args()[0]) if err != nil { - fmt.Println(err.Error()) - return nil + return err } res := client.CheckTxSync(txBytes) printResponse(c, res, string(res.Data), true) @@ -254,8 +252,7 @@ func cmdQuery(c *cli.Context) error { } queryBytes, err := stringOrHexToBytes(c.Args()[0]) if err != nil { - fmt.Println(err.Error()) - return nil + return err } res := client.QuerySync(queryBytes) printResponse(c, res, string(res.Data), true) From 4bb65366f4cbc3442b82eeb99efe1f9f1242dc26 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 3 Jan 2017 19:26:20 -0800 Subject: [PATCH 29/40] Update CLI test string args --- tests/test_cli/ex1.tmsp | 8 ++++---- tests/test_cli/ex1.tmsp.out | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_cli/ex1.tmsp b/tests/test_cli/ex1.tmsp index de61c8b2f..132512671 100644 --- a/tests/test_cli/ex1.tmsp +++ b/tests/test_cli/ex1.tmsp @@ -1,10 +1,10 @@ echo hello info commit -append_tx abc +append_tx "abc" info commit -query abc -append_tx def=xyz +query "abc" +append_tx "def=xyz" commit -query def +query "def" diff --git a/tests/test_cli/ex1.tmsp.out b/tests/test_cli/ex1.tmsp.out index eabeabd1f..51cee99f7 100644 --- a/tests/test_cli/ex1.tmsp.out +++ b/tests/test_cli/ex1.tmsp.out @@ -7,7 +7,7 @@ > commit -> data: 0x -> append_tx abc +> append_tx "abc" -> code: OK > info @@ -16,17 +16,17 @@ > commit -> data: 0x750502FC7E84BBD788ED589624F06CFA871845D1 -> query abc +> query "abc" -> code: OK --> data: {"index":0,"value":"abc","exists":true} +-> data: {"index":0,"value":"abc","valueHex":"616263","exists":true} -> append_tx def=xyz +> append_tx "def=xyz" -> code: OK > commit -> data: 0x76393B8A182E450286B0694C629ECB51B286EFD5 -> query def +> query "def" -> code: OK --> data: {"index":1,"value":"xyz","exists":true} +-> data: {"index":1,"value":"xyz","valueHex":"78797a","exists":true} From c31df4081cd660d4e7485bb81594b8c3ab26b636 Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Thu, 22 Dec 2016 18:24:45 -0500 Subject: [PATCH 30/40] added counter query support --- example/counter/counter.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/example/counter/counter.go b/example/counter/counter.go index 3252f9437..58c37c851 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -72,5 +72,14 @@ func (app *CounterApplication) Commit() types.Result { } func (app *CounterApplication) Query(query []byte) types.Result { - return types.NewResultOK(nil, Fmt("Query is not supported")) + queryStr := string(query) + + switch queryStr { + case "hash": + return types.NewResultOK(nil, Fmt("%v", app.hashCount)) + case "tx": + return types.NewResultOK(nil, Fmt("%v", app.txCount)) + } + + return types.ErrUnknownRequest.SetLog(Fmt("Invalid nonce. Expected hash or tx, got %v", queryStr)) } From 81b2697ccefc345a7dca8f3dd2ec2e9f83f15930 Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Thu, 22 Dec 2016 19:00:22 -0500 Subject: [PATCH 31/40] fix console exit, closes #35 --- cmd/tmsp-cli/tmsp-cli.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index 50e954d9f..cd9ae62ea 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -19,6 +19,10 @@ import ( var client tmspcli.Client func main() { + + //workaround for the cli library (https://github.com/urfave/cli/issues/565) + cli.OsExiter = func(_ int) {} + app := cli.NewApp() app.Name = "tmsp-cli" app.Usage = "tmsp-cli [command] [args...]" @@ -171,10 +175,7 @@ func cmdConsole(app *cli.App, c *cli.Context) error { args := []string{"tmsp-cli"} args = append(args, strings.Split(string(line), " ")...) - if err := app.Run(args); err != nil { - // if the command doesn't succeed, inform the user without exiting - fmt.Println("Error:", err.Error()) - } + app.Run(args) //cli already prints error within its func call } } From e6b9a2b6aaa32d23c404400beb59277298ea66ca Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 01:03:51 -0500 Subject: [PATCH 32/40] response struct and persistent args --- cmd/tmsp-cli/tmsp-cli.go | 107 ++++++++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 30 deletions(-) diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index cd9ae62ea..7e7bd21eb 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -15,6 +15,30 @@ import ( "github.com/urfave/cli" ) +//structure for data passed to print response +// variables must be exposed for JSON to read +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 +} + // client is a global variable so it can be reused by the console var client tmspcli.Client @@ -135,6 +159,20 @@ func badCmd(c *cli.Context, cmd string) { cli.DefaultAppComplete(c) } +//Generates new Args array based off of previous call args to maintain flag persistence +func persistentArgs(line []byte) []string { + + //generate the arguments to run from orginal os.Args + // to maintain flag arguments + args := os.Args + args = args[:len(args)-1] // remove the previous command argument + + if len(line) > 0 { //prevents introduction of extra space leading to argument parse errors + args = append(args, strings.Split(string(line), " ")...) + } + return args +} + //-------------------------------------------------------------------------------- func cmdBatch(app *cli.App, c *cli.Context) error { @@ -150,12 +188,9 @@ func cmdBatch(app *cli.App, c *cli.Context) error { } else if err != nil { return err } - args := []string{"tmsp-cli"} - if c.GlobalBool("verbose") { - args = append(args, "--verbose") - } - args = append(args, strings.Split(string(line), " ")...) - app.Run(args) + + args := persistentArgs(line) + app.Run(args) //cli prints error within its func call } return nil } @@ -163,6 +198,7 @@ func cmdBatch(app *cli.App, c *cli.Context) error { func cmdConsole(app *cli.App, c *cli.Context) error { // don't hard exit on mistyped commands (eg. check vs check_tx) app.CommandNotFound = badCmd + for { fmt.Printf("\n> ") bufReader := bufio.NewReader(os.Stdin) @@ -173,9 +209,8 @@ func cmdConsole(app *cli.App, c *cli.Context) error { return err } - args := []string{"tmsp-cli"} - args = append(args, strings.Split(string(line), " ")...) - app.Run(args) //cli already prints error within its func call + args := persistentArgs(line) + app.Run(args) //cli prints error within its func call } } @@ -186,14 +221,16 @@ func cmdEcho(c *cli.Context) error { return errors.New("Command echo takes 1 argument") } res := client.EchoSync(args[0]) - printResponse(c, res, string(res.Data), false) + rsp := newResponse(res, string(res.Data), false) + printResponse(c, rsp) return nil } // Get some info from the application func cmdInfo(c *cli.Context) error { res, _, _, _ := client.InfoSync() - printResponse(c, res, string(res.Data), false) + rsp := newResponse(res, string(res.Data), false) + printResponse(c, rsp) return nil } @@ -204,7 +241,8 @@ func cmdSetOption(c *cli.Context) error { return errors.New("Command set_option takes 2 arguments (key, value)") } res := client.SetOptionSync(args[0], args[1]) - printResponse(c, res, Fmt("%s=%s", args[0], args[1]), false) + rsp := newResponse(res, Fmt("%s=%s", args[0], args[1]), false) + printResponse(c, rsp) return nil } @@ -219,7 +257,8 @@ func cmdAppendTx(c *cli.Context) error { return err } res := client.AppendTxSync(txBytes) - printResponse(c, res, string(res.Data), true) + rsp := newResponse(res, string(res.Data), true) + printResponse(c, rsp) return nil } @@ -234,14 +273,16 @@ func cmdCheckTx(c *cli.Context) error { return err } res := client.CheckTxSync(txBytes) - printResponse(c, res, string(res.Data), true) + rsp := newResponse(res, string(res.Data), true) + printResponse(c, rsp) return nil } // Get application Merkle root hash func cmdCommit(c *cli.Context) error { res := client.CommitSync() - printResponse(c, res, Fmt("0x%X", res.Data), false) + rsp := newResponse(res, Fmt("0x%X", res.Data), false) + printResponse(c, rsp) return nil } @@ -256,31 +297,37 @@ func cmdQuery(c *cli.Context) error { return err } res := client.QuerySync(queryBytes) - printResponse(c, res, string(res.Data), true) + rsp := newResponse(res, string(res.Data), true) + printResponse(c, rsp) return nil } //-------------------------------------------------------------------------------- -func printResponse(c *cli.Context, res types.Result, s string, printCode bool) { - if c.GlobalBool("verbose") { +func printResponse(c *cli.Context, rsp *response) { + + verbose := c.GlobalBool("verbose") + + if verbose { fmt.Println(">", c.Command.Name, strings.Join(c.Args(), " ")) } - if printCode { - fmt.Printf("-> code: %s\n", res.Code.String()) - } - /*if res.Error != "" { - fmt.Printf("-> error: %s\n", res.Error) - }*/ - if s != "" { - fmt.Printf("-> data: %s\n", s) - } - if res.Log != "" { - fmt.Printf("-> log: %s\n", res.Log) + if rsp.PrintCode { + fmt.Printf("-> code: %s\n", rsp.Code) } - if c.GlobalBool("verbose") { + //if pr.res.Error != "" { + // fmt.Printf("-> error: %s\n", pr.res.Error) + //} + + if rsp.Data != "" { + fmt.Printf("-> data: %s\n", rsp.Data) + } + if rsp.Res.Log != "" { + fmt.Printf("-> log: %s\n", rsp.Res.Log) + } + + if verbose { fmt.Println("") } From 831cb4adcd3daa88451f3ea707f432fa269d5ed8 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 01:08:31 -0500 Subject: [PATCH 33/40] update glide --- glide.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glide.lock b/glide.lock index 15fbcd45b..5a8a6c779 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ hash: 0644029071e51c40b7b4f9b3b3c14fce59e6dadd42897ea20d7eaf049104969e -updated: 2016-12-06T03:21:00.488564175-08:00 +updated: 2017-01-12T01:05:04.505700434-05:00 imports: - name: github.com/btcsuite/btcd version: afec1bd1245a4a19e6dfe1306974b733e7cbb9b8 @@ -46,15 +46,15 @@ imports: - name: github.com/tendermint/go-crypto version: 4b11d62bdb324027ea01554e5767b71174680ba0 - name: github.com/tendermint/go-db - version: 5e2a1d3e300743380a329499804dde6bfb0af7d5 + version: 2645626c33d8702739e52a61a55d705c2dfe4530 - name: github.com/tendermint/go-logger version: cefb3a45c0bf3c493a04e9bcd9b1540528be59f2 - name: github.com/tendermint/go-merkle - version: 8bbe6968f21c1c8a3dcdd2f1ca2a87009a9ec912 + version: c7a7ae88ca72bf030a7fb7d0d52ce8d1e62b4e16 - name: github.com/tendermint/go-process version: 7f507d69fa4c13b34e7a17ff5c87d1eaaa759145 - name: github.com/tendermint/go-wire - version: 287d8caeae91d21686340f5f87170560531681e6 + version: 37d5dd6530857a1abc1db50a48ba22c3459826a1 - name: github.com/tendermint/log15 version: ae0f3d6450da9eac7074b439c8e1c3cabf0d5ce6 subpackages: From 0d82d26408e03eee7ea287aad3c169c0eeb27a35 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 26 Dec 2016 16:49:29 -0800 Subject: [PATCH 34/40] Frist commit on types.proto --- types/application.go | 2 +- types/types.proto | 27 ++++----------------------- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/types/application.go b/types/application.go index 0137f1e1a..b001bc3c2 100644 --- a/types/application.go +++ b/types/application.go @@ -8,7 +8,7 @@ import ( type Application interface { // Return application info - Info() (string, *TMSPInfo, *LastBlockInfo, *ConfigInfo) + Info() ResponseInfo // Set application option (e.g. mode=mempool, mode=consensus) SetOption(key string, value string) (log string) diff --git a/types/types.proto b/types/types.proto index f18391ee7..8d0860c9a 100644 --- a/types/types.proto +++ b/types/types.proto @@ -165,11 +165,10 @@ message ResponseFlush{ } message ResponseInfo { - string info = 1; // backwards compatible - - TMSPInfo tmsp_info = 2; - LastBlockInfo last_block = 3; - ConfigInfo config = 4; + string info = 1; + string version = 2; + uint64 last_block_height = 3; + bytes last_block_app_hash = 4; } message ResponseSetOption{ @@ -211,24 +210,6 @@ message ResponseEndBlock{ repeated Validator diffs = 4; } -//---------------------------------------- -// Info types - -message TMSPInfo { - string Version = 1; -} - -message LastBlockInfo { - uint64 block_height = 1; - bytes app_hash = 2; -} - -message ConfigInfo { - uint64 max_block_size_bytes = 1; - uint64 max_block_size_txs = 2; - uint64 max_tx_size = 3; -} - //---------------------------------------- // Blockchain Types From 8b76f3dd0074b869166f7240f515ead90a8ef2bc Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 26 Dec 2016 17:44:36 -0800 Subject: [PATCH 35/40] Make fields in ResponseInfo be flat --- client/client.go | 2 +- client/grpc_client.go | 13 +- client/local_client.go | 10 +- client/socket_client.go | 11 +- cmd/tmsp-cli/tmsp-cli.go | 7 +- example/chain_aware/chain_aware_app.go | 4 +- example/counter/counter.go | 4 +- example/dummy/dummy.go | 4 +- example/dummy/dummy_test.go | 12 +- example/dummy/persistent_dummy.go | 27 +- example/nil/nil_app.go | 4 +- types/application.go | 4 +- types/messages.go | 5 +- types/types.pb.go | 331 +++++++++---------------- types/types.proto | 2 +- 15 files changed, 186 insertions(+), 254 deletions(-) diff --git a/client/client.go b/client/client.go index d1954e3fe..c39357ba1 100644 --- a/client/client.go +++ b/client/client.go @@ -25,7 +25,7 @@ type Client interface { FlushSync() error EchoSync(msg string) (res types.Result) - InfoSync() (types.Result, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) + InfoSync() (resInfo types.ResponseInfo, err error) SetOptionSync(key string, value string) (res types.Result) AppendTxSync(tx []byte) (res types.Result) CheckTxSync(tx []byte) (res types.Result) diff --git a/client/grpc_client.go b/client/grpc_client.go index 1e0169738..e72f31fb5 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -262,13 +262,16 @@ func (cli *grpcClient) FlushSync() error { return nil } -func (cli *grpcClient) InfoSync() (types.Result, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { +func (cli *grpcClient) InfoSync() (resInfo types.ResponseInfo, err error) { reqres := cli.InfoAsync() - if res := cli.checkErrGetResult(); res.IsErr() { - return res, nil, nil, nil + if err = cli.Error(); err != nil { + return resInfo, err + } + if resInfo_ := reqres.Response.GetInfo(); resInfo_ != nil { + return *resInfo_, nil + } else { + return resInfo, nil } - resp := reqres.Response.GetInfo() - return types.NewResultOK([]byte(resp.Info), LOG), resp.TmspInfo, resp.LastBlock, resp.Config } func (cli *grpcClient) SetOptionSync(key string, value string) (res types.Result) { diff --git a/client/local_client.go b/client/local_client.go index e50763a8d..0c363d0c2 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -51,11 +51,11 @@ func (app *localClient) EchoAsync(msg string) *ReqRes { func (app *localClient) InfoAsync() *ReqRes { app.mtx.Lock() - info, tmspInfo, blockInfo, configInfo := app.Application.Info() + resInfo := app.Application.Info() app.mtx.Unlock() return app.callback( types.ToRequestInfo(), - types.ToResponseInfo(info, tmspInfo, blockInfo, configInfo), + types.ToResponseInfo(resInfo), ) } @@ -157,11 +157,11 @@ func (app *localClient) EchoSync(msg string) (res types.Result) { return types.OK.SetData([]byte(msg)) } -func (app *localClient) InfoSync() (types.Result, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { +func (app *localClient) InfoSync() (resInfo types.ResponseInfo, err error) { app.mtx.Lock() defer app.mtx.Unlock() - info, tmspInfo, blockInfo, configInfo := app.Application.Info() - return types.OK.SetData([]byte(info)), tmspInfo, blockInfo, configInfo + resInfo = app.Application.Info() + return resInfo, nil } func (app *localClient) SetOptionSync(key string, value string) (res types.Result) { diff --git a/client/socket_client.go b/client/socket_client.go index 01a330366..8c5c84287 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -292,14 +292,17 @@ func (cli *socketClient) FlushSync() error { return cli.Error() } -func (cli *socketClient) InfoSync() (types.Result, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { +func (cli *socketClient) InfoSync() (resInfo types.ResponseInfo, err error) { reqres := cli.queueRequest(types.ToRequestInfo()) cli.FlushSync() if err := cli.Error(); err != nil { - return types.ErrInternalError.SetLog(err.Error()), nil, nil, nil + return resInfo, err + } + if resInfo_ := reqres.Response.GetInfo(); resInfo_ != nil { + return *resInfo_, nil + } else { + return resInfo, nil } - resp := reqres.Response.GetInfo() - return types.Result{Code: OK, Data: []byte(resp.Info), Log: LOG}, resp.TmspInfo, resp.LastBlock, resp.Config } func (cli *socketClient) SetOptionSync(key string, value string) (res types.Result) { diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index 7e7bd21eb..2bf5b8624 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -228,8 +228,11 @@ func cmdEcho(c *cli.Context) error { // Get some info from the application func cmdInfo(c *cli.Context) error { - res, _, _, _ := client.InfoSync() - rsp := newResponse(res, string(res.Data), false) + resInfo, err := client.InfoSync() + if err != nil { + return err + } + rsp := newResponse(types.Result{}, string(resInfo.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 aec7fe1b2..15d8f8761 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -36,8 +36,8 @@ func NewChainAwareApplication() *ChainAwareApplication { return &ChainAwareApplication{} } -func (app *ChainAwareApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { - return "nil", nil, nil, nil +func (app *ChainAwareApplication) Info() types.ResponseInfo { + return types.ResponseInfo{} } func (app *ChainAwareApplication) SetOption(key string, value string) (log string) { diff --git a/example/counter/counter.go b/example/counter/counter.go index 58c37c851..221ddf04d 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -17,8 +17,8 @@ func NewCounterApplication(serial bool) *CounterApplication { return &CounterApplication{serial: serial} } -func (app *CounterApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { - return Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount), nil, nil, nil +func (app *CounterApplication) Info() types.ResponseInfo { + return types.ResponseInfo{Data: Fmt("{\"hashes\":%v,\"txs\":%v}", app.hashCount, app.txCount)} } func (app *CounterApplication) SetOption(key string, value string) (log string) { diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 086aee18f..ca7bc525b 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -19,8 +19,8 @@ func NewDummyApplication() *DummyApplication { return &DummyApplication{state: state} } -func (app *DummyApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { - return Fmt("{\"size\":%v}", app.state.Size()), nil, nil, nil +func (app *DummyApplication) Info() (resInfo types.ResponseInfo) { + return types.ResponseInfo{Data: 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 e284f1258..eea7f4a85 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -72,9 +72,9 @@ func TestPersistentDummyInfo(t *testing.T) { dummy := NewPersistentDummyApplication(dir) height := uint64(0) - _, _, lastBlockInfo, _ := dummy.Info() - if lastBlockInfo.BlockHeight != height { - t.Fatalf("expected height of %d, got %d", height, lastBlockInfo.BlockHeight) + resInfo := dummy.Info() + if resInfo.LastBlockHeight != height { + t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) } // make and apply block @@ -87,9 +87,9 @@ func TestPersistentDummyInfo(t *testing.T) { dummy.EndBlock(height) dummy.Commit() - _, _, lastBlockInfo, _ = dummy.Info() - if lastBlockInfo.BlockHeight != height { - t.Fatalf("expected height of %d, got %d", height, lastBlockInfo.BlockHeight) + resInfo = dummy.Info() + if resInfo.LastBlockHeight != height { + t.Fatalf("expected height of %d, got %d", height, resInfo.LastBlockHeight) } } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index 1fe40fc29..fc2b38cd5 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -38,7 +38,7 @@ func NewPersistentDummyApplication(dbDir string) *PersistentDummyApplication { stateTree := merkle.NewIAVLTree(0, db) stateTree.Load(lastBlock.AppHash) - log.Notice("Loaded state", "block", lastBlock.BlockHeight, "root", stateTree.Hash()) + log.Notice("Loaded state", "block", lastBlock.Height, "root", stateTree.Hash()) return &PersistentDummyApplication{ app: &DummyApplication{state: stateTree}, @@ -46,10 +46,12 @@ func NewPersistentDummyApplication(dbDir string) *PersistentDummyApplication { } } -func (app *PersistentDummyApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { - s, _, _, _ := app.app.Info() +func (app *PersistentDummyApplication) Info() (resInfo types.ResponseInfo) { + resInfo = app.app.Info() lastBlock := LoadLastBlock(app.db) - return s, nil, &lastBlock, nil + resInfo.LastBlockHeight = lastBlock.Height + resInfo.LastBlockAppHash = lastBlock.AppHash + return resInfo } func (app *PersistentDummyApplication) SetOption(key string, value string) (log string) { @@ -79,9 +81,9 @@ func (app *PersistentDummyApplication) Commit() types.Result { appHash := app.app.state.Save() log.Info("Saved state", "root", appHash) - lastBlock := types.LastBlockInfo{ - BlockHeight: app.blockHeader.Height, - AppHash: appHash, // this hash will be in the next block header + lastBlock := LastBlockInfo{ + Height: app.blockHeader.Height, + AppHash: appHash, // this hash will be in the next block header } SaveLastBlock(app.db, lastBlock) return types.NewResultOK(appHash, "") @@ -120,8 +122,13 @@ func (app *PersistentDummyApplication) EndBlock(height uint64) (diffs []*types.V var lastBlockKey = []byte("lastblock") +type LastBlockInfo struct { + Height uint64 + AppHash []byte +} + // Get the last block from the db -func LoadLastBlock(db dbm.DB) (lastBlock types.LastBlockInfo) { +func LoadLastBlock(db dbm.DB) (lastBlock LastBlockInfo) { buf := db.Get(lastBlockKey) if len(buf) != 0 { r, n, err := bytes.NewReader(buf), new(int), new(error) @@ -136,8 +143,8 @@ func LoadLastBlock(db dbm.DB) (lastBlock types.LastBlockInfo) { return lastBlock } -func SaveLastBlock(db dbm.DB, lastBlock types.LastBlockInfo) { - log.Notice("Saving block", "height", lastBlock.BlockHeight, "root", lastBlock.AppHash) +func SaveLastBlock(db dbm.DB, lastBlock LastBlockInfo) { + log.Notice("Saving block", "height", lastBlock.Height, "root", lastBlock.AppHash) buf, n, err := new(bytes.Buffer), new(int), new(error) wire.WriteBinary(lastBlock, buf, n, err) if *err != nil { diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index 05b5c7883..7cc01c052 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -11,8 +11,8 @@ func NewNilApplication() *NilApplication { return &NilApplication{} } -func (app *NilApplication) Info() (string, *types.TMSPInfo, *types.LastBlockInfo, *types.ConfigInfo) { - return "nil", nil, nil, nil +func (app *NilApplication) Info() (resInfo types.ResponseInfo) { + return } func (app *NilApplication) SetOption(key string, value string) (log string) { diff --git a/types/application.go b/types/application.go index b001bc3c2..d124afd50 100644 --- a/types/application.go +++ b/types/application.go @@ -59,8 +59,8 @@ func (app *GRPCApplication) Flush(ctx context.Context, req *RequestFlush) (*Resp } func (app *GRPCApplication) Info(ctx context.Context, req *RequestInfo) (*ResponseInfo, error) { - info, tmspInfo, blockInfo, configInfo := app.app.Info() - return &ResponseInfo{info, tmspInfo, blockInfo, configInfo}, nil + resInfo := app.app.Info() + return &resInfo, nil } func (app *GRPCApplication) SetOption(ctx context.Context, req *RequestSetOption) (*ResponseSetOption, error) { diff --git a/types/messages.go b/types/messages.go index 16e4fbd2b..afd4548e0 100644 --- a/types/messages.go +++ b/types/messages.go @@ -93,9 +93,10 @@ func ToResponseFlush() *Response { } } -func ToResponseInfo(info string, tmspInfo *TMSPInfo, blockInfo *LastBlockInfo, configInfo *ConfigInfo) *Response { +func ToResponseInfo(resInfo ResponseInfo) *Response { + resInfoCopy := resInfo return &Response{ - Value: &Response_Info{&ResponseInfo{info, tmspInfo, blockInfo, configInfo}}, + Value: &Response_Info{&resInfoCopy}, } } diff --git a/types/types.pb.go b/types/types.pb.go index 5dc576d01..c97817798 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -34,9 +34,6 @@ It has these top-level messages: ResponseInitChain ResponseBeginBlock ResponseEndBlock - TMSPInfo - LastBlockInfo - ConfigInfo Header BlockID PartSetHeader @@ -1270,10 +1267,10 @@ func (*ResponseFlush) ProtoMessage() {} func (*ResponseFlush) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } type ResponseInfo struct { - Info string `protobuf:"bytes,1,opt,name=info" json:"info,omitempty"` - TmspInfo *TMSPInfo `protobuf:"bytes,2,opt,name=tmsp_info,json=tmspInfo" json:"tmsp_info,omitempty"` - LastBlock *LastBlockInfo `protobuf:"bytes,3,opt,name=last_block,json=lastBlock" json:"last_block,omitempty"` - Config *ConfigInfo `protobuf:"bytes,4,opt,name=config" json:"config,omitempty"` + Data string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + LastBlockHeight uint64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight" json:"last_block_height,omitempty"` + LastBlockAppHash []byte `protobuf:"bytes,4,opt,name=last_block_app_hash,json=lastBlockAppHash,proto3" json:"last_block_app_hash,omitempty"` } func (m *ResponseInfo) Reset() { *m = ResponseInfo{} } @@ -1281,30 +1278,30 @@ func (m *ResponseInfo) String() string { return proto.CompactTextStri func (*ResponseInfo) ProtoMessage() {} func (*ResponseInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } -func (m *ResponseInfo) GetInfo() string { +func (m *ResponseInfo) GetData() string { if m != nil { - return m.Info + return m.Data } return "" } -func (m *ResponseInfo) GetTmspInfo() *TMSPInfo { +func (m *ResponseInfo) GetVersion() string { if m != nil { - return m.TmspInfo + return m.Version } - return nil + return "" } -func (m *ResponseInfo) GetLastBlock() *LastBlockInfo { +func (m *ResponseInfo) GetLastBlockHeight() uint64 { if m != nil { - return m.LastBlock + return m.LastBlockHeight } - return nil + return 0 } -func (m *ResponseInfo) GetConfig() *ConfigInfo { +func (m *ResponseInfo) GetLastBlockAppHash() []byte { if m != nil { - return m.Config + return m.LastBlockAppHash } return nil } @@ -1485,78 +1482,6 @@ func (m *ResponseEndBlock) GetDiffs() []*Validator { return nil } -type TMSPInfo struct { - Version string `protobuf:"bytes,1,opt,name=Version" json:"Version,omitempty"` -} - -func (m *TMSPInfo) Reset() { *m = TMSPInfo{} } -func (m *TMSPInfo) String() string { return proto.CompactTextString(m) } -func (*TMSPInfo) ProtoMessage() {} -func (*TMSPInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } - -func (m *TMSPInfo) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -type LastBlockInfo struct { - BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight" json:"block_height,omitempty"` - AppHash []byte `protobuf:"bytes,2,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` -} - -func (m *LastBlockInfo) Reset() { *m = LastBlockInfo{} } -func (m *LastBlockInfo) String() string { return proto.CompactTextString(m) } -func (*LastBlockInfo) ProtoMessage() {} -func (*LastBlockInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } - -func (m *LastBlockInfo) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func (m *LastBlockInfo) GetAppHash() []byte { - if m != nil { - return m.AppHash - } - return nil -} - -type ConfigInfo struct { - MaxBlockSizeBytes uint64 `protobuf:"varint,1,opt,name=max_block_size_bytes,json=maxBlockSizeBytes" json:"max_block_size_bytes,omitempty"` - MaxBlockSizeTxs uint64 `protobuf:"varint,2,opt,name=max_block_size_txs,json=maxBlockSizeTxs" json:"max_block_size_txs,omitempty"` - MaxTxSize uint64 `protobuf:"varint,3,opt,name=max_tx_size,json=maxTxSize" json:"max_tx_size,omitempty"` -} - -func (m *ConfigInfo) Reset() { *m = ConfigInfo{} } -func (m *ConfigInfo) String() string { return proto.CompactTextString(m) } -func (*ConfigInfo) ProtoMessage() {} -func (*ConfigInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } - -func (m *ConfigInfo) GetMaxBlockSizeBytes() uint64 { - if m != nil { - return m.MaxBlockSizeBytes - } - return 0 -} - -func (m *ConfigInfo) GetMaxBlockSizeTxs() uint64 { - if m != nil { - return m.MaxBlockSizeTxs - } - return 0 -} - -func (m *ConfigInfo) GetMaxTxSize() uint64 { - if m != nil { - return m.MaxTxSize - } - return 0 -} - type Header struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId" json:"chain_id,omitempty"` Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` @@ -1572,7 +1497,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{28} } +func (*Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } func (m *Header) GetChainId() string { if m != nil { @@ -1645,7 +1570,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{29} } +func (*BlockID) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } func (m *BlockID) GetHash() []byte { if m != nil { @@ -1669,7 +1594,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{30} } +func (*PartSetHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } func (m *PartSetHeader) GetTotal() uint64 { if m != nil { @@ -1693,7 +1618,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{31} } +func (*Validator) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } func (m *Validator) GetPubKey() []byte { if m != nil { @@ -1735,9 +1660,6 @@ func init() { proto.RegisterType((*ResponseInitChain)(nil), "types.ResponseInitChain") proto.RegisterType((*ResponseBeginBlock)(nil), "types.ResponseBeginBlock") proto.RegisterType((*ResponseEndBlock)(nil), "types.ResponseEndBlock") - proto.RegisterType((*TMSPInfo)(nil), "types.TMSPInfo") - proto.RegisterType((*LastBlockInfo)(nil), "types.LastBlockInfo") - proto.RegisterType((*ConfigInfo)(nil), "types.ConfigInfo") proto.RegisterType((*Header)(nil), "types.Header") proto.RegisterType((*BlockID)(nil), "types.BlockID") proto.RegisterType((*PartSetHeader)(nil), "types.PartSetHeader") @@ -2151,116 +2073,109 @@ var _TMSPApplication_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("types/types.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1774 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x58, 0x4b, 0x73, 0xdb, 0xc8, - 0x11, 0x16, 0x24, 0x3e, 0x9b, 0x12, 0x35, 0x6a, 0x51, 0x12, 0xcd, 0xa4, 0x52, 0x5e, 0x64, 0x37, - 0x2b, 0x79, 0x5d, 0x76, 0x4a, 0xae, 0xdd, 0xb2, 0xb3, 0xa9, 0x54, 0x59, 0xb6, 0xd6, 0x54, 0x6d, - 0x6c, 0x2b, 0xb0, 0xd6, 0x87, 0x3c, 0x8a, 0x05, 0x11, 0x43, 0x12, 0x11, 0x09, 0xc0, 0xc0, 0xc0, - 0x4b, 0xf9, 0x1f, 0x6c, 0xfe, 0x48, 0xae, 0xb9, 0xe4, 0x92, 0x6b, 0x4e, 0x79, 0x3f, 0x7e, 0xd1, - 0x56, 0xcf, 0x0c, 0x9e, 0x02, 0x7d, 0xf2, 0x85, 0xc5, 0xe9, 0xd7, 0xcc, 0x74, 0x7f, 0xfd, 0xcd, - 0x60, 0x60, 0x47, 0x5c, 0x07, 0x3c, 0xba, 0x2f, 0x7f, 0xef, 0x05, 0xa1, 0x2f, 0x7c, 0xac, 0xcb, - 0x81, 0xf9, 0xd7, 0x1a, 0x34, 0x2d, 0xfe, 0x26, 0xe6, 0x91, 0xc0, 0x43, 0xa8, 0xf1, 0xf1, 0xcc, - 0xef, 0x1b, 0xb7, 0x8d, 0xc3, 0xce, 0x31, 0xde, 0x53, 0xe6, 0x5a, 0x7b, 0x3a, 0x9e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, 0x66, 0x7a, 0x01, 0xf2, 0x3f, 0x7e, 0x02, - 0x8d, 0x19, 0xb7, 0x1d, 0x1e, 0xea, 0xfe, 0xdb, 0xd2, 0x61, 0x87, 0x52, 0x68, 0x69, 0xa5, 0x79, - 0x94, 0x66, 0x24, 0xa9, 0x1e, 0xee, 0x93, 0xa7, 0x3b, 0x9d, 0x09, 0x19, 0xaf, 0x66, 0xe9, 0x91, - 0xf9, 0x5d, 0x1d, 0x5a, 0x16, 0x8f, 0x02, 0xdf, 0x8b, 0x38, 0x3e, 0x84, 0x36, 0x5f, 0x8e, 0xb9, - 0xea, 0x42, 0xa3, 0x04, 0x24, 0x65, 0x73, 0x9a, 0xe8, 0x09, 0x84, 0xa9, 0x31, 0x1e, 0x69, 0x06, - 0x29, 0xd3, 0x82, 0x76, 0xca, 0x53, 0xc8, 0xdd, 0x84, 0x42, 0x36, 0x4a, 0x5d, 0xa4, 0x6c, 0x4b, - 0x1c, 0x72, 0xa4, 0x39, 0xa4, 0x56, 0x19, 0xb8, 0x40, 0x22, 0x8f, 0x0a, 0x24, 0x52, 0xaf, 0x5c, - 0xfe, 0x0a, 0x16, 0xf9, 0x22, 0xcf, 0x22, 0x8d, 0x52, 0xf3, 0x29, 0xcf, 0x4a, 0x1a, 0x79, 0x90, - 0xa3, 0x91, 0x66, 0xa9, 0x7b, 0x94, 0x5b, 0x05, 0x8f, 0xdc, 0x4f, 0x79, 0xa4, 0x55, 0x62, 0x1e, - 0xed, 0x52, 0x26, 0x92, 0xbb, 0x09, 0x16, 0xdb, 0x95, 0x19, 0x2b, 0x31, 0xc9, 0xa3, 0x02, 0x93, - 0x40, 0x65, 0x1a, 0x56, 0x50, 0xc9, 0xcf, 0x8b, 0x54, 0xa2, 0xf8, 0xe0, 0x56, 0xc9, 0x77, 0x25, - 0x97, 0x7c, 0x91, 0xe7, 0x92, 0xcd, 0xca, 0x24, 0xbe, 0x9f, 0x4c, 0x8e, 0xa8, 0x0d, 0x4a, 0x30, - 0xa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x6b, 0xaa, 0x29, - 0x63, 0x2f, 0x5e, 0xd0, 0x52, 0x8e, 0x61, 0x2b, 0x6b, 0x68, 0x9a, 0x44, 0x9d, 0x26, 0x5d, 0x5d, - 0x1c, 0x95, 0xde, 0xa7, 0x56, 0x27, 0xed, 0xe6, 0x33, 0x07, 0x0f, 0x81, 0x49, 0x1f, 0x45, 0xda, - 0x2a, 0x9d, 0x0d, 0x99, 0xce, 0x2e, 0xc9, 0x35, 0xab, 0xd3, 0x29, 0xfe, 0x03, 0x68, 0x13, 0x96, - 0x94, 0x49, 0x53, 0x9a, 0xb4, 0x48, 0x20, 0x95, 0x9f, 0xc2, 0x76, 0x76, 0x33, 0x50, 0x26, 0x2d, - 0x15, 0x25, 0x13, 0x4b, 0xc3, 0x7c, 0xd9, 0xda, 0xc5, 0xb2, 0x9d, 0x41, 0x53, 0x2f, 0xb1, 0xf2, - 0x16, 0x71, 0x07, 0xea, 0x81, 0x1d, 0x8a, 0x48, 0x13, 0x5b, 0xc2, 0x54, 0xe7, 0x76, 0x48, 0xb7, - 0x2f, 0x7d, 0x97, 0x50, 0x26, 0xe6, 0x23, 0xd8, 0x2a, 0xc8, 0x89, 0x8f, 0x85, 0x2f, 0xec, 0xb9, - 0x2e, 0xba, 0x1a, 0xa4, 0xd3, 0xac, 0x67, 0xd3, 0x98, 0x8f, 0xa0, 0x9d, 0xa2, 0x98, 0xca, 0x12, - 0xc4, 0x97, 0x5f, 0xf3, 0xe4, 0x42, 0xa5, 0x47, 0x14, 0x2e, 0xf0, 0xbf, 0xd5, 0x17, 0x9a, 0x9a, - 0xa5, 0x06, 0x77, 0xfe, 0x62, 0x40, 0xe7, 0xb9, 0x22, 0x70, 0xea, 0x47, 0xdc, 0x86, 0xce, 0x8b, - 0x78, 0x3e, 0xd7, 0x22, 0xb6, 0x86, 0x2d, 0xa8, 0x11, 0xef, 0x33, 0x03, 0xdb, 0x50, 0x97, 0xbc, - 0xce, 0xd6, 0x49, 0x48, 0x30, 0x65, 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, 0xed, 0xff, 0x0c, 0x1c, 0xc0, 0x5e, 0x41, 0xe8, 0x7a, 0xd3, 0x73, 0xea, 0x38, 0xf6, 0x7f, - 0xe3, 0xf8, 0xbb, 0x3a, 0x6c, 0xd3, 0x11, 0xf3, 0x38, 0x50, 0x13, 0xd0, 0x25, 0xe3, 0xbe, 0xea, - 0x33, 0xac, 0x78, 0x13, 0x18, 0x54, 0xdd, 0xf2, 0xf1, 0x58, 0xb7, 0x23, 0x56, 0x3d, 0x0d, 0x0c, - 0x2a, 0x2f, 0xfb, 0x34, 0x89, 0xba, 0x88, 0xdd, 0x7c, 0x21, 0x18, 0x54, 0xdd, 0xf8, 0xf1, 0x17, - 0xb9, 0xf6, 0xc6, 0x55, 0xef, 0x04, 0x83, 0x95, 0x77, 0x7f, 0xfc, 0x32, 0x23, 0x00, 0x5c, 0xf1, - 0x5a, 0x30, 0x58, 0x75, 0xff, 0xc7, 0x87, 0x29, 0x5f, 0x60, 0xf5, 0x9b, 0xc1, 0x60, 0xc5, 0x37, - 0x00, 0xe5, 0x46, 0x5d, 0x6d, 0xaa, 0x9e, 0x02, 0x06, 0x95, 0xd7, 0x7a, 0xfc, 0x3c, 0x21, 0x24, - 0xac, 0x7c, 0x6e, 0x18, 0x54, 0x7f, 0x3c, 0x50, 0x86, 0xb2, 0x0f, 0xd2, 0x55, 0xef, 0x08, 0x83, - 0x95, 0x9f, 0x05, 0xf8, 0x38, 0xcf, 0x70, 0xb8, 0xf2, 0x35, 0x61, 0xb0, 0xfa, 0xe3, 0x80, 0x92, - 0x9c, 0x7d, 0x7d, 0x56, 0xbf, 0x29, 0x0c, 0x56, 0x7d, 0x1f, 0x5c, 0x36, 0xe4, 0x5b, 0xd5, 0x83, - 0xef, 0x03, 0x00, 0x00, 0xff, 0xff, 0x7e, 0xa9, 0x42, 0xf7, 0xc0, 0x12, 0x00, 0x00, + // 1654 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6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0x8e, 0xcf, 0xa1, 0xc3, 0xef, 0x66, + 0x5c, 0x56, 0xa1, 0x56, 0x00, 0x92, 0xb4, 0x39, 0x8f, 0xf5, 0x04, 0xc2, 0xc4, 0x18, 0x1f, 0x2b, + 0x06, 0x29, 0xd2, 0x82, 0x72, 0xca, 0x52, 0xc8, 0x47, 0x31, 0x85, 0xd4, 0x0a, 0x55, 0x24, 0x6d, + 0x0b, 0x1c, 0xf2, 0x58, 0x71, 0x48, 0xbd, 0x34, 0x70, 0x8e, 0x44, 0x4e, 0x72, 0x24, 0xd2, 0x28, + 0x5d, 0xfe, 0x06, 0x16, 0xf9, 0x34, 0xcb, 0x22, 0xcd, 0x42, 0xf1, 0x49, 0xcf, 0x52, 0x1a, 0xf9, + 0x38, 0x43, 0x23, 0xad, 0x42, 0xf5, 0x48, 0xb7, 0x12, 0x1e, 0x79, 0x96, 0xf0, 0x48, 0xbb, 0xc0, + 0x3c, 0xca, 0xa5, 0x48, 0x24, 0x1f, 0xc5, 0x58, 0xec, 0x94, 0x66, 0xac, 0xc0, 0x24, 0x27, 0x39, + 0x26, 0x81, 0xd2, 0x34, 0x6c, 0xa0, 0x92, 0x5f, 0xe4, 0xa9, 0x44, 0xf2, 0xc1, 0x61, 0xc1, 0x77, + 0x23, 0x97, 0x7c, 0x9a, 0xe5, 0x92, 0xad, 0xd2, 0x24, 0x7e, 0x37, 0x99, 0x3c, 0xa6, 0x32, 0x28, + 0xc0, 0x8c, 0x0a, 0x91, 0xfb, 0xbe, 0xeb, 0x2b, 0x1e, 0x90, 0x03, 0xfd, 0x88, 0xca, 0x35, 0x05, + 0xd7, 0x77, 0x10, 0x8f, 0x28, 0xd9, 0x0c, 0xb4, 0xf4, 0x3f, 0x6a, 0xa9, 0x2f, 0xe1, 0x87, 0x0a, + 0xcd, 0x32, 0x43, 0x53, 0x39, 0x8a, 0x6f, 0x8a, 0x77, 0xcb, 0xfd, 0x80, 0x80, 0x24, 0xb9, 0x26, + 0x1e, 0xe2, 0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 0x62, + 0x15, 0x6c, 0x43, 0x9d, 0xc8, 0x8d, 0x69, 0xd8, 0x81, 0x86, 0x20, 0x2f, 0x56, 0x25, 0x21, 0xb1, + 0x16, 0xab, 0xe1, 0x36, 0x74, 0x12, 0x9a, 0x60, 0x75, 0x1a, 0x26, 0xac, 0xc9, 0x1a, 0xb8, 0x05, + 0xed, 0x98, 0x1d, 0xd8, 0x0e, 0x76, 0xa1, 0xa5, 0x8a, 0x99, 0x21, 0x02, 0x34, 0xe5, 0x41, 0xb1, + 0x5d, 0x8a, 0x2c, 0xea, 0x90, 0x0d, 0x28, 0x40, 0x82, 0x6c, 0xb6, 0x87, 0x3d, 0x80, 0x14, 0xd3, + 0x6c, 0x9f, 0x02, 0xc6, 0x68, 0x66, 0x07, 0x4f, 0xfe, 0xdc, 0x80, 0x76, 0x5c, 0x47, 0xd8, 0x84, + 0xea, 0x9b, 0x2f, 0x58, 0x05, 0x77, 0x60, 0x7b, 0xe2, 0x84, 0xdc, 0x77, 0xcc, 0xd5, 0x39, 0xd1, + 0x34, 0xd3, 0x48, 0x74, 0xee, 0xcc, 0x5c, 0xcb, 0x76, 0x16, 0x52, 0x54, 0xa5, 0x40, 0x67, 0xa6, + 0xf5, 0xda, 0x75, 0x66, 0x9c, 0xd5, 0x90, 0xc1, 0xd6, 0x97, 0x8e, 0x19, 0x85, 0x4b, 0xd7, 0xb7, + 0xff, 0xc0, 0x2d, 0x56, 0xc7, 0x3d, 0xd8, 0x99, 0x38, 0x41, 0x34, 0x9f, 0xdb, 0x33, 0x9b, 0x3b, + 0xe1, 0xe7, 0x91, 0x63, 0x05, 0xac, 0x81, 0x08, 0xbd, 0x2f, 0x9d, 0x1b, 0xc7, 0xfd, 0xda, 0x51, + 0xbd, 0x0d, 0x6b, 0xe2, 0x10, 0x06, 0x67, 0x66, 0xc0, 0x5f, 0x46, 0xde, 0xca, 0x9e, 0x99, 0x21, + 0x3f, 0xb5, 0x2c, 0x9f, 0x07, 0x01, 0xe3, 0x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, 0xa5, 0x11, 0x00, 0x00, } diff --git a/types/types.proto b/types/types.proto index 8d0860c9a..69f9a5735 100644 --- a/types/types.proto +++ b/types/types.proto @@ -165,7 +165,7 @@ message ResponseFlush{ } message ResponseInfo { - string info = 1; + string data = 1; string version = 2; uint64 last_block_height = 3; bytes last_block_app_hash = 4; From f8167872d8ddd3a2362452ef1414991b5afa8862 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 26 Dec 2016 22:12:32 -0800 Subject: [PATCH 36/40] EndBlock also returns ResponseEndBlock --- client/client.go | 2 +- client/grpc_client.go | 10 +++++++--- client/local_client.go | 12 ++++++------ client/socket_client.go | 10 +++++++--- cmd/counter/main.go | 3 ++- cmd/dummy/main.go | 3 ++- example/chain_aware/chain_aware_app.go | 7 ++++--- example/chain_aware/chain_aware_test.go | 3 ++- example/dummy/dummy_test.go | 4 ++-- example/dummy/persistent_dummy.go | 4 ++-- server/socket_server.go | 9 +++++---- types/application.go | 6 +++--- types/messages.go | 5 +++-- 13 files changed, 46 insertions(+), 32 deletions(-) diff --git a/client/client.go b/client/client.go index c39357ba1..c3c1e151d 100644 --- a/client/client.go +++ b/client/client.go @@ -38,7 +38,7 @@ type Client interface { InitChainSync(validators []*types.Validator) (err error) BeginBlockSync(hash []byte, header *types.Header) (err error) - EndBlockSync(height uint64) (changedValidators []*types.Validator, err error) + EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) } //---------------------------------------- diff --git a/client/grpc_client.go b/client/grpc_client.go index e72f31fb5..15cda522e 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -329,10 +329,14 @@ func (cli *grpcClient) BeginBlockSync(hash []byte, header *types.Header) (err er return cli.Error() } -func (cli *grpcClient) EndBlockSync(height uint64) (validators []*types.Validator, err error) { +func (cli *grpcClient) EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) { reqres := cli.EndBlockAsync(height) if err := cli.Error(); err != nil { - return nil, err + return resEndBlock, err + } + if resEndBlock_ := reqres.Response.GetEndBlock(); resEndBlock_ != nil { + return *resEndBlock_, nil + } else { + return resEndBlock, nil } - return reqres.Response.GetEndBlock().Diffs, nil } diff --git a/client/local_client.go b/client/local_client.go index 0c363d0c2..ee5d6f281 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -136,14 +136,14 @@ func (app *localClient) BeginBlockAsync(hash []byte, header *types.Header) *ReqR func (app *localClient) EndBlockAsync(height uint64) *ReqRes { app.mtx.Lock() - var validators []*types.Validator + var resEndBlock types.ResponseEndBlock if bcApp, ok := app.Application.(types.BlockchainAware); ok { - validators = bcApp.EndBlock(height) + resEndBlock = bcApp.EndBlock(height) } app.mtx.Unlock() return app.callback( types.ToRequestEndBlock(height), - types.ToResponseEndBlock(validators), + types.ToResponseEndBlock(resEndBlock), ) } @@ -217,13 +217,13 @@ func (app *localClient) BeginBlockSync(hash []byte, header *types.Header) (err e return nil } -func (app *localClient) EndBlockSync(height uint64) (changedValidators []*types.Validator, err error) { +func (app *localClient) EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) { app.mtx.Lock() if bcApp, ok := app.Application.(types.BlockchainAware); ok { - changedValidators = bcApp.EndBlock(height) + resEndBlock = bcApp.EndBlock(height) } app.mtx.Unlock() - return changedValidators, nil + return resEndBlock, nil } //------------------------------------------------------- diff --git a/client/socket_client.go b/client/socket_client.go index 8c5c84287..aecaeea52 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -373,13 +373,17 @@ func (cli *socketClient) BeginBlockSync(hash []byte, header *types.Header) (err return nil } -func (cli *socketClient) EndBlockSync(height uint64) (validators []*types.Validator, err error) { +func (cli *socketClient) EndBlockSync(height uint64) (resEndBlock types.ResponseEndBlock, err error) { reqres := cli.queueRequest(types.ToRequestEndBlock(height)) cli.FlushSync() if err := cli.Error(); err != nil { - return nil, err + return resEndBlock, err + } + if resEndBlock_ := reqres.Response.GetEndBlock(); resEndBlock_ != nil { + return *resEndBlock_, nil + } else { + return resEndBlock, nil } - return reqres.Response.GetEndBlock().Diffs, nil } //---------------------------------------- diff --git a/cmd/counter/main.go b/cmd/counter/main.go index c04a40e0f..0f284af9e 100644 --- a/cmd/counter/main.go +++ b/cmd/counter/main.go @@ -17,7 +17,7 @@ func main() { app := counter.NewCounterApplication(*serialPtr) // Start the listener - _, err := server.NewServer(*addrPtr, *tmspPtr, app) + srv, err := server.NewServer(*addrPtr, *tmspPtr, app) if err != nil { Exit(err.Error()) } @@ -25,6 +25,7 @@ func main() { // Wait forever TrapSignal(func() { // Cleanup + srv.Stop() }) } diff --git a/cmd/dummy/main.go b/cmd/dummy/main.go index 8a1465c49..fe7ae750b 100644 --- a/cmd/dummy/main.go +++ b/cmd/dummy/main.go @@ -25,7 +25,7 @@ func main() { } // Start the listener - _, err := server.NewServer(*addrPtr, *tmspPtr, app) + srv, err := server.NewServer(*addrPtr, *tmspPtr, app) if err != nil { Exit(err.Error()) } @@ -33,6 +33,7 @@ func main() { // Wait forever TrapSignal(func() { // Cleanup + srv.Stop() }) } diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index 15d8f8761..cd91c6825 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -15,7 +15,7 @@ func main() { flag.Parse() // Start the listener - _, err := server.NewServer(*addrPtr, *tmspPtr, NewChainAwareApplication()) + srv, err := server.NewServer(*addrPtr, *tmspPtr, NewChainAwareApplication()) if err != nil { Exit(err.Error()) } @@ -23,6 +23,7 @@ func main() { // Wait forever TrapSignal(func() { // Cleanup + srv.Stop() }) } @@ -65,9 +66,9 @@ func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) return } -func (app *ChainAwareApplication) EndBlock(height uint64) []*types.Validator { +func (app *ChainAwareApplication) EndBlock(height uint64) (resEndBlock types.ResponseEndBlock) { app.endCount += 1 - return nil + return } func (app *ChainAwareApplication) InitChain(vals []*types.Validator) { diff --git a/example/chain_aware/chain_aware_test.go b/example/chain_aware/chain_aware_test.go index bad7c8120..fd3754704 100644 --- a/example/chain_aware/chain_aware_test.go +++ b/example/chain_aware/chain_aware_test.go @@ -16,10 +16,11 @@ func TestChainAware(t *testing.T) { app := NewChainAwareApplication() // Start the listener - _, err := server.NewServer("unix://test.sock", "socket", app) + srv, err := server.NewServer("unix://test.sock", "socket", app) if err != nil { t.Fatal(err) } + defer srv.Stop() // Connect to the socket client, err := tmspcli.NewSocketClient("unix://test.sock", false) diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index eea7f4a85..f1287c9d3 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -179,10 +179,10 @@ func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff [ t.Fatal(r) } } - diff2 := dummyChain.EndBlock(height) + resEndBlock := dummyChain.EndBlock(height) dummy.Commit() - valsEqual(t, diff, diff2) + valsEqual(t, diff, resEndBlock.Diffs) } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index fc2b38cd5..dc774ca36 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -113,8 +113,8 @@ func (app *PersistentDummyApplication) BeginBlock(hash []byte, header *types.Hea } // Update the validator set -func (app *PersistentDummyApplication) EndBlock(height uint64) (diffs []*types.Validator) { - return app.changes +func (app *PersistentDummyApplication) EndBlock(height uint64) (resEndBlock types.ResponseEndBlock) { + return types.ResponseEndBlock{Diffs: app.changes} } //----------------------------------------- diff --git a/server/socket_server.go b/server/socket_server.go index 43b4ed638..5a916ef4e 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -168,7 +168,8 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types case *types.Request_Flush: responses <- types.ToResponseFlush() case *types.Request_Info: - responses <- types.ToResponseInfo(s.app.Info()) + resInfo := s.app.Info() + responses <- types.ToResponseInfo(resInfo) case *types.Request_SetOption: so := r.SetOption logStr := s.app.SetOption(so.Key, so.Value) @@ -197,10 +198,10 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types responses <- types.ToResponseBeginBlock() case *types.Request_EndBlock: if app, ok := s.app.(types.BlockchainAware); ok { - validators := app.EndBlock(r.EndBlock.Height) - responses <- types.ToResponseEndBlock(validators) + resEndBlock := app.EndBlock(r.EndBlock.Height) + responses <- types.ToResponseEndBlock(resEndBlock) } else { - responses <- types.ToResponseEndBlock(nil) + responses <- types.ToResponseEndBlock(types.ResponseEndBlock{}) } default: responses <- types.ToResponseException("Unknown request") diff --git a/types/application.go b/types/application.go index d124afd50..59b619e88 100644 --- a/types/application.go +++ b/types/application.go @@ -38,7 +38,7 @@ type BlockchainAware interface { // Signals the end of a block // diffs: changed validators from app to TendermintCore - EndBlock(height uint64) (diffs []*Validator) + EndBlock(height uint64) ResponseEndBlock } //------------------------------------ @@ -103,8 +103,8 @@ func (app *GRPCApplication) BeginBlock(ctx context.Context, req *RequestBeginBlo func (app *GRPCApplication) EndBlock(ctx context.Context, req *RequestEndBlock) (*ResponseEndBlock, error) { if chainAware, ok := app.app.(BlockchainAware); ok { - diffs := chainAware.EndBlock(req.Height) - return &ResponseEndBlock{diffs}, nil + resEndBlock := chainAware.EndBlock(req.Height) + return &resEndBlock, nil } return &ResponseEndBlock{}, nil } diff --git a/types/messages.go b/types/messages.go index afd4548e0..428b05dc6 100644 --- a/types/messages.go +++ b/types/messages.go @@ -142,9 +142,10 @@ func ToResponseBeginBlock() *Response { } } -func ToResponseEndBlock(validators []*Validator) *Response { +func ToResponseEndBlock(resEndBlock ResponseEndBlock) *Response { + resEndBlockCopy := resEndBlock return &Response{ - Value: &Response_EndBlock{&ResponseEndBlock{validators}}, + Value: &Response_EndBlock{&resEndBlockCopy}, } } From 490a96ef6697aa5ef3d170a8a88c0e0bd724ff2b Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 15:18:38 -0500 Subject: [PATCH 37/40] drop unneeded variable copy --- types/messages.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/types/messages.go b/types/messages.go index 428b05dc6..2d256d8ca 100644 --- a/types/messages.go +++ b/types/messages.go @@ -94,9 +94,8 @@ func ToResponseFlush() *Response { } func ToResponseInfo(resInfo ResponseInfo) *Response { - resInfoCopy := resInfo return &Response{ - Value: &Response_Info{&resInfoCopy}, + Value: &Response_Info{&resInfo}, } } @@ -143,9 +142,8 @@ func ToResponseBeginBlock() *Response { } func ToResponseEndBlock(resEndBlock ResponseEndBlock) *Response { - resEndBlockCopy := resEndBlock return &Response{ - Value: &Response_EndBlock{&resEndBlockCopy}, + Value: &Response_EndBlock{&resEndBlock}, } } From 80f377135b08c01deeed6d8b19eb896e5f159b96 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 15:27:08 -0500 Subject: [PATCH 38/40] AppendTx -> DeliverTx --- README.md | 10 +- client/client.go | 4 +- client/grpc_client.go | 14 +-- client/local_client.go | 12 +-- client/socket_client.go | 14 +-- cmd/tmsp-cli/tmsp-cli.go | 12 +-- example/chain_aware/chain_aware_app.go | 2 +- example/counter/counter.go | 2 +- example/dummy/dummy.go | 2 +- example/dummy/dummy_test.go | 6 +- example/dummy/persistent_dummy.go | 4 +- example/example_test.go | 34 +++---- example/nil/nil_app.go | 2 +- example/python/app.py | 2 +- example/python/tmsp/msg.py | 4 +- example/python3/app.py | 2 +- example/python3/tmsp/msg.py | 4 +- server/socket_server.go | 6 +- tests/test_app/app.go | 8 +- tests/test_app/main.go | 16 ++-- tests/test_cli/ex1.tmsp | 4 +- tests/test_cli/ex1.tmsp.out | 4 +- tests/test_cli/ex2.tmsp | 6 +- tests/test_cli/ex2.tmsp.out | 6 +- types/application.go | 10 +- types/messages.go | 8 +- types/types.pb.go | 126 ++++++++++++------------- types/types.proto | 12 +-- 28 files changed, 168 insertions(+), 168 deletions(-) diff --git a/README.md b/README.md index b4af06f08..cb757695b 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Note this prefixing does not apply for grpc. TMSP requests/responses are simple Protobuf messages. Check out the [schema file](https://github.com/tendermint/tmsp/blob/master/types/types.proto). -#### AppendTx +#### DeliverTx * __Arguments__: * `Data ([]byte)`: The request transaction bytes * __Returns__: @@ -71,7 +71,7 @@ TMSP 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 AppendTx, but they happen on different connections - CheckTx from the mempool connection, and AppendTx 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 appendtxs, 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 stte 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`, @@ -122,7 +122,7 @@ TMSP requests/responses are simple Protobuf messages. Check out the [schema fil * __Arguments__: * `Height (uint64)`: The block height that is starting * __Usage__:
- Signals the beginning of a new block. Called prior to any AppendTxs. + Signals the beginning of a new block. Called prior to any DeliverTxs. #### EndBlock * __Arguments__: @@ -149,7 +149,7 @@ TMSP requests/responses are simple Protobuf messages. Check out the [schema fil ##### Jan 23th, 2016 * Added CheckTx/Query TMSP message types -* Added Result/Log fields to AppendTx/CheckTx/SetOption +* Added Result/Log fields to DeliverTx/CheckTx/SetOption * Removed Listener messages * Removed Code from ResponseSetOption and ResponseGetHash * Made examples BigEndian @@ -160,4 +160,4 @@ TMSP requests/responses are simple Protobuf messages. Check out the [schema fil ##### Jan 8th, 2016 -* Tendermint/TMSP now comes to consensus on the order first before AppendTx. +* Tendermint/TMSP now comes to consensus on the order first before DeliverTx. diff --git a/client/client.go b/client/client.go index c3c1e151d..0305b29e2 100644 --- a/client/client.go +++ b/client/client.go @@ -18,7 +18,7 @@ type Client interface { EchoAsync(msg string) *ReqRes InfoAsync() *ReqRes SetOptionAsync(key string, value string) *ReqRes - AppendTxAsync(tx []byte) *ReqRes + DeliverTxAsync(tx []byte) *ReqRes CheckTxAsync(tx []byte) *ReqRes QueryAsync(tx []byte) *ReqRes CommitAsync() *ReqRes @@ -27,7 +27,7 @@ type Client interface { EchoSync(msg string) (res types.Result) InfoSync() (resInfo types.ResponseInfo, err error) SetOptionSync(key string, value string) (res types.Result) - AppendTxSync(tx []byte) (res types.Result) + DeliverTxSync(tx []byte) (res types.Result) CheckTxSync(tx []byte) (res types.Result) QuerySync(tx []byte) (res types.Result) CommitSync() (res types.Result) diff --git a/client/grpc_client.go b/client/grpc_client.go index 15cda522e..ac6beb06b 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -155,13 +155,13 @@ func (cli *grpcClient) SetOptionAsync(key string, value string) *ReqRes { return cli.finishAsyncCall(req, &types.Response{&types.Response_SetOption{res}}) } -func (cli *grpcClient) AppendTxAsync(tx []byte) *ReqRes { - req := types.ToRequestAppendTx(tx) - res, err := cli.client.AppendTx(context.Background(), req.GetAppendTx(), grpc.FailFast(true)) +func (cli *grpcClient) DeliverTxAsync(tx []byte) *ReqRes { + req := types.ToRequestDeliverTx(tx) + res, err := cli.client.DeliverTx(context.Background(), req.GetDeliverTx(), grpc.FailFast(true)) if err != nil { cli.StopForError(err) } - return cli.finishAsyncCall(req, &types.Response{&types.Response_AppendTx{res}}) + return cli.finishAsyncCall(req, &types.Response{&types.Response_DeliverTx{res}}) } func (cli *grpcClient) CheckTxAsync(tx []byte) *ReqRes { @@ -283,12 +283,12 @@ func (cli *grpcClient) SetOptionSync(key string, value string) (res types.Result return types.Result{Code: OK, Data: nil, Log: resp.Log} } -func (cli *grpcClient) AppendTxSync(tx []byte) (res types.Result) { - reqres := cli.AppendTxAsync(tx) +func (cli *grpcClient) DeliverTxSync(tx []byte) (res types.Result) { + reqres := cli.DeliverTxAsync(tx) if res := cli.checkErrGetResult(); res.IsErr() { return res } - resp := reqres.Response.GetAppendTx() + resp := reqres.Response.GetDeliverTx() return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } diff --git a/client/local_client.go b/client/local_client.go index ee5d6f281..9b0eeaf00 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -69,13 +69,13 @@ func (app *localClient) SetOptionAsync(key string, value string) *ReqRes { ) } -func (app *localClient) AppendTxAsync(tx []byte) *ReqRes { +func (app *localClient) DeliverTxAsync(tx []byte) *ReqRes { app.mtx.Lock() - res := app.Application.AppendTx(tx) + res := app.Application.DeliverTx(tx) app.mtx.Unlock() return app.callback( - types.ToRequestAppendTx(tx), - types.ToResponseAppendTx(res.Code, res.Data, res.Log), + types.ToRequestDeliverTx(tx), + types.ToResponseDeliverTx(res.Code, res.Data, res.Log), ) } @@ -171,9 +171,9 @@ func (app *localClient) SetOptionSync(key string, value string) (res types.Resul return types.OK.SetLog(log) } -func (app *localClient) AppendTxSync(tx []byte) (res types.Result) { +func (app *localClient) DeliverTxSync(tx []byte) (res types.Result) { app.mtx.Lock() - res = app.Application.AppendTx(tx) + res = app.Application.DeliverTx(tx) app.mtx.Unlock() return res } diff --git a/client/socket_client.go b/client/socket_client.go index aecaeea52..2a914f815 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -243,8 +243,8 @@ func (cli *socketClient) SetOptionAsync(key string, value string) *ReqRes { return cli.queueRequest(types.ToRequestSetOption(key, value)) } -func (cli *socketClient) AppendTxAsync(tx []byte) *ReqRes { - return cli.queueRequest(types.ToRequestAppendTx(tx)) +func (cli *socketClient) DeliverTxAsync(tx []byte) *ReqRes { + return cli.queueRequest(types.ToRequestDeliverTx(tx)) } func (cli *socketClient) CheckTxAsync(tx []byte) *ReqRes { @@ -315,13 +315,13 @@ func (cli *socketClient) SetOptionSync(key string, value string) (res types.Resu return types.Result{Code: OK, Data: nil, Log: resp.Log} } -func (cli *socketClient) AppendTxSync(tx []byte) (res types.Result) { - reqres := cli.queueRequest(types.ToRequestAppendTx(tx)) +func (cli *socketClient) DeliverTxSync(tx []byte) (res types.Result) { + reqres := cli.queueRequest(types.ToRequestDeliverTx(tx)) cli.FlushSync() if err := cli.Error(); err != nil { return types.ErrInternalError.SetLog(err.Error()) } - resp := reqres.Response.GetAppendTx() + resp := reqres.Response.GetDeliverTx() return types.Result{Code: resp.Code, Data: resp.Data, Log: resp.Log} } @@ -429,8 +429,8 @@ func resMatchesReq(req *types.Request, res *types.Response) (ok bool) { _, ok = res.Value.(*types.Response_Info) case *types.Request_SetOption: _, ok = res.Value.(*types.Response_SetOption) - case *types.Request_AppendTx: - _, ok = res.Value.(*types.Response_AppendTx) + case *types.Request_DeliverTx: + _, ok = res.Value.(*types.Response_DeliverTx) case *types.Request_CheckTx: _, ok = res.Value.(*types.Response_CheckTx) case *types.Request_Commit: diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/tmsp-cli/tmsp-cli.go index 2bf5b8624..b1d0d33e4 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/tmsp-cli/tmsp-cli.go @@ -104,10 +104,10 @@ func main() { }, }, { - Name: "append_tx", - Usage: "Append a new tx to application", + Name: "deliver_tx", + Usage: "Deliver a new tx to application", Action: func(c *cli.Context) error { - return cmdAppendTx(c) + return cmdDeliverTx(c) }, }, { @@ -250,16 +250,16 @@ func cmdSetOption(c *cli.Context) error { } // Append a new tx to application -func cmdAppendTx(c *cli.Context) error { +func cmdDeliverTx(c *cli.Context) error { args := c.Args() if len(args) != 1 { - return errors.New("Command append_tx takes 1 argument") + return errors.New("Command deliver_tx takes 1 argument") } txBytes, err := stringOrHexToBytes(c.Args()[0]) if err != nil { return err } - res := client.AppendTxSync(txBytes) + res := client.DeliverTxSync(txBytes) rsp := newResponse(res, string(res.Data), true) printResponse(c, rsp) return nil diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index cd91c6825..35774d668 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -45,7 +45,7 @@ func (app *ChainAwareApplication) SetOption(key string, value string) (log strin return "" } -func (app *ChainAwareApplication) AppendTx(tx []byte) types.Result { +func (app *ChainAwareApplication) DeliverTx(tx []byte) types.Result { return types.NewResultOK(nil, "") } diff --git a/example/counter/counter.go b/example/counter/counter.go index 221ddf04d..663abcab0 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -28,7 +28,7 @@ func (app *CounterApplication) SetOption(key string, value string) (log string) return "" } -func (app *CounterApplication) AppendTx(tx []byte) types.Result { +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))) diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index ca7bc525b..7e0be585c 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -28,7 +28,7 @@ func (app *DummyApplication) SetOption(key string, value string) (log string) { } // tx is either "key=value" or just arbitrary bytes -func (app *DummyApplication) AppendTx(tx []byte) types.Result { +func (app *DummyApplication) DeliverTx(tx []byte) types.Result { parts := strings.Split(string(tx), "=") if len(parts) == 2 { app.state.Set([]byte(parts[0]), []byte(parts[1])) diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index f1287c9d3..2f486aa5f 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -13,10 +13,10 @@ import ( ) func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value string) { - if r := dummy.AppendTx(tx); r.IsErr() { + if r := dummy.DeliverTx(tx); r.IsErr() { t.Fatal(r) } - if r := dummy.AppendTx(tx); r.IsErr() { + if r := dummy.DeliverTx(tx); r.IsErr() { t.Fatal(r) } @@ -175,7 +175,7 @@ func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff [ dummyChain := dummy.(types.BlockchainAware) // hmm... dummyChain.BeginBlock(hash, header) for _, tx := range txs { - if r := dummy.AppendTx(tx); r.IsErr() { + if r := dummy.DeliverTx(tx); r.IsErr() { t.Fatal(r) } } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index dc774ca36..f4dbc6ee1 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -59,7 +59,7 @@ func (app *PersistentDummyApplication) SetOption(key string, value string) (log } // tx is either "key=value" or just arbitrary bytes -func (app *PersistentDummyApplication) AppendTx(tx []byte) types.Result { +func (app *PersistentDummyApplication) DeliverTx(tx []byte) types.Result { // if it starts with "val:", update the validator set // format is "val:pubkey/power" if isValidatorTx(tx) { @@ -69,7 +69,7 @@ func (app *PersistentDummyApplication) AppendTx(tx []byte) types.Result { } // otherwise, update the key-value store - return app.app.AppendTx(tx) + return app.app.DeliverTx(tx) } func (app *PersistentDummyApplication) CheckTx(tx []byte) types.Result { diff --git a/example/example_test.go b/example/example_test.go index 3293be555..6ff334d3f 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -35,7 +35,7 @@ func TestGRPC(t *testing.T) { func testStream(t *testing.T, app types.Application) { - numAppendTxs := 200000 + numDeliverTxs := 200000 // Start the listener server, err := server.NewSocketServer("unix://test.sock", app) @@ -57,15 +57,15 @@ func testStream(t *testing.T, app types.Application) { client.SetResponseCallback(func(req *types.Request, res *types.Response) { // Process response switch r := res.Value.(type) { - case *types.Response_AppendTx: + case *types.Response_DeliverTx: counter += 1 - if r.AppendTx.Code != types.CodeType_OK { - t.Error("AppendTx failed with ret_code", r.AppendTx.Code) + if r.DeliverTx.Code != types.CodeType_OK { + t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code) } - if counter > numAppendTxs { - t.Fatalf("Too many AppendTx responses. Got %d, expected %d", counter, numAppendTxs) + if counter > numDeliverTxs { + t.Fatalf("Too many DeliverTx responses. Got %d, expected %d", counter, numDeliverTxs) } - if counter == numAppendTxs { + if counter == numDeliverTxs { go func() { time.Sleep(time.Second * 2) // Wait for a bit to allow counter overflow close(done) @@ -80,9 +80,9 @@ func testStream(t *testing.T, app types.Application) { }) // Write requests - for counter := 0; counter < numAppendTxs; counter++ { + for counter := 0; counter < numDeliverTxs; counter++ { // Send request - reqRes := client.AppendTxAsync([]byte("test")) + reqRes := client.DeliverTxAsync([]byte("test")) _ = reqRes // check err ? @@ -108,7 +108,7 @@ func dialerFunc(addr string, timeout time.Duration) (net.Conn, error) { func testGRPCSync(t *testing.T, app *types.GRPCApplication) { - numAppendTxs := 2000 + numDeliverTxs := 2000 // Start the listener server, err := server.NewGRPCServer("unix://test.sock", app) @@ -127,21 +127,21 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { client := types.NewTMSPApplicationClient(conn) // Write requests - for counter := 0; counter < numAppendTxs; counter++ { + for counter := 0; counter < numDeliverTxs; counter++ { // Send request - response, err := client.AppendTx(context.Background(), &types.RequestAppendTx{[]byte("test")}) + response, err := client.DeliverTx(context.Background(), &types.RequestDeliverTx{[]byte("test")}) if err != nil { - t.Fatalf("Error in GRPC AppendTx: %v", err.Error()) + t.Fatalf("Error in GRPC DeliverTx: %v", err.Error()) } counter += 1 if response.Code != types.CodeType_OK { - t.Error("AppendTx failed with ret_code", response.Code) + t.Error("DeliverTx failed with ret_code", response.Code) } - if counter > numAppendTxs { - t.Fatal("Too many AppendTx responses") + if counter > numDeliverTxs { + t.Fatal("Too many DeliverTx responses") } t.Log("response", counter) - if counter == numAppendTxs { + if counter == numDeliverTxs { go func() { time.Sleep(time.Second * 2) // Wait for a bit to allow counter overflow }() diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index 7cc01c052..928395bc0 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -19,7 +19,7 @@ func (app *NilApplication) SetOption(key string, value string) (log string) { return "" } -func (app *NilApplication) AppendTx(tx []byte) types.Result { +func (app *NilApplication) DeliverTx(tx []byte) types.Result { return types.NewResultOK(nil, "") } diff --git a/example/python/app.py b/example/python/app.py index b8cfcca8b..335188fa5 100644 --- a/example/python/app.py +++ b/example/python/app.py @@ -24,7 +24,7 @@ class CounterApplication(): self.serial = True return 0 - def append_tx(self, txBytes): + def deliver_tx(self, txBytes): if self.serial: txByteArray = bytearray(txBytes) if len(txBytes) >= 2 and txBytes[:2] == "0x": diff --git a/example/python/tmsp/msg.py b/example/python/tmsp/msg.py index a03c0a073..fcb85c1f1 100644 --- a/example/python/tmsp/msg.py +++ b/example/python/tmsp/msg.py @@ -6,7 +6,7 @@ message_types = { 0x02: "flush", 0x03: "info", 0x04: "set_option", - 0x21: "append_tx", + 0x21: "deliver_tx", 0x22: "check_tx", 0x23: "commit", 0x24: "add_listener", @@ -32,7 +32,7 @@ class RequestDecoder(): def set_option(self): return decode_string(self.reader), decode_string(self.reader) - def append_tx(self): + def deliver_tx(self): return decode_string(self.reader) def check_tx(self): diff --git a/example/python3/app.py b/example/python3/app.py index c3d11490e..a0b727b74 100644 --- a/example/python3/app.py +++ b/example/python3/app.py @@ -24,7 +24,7 @@ class CounterApplication(): self.serial = True return 0 - def append_tx(self, txBytes): + def deliver_tx(self, txBytes): if self.serial: txByteArray = bytearray(txBytes) if len(txBytes) >= 2 and txBytes[:2] == "0x": diff --git a/example/python3/tmsp/msg.py b/example/python3/tmsp/msg.py index ae30f88d9..e8d69db96 100644 --- a/example/python3/tmsp/msg.py +++ b/example/python3/tmsp/msg.py @@ -6,7 +6,7 @@ message_types = { 0x02: "flush", 0x03: "info", 0x04: "set_option", - 0x21: "append_tx", + 0x21: "deliver_tx", 0x22: "check_tx", 0x23: "commit", 0x24: "add_listener", @@ -32,7 +32,7 @@ class RequestDecoder(): def set_option(self): return decode_string(self.reader), decode_string(self.reader) - def append_tx(self): + def deliver_tx(self): return decode_string(self.reader) def check_tx(self): diff --git a/server/socket_server.go b/server/socket_server.go index 5a916ef4e..2be3bbb5c 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -174,9 +174,9 @@ func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types so := r.SetOption logStr := s.app.SetOption(so.Key, so.Value) responses <- types.ToResponseSetOption(logStr) - case *types.Request_AppendTx: - res := s.app.AppendTx(r.AppendTx.Tx) - responses <- types.ToResponseAppendTx(res.Code, res.Data, res.Log) + case *types.Request_DeliverTx: + res := s.app.DeliverTx(r.DeliverTx.Tx) + responses <- types.ToResponseDeliverTx(res.Code, res.Data, res.Log) case *types.Request_CheckTx: res := s.app.CheckTx(r.CheckTx.Tx) responses <- types.ToResponseCheckTx(res.Code, res.Data, res.Log) diff --git a/tests/test_app/app.go b/tests/test_app/app.go index 44e36eebc..b38d07373 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -62,15 +62,15 @@ func Commit(client tmspcli.Client, hashExp []byte) { } } -func AppendTx(client tmspcli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { - res := client.AppendTxSync(txBytes) +func DeliverTx(client tmspcli.Client, txBytes []byte, codeExp types.CodeType, dataExp []byte) { + res := client.DeliverTxSync(txBytes) code, data, log := res.Code, res.Data, res.Log if code != codeExp { - panic(Fmt("AppendTx response code was unexpected. Got %v expected %v. Log: %v", + panic(Fmt("DeliverTx response code was unexpected. Got %v expected %v. Log: %v", code, codeExp, log)) } if !bytes.Equal(data, dataExp) { - panic(Fmt("AppendTx response data was unexpected. Got %X expected %X", + panic(Fmt("DeliverTx response data was unexpected. Got %X expected %X", data, dataExp)) } } diff --git a/tests/test_app/main.go b/tests/test_app/main.go index ada637181..db627a3e9 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -34,15 +34,15 @@ func testCounter() { SetOption(client, "serial", "on") Commit(client, nil) - AppendTx(client, []byte("abc"), types.CodeType_BadNonce, nil) + DeliverTx(client, []byte("abc"), types.CodeType_BadNonce, nil) Commit(client, nil) - AppendTx(client, []byte{0x00}, types.CodeType_OK, nil) + DeliverTx(client, []byte{0x00}, types.CodeType_OK, nil) Commit(client, []byte{0, 0, 0, 0, 0, 0, 0, 1}) - AppendTx(client, []byte{0x00}, types.CodeType_BadNonce, nil) - AppendTx(client, []byte{0x01}, types.CodeType_OK, nil) - AppendTx(client, []byte{0x00, 0x02}, types.CodeType_OK, nil) - AppendTx(client, []byte{0x00, 0x03}, types.CodeType_OK, nil) - AppendTx(client, []byte{0x00, 0x00, 0x04}, types.CodeType_OK, nil) - AppendTx(client, []byte{0x00, 0x00, 0x06}, types.CodeType_BadNonce, nil) + 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}) } diff --git a/tests/test_cli/ex1.tmsp b/tests/test_cli/ex1.tmsp index 132512671..e909266ec 100644 --- a/tests/test_cli/ex1.tmsp +++ b/tests/test_cli/ex1.tmsp @@ -1,10 +1,10 @@ echo hello info commit -append_tx "abc" +deliver_tx "abc" info commit query "abc" -append_tx "def=xyz" +deliver_tx "def=xyz" commit query "def" diff --git a/tests/test_cli/ex1.tmsp.out b/tests/test_cli/ex1.tmsp.out index 51cee99f7..c8739758c 100644 --- a/tests/test_cli/ex1.tmsp.out +++ b/tests/test_cli/ex1.tmsp.out @@ -7,7 +7,7 @@ > commit -> data: 0x -> append_tx "abc" +> deliver_tx "abc" -> code: OK > info @@ -20,7 +20,7 @@ -> code: OK -> data: {"index":0,"value":"abc","valueHex":"616263","exists":true} -> append_tx "def=xyz" +> deliver_tx "def=xyz" -> code: OK > commit diff --git a/tests/test_cli/ex2.tmsp b/tests/test_cli/ex2.tmsp index e9550db80..3b435f22a 100644 --- a/tests/test_cli/ex2.tmsp +++ b/tests/test_cli/ex2.tmsp @@ -1,8 +1,8 @@ set_option serial on check_tx 0x00 check_tx 0xff -append_tx 0x00 +deliver_tx 0x00 check_tx 0x00 -append_tx 0x01 -append_tx 0x04 +deliver_tx 0x01 +deliver_tx 0x04 info diff --git a/tests/test_cli/ex2.tmsp.out b/tests/test_cli/ex2.tmsp.out index 84e4ad4f7..1fab1e841 100644 --- a/tests/test_cli/ex2.tmsp.out +++ b/tests/test_cli/ex2.tmsp.out @@ -7,17 +7,17 @@ > check_tx 0xff -> code: OK -> append_tx 0x00 +> deliver_tx 0x00 -> code: OK > check_tx 0x00 -> code: BadNonce -> log: Invalid nonce. Expected >= 1, got 0 -> append_tx 0x01 +> deliver_tx 0x01 -> code: OK -> append_tx 0x04 +> deliver_tx 0x04 -> code: BadNonce -> log: Invalid nonce. Expected 2, got 4 diff --git a/types/application.go b/types/application.go index 59b619e88..4da5e6f76 100644 --- a/types/application.go +++ b/types/application.go @@ -13,8 +13,8 @@ type Application interface { // Set application option (e.g. mode=mempool, mode=consensus) SetOption(key string, value string) (log string) - // Append a tx - AppendTx(tx []byte) Result + // Deliver a tx + DeliverTx(tx []byte) Result // Validate a tx for the mempool CheckTx(tx []byte) Result @@ -67,9 +67,9 @@ func (app *GRPCApplication) SetOption(ctx context.Context, req *RequestSetOption return &ResponseSetOption{app.app.SetOption(req.Key, req.Value)}, nil } -func (app *GRPCApplication) AppendTx(ctx context.Context, req *RequestAppendTx) (*ResponseAppendTx, error) { - r := app.app.AppendTx(req.Tx) - return &ResponseAppendTx{r.Code, r.Data, r.Log}, nil +func (app *GRPCApplication) DeliverTx(ctx context.Context, req *RequestDeliverTx) (*ResponseDeliverTx, error) { + r := app.app.DeliverTx(req.Tx) + return &ResponseDeliverTx{r.Code, r.Data, r.Log}, nil } func (app *GRPCApplication) CheckTx(ctx context.Context, req *RequestCheckTx) (*ResponseCheckTx, error) { diff --git a/types/messages.go b/types/messages.go index 2d256d8ca..84e6ee0b3 100644 --- a/types/messages.go +++ b/types/messages.go @@ -31,9 +31,9 @@ func ToRequestSetOption(key string, value string) *Request { } } -func ToRequestAppendTx(txBytes []byte) *Request { +func ToRequestDeliverTx(txBytes []byte) *Request { return &Request{ - Value: &Request_AppendTx{&RequestAppendTx{txBytes}}, + Value: &Request_DeliverTx{&RequestDeliverTx{txBytes}}, } } @@ -105,9 +105,9 @@ func ToResponseSetOption(log string) *Response { } } -func ToResponseAppendTx(code CodeType, data []byte, log string) *Response { +func ToResponseDeliverTx(code CodeType, data []byte, log string) *Response { return &Response{ - Value: &Response_AppendTx{&ResponseAppendTx{code, data, log}}, + Value: &Response_DeliverTx{&ResponseDeliverTx{code, data, log}}, } } diff --git a/types/types.pb.go b/types/types.pb.go index c97817798..2c279bd20 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -14,7 +14,7 @@ It has these top-level messages: RequestFlush RequestInfo RequestSetOption - RequestAppendTx + RequestDeliverTx RequestCheckTx RequestQuery RequestCommit @@ -27,7 +27,7 @@ It has these top-level messages: ResponseFlush ResponseInfo ResponseSetOption - ResponseAppendTx + ResponseDeliverTx ResponseCheckTx ResponseQuery ResponseCommit @@ -74,7 +74,7 @@ const ( MessageType_Info MessageType = 3 MessageType_SetOption MessageType = 4 MessageType_Exception MessageType = 5 - MessageType_AppendTx MessageType = 17 + MessageType_DeliverTx MessageType = 17 MessageType_CheckTx MessageType = 18 MessageType_Commit MessageType = 19 MessageType_Query MessageType = 20 @@ -90,7 +90,7 @@ var MessageType_name = map[int32]string{ 3: "Info", 4: "SetOption", 5: "Exception", - 17: "AppendTx", + 17: "DeliverTx", 18: "CheckTx", 19: "Commit", 20: "Query", @@ -105,7 +105,7 @@ var MessageType_value = map[string]int32{ "Info": 3, "SetOption": 4, "Exception": 5, - "AppendTx": 17, + "DeliverTx": 17, "CheckTx": 18, "Commit": 19, "Query": 20, @@ -233,7 +233,7 @@ type Request struct { // *Request_Flush // *Request_Info // *Request_SetOption - // *Request_AppendTx + // *Request_DeliverTx // *Request_CheckTx // *Request_Commit // *Request_Query @@ -264,8 +264,8 @@ type Request_Info struct { type Request_SetOption struct { SetOption *RequestSetOption `protobuf:"bytes,4,opt,name=set_option,json=setOption,oneof"` } -type Request_AppendTx struct { - AppendTx *RequestAppendTx `protobuf:"bytes,5,opt,name=append_tx,json=appendTx,oneof"` +type Request_DeliverTx struct { + DeliverTx *RequestDeliverTx `protobuf:"bytes,5,opt,name=deliver_tx,json=deliverTx,oneof"` } type Request_CheckTx struct { CheckTx *RequestCheckTx `protobuf:"bytes,6,opt,name=check_tx,json=checkTx,oneof"` @@ -290,7 +290,7 @@ func (*Request_Echo) isRequest_Value() {} func (*Request_Flush) isRequest_Value() {} func (*Request_Info) isRequest_Value() {} func (*Request_SetOption) isRequest_Value() {} -func (*Request_AppendTx) isRequest_Value() {} +func (*Request_DeliverTx) isRequest_Value() {} func (*Request_CheckTx) isRequest_Value() {} func (*Request_Commit) isRequest_Value() {} func (*Request_Query) isRequest_Value() {} @@ -333,9 +333,9 @@ func (m *Request) GetSetOption() *RequestSetOption { return nil } -func (m *Request) GetAppendTx() *RequestAppendTx { - if x, ok := m.GetValue().(*Request_AppendTx); ok { - return x.AppendTx +func (m *Request) GetDeliverTx() *RequestDeliverTx { + if x, ok := m.GetValue().(*Request_DeliverTx); ok { + return x.DeliverTx } return nil } @@ -389,7 +389,7 @@ func (*Request) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error (*Request_Flush)(nil), (*Request_Info)(nil), (*Request_SetOption)(nil), - (*Request_AppendTx)(nil), + (*Request_DeliverTx)(nil), (*Request_CheckTx)(nil), (*Request_Commit)(nil), (*Request_Query)(nil), @@ -423,9 +423,9 @@ func _Request_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { if err := b.EncodeMessage(x.SetOption); err != nil { return err } - case *Request_AppendTx: + case *Request_DeliverTx: b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.AppendTx); err != nil { + if err := b.EncodeMessage(x.DeliverTx); err != nil { return err } case *Request_CheckTx: @@ -500,13 +500,13 @@ func _Request_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer err := b.DecodeMessage(msg) m.Value = &Request_SetOption{msg} return true, err - case 5: // value.append_tx + case 5: // value.deliver_tx if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } - msg := new(RequestAppendTx) + msg := new(RequestDeliverTx) err := b.DecodeMessage(msg) - m.Value = &Request_AppendTx{msg} + m.Value = &Request_DeliverTx{msg} return true, err case 6: // value.check_tx if wire != proto.WireBytes { @@ -585,8 +585,8 @@ func _Request_OneofSizer(msg proto.Message) (n int) { n += proto.SizeVarint(4<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s - case *Request_AppendTx: - s := proto.Size(x.AppendTx) + case *Request_DeliverTx: + s := proto.Size(x.DeliverTx) n += proto.SizeVarint(5<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s @@ -683,16 +683,16 @@ func (m *RequestSetOption) GetValue() string { return "" } -type RequestAppendTx struct { +type RequestDeliverTx struct { Tx []byte `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` } -func (m *RequestAppendTx) Reset() { *m = RequestAppendTx{} } -func (m *RequestAppendTx) String() string { return proto.CompactTextString(m) } -func (*RequestAppendTx) ProtoMessage() {} -func (*RequestAppendTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (m *RequestDeliverTx) Reset() { *m = RequestDeliverTx{} } +func (m *RequestDeliverTx) String() string { return proto.CompactTextString(m) } +func (*RequestDeliverTx) ProtoMessage() {} +func (*RequestDeliverTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } -func (m *RequestAppendTx) GetTx() []byte { +func (m *RequestDeliverTx) GetTx() []byte { if m != nil { return m.Tx } @@ -802,7 +802,7 @@ type Response struct { // *Response_Flush // *Response_Info // *Response_SetOption - // *Response_AppendTx + // *Response_DeliverTx // *Response_CheckTx // *Response_Commit // *Response_Query @@ -836,8 +836,8 @@ type Response_Info struct { type Response_SetOption struct { SetOption *ResponseSetOption `protobuf:"bytes,5,opt,name=set_option,json=setOption,oneof"` } -type Response_AppendTx struct { - AppendTx *ResponseAppendTx `protobuf:"bytes,6,opt,name=append_tx,json=appendTx,oneof"` +type Response_DeliverTx struct { + DeliverTx *ResponseDeliverTx `protobuf:"bytes,6,opt,name=deliver_tx,json=deliverTx,oneof"` } type Response_CheckTx struct { CheckTx *ResponseCheckTx `protobuf:"bytes,7,opt,name=check_tx,json=checkTx,oneof"` @@ -863,7 +863,7 @@ func (*Response_Echo) isResponse_Value() {} func (*Response_Flush) isResponse_Value() {} func (*Response_Info) isResponse_Value() {} func (*Response_SetOption) isResponse_Value() {} -func (*Response_AppendTx) isResponse_Value() {} +func (*Response_DeliverTx) isResponse_Value() {} func (*Response_CheckTx) isResponse_Value() {} func (*Response_Commit) isResponse_Value() {} func (*Response_Query) isResponse_Value() {} @@ -913,9 +913,9 @@ func (m *Response) GetSetOption() *ResponseSetOption { return nil } -func (m *Response) GetAppendTx() *ResponseAppendTx { - if x, ok := m.GetValue().(*Response_AppendTx); ok { - return x.AppendTx +func (m *Response) GetDeliverTx() *ResponseDeliverTx { + if x, ok := m.GetValue().(*Response_DeliverTx); ok { + return x.DeliverTx } return nil } @@ -970,7 +970,7 @@ func (*Response) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) erro (*Response_Flush)(nil), (*Response_Info)(nil), (*Response_SetOption)(nil), - (*Response_AppendTx)(nil), + (*Response_DeliverTx)(nil), (*Response_CheckTx)(nil), (*Response_Commit)(nil), (*Response_Query)(nil), @@ -1009,9 +1009,9 @@ func _Response_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { if err := b.EncodeMessage(x.SetOption); err != nil { return err } - case *Response_AppendTx: + case *Response_DeliverTx: b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.AppendTx); err != nil { + if err := b.EncodeMessage(x.DeliverTx); err != nil { return err } case *Response_CheckTx: @@ -1094,13 +1094,13 @@ func _Response_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffe err := b.DecodeMessage(msg) m.Value = &Response_SetOption{msg} return true, err - case 6: // value.append_tx + case 6: // value.deliver_tx if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } - msg := new(ResponseAppendTx) + msg := new(ResponseDeliverTx) err := b.DecodeMessage(msg) - m.Value = &Response_AppendTx{msg} + m.Value = &Response_DeliverTx{msg} return true, err case 7: // value.check_tx if wire != proto.WireBytes { @@ -1184,8 +1184,8 @@ func _Response_OneofSizer(msg proto.Message) (n int) { n += proto.SizeVarint(5<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s - case *Response_AppendTx: - s := proto.Size(x.AppendTx) + case *Response_DeliverTx: + s := proto.Size(x.DeliverTx) n += proto.SizeVarint(6<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s @@ -1322,32 +1322,32 @@ func (m *ResponseSetOption) GetLog() string { return "" } -type ResponseAppendTx struct { +type ResponseDeliverTx struct { Code CodeType `protobuf:"varint,1,opt,name=code,enum=types.CodeType" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` Log string `protobuf:"bytes,3,opt,name=log" json:"log,omitempty"` } -func (m *ResponseAppendTx) Reset() { *m = ResponseAppendTx{} } -func (m *ResponseAppendTx) String() string { return proto.CompactTextString(m) } -func (*ResponseAppendTx) ProtoMessage() {} -func (*ResponseAppendTx) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } +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 (m *ResponseAppendTx) GetCode() CodeType { +func (m *ResponseDeliverTx) GetCode() CodeType { if m != nil { return m.Code } return CodeType_OK } -func (m *ResponseAppendTx) GetData() []byte { +func (m *ResponseDeliverTx) GetData() []byte { if m != nil { return m.Data } return nil } -func (m *ResponseAppendTx) GetLog() string { +func (m *ResponseDeliverTx) GetLog() string { if m != nil { return m.Log } @@ -1640,7 +1640,7 @@ func init() { proto.RegisterType((*RequestFlush)(nil), "types.RequestFlush") proto.RegisterType((*RequestInfo)(nil), "types.RequestInfo") proto.RegisterType((*RequestSetOption)(nil), "types.RequestSetOption") - proto.RegisterType((*RequestAppendTx)(nil), "types.RequestAppendTx") + proto.RegisterType((*RequestDeliverTx)(nil), "types.RequestDeliverTx") proto.RegisterType((*RequestCheckTx)(nil), "types.RequestCheckTx") proto.RegisterType((*RequestQuery)(nil), "types.RequestQuery") proto.RegisterType((*RequestCommit)(nil), "types.RequestCommit") @@ -1653,7 +1653,7 @@ func init() { proto.RegisterType((*ResponseFlush)(nil), "types.ResponseFlush") proto.RegisterType((*ResponseInfo)(nil), "types.ResponseInfo") proto.RegisterType((*ResponseSetOption)(nil), "types.ResponseSetOption") - proto.RegisterType((*ResponseAppendTx)(nil), "types.ResponseAppendTx") + proto.RegisterType((*ResponseDeliverTx)(nil), "types.ResponseDeliverTx") proto.RegisterType((*ResponseCheckTx)(nil), "types.ResponseCheckTx") proto.RegisterType((*ResponseQuery)(nil), "types.ResponseQuery") proto.RegisterType((*ResponseCommit)(nil), "types.ResponseCommit") @@ -1683,7 +1683,7 @@ type TMSPApplicationClient interface { Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) SetOption(ctx context.Context, in *RequestSetOption, opts ...grpc.CallOption) (*ResponseSetOption, error) - AppendTx(ctx context.Context, in *RequestAppendTx, opts ...grpc.CallOption) (*ResponseAppendTx, error) + 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) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) @@ -1736,9 +1736,9 @@ func (c *tMSPApplicationClient) SetOption(ctx context.Context, in *RequestSetOpt return out, nil } -func (c *tMSPApplicationClient) AppendTx(ctx context.Context, in *RequestAppendTx, opts ...grpc.CallOption) (*ResponseAppendTx, error) { - out := new(ResponseAppendTx) - err := grpc.Invoke(ctx, "/types.TMSPApplication/AppendTx", in, out, c.cc, opts...) +func (c *tMSPApplicationClient) DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) { + out := new(ResponseDeliverTx) + err := grpc.Invoke(ctx, "/types.TMSPApplication/DeliverTx", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1806,7 +1806,7 @@ type TMSPApplicationServer interface { Flush(context.Context, *RequestFlush) (*ResponseFlush, error) Info(context.Context, *RequestInfo) (*ResponseInfo, error) SetOption(context.Context, *RequestSetOption) (*ResponseSetOption, error) - AppendTx(context.Context, *RequestAppendTx) (*ResponseAppendTx, error) + DeliverTx(context.Context, *RequestDeliverTx) (*ResponseDeliverTx, error) CheckTx(context.Context, *RequestCheckTx) (*ResponseCheckTx, error) Query(context.Context, *RequestQuery) (*ResponseQuery, error) Commit(context.Context, *RequestCommit) (*ResponseCommit, error) @@ -1891,20 +1891,20 @@ func _TMSPApplication_SetOption_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } -func _TMSPApplication_AppendTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RequestAppendTx) +func _TMSPApplication_DeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequestDeliverTx) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).AppendTx(ctx, in) + return srv.(TMSPApplicationServer).DeliverTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/AppendTx", + FullMethod: "/types.TMSPApplication/DeliverTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).AppendTx(ctx, req.(*RequestAppendTx)) + return srv.(TMSPApplicationServer).DeliverTx(ctx, req.(*RequestDeliverTx)) } return interceptor(ctx, in, info, handler) } @@ -2038,8 +2038,8 @@ var _TMSPApplication_serviceDesc = grpc.ServiceDesc{ Handler: _TMSPApplication_SetOption_Handler, }, { - MethodName: "AppendTx", - Handler: _TMSPApplication_AppendTx_Handler, + MethodName: "DeliverTx", + Handler: _TMSPApplication_DeliverTx_Handler, }, { MethodName: "CheckTx", diff --git a/types/types.proto b/types/types.proto index 69f9a5735..34e5450b8 100644 --- a/types/types.proto +++ b/types/types.proto @@ -18,7 +18,7 @@ enum MessageType { Info = 0x03; SetOption = 0x04; Exception = 0x05; - AppendTx = 0x11; + DeliverTx = 0x11; CheckTx = 0x12; Commit = 0x13; Query = 0x14; @@ -79,7 +79,7 @@ message Request { RequestFlush flush = 2; RequestInfo info = 3; RequestSetOption set_option = 4; - RequestAppendTx append_tx = 5; + RequestDeliverTx deliver_tx = 5; RequestCheckTx check_tx = 6; RequestCommit commit = 7; RequestQuery query = 8; @@ -104,7 +104,7 @@ message RequestSetOption{ string value = 2; } -message RequestAppendTx{ +message RequestDeliverTx{ bytes tx = 1; } @@ -143,7 +143,7 @@ message Response { ResponseFlush flush = 3; ResponseInfo info = 4; ResponseSetOption set_option = 5; - ResponseAppendTx append_tx = 6; + ResponseDeliverTx deliver_tx = 6; ResponseCheckTx check_tx = 7; ResponseCommit commit = 8; ResponseQuery query = 9; @@ -175,7 +175,7 @@ message ResponseSetOption{ string log = 1; } -message ResponseAppendTx{ +message ResponseDeliverTx{ CodeType code = 1; bytes data = 2; string log = 3; @@ -248,7 +248,7 @@ service TMSPApplication { rpc Flush(RequestFlush) returns (ResponseFlush); rpc Info(RequestInfo) returns (ResponseInfo); rpc SetOption(RequestSetOption) returns (ResponseSetOption); - rpc AppendTx(RequestAppendTx) returns (ResponseAppendTx); + rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); rpc Query(RequestQuery) returns (ResponseQuery); rpc Commit(RequestCommit) returns (ResponseCommit); From 5189a2248d5b4d952a40fc72a14c510af3aa10dc Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 15:47:55 -0500 Subject: [PATCH 39/40] TMSP -> ABCI --- LICENSE | 2 +- Makefile | 4 +- README.md | 32 ++-- client/client.go | 6 +- client/grpc_client.go | 12 +- client/local_client.go | 4 +- client/log.go | 4 +- client/socket_client.go | 8 +- cmd/{tmsp-cli => abci-cli}/tmsp-cli.go | 18 +-- cmd/counter/main.go | 8 +- cmd/dummy/main.go | 10 +- example/chain_aware/chain_aware_app.go | 8 +- example/chain_aware/chain_aware_test.go | 8 +- example/counter/counter.go | 2 +- example/dummy/README.md | 2 +- example/dummy/dummy.go | 2 +- example/dummy/dummy_test.go | 8 +- example/dummy/persistent_dummy.go | 2 +- example/example_test.go | 14 +- example/js/README.md | 2 +- example/nil/nil_app.go | 2 +- example/python/{tmsp => abci}/__init__.py | 0 example/python/{tmsp => abci}/msg.py | 2 +- example/python/{tmsp => abci}/reader.py | 0 example/python/{tmsp => abci}/server.py | 4 +- example/python/{tmsp => abci}/wire.py | 0 example/python/app.py | 10 +- example/python3/{tmsp => abci}/__init__.py | 0 example/python3/{tmsp => abci}/msg.py | 2 +- example/python3/{tmsp => abci}/reader.py | 0 example/python3/{tmsp => abci}/server.py | 4 +- example/python3/{tmsp => abci}/wire.py | 0 example/python3/app.py | 10 +- glide.yaml | 2 +- server/grpc_server.go | 10 +- server/log.go | 2 +- server/server.go | 2 +- server/socket_server.go | 4 +- tests/benchmarks/parallel/parallel.go | 2 +- tests/benchmarks/simple/simple.go | 2 +- tests/test_app/app.go | 26 +-- tests/test_app/main.go | 22 +-- tests/test_app/test.sh | 10 +- tests/test_cli/{ex1.tmsp => ex1.abci} | 0 tests/test_cli/{ex1.tmsp.out => ex1.abci.out} | 0 tests/test_cli/{ex2.tmsp => ex2.abci} | 0 tests/test_cli/{ex2.tmsp.out => ex2.abci.out} | 0 tests/test_cli/test.sh | 8 +- testutil/messages.go | 2 +- types/result.go | 2 +- types/types.pb.go | 152 +++++++++--------- types/types.proto | 4 +- 52 files changed, 221 insertions(+), 219 deletions(-) rename cmd/{tmsp-cli => abci-cli}/tmsp-cli.go (95%) rename example/python/{tmsp => abci}/__init__.py (100%) rename example/python/{tmsp => abci}/msg.py (94%) rename example/python/{tmsp => abci}/reader.py (100%) rename example/python/{tmsp => abci}/server.py (98%) rename example/python/{tmsp => abci}/wire.py (100%) rename example/python3/{tmsp => abci}/__init__.py (100%) rename example/python3/{tmsp => abci}/msg.py (94%) rename example/python3/{tmsp => abci}/reader.py (100%) rename example/python3/{tmsp => abci}/server.py (98%) rename example/python3/{tmsp => abci}/wire.py (100%) rename tests/test_cli/{ex1.tmsp => ex1.abci} (100%) rename tests/test_cli/{ex1.tmsp.out => ex1.abci.out} (100%) rename tests/test_cli/{ex2.tmsp => ex2.abci} (100%) rename tests/test_cli/{ex2.tmsp.out => ex2.abci.out} (100%) diff --git a/LICENSE b/LICENSE index 3934a10fe..57951bb8a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Tendermint TMSP +Tendermint ABCI Copyright (C) 2015 Tendermint diff --git a/Makefile b/Makefile index b00c5a672..22fa6fdd1 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,13 @@ all: protoc test install -NOVENDOR = go list github.com/tendermint/tmsp/... | grep -v /vendor/ +NOVENDOR = go list github.com/tendermint/abci/... | grep -v /vendor/ protoc: protoc --go_out=plugins=grpc:. types/*.proto install: - go install github.com/tendermint/tmsp/cmd/... + go install github.com/tendermint/abci/cmd/... test: go test `${NOVENDOR}` diff --git a/README.md b/README.md index cb757695b..8672af921 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,37 @@ -# Tendermint Socket Protocol (TMSP) +# Tendermint Socket Protocol (ABCI) -[![CircleCI](https://circleci.com/gh/tendermint/tmsp.svg?style=svg)](https://circleci.com/gh/tendermint/tmsp) +[![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. -**TMSP** is a socket protocol enabling a blockchain consensus engine, running in one process, +**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 TMSP, motivations, and tutorials, please visit [our blog post](http://tendermint.com/blog/tmsp-the-tendermint-socket-protocol/). +For more information on ABCI, motivations, and tutorials, please visit [our blog post](http://tendermint.com/blog/abci-the-tendermint-socket-protocol/). Other implementations: -* [cpp-tmsp](https://github.com/mdyring/cpp-tmsp) by Martin Dyring-Andersen -* [js-tmsp](https://github.com/tendermint/js-tmsp) -* [jTMSP](https://github.com/jTMSP/) for Java +* [cpp-abci](https://github.com/mdyring/cpp-abci) by Martin Dyring-Andersen +* [js-abci](https://github.com/tendermint/js-abci) +* [jABCI](https://github.com/jABCI/) for Java ## Contents This repository holds a number of important pieces: - `types/types.proto` - - the protobuf file defining TMSP 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 TMSP client and server +- golang implementation of ABCI client and server - two implementations: - asynchronous, ordered message passing over unix or tcp; - messages are serialized using protobuf and length prefixed - grpc - TendermintCore runs a client, and the application runs a server -- `cmd/tmsp-cli` - - command line tool wrapping the client for probing/testing a TMSP application - - use `tmsp-cli --version` to get the TMSP version +- `cmd/abci-cli` + - command line tool wrapping the client for probing/testing a ABCI application + - use `abci-cli --version` to get the ABCI version - examples: - the `cmd/counter` application, which illustrates nonce checking in txs @@ -42,13 +42,13 @@ This repository holds a number of important pieces: Since this is a streaming protocol, all messages are encoded with a length-prefix followed by the message encoded in Protobuf3. Protobuf3 doesn't have an official length-prefix standard, so we use our own. The first byte represents the length of the big-endian encoded length. -For example, if the Protobuf3 encoded TMSP message is `0xDEADBEEF` (4 bytes), the length-prefixed message is `0x0104DEADBEEF`. If the Protobuf3 encoded TMSP message is 65535 bytes long, the length-prefixed message would be like `0x02FFFF...`. +For example, if the Protobuf3 encoded ABCI message is `0xDEADBEEF` (4 bytes), the length-prefixed message is `0x0104DEADBEEF`. If the Protobuf3 encoded ABCI message is 65535 bytes long, the length-prefixed message would be like `0x02FFFF...`. Note this prefixing does not apply for grpc. ## Message types -TMSP requests/responses are simple Protobuf messages. Check out the [schema file](https://github.com/tendermint/tmsp/blob/master/types/types.proto). +ABCI requests/responses are simple Protobuf messages. Check out the [schema file](https://github.com/tendermint/abci/blob/master/types/types.proto). #### DeliverTx * __Arguments__: @@ -148,7 +148,7 @@ TMSP requests/responses are simple Protobuf messages. Check out the [schema fil ##### Jan 23th, 2016 -* Added CheckTx/Query TMSP message types +* Added CheckTx/Query ABCI message types * Added Result/Log fields to DeliverTx/CheckTx/SetOption * Removed Listener messages * Removed Code from ResponseSetOption and ResponseGetHash @@ -160,4 +160,4 @@ TMSP requests/responses are simple Protobuf messages. Check out the [schema fil ##### Jan 8th, 2016 -* Tendermint/TMSP now comes to consensus on the order first before DeliverTx. +* Tendermint/ABCI now comes to consensus on the order first before DeliverTx. diff --git a/client/client.go b/client/client.go index 0305b29e2..8ea295937 100644 --- a/client/client.go +++ b/client/client.go @@ -1,11 +1,11 @@ -package tmspcli +package abcicli import ( "fmt" "sync" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) type Client interface { @@ -50,7 +50,7 @@ func NewClient(addr, transport string, mustConnect bool) (client Client, err err case "grpc": client, err = NewGRPCClient(addr, mustConnect) default: - err = fmt.Errorf("Unknown tmsp transport %s", transport) + err = fmt.Errorf("Unknown abci transport %s", transport) } return diff --git a/client/grpc_client.go b/client/grpc_client.go index ac6beb06b..566ee183e 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -1,4 +1,4 @@ -package tmspcli +package abcicli import ( "net" @@ -9,7 +9,7 @@ import ( grpc "google.golang.org/grpc" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) // A stripped copy of the remoteClient that makes @@ -18,7 +18,7 @@ type grpcClient struct { BaseService mustConnect bool - client types.TMSPApplicationClient + client types.ABCIApplicationClient mtx sync.Mutex addr string @@ -50,13 +50,13 @@ RETRY_LOOP: if cli.mustConnect { return err } else { - log.Warn(Fmt("tmsp.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) + log.Warn(Fmt("abci.grpcClient failed to connect to %v. Retrying...\n", cli.addr)) time.Sleep(time.Second * 3) continue RETRY_LOOP } } - client := types.NewTMSPApplicationClient(conn) + client := types.NewABCIApplicationClient(conn) ENSURE_CONNECTED: for { @@ -93,7 +93,7 @@ func (cli *grpcClient) StopForError(err error) { } cli.mtx.Unlock() - log.Warn(Fmt("Stopping tmsp.grpcClient for error: %v", err.Error())) + log.Warn(Fmt("Stopping abci.grpcClient for error: %v", err.Error())) cli.Stop() } diff --git a/client/local_client.go b/client/local_client.go index 9b0eeaf00..b787eb365 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -1,10 +1,10 @@ -package tmspcli +package abcicli import ( "sync" . "github.com/tendermint/go-common" - types "github.com/tendermint/tmsp/types" + types "github.com/tendermint/abci/types" ) type localClient struct { diff --git a/client/log.go b/client/log.go index deadf6c34..944b05ba0 100644 --- a/client/log.go +++ b/client/log.go @@ -1,7 +1,7 @@ -package tmspcli +package abcicli import ( "github.com/tendermint/go-logger" ) -var log = logger.New("module", "tmspcli") +var log = logger.New("module", "abcicli") diff --git a/client/socket_client.go b/client/socket_client.go index 2a914f815..9b4f9aed4 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -1,4 +1,4 @@ -package tmspcli +package abcicli import ( "bufio" @@ -11,7 +11,7 @@ import ( "time" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) const ( @@ -70,7 +70,7 @@ RETRY_LOOP: if cli.mustConnect { return err } else { - log.Warn(Fmt("tmsp.socketClient failed to connect to %v. Retrying...", cli.addr)) + log.Warn(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 tmsp.socketClient for error: %v", err.Error())) + log.Warn(Fmt("Stopping abci.socketClient for error: %v", err.Error())) cli.Stop() } diff --git a/cmd/tmsp-cli/tmsp-cli.go b/cmd/abci-cli/tmsp-cli.go similarity index 95% rename from cmd/tmsp-cli/tmsp-cli.go rename to cmd/abci-cli/tmsp-cli.go index b1d0d33e4..b8bc2937e 100644 --- a/cmd/tmsp-cli/tmsp-cli.go +++ b/cmd/abci-cli/tmsp-cli.go @@ -10,8 +10,8 @@ import ( "strings" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/client" + "github.com/tendermint/abci/types" "github.com/urfave/cli" ) @@ -40,7 +40,7 @@ func newResponse(res types.Result, data string, printCode bool) *response { } // client is a global variable so it can be reused by the console -var client tmspcli.Client +var client abcicli.Client func main() { @@ -48,8 +48,8 @@ func main() { cli.OsExiter = func(_ int) {} app := cli.NewApp() - app.Name = "tmsp-cli" - app.Usage = "tmsp-cli [command] [args...]" + app.Name = "abci-cli" + app.Usage = "abci-cli [command] [args...]" app.Version = "0.2.1" // better error handling in console app.Flags = []cli.Flag{ cli.StringFlag{ @@ -58,7 +58,7 @@ func main() { Usage: "address of application socket", }, cli.StringFlag{ - Name: "tmsp", + Name: "abci", Value: "socket", Usage: "socket or grpc", }, @@ -70,14 +70,14 @@ func main() { app.Commands = []cli.Command{ { Name: "batch", - Usage: "Run a batch of tmsp commands against an application", + Usage: "Run a batch of abci commands against an application", Action: func(c *cli.Context) error { return cmdBatch(app, c) }, }, { Name: "console", - Usage: "Start an interactive tmsp console for multiple commands", + Usage: "Start an interactive abci console for multiple commands", Action: func(c *cli.Context) error { return cmdConsole(app, c) }, @@ -143,7 +143,7 @@ func main() { func before(c *cli.Context) error { if client == nil { var err error - client, err = tmspcli.NewClient(c.GlobalString("address"), c.GlobalString("tmsp"), false) + client, err = abcicli.NewClient(c.GlobalString("address"), c.GlobalString("abci"), false) if err != nil { Exit(err.Error()) } diff --git a/cmd/counter/main.go b/cmd/counter/main.go index 0f284af9e..218224a0a 100644 --- a/cmd/counter/main.go +++ b/cmd/counter/main.go @@ -4,20 +4,20 @@ import ( "flag" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/example/counter" - "github.com/tendermint/tmsp/server" + "github.com/tendermint/abci/example/counter" + "github.com/tendermint/abci/server" ) func main() { addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address") - tmspPtr := flag.String("tmsp", "socket", "TMSP server: socket | grpc") + abciPtr := flag.String("abci", "socket", "ABCI server: socket | grpc") serialPtr := flag.Bool("serial", false, "Enforce incrementing (serial) txs") flag.Parse() app := counter.NewCounterApplication(*serialPtr) // Start the listener - srv, err := server.NewServer(*addrPtr, *tmspPtr, app) + srv, err := server.NewServer(*addrPtr, *abciPtr, app) if err != nil { Exit(err.Error()) } diff --git a/cmd/dummy/main.go b/cmd/dummy/main.go index fe7ae750b..aecb1138f 100644 --- a/cmd/dummy/main.go +++ b/cmd/dummy/main.go @@ -4,15 +4,15 @@ import ( "flag" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/example/dummy" - "github.com/tendermint/tmsp/server" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/example/dummy" + "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) func main() { addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address") - tmspPtr := flag.String("tmsp", "socket", "socket | grpc") + abciPtr := flag.String("abci", "socket", "socket | grpc") persistencePtr := flag.String("persist", "", "directory to use for a database") flag.Parse() @@ -25,7 +25,7 @@ func main() { } // Start the listener - srv, err := server.NewServer(*addrPtr, *tmspPtr, app) + srv, err := server.NewServer(*addrPtr, *abciPtr, app) if err != nil { Exit(err.Error()) } diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index 35774d668..e3543f13c 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -4,18 +4,18 @@ import ( "flag" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/server" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) func main() { addrPtr := flag.String("addr", "tcp://0.0.0.0:46658", "Listen address") - tmspPtr := flag.String("tmsp", "socket", "socket | grpc") + abciPtr := flag.String("abci", "socket", "socket | grpc") flag.Parse() // Start the listener - srv, err := server.NewServer(*addrPtr, *tmspPtr, NewChainAwareApplication()) + srv, err := server.NewServer(*addrPtr, *abciPtr, NewChainAwareApplication()) if err != nil { Exit(err.Error()) } diff --git a/example/chain_aware/chain_aware_test.go b/example/chain_aware/chain_aware_test.go index fd3754704..f5283a386 100644 --- a/example/chain_aware/chain_aware_test.go +++ b/example/chain_aware/chain_aware_test.go @@ -6,9 +6,9 @@ import ( "testing" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/server" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/client" + "github.com/tendermint/abci/server" + "github.com/tendermint/abci/types" ) func TestChainAware(t *testing.T) { @@ -23,7 +23,7 @@ func TestChainAware(t *testing.T) { defer srv.Stop() // Connect to the socket - client, err := tmspcli.NewSocketClient("unix://test.sock", false) + client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { Exit(Fmt("Error starting socket client: %v", err.Error())) } diff --git a/example/counter/counter.go b/example/counter/counter.go index 663abcab0..90be6d92b 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -4,7 +4,7 @@ import ( "encoding/binary" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) type CounterApplication struct { diff --git a/example/dummy/README.md b/example/dummy/README.md index 19f82fda6..8c1f0f042 100644 --- a/example/dummy/README.md +++ b/example/dummy/README.md @@ -14,7 +14,7 @@ The app has no replay protection (other than what the mempool provides). The PersistentDummyApplication wraps the DummyApplication and provides two additional features: -1) persistence of state across app restarts (using Tendermint's TMSP-Handshake mechanism) +1) persistence of state across app restarts (using Tendermint's ABCI-Handshake mechanism) 2) validator set changes The state is persisted in leveldb along with the last block committed, diff --git a/example/dummy/dummy.go b/example/dummy/dummy.go index 7e0be585c..648ef07e3 100644 --- a/example/dummy/dummy.go +++ b/example/dummy/dummy.go @@ -7,7 +7,7 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) type DummyApplication struct { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index 2f486aa5f..d22943472 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -9,7 +9,7 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value string) { @@ -49,7 +49,7 @@ func TestDummyKV(t *testing.T) { } func TestPersistentDummyKV(t *testing.T) { - dir, err := ioutil.TempDir("/tmp", "tmsp-dummy-test") // TODO + dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO if err != nil { t.Fatal(err) } @@ -65,7 +65,7 @@ func TestPersistentDummyKV(t *testing.T) { } func TestPersistentDummyInfo(t *testing.T) { - dir, err := ioutil.TempDir("/tmp", "tmsp-dummy-test") // TODO + dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO if err != nil { t.Fatal(err) } @@ -96,7 +96,7 @@ func TestPersistentDummyInfo(t *testing.T) { // add a validator, remove a validator, update a validator func TestValSetChanges(t *testing.T) { - dir, err := ioutil.TempDir("/tmp", "tmsp-dummy-test") // TODO + dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO if err != nil { t.Fatal(err) } diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index f4dbc6ee1..fa730bcb5 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -10,7 +10,7 @@ import ( dbm "github.com/tendermint/go-db" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) const ( diff --git a/example/example_test.go b/example/example_test.go index 6ff334d3f..1ddefddb5 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -11,11 +11,11 @@ import ( "google.golang.org/grpc" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/example/dummy" - nilapp "github.com/tendermint/tmsp/example/nil" - "github.com/tendermint/tmsp/server" - "github.com/tendermint/tmsp/types" + "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" ) func TestDummy(t *testing.T) { @@ -45,7 +45,7 @@ func testStream(t *testing.T, app types.Application) { defer server.Stop() // Connect to the socket - client, err := tmspcli.NewSocketClient("unix://test.sock", false) + client, err := abcicli.NewSocketClient("unix://test.sock", false) if err != nil { Exit(Fmt("Error starting socket client: %v", err.Error())) } @@ -124,7 +124,7 @@ func testGRPCSync(t *testing.T, app *types.GRPCApplication) { } defer conn.Close() - client := types.NewTMSPApplicationClient(conn) + client := types.NewABCIApplicationClient(conn) // Write requests for counter := 0; counter < numDeliverTxs; counter++ { diff --git a/example/js/README.md b/example/js/README.md index f18755065..1bef9cbf5 100644 --- a/example/js/README.md +++ b/example/js/README.md @@ -1 +1 @@ -This example has been moved here: https://github.com/tendermint/js-tmsp/tree/master/example +This example has been moved here: https://github.com/tendermint/js-abci/tree/master/example diff --git a/example/nil/nil_app.go b/example/nil/nil_app.go index 928395bc0..cd57f0d98 100644 --- a/example/nil/nil_app.go +++ b/example/nil/nil_app.go @@ -1,7 +1,7 @@ package nilapp import ( - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) type NilApplication struct { diff --git a/example/python/tmsp/__init__.py b/example/python/abci/__init__.py similarity index 100% rename from example/python/tmsp/__init__.py rename to example/python/abci/__init__.py diff --git a/example/python/tmsp/msg.py b/example/python/abci/msg.py similarity index 94% rename from example/python/tmsp/msg.py rename to example/python/abci/msg.py index fcb85c1f1..7329f5852 100644 --- a/example/python/tmsp/msg.py +++ b/example/python/abci/msg.py @@ -13,7 +13,7 @@ message_types = { 0x25: "rm_listener", } -# return the decoded arguments of tmsp messages +# return the decoded arguments of abci messages class RequestDecoder(): diff --git a/example/python/tmsp/reader.py b/example/python/abci/reader.py similarity index 100% rename from example/python/tmsp/reader.py rename to example/python/abci/reader.py diff --git a/example/python/tmsp/server.py b/example/python/abci/server.py similarity index 98% rename from example/python/tmsp/server.py rename to example/python/abci/server.py index 60f76e3af..40d50896c 100644 --- a/example/python/tmsp/server.py +++ b/example/python/abci/server.py @@ -26,9 +26,9 @@ class Connection(): raise IOError("dead connection") this.recBuf.write(data) -# TMSP server responds to messges by calling methods on the app +# ABCI server responds to messges by calling methods on the app -class TMSPServer(): +class ABCIServer(): def __init__(self, app, port=5410): self.app = app diff --git a/example/python/tmsp/wire.py b/example/python/abci/wire.py similarity index 100% rename from example/python/tmsp/wire.py rename to example/python/abci/wire.py diff --git a/example/python/app.py b/example/python/app.py index 335188fa5..a44ff3455 100644 --- a/example/python/app.py +++ b/example/python/app.py @@ -1,8 +1,8 @@ import sys -from tmsp.wire import hex2bytes, decode_big_endian, encode_big_endian -from tmsp.server import TMSPServer -from tmsp.reader import BytesBuffer +from abci.wire import hex2bytes, decode_big_endian, encode_big_endian +from abci.server import ABCIServer +from abci.reader import BytesBuffer class CounterApplication(): @@ -75,8 +75,8 @@ if __name__ == '__main__': print "too many arguments" quit() - print 'TMSP Demo APP (Python)' + print 'ABCI Demo APP (Python)' app = CounterApplication() - server = TMSPServer(app, port) + server = ABCIServer(app, port) server.main_loop() diff --git a/example/python3/tmsp/__init__.py b/example/python3/abci/__init__.py similarity index 100% rename from example/python3/tmsp/__init__.py rename to example/python3/abci/__init__.py diff --git a/example/python3/tmsp/msg.py b/example/python3/abci/msg.py similarity index 94% rename from example/python3/tmsp/msg.py rename to example/python3/abci/msg.py index e8d69db96..807c4b6b0 100644 --- a/example/python3/tmsp/msg.py +++ b/example/python3/abci/msg.py @@ -13,7 +13,7 @@ message_types = { 0x25: "rm_listener", } -# return the decoded arguments of tmsp messages +# return the decoded arguments of abci messages class RequestDecoder(): diff --git a/example/python3/tmsp/reader.py b/example/python3/abci/reader.py similarity index 100% rename from example/python3/tmsp/reader.py rename to example/python3/abci/reader.py diff --git a/example/python3/tmsp/server.py b/example/python3/abci/server.py similarity index 98% rename from example/python3/tmsp/server.py rename to example/python3/abci/server.py index 03735bb37..04063262d 100644 --- a/example/python3/tmsp/server.py +++ b/example/python3/abci/server.py @@ -29,9 +29,9 @@ class Connection(): raise IOError("dead connection") this.recBuf.write(data) -# TMSP server responds to messges by calling methods on the app +# ABCI server responds to messges by calling methods on the app -class TMSPServer(): +class ABCIServer(): def __init__(self, app, port=5410): self.app = app diff --git a/example/python3/tmsp/wire.py b/example/python3/abci/wire.py similarity index 100% rename from example/python3/tmsp/wire.py rename to example/python3/abci/wire.py diff --git a/example/python3/app.py b/example/python3/app.py index a0b727b74..b40041a43 100644 --- a/example/python3/app.py +++ b/example/python3/app.py @@ -1,8 +1,8 @@ import sys -from tmsp.wire import hex2bytes, decode_big_endian, encode_big_endian -from tmsp.server import TMSPServer -from tmsp.reader import BytesBuffer +from abci.wire import hex2bytes, decode_big_endian, encode_big_endian +from abci.server import ABCIServer +from abci.reader import BytesBuffer class CounterApplication(): @@ -75,8 +75,8 @@ if __name__ == '__main__': print("too many arguments") quit() - print('TMSP Demo APP (Python)') + print('ABCI Demo APP (Python)') app = CounterApplication() - server = TMSPServer(app, port) + server = ABCIServer(app, port) server.main_loop() diff --git a/glide.yaml b/glide.yaml index 440d47cc0..fae5a9841 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,4 +1,4 @@ -package: github.com/tendermint/tmsp +package: github.com/tendermint/abci import: - package: github.com/golang/protobuf subpackages: diff --git a/server/grpc_server.go b/server/grpc_server.go index 472da25dd..1acd45a36 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) // var maxNumberConnections = 2 @@ -20,10 +20,10 @@ type GRPCServer struct { listener net.Listener server *grpc.Server - app types.TMSPApplicationServer + app types.ABCIApplicationServer } -func NewGRPCServer(protoAddr string, app types.TMSPApplicationServer) (Service, error) { +func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (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.TMSPApplicationServer) (Service, listener: nil, app: app, } - s.BaseService = *NewBaseService(nil, "TMSPServer", s) + s.BaseService = *NewBaseService(nil, "ABCIServer", s) _, err := s.Start() // Just start it return s, err } @@ -45,7 +45,7 @@ func (s *GRPCServer) OnStart() error { } s.listener = ln s.server = grpc.NewServer() - types.RegisterTMSPApplicationServer(s.server, s.app) + types.RegisterABCIApplicationServer(s.server, s.app) go s.server.Serve(s.listener) return nil } diff --git a/server/log.go b/server/log.go index 8ac4092e7..4b313d25f 100644 --- a/server/log.go +++ b/server/log.go @@ -4,4 +4,4 @@ import ( "github.com/tendermint/go-logger" ) -var log = logger.New("module", "tmsp-server") +var log = logger.New("module", "abci-server") diff --git a/server/server.go b/server/server.go index f2b9d0af4..496767470 100644 --- a/server/server.go +++ b/server/server.go @@ -4,7 +4,7 @@ import ( "fmt" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) func NewServer(protoAddr, transport string, app types.Application) (Service, error) { diff --git a/server/socket_server.go b/server/socket_server.go index 2be3bbb5c..bd26a18a8 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -9,7 +9,7 @@ import ( "sync" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) // var maxNumberConnections = 2 @@ -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, "TMSPServer", s) + s.BaseService = *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 db57e19bf..5960d529a 100644 --- a/tests/benchmarks/parallel/parallel.go +++ b/tests/benchmarks/parallel/parallel.go @@ -6,7 +6,7 @@ import ( //"encoding/hex" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) func main() { diff --git a/tests/benchmarks/simple/simple.go b/tests/benchmarks/simple/simple.go index 585ebd2b5..fb536730c 100644 --- a/tests/benchmarks/simple/simple.go +++ b/tests/benchmarks/simple/simple.go @@ -9,7 +9,7 @@ import ( //"encoding/hex" . "github.com/tendermint/go-common" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) func main() { diff --git a/tests/test_app/app.go b/tests/test_app/app.go index b38d07373..59d5b0e70 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -7,24 +7,24 @@ import ( . "github.com/tendermint/go-common" "github.com/tendermint/go-process" - "github.com/tendermint/tmsp/client" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/client" + "github.com/tendermint/abci/types" ) //---------------------------------------- -func StartApp(tmspApp string) *process.Process { +func StartApp(abciApp string) *process.Process { // Start the app //outBuf := NewBufferCloser(nil) - proc, err := process.StartProcess("tmsp_app", + proc, err := process.StartProcess("abci_app", "", "bash", - []string{"-c", tmspApp}, + []string{"-c", abciApp}, nil, os.Stdout, ) if err != nil { - panic("running tmsp_app: " + err.Error()) + panic("running abci_app: " + err.Error()) } // TODO a better way to handle this? @@ -33,16 +33,16 @@ func StartApp(tmspApp string) *process.Process { return proc } -func StartClient(tmspType string) tmspcli.Client { +func StartClient(abciType string) abcicli.Client { // Start client - client, err := tmspcli.NewClient("tcp://127.0.0.1:46658", tmspType, true) + client, err := abcicli.NewClient("tcp://127.0.0.1:46658", abciType, true) if err != nil { - panic("connecting to tmsp_app: " + err.Error()) + panic("connecting to abci_app: " + err.Error()) } return client } -func SetOption(client tmspcli.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 +50,7 @@ func SetOption(client tmspcli.Client, key, value string) { } } -func Commit(client tmspcli.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 +62,7 @@ func Commit(client tmspcli.Client, hashExp []byte) { } } -func DeliverTx(client tmspcli.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 +75,7 @@ func DeliverTx(client tmspcli.Client, txBytes []byte, codeExp types.CodeType, da } } -func CheckTx(client tmspcli.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 db627a3e9..05f66b07f 100644 --- a/tests/test_app/main.go +++ b/tests/test_app/main.go @@ -4,15 +4,15 @@ import ( "fmt" "os" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) -var tmspType string +var abciType string func init() { - tmspType = os.Getenv("TMSP") - if tmspType == "" { - tmspType = "socket" + abciType = os.Getenv("ABCI") + if abciType == "" { + abciType = "socket" } } @@ -21,15 +21,15 @@ func main() { } func testCounter() { - tmspApp := os.Getenv("TMSP_APP") - if tmspApp == "" { - panic("No TMSP_APP specified") + abciApp := os.Getenv("ABCI_APP") + if abciApp == "" { + panic("No ABCI_APP specified") } - fmt.Printf("Running %s test with tmsp=%s\n", tmspApp, tmspType) - appProc := StartApp(tmspApp) + fmt.Printf("Running %s test with abci=%s\n", abciApp, abciType) + appProc := StartApp(abciApp) defer appProc.StopProcess(true) - client := StartClient(tmspType) + client := StartClient(abciType) defer client.Stop() SetOption(client, "serial", "on") diff --git a/tests/test_app/test.sh b/tests/test_app/test.sh index 4c28a831b..a0f2c3ce6 100755 --- a/tests/test_app/test.sh +++ b/tests/test_app/test.sh @@ -1,17 +1,17 @@ #! /bin/bash set -e -# These tests spawn the counter app and server by execing the TMSP_APP command and run some simple client tests against it +# These tests spawn the counter app and server by execing the ABCI_APP command and run some simple client tests against it -ROOT=$GOPATH/src/github.com/tendermint/tmsp/tests/test_app +ROOT=$GOPATH/src/github.com/tendermint/abci/tests/test_app cd $ROOT # test golang counter -TMSP_APP="counter" go run *.go +ABCI_APP="counter" go run *.go # test golang counter via grpc -TMSP_APP="counter -tmsp=grpc" TMSP="grpc" go run *.go +ABCI_APP="counter -abci=grpc" ABCI="grpc" go run *.go # test nodejs counter # TODO: fix node app -#TMSP_APP="node $GOPATH/src/github.com/tendermint/js-tmsp/example/app.js" go test -test.run TestCounter +#ABCI_APP="node $GOPATH/src/github.com/tendermint/js-abci/example/app.js" go test -test.run TestCounter diff --git a/tests/test_cli/ex1.tmsp b/tests/test_cli/ex1.abci similarity index 100% rename from tests/test_cli/ex1.tmsp rename to tests/test_cli/ex1.abci diff --git a/tests/test_cli/ex1.tmsp.out b/tests/test_cli/ex1.abci.out similarity index 100% rename from tests/test_cli/ex1.tmsp.out rename to tests/test_cli/ex1.abci.out diff --git a/tests/test_cli/ex2.tmsp b/tests/test_cli/ex2.abci similarity index 100% rename from tests/test_cli/ex2.tmsp rename to tests/test_cli/ex2.abci diff --git a/tests/test_cli/ex2.tmsp.out b/tests/test_cli/ex2.abci.out similarity index 100% rename from tests/test_cli/ex2.tmsp.out rename to tests/test_cli/ex2.abci.out diff --git a/tests/test_cli/test.sh b/tests/test_cli/test.sh index 00446c45d..a770730be 100644 --- a/tests/test_cli/test.sh +++ b/tests/test_cli/test.sh @@ -1,5 +1,7 @@ #! /bin/bash +cd $GOPATH/src/github.com/tendermint/abci + function testExample() { N=$1 INPUT=$2 @@ -8,7 +10,7 @@ function testExample() { echo "Example $N" $APP &> /dev/null & sleep 2 - tmsp-cli --verbose batch < $INPUT > "${INPUT}.out.new" + abci-cli --verbose batch < $INPUT > "${INPUT}.out.new" killall "$APP" pre=`shasum < "${INPUT}.out"` @@ -26,8 +28,8 @@ function testExample() { rm "${INPUT}".out.new } -testExample 1 tests/test_cli/ex1.tmsp dummy -testExample 2 tests/test_cli/ex2.tmsp counter +testExample 1 tests/test_cli/ex1.abci dummy +testExample 2 tests/test_cli/ex2.abci counter echo "" echo "PASS" diff --git a/testutil/messages.go b/testutil/messages.go index 2890fbd5f..1036e48e4 100644 --- a/testutil/messages.go +++ b/testutil/messages.go @@ -2,7 +2,7 @@ package testutil import ( "github.com/tendermint/go-crypto" - "github.com/tendermint/tmsp/types" + "github.com/tendermint/abci/types" ) //---------------------------------------- diff --git a/types/result.go b/types/result.go index 717ae2fa0..571c5bf8b 100644 --- a/types/result.go +++ b/types/result.go @@ -28,7 +28,7 @@ func (res Result) IsErr() bool { } func (res Result) Error() string { - return fmt.Sprintf("TMSP code:%v, data:%X, log:%v", res.Code, res.Data, res.Log) + return fmt.Sprintf("ABCI code:%v, data:%X, log:%v", res.Code, res.Data, res.Log) } func (res Result) PrependLog(log string) Result { diff --git a/types/types.pb.go b/types/types.pb.go index 2c279bd20..40c3441b8 100644 --- a/types/types.pb.go +++ b/types/types.pb.go @@ -1676,9 +1676,9 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for TMSPApplication service +// Client API for ABCIApplication service -type TMSPApplicationClient interface { +type ABCIApplicationClient interface { Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) @@ -1696,13 +1696,13 @@ type tMSPApplicationClient struct { cc *grpc.ClientConn } -func NewTMSPApplicationClient(cc *grpc.ClientConn) TMSPApplicationClient { +func NewABCIApplicationClient(cc *grpc.ClientConn) ABCIApplicationClient { return &tMSPApplicationClient{cc} } func (c *tMSPApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts ...grpc.CallOption) (*ResponseEcho, error) { out := new(ResponseEcho) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Echo", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Echo", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1711,7 +1711,7 @@ func (c *tMSPApplicationClient) Echo(ctx context.Context, in *RequestEcho, opts func (c *tMSPApplicationClient) Flush(ctx context.Context, in *RequestFlush, opts ...grpc.CallOption) (*ResponseFlush, error) { out := new(ResponseFlush) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Flush", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Flush", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1720,7 +1720,7 @@ func (c *tMSPApplicationClient) Flush(ctx context.Context, in *RequestFlush, opt func (c *tMSPApplicationClient) Info(ctx context.Context, in *RequestInfo, opts ...grpc.CallOption) (*ResponseInfo, error) { out := new(ResponseInfo) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Info", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Info", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1729,7 +1729,7 @@ func (c *tMSPApplicationClient) Info(ctx context.Context, in *RequestInfo, opts func (c *tMSPApplicationClient) SetOption(ctx context.Context, in *RequestSetOption, opts ...grpc.CallOption) (*ResponseSetOption, error) { out := new(ResponseSetOption) - err := grpc.Invoke(ctx, "/types.TMSPApplication/SetOption", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/SetOption", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1738,7 +1738,7 @@ func (c *tMSPApplicationClient) SetOption(ctx context.Context, in *RequestSetOpt func (c *tMSPApplicationClient) DeliverTx(ctx context.Context, in *RequestDeliverTx, opts ...grpc.CallOption) (*ResponseDeliverTx, error) { out := new(ResponseDeliverTx) - err := grpc.Invoke(ctx, "/types.TMSPApplication/DeliverTx", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/DeliverTx", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1747,7 +1747,7 @@ func (c *tMSPApplicationClient) DeliverTx(ctx context.Context, in *RequestDelive func (c *tMSPApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, opts ...grpc.CallOption) (*ResponseCheckTx, error) { out := new(ResponseCheckTx) - err := grpc.Invoke(ctx, "/types.TMSPApplication/CheckTx", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/CheckTx", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1756,7 +1756,7 @@ func (c *tMSPApplicationClient) CheckTx(ctx context.Context, in *RequestCheckTx, func (c *tMSPApplicationClient) Query(ctx context.Context, in *RequestQuery, opts ...grpc.CallOption) (*ResponseQuery, error) { out := new(ResponseQuery) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Query", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Query", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1765,7 +1765,7 @@ func (c *tMSPApplicationClient) Query(ctx context.Context, in *RequestQuery, opt func (c *tMSPApplicationClient) Commit(ctx context.Context, in *RequestCommit, opts ...grpc.CallOption) (*ResponseCommit, error) { out := new(ResponseCommit) - err := grpc.Invoke(ctx, "/types.TMSPApplication/Commit", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/Commit", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1774,7 +1774,7 @@ func (c *tMSPApplicationClient) Commit(ctx context.Context, in *RequestCommit, o func (c *tMSPApplicationClient) InitChain(ctx context.Context, in *RequestInitChain, opts ...grpc.CallOption) (*ResponseInitChain, error) { out := new(ResponseInitChain) - err := grpc.Invoke(ctx, "/types.TMSPApplication/InitChain", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/InitChain", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1783,7 +1783,7 @@ func (c *tMSPApplicationClient) InitChain(ctx context.Context, in *RequestInitCh func (c *tMSPApplicationClient) BeginBlock(ctx context.Context, in *RequestBeginBlock, opts ...grpc.CallOption) (*ResponseBeginBlock, error) { out := new(ResponseBeginBlock) - err := grpc.Invoke(ctx, "/types.TMSPApplication/BeginBlock", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/BeginBlock", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1792,16 +1792,16 @@ func (c *tMSPApplicationClient) BeginBlock(ctx context.Context, in *RequestBegin func (c *tMSPApplicationClient) EndBlock(ctx context.Context, in *RequestEndBlock, opts ...grpc.CallOption) (*ResponseEndBlock, error) { out := new(ResponseEndBlock) - err := grpc.Invoke(ctx, "/types.TMSPApplication/EndBlock", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/types.ABCIApplication/EndBlock", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// Server API for TMSPApplication service +// Server API for ABCIApplication service -type TMSPApplicationServer interface { +type ABCIApplicationServer interface { Echo(context.Context, *RequestEcho) (*ResponseEcho, error) Flush(context.Context, *RequestFlush) (*ResponseFlush, error) Info(context.Context, *RequestInfo) (*ResponseInfo, error) @@ -1815,255 +1815,255 @@ type TMSPApplicationServer interface { EndBlock(context.Context, *RequestEndBlock) (*ResponseEndBlock, error) } -func RegisterTMSPApplicationServer(s *grpc.Server, srv TMSPApplicationServer) { - s.RegisterService(&_TMSPApplication_serviceDesc, srv) +func RegisterABCIApplicationServer(s *grpc.Server, srv ABCIApplicationServer) { + s.RegisterService(&_ABCIApplication_serviceDesc, srv) } -func _TMSPApplication_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestEcho) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Echo(ctx, in) + return srv.(ABCIApplicationServer).Echo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Echo", + FullMethod: "/types.ABCIApplication/Echo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Echo(ctx, req.(*RequestEcho)) + return srv.(ABCIApplicationServer).Echo(ctx, req.(*RequestEcho)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestFlush) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Flush(ctx, in) + return srv.(ABCIApplicationServer).Flush(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Flush", + FullMethod: "/types.ABCIApplication/Flush", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Flush(ctx, req.(*RequestFlush)) + return srv.(ABCIApplicationServer).Flush(ctx, req.(*RequestFlush)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestInfo) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Info(ctx, in) + return srv.(ABCIApplicationServer).Info(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Info", + FullMethod: "/types.ABCIApplication/Info", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Info(ctx, req.(*RequestInfo)) + return srv.(ABCIApplicationServer).Info(ctx, req.(*RequestInfo)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_SetOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_SetOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestSetOption) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).SetOption(ctx, in) + return srv.(ABCIApplicationServer).SetOption(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/SetOption", + FullMethod: "/types.ABCIApplication/SetOption", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).SetOption(ctx, req.(*RequestSetOption)) + return srv.(ABCIApplicationServer).SetOption(ctx, req.(*RequestSetOption)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_DeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_DeliverTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestDeliverTx) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).DeliverTx(ctx, in) + return srv.(ABCIApplicationServer).DeliverTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/DeliverTx", + FullMethod: "/types.ABCIApplication/DeliverTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).DeliverTx(ctx, req.(*RequestDeliverTx)) + return srv.(ABCIApplicationServer).DeliverTx(ctx, req.(*RequestDeliverTx)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_CheckTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestCheckTx) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).CheckTx(ctx, in) + return srv.(ABCIApplicationServer).CheckTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/CheckTx", + FullMethod: "/types.ABCIApplication/CheckTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).CheckTx(ctx, req.(*RequestCheckTx)) + return srv.(ABCIApplicationServer).CheckTx(ctx, req.(*RequestCheckTx)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestQuery) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Query(ctx, in) + return srv.(ABCIApplicationServer).Query(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Query", + FullMethod: "/types.ABCIApplication/Query", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Query(ctx, req.(*RequestQuery)) + return srv.(ABCIApplicationServer).Query(ctx, req.(*RequestQuery)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +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 { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).Commit(ctx, in) + return srv.(ABCIApplicationServer).Commit(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/Commit", + FullMethod: "/types.ABCIApplication/Commit", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).Commit(ctx, req.(*RequestCommit)) + return srv.(ABCIApplicationServer).Commit(ctx, req.(*RequestCommit)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_InitChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestInitChain) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).InitChain(ctx, in) + return srv.(ABCIApplicationServer).InitChain(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/InitChain", + FullMethod: "/types.ABCIApplication/InitChain", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).InitChain(ctx, req.(*RequestInitChain)) + return srv.(ABCIApplicationServer).InitChain(ctx, req.(*RequestInitChain)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_BeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_BeginBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestBeginBlock) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).BeginBlock(ctx, in) + return srv.(ABCIApplicationServer).BeginBlock(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/BeginBlock", + FullMethod: "/types.ABCIApplication/BeginBlock", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).BeginBlock(ctx, req.(*RequestBeginBlock)) + return srv.(ABCIApplicationServer).BeginBlock(ctx, req.(*RequestBeginBlock)) } return interceptor(ctx, in, info, handler) } -func _TMSPApplication_EndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ABCIApplication_EndBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RequestEndBlock) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TMSPApplicationServer).EndBlock(ctx, in) + return srv.(ABCIApplicationServer).EndBlock(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/types.TMSPApplication/EndBlock", + FullMethod: "/types.ABCIApplication/EndBlock", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TMSPApplicationServer).EndBlock(ctx, req.(*RequestEndBlock)) + return srv.(ABCIApplicationServer).EndBlock(ctx, req.(*RequestEndBlock)) } return interceptor(ctx, in, info, handler) } -var _TMSPApplication_serviceDesc = grpc.ServiceDesc{ - ServiceName: "types.TMSPApplication", - HandlerType: (*TMSPApplicationServer)(nil), +var _ABCIApplication_serviceDesc = grpc.ServiceDesc{ + ServiceName: "types.ABCIApplication", + HandlerType: (*ABCIApplicationServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", - Handler: _TMSPApplication_Echo_Handler, + Handler: _ABCIApplication_Echo_Handler, }, { MethodName: "Flush", - Handler: _TMSPApplication_Flush_Handler, + Handler: _ABCIApplication_Flush_Handler, }, { MethodName: "Info", - Handler: _TMSPApplication_Info_Handler, + Handler: _ABCIApplication_Info_Handler, }, { MethodName: "SetOption", - Handler: _TMSPApplication_SetOption_Handler, + Handler: _ABCIApplication_SetOption_Handler, }, { MethodName: "DeliverTx", - Handler: _TMSPApplication_DeliverTx_Handler, + Handler: _ABCIApplication_DeliverTx_Handler, }, { MethodName: "CheckTx", - Handler: _TMSPApplication_CheckTx_Handler, + Handler: _ABCIApplication_CheckTx_Handler, }, { MethodName: "Query", - Handler: _TMSPApplication_Query_Handler, + Handler: _ABCIApplication_Query_Handler, }, { MethodName: "Commit", - Handler: _TMSPApplication_Commit_Handler, + Handler: _ABCIApplication_Commit_Handler, }, { MethodName: "InitChain", - Handler: _TMSPApplication_InitChain_Handler, + Handler: _ABCIApplication_InitChain_Handler, }, { MethodName: "BeginBlock", - Handler: _TMSPApplication_BeginBlock_Handler, + Handler: _ABCIApplication_BeginBlock_Handler, }, { MethodName: "EndBlock", - Handler: _TMSPApplication_EndBlock_Handler, + Handler: _ABCIApplication_EndBlock_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/types/types.proto b/types/types.proto index 34e5450b8..b3ff1655e 100644 --- a/types/types.proto +++ b/types/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package types; -// This file is copied from http://github.com/tendermint/tmsp +// This file is copied from http://github.com/tendermint/abci //---------------------------------------- // Message types @@ -243,7 +243,7 @@ message Validator { //---------------------------------------- // Service Definition -service TMSPApplication { +service ABCIApplication { rpc Echo(RequestEcho) returns (ResponseEcho) ; rpc Flush(RequestFlush) returns (ResponseFlush); rpc Info(RequestInfo) returns (ResponseInfo); From 42b7bfbf0c5e760655321b0d25adabcb7428d08d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 12 Jan 2017 21:20:09 -0500 Subject: [PATCH 40/40] update version and glide --- cmd/abci-cli/tmsp-cli.go | 4 ++-- glide.lock | 33 +++++++++++++++++++-------------- glide.yaml | 1 - types/version.go | 7 +++++++ 4 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 types/version.go diff --git a/cmd/abci-cli/tmsp-cli.go b/cmd/abci-cli/tmsp-cli.go index b8bc2937e..39dace9f9 100644 --- a/cmd/abci-cli/tmsp-cli.go +++ b/cmd/abci-cli/tmsp-cli.go @@ -9,9 +9,9 @@ import ( "os" "strings" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/client" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" "github.com/urfave/cli" ) @@ -50,7 +50,7 @@ func main() { app := cli.NewApp() app.Name = "abci-cli" app.Usage = "abci-cli [command] [args...]" - app.Version = "0.2.1" // better error handling in console + app.Version = "0.3.0" // hex handling app.Flags = []cli.Flag{ cli.StringFlag{ Name: "address", diff --git a/glide.lock b/glide.lock index 5a8a6c779..27767606d 100644 --- a/glide.lock +++ b/glide.lock @@ -1,12 +1,10 @@ -hash: 0644029071e51c40b7b4f9b3b3c14fce59e6dadd42897ea20d7eaf049104969e -updated: 2017-01-12T01:05:04.505700434-05:00 +hash: c050dfd4a6af84ab490a78c1580ac74caf42ed00799de7017d2ee325b806f77e +updated: 2017-01-12T21:19:13.812049926-05:00 imports: - name: github.com/btcsuite/btcd - version: afec1bd1245a4a19e6dfe1306974b733e7cbb9b8 + version: 153dca5c1e4b5d1ea1523592495e5bedfa503391 subpackages: - btcec -- name: github.com/btcsuite/fastsha256 - version: 637e656429416087660c84436a2a035d69d54e2e - name: github.com/go-stack/stack version: 100eb0c0a9c5b306ca2fb4f165df21d80ada4b82 - name: github.com/golang/protobuf @@ -20,9 +18,9 @@ imports: - name: github.com/mattn/go-colorable version: d228849504861217f796da67fae4f6e347643f15 - name: github.com/mattn/go-isatty - version: 66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8 + version: 30a891c33c7cde7b02a981314b4228ec99380cca - name: github.com/syndtr/goleveldb - version: 6b4daa5362b502898ddf367c5c11deb9e7a5c727 + version: 23851d93a2292dcc56e71a18ec9e0624d84a0f65 subpackages: - leveldb - leveldb/cache @@ -50,19 +48,19 @@ imports: - name: github.com/tendermint/go-logger version: cefb3a45c0bf3c493a04e9bcd9b1540528be59f2 - name: github.com/tendermint/go-merkle - version: c7a7ae88ca72bf030a7fb7d0d52ce8d1e62b4e16 + version: 2979c7eb8aa020fa1cf203654907dbb889703888 - name: github.com/tendermint/go-process version: 7f507d69fa4c13b34e7a17ff5c87d1eaaa759145 - name: github.com/tendermint/go-wire - version: 37d5dd6530857a1abc1db50a48ba22c3459826a1 + version: 2f3b7aafe21c80b19b6ee3210ecb3e3d07c7a471 - name: github.com/tendermint/log15 version: ae0f3d6450da9eac7074b439c8e1c3cabf0d5ce6 subpackages: - term - name: github.com/urfave/cli - version: 0bdeddeeb0f650497d603c4ad7b20cfe685682f6 + version: 8ef3805c9de2519805c3f060524b695bba2cd715 - name: golang.org/x/crypto - version: ede567c8e044a5913dad1d1af3696d9da953104c + version: 7c6cc321c680f03b9ef0764448e780704f486b51 subpackages: - nacl/secretbox - openpgp/armor @@ -71,7 +69,7 @@ imports: - ripemd160 - salsa20/salsa - name: golang.org/x/net - version: 4971afdc2f162e82d185353533d3cf16188a9f4e + version: 60c41d1de8da134c05b7b40154a9a82bf5b7edb9 subpackages: - context - http2 @@ -81,11 +79,18 @@ imports: - lex/httplex - trace - name: golang.org/x/sys - version: 30237cf4eefd639b184d1f2cb77a581ea0be8947 + version: d75a52659825e75fff6158388dddc6a5b04f9ba5 subpackages: - unix +- name: golang.org/x/text + version: 44f4f658a783b0cee41fe0a23b8fc91d9c120558 + subpackages: + - secure/bidirule + - transform + - unicode/bidi + - unicode/norm - name: google.golang.org/grpc - version: 63bd55dfbf781b183216d2dd4433a659c947648a + version: 50955793b0183f9de69bd78e2ec251cf20aab121 subpackages: - codes - credentials diff --git a/glide.yaml b/glide.yaml index fae5a9841..91283045d 100644 --- a/glide.yaml +++ b/glide.yaml @@ -14,7 +14,6 @@ import: - package: github.com/tendermint/go-process version: develop - package: github.com/tendermint/go-wire - version: develop - package: github.com/urfave/cli - package: golang.org/x/net subpackages: diff --git a/types/version.go b/types/version.go new file mode 100644 index 000000000..719c6c98c --- /dev/null +++ b/types/version.go @@ -0,0 +1,7 @@ +package types + +const Maj = "0" +const Min = "3" // ResponseInfo, ResponseEndBlock +const Fix = "0" // + +const Version = Maj + "." + Min + "." + Fix