From 149b2fc0a2ad91cd3c7b54a73d5cf93a68023175 Mon Sep 17 00:00:00 2001 From: rickyyangz Date: Thu, 9 May 2019 11:13:32 +0800 Subject: [PATCH] upgrade tendermint to 0315 --- Gopkg.lock | 31 ++++++++++++++----------------- Gopkg.toml | 2 +- baseapp/helpers.go | 27 --------------------------- client/lcd/root.go | 14 ++++++++------ client/lcd/test_helpers.go | 4 ++-- server/start.go | 3 ++- 6 files changed, 27 insertions(+), 54 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 8cae851a2..bc31c206e 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -54,14 +54,6 @@ revision = "346938d642f2ec3594ed81d874461961cd0faa76" version = "v1.1.0" -[[projects]] - digest = "1:fed20bf7f0da387c96d4cfc140a95572e5aba4bb984beb7de910e090ae39849b" - name = "github.com/ethereum/go-ethereum" - packages = ["crypto/secp256k1"] - pruneopts = "UT" - revision = "c942700427557e3ff6de3aaf6b916e2f056c1ec2" - version = "v1.8.23" - [[projects]] digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd" name = "github.com/fsnotify/fsnotify" @@ -103,7 +95,7 @@ version = "v1.8.0" [[projects]] - digest = "1:35621fe20f140f05a0c4ef662c26c0ab4ee50bca78aa30fe87d33120bd28165e" + digest = "1:95e1006e41c641abd2f365dfa0f1213c04da294e7cd5f0bf983af234b775db64" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -114,8 +106,8 @@ "types", ] pruneopts = "UT" - revision = "636bf0302bc95575d69441b25a2603156ffdddf1" - version = "v1.1.1" + revision = "ba06b47c162d49f2af050fb4c75bcbc86a159d5c" + version = "v1.2.1" [[projects]] digest = "1:17fe264ee908afc795734e8c4e63db2accabaf57326dbf21763a7d6b86096260" @@ -201,12 +193,12 @@ version = "v1.0" [[projects]] - branch = "master" - digest = "1:39b27d1381a30421f9813967a5866fba35dc1d4df43a6eefe3b7a5444cb07214" + digest = "1:a74b5a8e34ee5843cd6e65f698f3e75614f812ff170c2243425d75bc091e9af2" name = "github.com/jmhodges/levigo" packages = ["."] pruneopts = "UT" - revision = "c42d9e0ca023e2198120196f842701bb4c55d7b9" + revision = "853d788c5c416eaaee5b044570784a96c7a26975" + version = "v1.0.0" [[projects]] branch = "master" @@ -448,7 +440,8 @@ version = "v0.12.0-binance.0" [[projects]] - digest = "1:09921dbdc56888c7a8d926a35ddd829a7891d6dd3b6eb91a0eb4849f4c0348ce" + branch = "develop" + digest = "1:2b400bdb8f3290f0e660edfbd316e007839a9f23a59e10f6a31d0de28995e105" name = "github.com/tendermint/tendermint" packages = [ "abci/client", @@ -470,6 +463,7 @@ "crypto/multisig", "crypto/multisig/bitarray", "crypto/secp256k1", + "crypto/secp256k1/internal/secp256k1", "crypto/tmhash", "crypto/xsalsa20symmetric", "evidence", @@ -483,6 +477,7 @@ "libs/events", "libs/fail", "libs/flowrate", + "libs/gopool", "libs/log", "libs/pubsub", "libs/pubsub/query", @@ -506,6 +501,9 @@ "rpc/lib/server", "rpc/lib/types", "state", + "state/blockindex", + "state/blockindex/kv", + "state/blockindex/null", "state/txindex", "state/txindex/kv", "state/txindex/null", @@ -514,9 +512,8 @@ "version", ] pruneopts = "UT" - revision = "3abb98b2e97b6ef6286e6f7d4b164012fe36ec80" + revision = "500b85f7fa5b745c9c98879314d8ee046815e082" source = "github.com/binance-chain/bnc-tendermint" - version = "v0.30.1-binance.0" [[projects]] digest = "1:6f6dc6060c4e9ba73cf28aa88f12a69a030d3d19d518ef8e931879eaa099628d" diff --git a/Gopkg.toml b/Gopkg.toml index b15fb8354..fbf279703 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -59,7 +59,7 @@ [[override]] name = "github.com/tendermint/tendermint" source = "github.com/binance-chain/bnc-tendermint" - version = "=v0.30.1-binance.0" + branch = "develop" ## deps without releases: diff --git a/baseapp/helpers.go b/baseapp/helpers.go index cc965316c..5708906bf 100644 --- a/baseapp/helpers.go +++ b/baseapp/helpers.go @@ -2,8 +2,6 @@ package baseapp import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/abci/server" - abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto/tmhash" cmn "github.com/tendermint/tendermint/libs/common" ) @@ -25,28 +23,3 @@ func (app *BaseApp) Deliver(tx sdk.Tx) (result sdk.Result) { txHash := cmn.HexBytes(tmhash.Sum(nil)).String() return app.RunTx(sdk.RunTxModeDeliver, nil, tx, txHash) } - -// RunForever - BasecoinApp execution and cleanup -func RunForever(app abci.Application) { - - // Start the ABCI server - srv, err := server.NewServer("0.0.0.0:26658", "socket", app) - if err != nil { - cmn.Exit(err.Error()) - return - } - err = srv.Start() - if err != nil { - cmn.Exit(err.Error()) - return - } - - // Wait forever - cmn.TrapSignal(func() { - // Cleanup - err := srv.Stop() - if err != nil { - cmn.Exit(err.Error()) - } - }) -} diff --git a/client/lcd/root.go b/client/lcd/root.go index 10faadd1a..dc94a2904 100644 --- a/client/lcd/root.go +++ b/client/lcd/root.go @@ -12,6 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/server" auth "github.com/cosmos/cosmos-sdk/x/auth/client/rest" bank "github.com/cosmos/cosmos-sdk/x/bank/client/rest" gov "github.com/cosmos/cosmos-sdk/x/gov/client/rest" @@ -21,7 +22,6 @@ import ( "github.com/rakyll/statik/fs" "github.com/spf13/cobra" "github.com/spf13/viper" - cmn "github.com/tendermint/tendermint/libs/common" "github.com/tendermint/tendermint/libs/log" tmserver "github.com/tendermint/tendermint/rpc/lib/server" ) @@ -58,12 +58,13 @@ func ServeCommand(cdc *codec.Codec) *cobra.Command { var listener net.Listener var fingerprint string if viper.GetBool(flagInsecure) { - listener, err := tmserver.Listen(listenAddr, tmserver.Config{MaxOpenConnections: maxOpen}) + cfg := &tmserver.Config{MaxOpenConnections: maxOpen} + listener, err := tmserver.Listen(listenAddr, cfg) if err != nil { return err } go func() { - if err = tmserver.StartHTTPServer(listener, handler, logger); err != nil { + if err = tmserver.StartHTTPServer(listener, handler, logger, cfg); err != nil { panic(err) } }() @@ -91,12 +92,13 @@ func ServeCommand(cdc *codec.Codec) *cobra.Command { } defer cleanupFunc() } - listener, err := tmserver.Listen(listenAddr, tmserver.Config{MaxOpenConnections: maxOpen}) + cfg := &tmserver.Config{MaxOpenConnections: maxOpen} + listener, err := tmserver.Listen(listenAddr, cfg) if err != nil { return err } go func() { - if err = tmserver.StartHTTPServer(listener, handler, logger); err != nil { + if err = tmserver.StartHTTPAndTLSServer(listener, handler, certFile, keyFile, logger, cfg); err != nil { panic(err) } }() @@ -105,7 +107,7 @@ func ServeCommand(cdc *codec.Codec) *cobra.Command { logger.Info("REST server started") // wait forever and cleanup - cmn.TrapSignal(func() { + server.TrapSignal(func() { defer cleanupFunc() err := listener.Close() logger.Error("error closing listener", "err", err) diff --git a/client/lcd/test_helpers.go b/client/lcd/test_helpers.go index 77929dcc2..1e86ee585 100644 --- a/client/lcd/test_helpers.go +++ b/client/lcd/test_helpers.go @@ -334,12 +334,12 @@ func startTM( // // NOTE: This causes the thread to block. func startLCD(logger log.Logger, listenAddr string, cdc *codec.Codec) (net.Listener, error) { - listener, err := tmrpc.Listen(listenAddr, tmrpc.Config{}) + listener, err := tmrpc.Listen(listenAddr, &tmrpc.Config{}) if err != nil { return nil, err } - go tmrpc.StartHTTPServer(listener, createHandler(cdc), logger) + go tmrpc.StartHTTPServer(listener, createHandler(cdc), logger, &tmrpc.Config{}) return listener, nil } diff --git a/server/start.go b/server/start.go index 9012bc198..13a084edb 100644 --- a/server/start.go +++ b/server/start.go @@ -87,13 +87,14 @@ func startStandAlone(ctx *Context, appCreator AppCreator) error { } // wait forever - cmn.TrapSignal(func() { + cmn.TrapSignal(ctx.Logger, func() { // cleanup err = svr.Stop() if err != nil { cmn.Exit(err.Error()) } }) + select {} return nil }