From 3fbe9f235a1cc994c0eee24f55ffae7fa952ce63 Mon Sep 17 00:00:00 2001 From: Zach Date: Fri, 14 Dec 2018 00:32:09 -0500 Subject: [PATCH 01/12] docs: add edit on Github links (#3014) --- docs/.vuepress/config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index a1e150c3..7c8aeee5 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -8,6 +8,11 @@ module.exports = { lineNumbers: true }, themeConfig: { + repo: "tendermint/tendermint", + editLinks: true, + docsDir: "docs", + docsBranch: "develop", + editLinkText: 'Edit this page on Github', lastUpdated: true, algolia: { apiKey: '59f0e2deb984aa9cdf2b3a5fd24ac501', From f5cca9f1215814301ea4996db747b64eb3926d84 Mon Sep 17 00:00:00 2001 From: Zach Date: Sat, 15 Dec 2018 14:01:28 -0500 Subject: [PATCH 02/12] docs: update DOCS_README (#3019) Co-Authored-By: zramsay --- docs/DOCS_README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/DOCS_README.md b/docs/DOCS_README.md index a7671c36..c91d0391 100644 --- a/docs/DOCS_README.md +++ b/docs/DOCS_README.md @@ -12,10 +12,10 @@ respectively. ## How It Works -There is a Jenkins job listening for changes in the `/docs` directory, on both +There is a CircleCI job listening for changes in the `/docs` directory, on both the `master` and `develop` branches. Any updates to files in this directory on those branches will automatically trigger a website deployment. Under the hood, -a private website repository has make targets consumed by a standard Jenkins task. +the private website repository has a `make build-docs` target consumed by a CircleCI job in that repo. ## README @@ -93,6 +93,10 @@ python -m SimpleHTTPServer 8080 then navigate to localhost:8080 in your browser. +## Search + +We are using [Algolia](https://www.algolia.com) to power full-text search. This uses a public API search-only key in the `config.js` as well as a [tendermint.json](https://github.com/algolia/docsearch-configs/blob/master/configs/tendermint.json) configuration file that we can update with PRs. + ## Consistency Because the build processes are identical (as is the information contained herein), this file should be kept in sync as From ae275d791e7e802b6fec9243af56c7a3b53f6a08 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Sat, 15 Dec 2018 23:27:02 +0400 Subject: [PATCH 03/12] mempool: notifyTxsAvailable if there're txs left, but recheck=false (#2991) (left after committing a block) Fixes #2961 -------------- ORIGINAL ISSUE Tendermint version : 0.26.4-b771798d ABCI app : kv-store Environment: OS (e.g. from /etc/os-release): macOS 10.14.1 What happened: Set mempool.recheck = false and create empty block = false in config.toml. When transactions get added right between a new empty block is being proposed and committed, the proposer won't propose new block for that transactions immediately after. That transactions are stuck in the mempool until a new transaction is added and trigger the proposer. What you expected to happen: If there is a transaction left in the mempool, new block should be proposed immediately. Have you tried the latest version: yes How to reproduce it (as minimally and precisely as possible): Fire two transaction using broadcast_tx_sync with specific delay between them. (You may need to do it multiple time before the right delay is found, on my machine the delay is 0.98s) Logs (paste a small part showing an error (< 10 lines) or link a pastebin, gist, etc. containing more of the log file): https://pastebin.com/0Wt6uhPF Config (you can paste only the changes you've made): [mempool] recheck = false create_empty_block = false Anything else we need to know: In mempool.go, we found that proposer will immediately propose new block if Last committed block has some transaction (causing AppHash to changed) or mem.notifyTxsAvailable() is called. Our scenario is as followed. A transaction is fired, it will create 1 block with 1 tx (line 1-4 in the log) and 1 empty block. After the empty block is proposed but before it is committed, second transaction is fired and added to mempool. (line 8-16) Now, since the last committed block is empty and mem.notifyTxsAvailable() will be called only if mempool.recheck = true. The proposer won't immediately propose new block, causing the second transaction to stuck in mempool until another transaction is added to mempool and trigger mem.notifyTxsAvailable(). --- CHANGELOG_PENDING.md | 1 + mempool/mempool.go | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 3cc491fe..bcbeb496 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -24,5 +24,6 @@ Special thanks to external contributors on this release: ### BUG FIXES: - [kv indexer] \#2912 don't ignore key when executing CONTAINS +- [mempool] \#2961 notifyTxsAvailable if there're txs left after committing a block, but recheck=false - [mempool] \#2994 Don't allow txs with negative gas wanted - [p2p] \#2715 fix a bug where seeds don't disconnect from a peer after 3h diff --git a/mempool/mempool.go b/mempool/mempool.go index 40468315..c5f966c4 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -556,13 +556,18 @@ func (mem *Mempool) Update( // Remove committed transactions. txsLeft := mem.removeTxs(txs) - // Recheck mempool txs if any txs were committed in the block - if mem.config.Recheck && len(txsLeft) > 0 { - mem.logger.Info("Recheck txs", "numtxs", len(txsLeft), "height", height) - mem.recheckTxs(txsLeft) - // At this point, mem.txs are being rechecked. - // mem.recheckCursor re-scans mem.txs and possibly removes some txs. - // Before mem.Reap(), we should wait for mem.recheckCursor to be nil. + // Either recheck non-committed txs to see if they became invalid + // or just notify there're some txs left. + if len(txsLeft) > 0 { + if mem.config.Recheck { + mem.logger.Info("Recheck txs", "numtxs", len(txsLeft), "height", height) + mem.recheckTxs(txsLeft) + // At this point, mem.txs are being rechecked. + // mem.recheckCursor re-scans mem.txs and possibly removes some txs. + // Before mem.Reap(), we should wait for mem.recheckCursor to be nil. + } else { + mem.notifyTxsAvailable() + } } // Update metrics From f82a8ff73a6352355c2f10809a1cce1b23349d20 Mon Sep 17 00:00:00 2001 From: JamesRay <66258875@qq.com> Date: Sun, 16 Dec 2018 03:33:30 +0800 Subject: [PATCH 04/12] During replay, when appHeight==0, only saveState if stateHeight is also 0 (#3006) * optimize addProposalBlockPart * optimize addProposalBlockPart * if ProposalBlockParts and LockedBlockParts both exist,let LockedBlockParts overwrite ProposalBlockParts. * fix tryAddBlock * broadcast lockedBlockParts in higher priority * when appHeight==0, it's better fetch genDoc than state.validators. * not save state if replay from height 1 * only save state if replay from height 1 when stateHeight is also 1 * only save state if replay from height 1 when stateHeight is also 1 * only save state if replay from height 0 when stateHeight is also 0 * handshake info's response version only update when stateHeight==0 * save the handshake responseInfo appVersion --- CHANGELOG_PENDING.md | 1 + consensus/replay.go | 37 ++++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index bcbeb496..98acb141 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -27,3 +27,4 @@ Special thanks to external contributors on this release: - [mempool] \#2961 notifyTxsAvailable if there're txs left after committing a block, but recheck=false - [mempool] \#2994 Don't allow txs with negative gas wanted - [p2p] \#2715 fix a bug where seeds don't disconnect from a peer after 3h +- [replay] \#3006 saveState only when stateHeight is also 0 diff --git a/consensus/replay.go b/consensus/replay.go index ba118e66..16b66e86 100644 --- a/consensus/replay.go +++ b/consensus/replay.go @@ -11,7 +11,6 @@ import ( "time" abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/version" //auto "github.com/tendermint/tendermint/libs/autofile" cmn "github.com/tendermint/tendermint/libs/common" dbm "github.com/tendermint/tendermint/libs/db" @@ -20,6 +19,7 @@ import ( "github.com/tendermint/tendermint/proxy" sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/types" + "github.com/tendermint/tendermint/version" ) var crc32c = crc32.MakeTable(crc32.Castagnoli) @@ -247,6 +247,7 @@ func (h *Handshaker) Handshake(proxyApp proxy.AppConns) error { // Set AppVersion on the state. h.initialState.Version.Consensus.App = version.Protocol(res.AppVersion) + sm.SaveState(h.stateDB, h.initialState) // Replay blocks up to the latest in the blockstore. _, err = h.ReplayBlocks(h.initialState, appHash, blockHeight, proxyApp) @@ -295,25 +296,27 @@ func (h *Handshaker) ReplayBlocks( return nil, err } - // If the app returned validators or consensus params, update the state. - if len(res.Validators) > 0 { - vals, err := types.PB2TM.ValidatorUpdates(res.Validators) - if err != nil { - return nil, err + if stateBlockHeight == 0 { //we only update state when we are in initial state + // If the app returned validators or consensus params, update the state. + if len(res.Validators) > 0 { + vals, err := types.PB2TM.ValidatorUpdates(res.Validators) + if err != nil { + return nil, err + } + state.Validators = types.NewValidatorSet(vals) + state.NextValidators = types.NewValidatorSet(vals) + } else { + // If validator set is not set in genesis and still empty after InitChain, exit. + if len(h.genDoc.Validators) == 0 { + return nil, fmt.Errorf("Validator set is nil in genesis and still empty after InitChain") + } } - state.Validators = types.NewValidatorSet(vals) - state.NextValidators = types.NewValidatorSet(vals) - } else { - // If validator set is not set in genesis and still empty after InitChain, exit. - if len(h.genDoc.Validators) == 0 { - return nil, fmt.Errorf("Validator set is nil in genesis and still empty after InitChain") + + if res.ConsensusParams != nil { + state.ConsensusParams = types.PB2TM.ConsensusParams(res.ConsensusParams) } + sm.SaveState(h.stateDB, state) } - - if res.ConsensusParams != nil { - state.ConsensusParams = types.PB2TM.ConsensusParams(res.ConsensusParams) - } - sm.SaveState(h.stateDB, state) } // First handle edge cases and constraints on the storeBlockHeight. From 7c9e767e1fc2fa3f84d50a7313e20ddbff174b46 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 15 Dec 2018 15:26:27 -0500 Subject: [PATCH 05/12] 2980 fix cors (#3021) * config: cors options are arrays of strings, not strings Fixes #2980 * docs: update tendermint-core/configuration.html page * set allow_duplicate_ip to false * in `tendermint testnet`, set allow_duplicate_ip to true Refs #2712 * fixes after Ismail's review * Revert "set allow_duplicate_ip to false" This reverts commit 24c1094ebcf2bd35f2642a44d7a1e5fb5c178fb1. --- CHANGELOG_PENDING.md | 1 + config/config.go | 8 ++-- config/toml.go | 16 ++++---- docs/tendermint-core/configuration.md | 56 ++++++++++++++++----------- 4 files changed, 46 insertions(+), 35 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 98acb141..9854bce5 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -23,6 +23,7 @@ Special thanks to external contributors on this release: - [ci/cd] Updated CircleCI job to trigger website build when docs are updated ### BUG FIXES: +- [config] \#2980 fix cors options formatting - [kv indexer] \#2912 don't ignore key when executing CONTAINS - [mempool] \#2961 notifyTxsAvailable if there're txs left after committing a block, but recheck=false - [mempool] \#2994 Don't allow txs with negative gas wanted diff --git a/config/config.go b/config/config.go index 23b03399..2b9c8758 100644 --- a/config/config.go +++ b/config/config.go @@ -283,7 +283,7 @@ type RPCConfig struct { // Maximum number of simultaneous connections. // Does not include RPC (HTTP&WebSocket) connections. See max_open_connections - // If you want to accept more significant number than the default, make sure + // If you want to accept a larger number than the default, make sure // you increase your OS limits. // 0 - unlimited. GRPCMaxOpenConnections int `mapstructure:"grpc_max_open_connections"` @@ -293,7 +293,7 @@ type RPCConfig struct { // Maximum number of simultaneous connections (including WebSocket). // Does not include gRPC connections. See grpc_max_open_connections - // If you want to accept more significant number than the default, make sure + // If you want to accept a larger number than the default, make sure // you increase your OS limits. // 0 - unlimited. // Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} @@ -774,12 +774,12 @@ type InstrumentationConfig struct { PrometheusListenAddr string `mapstructure:"prometheus_listen_addr"` // Maximum number of simultaneous connections. - // If you want to accept more significant number than the default, make sure + // If you want to accept a larger number than the default, make sure // you increase your OS limits. // 0 - unlimited. MaxOpenConnections int `mapstructure:"max_open_connections"` - // Tendermint instrumentation namespace. + // Instrumentation namespace. Namespace string `mapstructure:"namespace"` } diff --git a/config/toml.go b/config/toml.go index 21e017b4..9aa30451 100644 --- a/config/toml.go +++ b/config/toml.go @@ -125,13 +125,13 @@ laddr = "{{ .RPC.ListenAddress }}" # A list of origins a cross-domain request can be executed from # Default value '[]' disables cors support # Use '["*"]' to allow any origin -cors_allowed_origins = "{{ .RPC.CORSAllowedOrigins }}" +cors_allowed_origins = [{{ range .RPC.CORSAllowedOrigins }}{{ printf "%q, " . }}{{end}}] # A list of methods the client is allowed to use with cross-domain requests -cors_allowed_methods = "{{ .RPC.CORSAllowedMethods }}" +cors_allowed_methods = [{{ range .RPC.CORSAllowedMethods }}{{ printf "%q, " . }}{{end}}] # A list of non simple headers the client is allowed to use with cross-domain requests -cors_allowed_headers = "{{ .RPC.CORSAllowedHeaders }}" +cors_allowed_headers = [{{ range .RPC.CORSAllowedHeaders }}{{ printf "%q, " . }}{{end}}] # TCP or UNIX socket address for the gRPC server to listen on # NOTE: This server only supports /broadcast_tx_commit @@ -139,7 +139,7 @@ grpc_laddr = "{{ .RPC.GRPCListenAddress }}" # Maximum number of simultaneous connections. # Does not include RPC (HTTP&WebSocket) connections. See max_open_connections -# If you want to accept more significant number than the default, make sure +# If you want to accept a larger number than the default, make sure # you increase your OS limits. # 0 - unlimited. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} @@ -151,7 +151,7 @@ unsafe = {{ .RPC.Unsafe }} # Maximum number of simultaneous connections (including WebSocket). # Does not include gRPC connections. See grpc_max_open_connections -# If you want to accept more significant number than the default, make sure +# If you want to accept a larger number than the default, make sure # you increase your OS limits. # 0 - unlimited. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} @@ -269,8 +269,8 @@ blocktime_iota = "{{ .Consensus.BlockTimeIota }}" # What indexer to use for transactions # # Options: -# 1) "null" (default) -# 2) "kv" - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). +# 1) "null" +# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). indexer = "{{ .TxIndex.Indexer }}" # Comma-separated list of tags to index (by default the only tag is "tx.hash") @@ -302,7 +302,7 @@ prometheus = {{ .Instrumentation.Prometheus }} prometheus_listen_addr = "{{ .Instrumentation.PrometheusListenAddr }}" # Maximum number of simultaneous connections. -# If you want to accept more significant number than the default, make sure +# If you want to accept a larger number than the default, make sure # you increase your OS limits. # 0 - unlimited. max_open_connections = {{ .Instrumentation.MaxOpenConnections }} diff --git a/docs/tendermint-core/configuration.md b/docs/tendermint-core/configuration.md index 7d1a562e..b61ebe73 100644 --- a/docs/tendermint-core/configuration.md +++ b/docs/tendermint-core/configuration.md @@ -36,22 +36,26 @@ db_backend = "leveldb" # Database directory db_dir = "data" -# Output level for logging -log_level = "state:info,*:error" +# Output level for logging, including package level options +log_level = "main:info,state:info,*:error" # Output format: 'plain' (colored text) or 'json' log_format = "plain" ##### additional base config options ##### -# The ID of the chain to join (should be signed with every transaction and vote) -chain_id = "" - # Path to the JSON file containing the initial validator set and other meta data -genesis_file = "genesis.json" +genesis_file = "config/genesis.json" # Path to the JSON file containing the private key to use as a validator in the consensus protocol -priv_validator_file = "priv_validator.json" +priv_validator_file = "config/priv_validator.json" + +# TCP or UNIX socket address for Tendermint to listen on for +# connections from an external PrivValidator process +priv_validator_laddr = "" + +# Path to the JSON file containing the private key to use for node authentication in the p2p protocol +node_key_file = "config/node_key.json" # Mechanism to connect to the ABCI application: socket | grpc abci = "socket" @@ -74,13 +78,13 @@ laddr = "tcp://0.0.0.0:26657" # A list of origins a cross-domain request can be executed from # Default value '[]' disables cors support # Use '["*"]' to allow any origin -cors_allowed_origins = "[]" +cors_allowed_origins = [] # A list of methods the client is allowed to use with cross-domain requests -cors_allowed_methods = "[HEAD GET POST]" +cors_allowed_methods = [HEAD GET POST] # A list of non simple headers the client is allowed to use with cross-domain requests -cors_allowed_headers = "[Origin Accept Content-Type X-Requested-With X-Server-Time]" +cors_allowed_headers = [Origin Accept Content-Type X-Requested-With X-Server-Time] # TCP or UNIX socket address for the gRPC server to listen on # NOTE: This server only supports /broadcast_tx_commit @@ -88,7 +92,7 @@ grpc_laddr = "" # Maximum number of simultaneous connections. # Does not include RPC (HTTP&WebSocket) connections. See max_open_connections -# If you want to accept more significant number than the default, make sure +# If you want to accept a larger number than the default, make sure # you increase your OS limits. # 0 - unlimited. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} @@ -100,7 +104,7 @@ unsafe = false # Maximum number of simultaneous connections (including WebSocket). # Does not include gRPC connections. See grpc_max_open_connections -# If you want to accept more significant number than the default, make sure +# If you want to accept a larger number than the default, make sure # you increase your OS limits. # 0 - unlimited. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} @@ -113,6 +117,12 @@ max_open_connections = 900 # Address to listen for incoming connections laddr = "tcp://0.0.0.0:26656" +# Address to advertise to peers for them to dial +# If empty, will use the same port as the laddr, +# and will introspect on the listener or use UPnP +# to figure out the address. +external_address = "" + # Comma separated list of seed nodes to connect to seeds = "" @@ -123,7 +133,7 @@ persistent_peers = "" upnp = false # Path to address book -addr_book_file = "addrbook.json" +addr_book_file = "config/addrbook.json" # Set true for strict address routability rules # Set false for private or local networks @@ -171,26 +181,26 @@ dial_timeout = "3s" recheck = true broadcast = true -wal_dir = "data/mempool.wal" +wal_dir = "" # size of the mempool -size = 100000 +size = 5000 # size of the cache (used to filter transactions we saw earlier) -cache_size = 100000 +cache_size = 10000 ##### consensus configuration options ##### [consensus] wal_file = "data/cs.wal/wal" -timeout_propose = "3000ms" +timeout_propose = "3s" timeout_propose_delta = "500ms" -timeout_prevote = "1000ms" +timeout_prevote = "1s" timeout_prevote_delta = "500ms" -timeout_precommit = "1000ms" +timeout_precommit = "1s" timeout_precommit_delta = "500ms" -timeout_commit = "1000ms" +timeout_commit = "1s" # Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) skip_timeout_commit = false @@ -201,10 +211,10 @@ create_empty_blocks_interval = "0s" # Reactor sleep duration parameters peer_gossip_sleep_duration = "100ms" -peer_query_maj23_sleep_duration = "2000ms" +peer_query_maj23_sleep_duration = "2s" # Block time parameters. Corresponds to the minimum time increment between consecutive blocks. -blocktime_iota = "1000ms" +blocktime_iota = "1s" ##### transactions indexer configuration options ##### [tx_index] @@ -245,7 +255,7 @@ prometheus = false prometheus_listen_addr = ":26660" # Maximum number of simultaneous connections. -# If you want to accept a more significant number than the default, make sure +# If you want to accept a larger number than the default, make sure # you increase your OS limits. # 0 - unlimited. max_open_connections = 3 From a75dab492ce74759f32065533df63c45b1d7fd4e Mon Sep 17 00:00:00 2001 From: Hleb Albau Date: Sat, 15 Dec 2018 23:32:35 +0300 Subject: [PATCH 06/12] #2980 fix cors doc (#3013) --- docs/tendermint-core/configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tendermint-core/configuration.md b/docs/tendermint-core/configuration.md index b61ebe73..e66dcf51 100644 --- a/docs/tendermint-core/configuration.md +++ b/docs/tendermint-core/configuration.md @@ -81,10 +81,10 @@ laddr = "tcp://0.0.0.0:26657" cors_allowed_origins = [] # A list of methods the client is allowed to use with cross-domain requests -cors_allowed_methods = [HEAD GET POST] +cors_allowed_methods = ["HEAD", "GET", "POST"] # A list of non simple headers the client is allowed to use with cross-domain requests -cors_allowed_headers = [Origin Accept Content-Type X-Requested-With X-Server-Time] +cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time"] # TCP or UNIX socket address for the gRPC server to listen on # NOTE: This server only supports /broadcast_tx_commit From b53a2712df582d7ea4b3cf5aca0427e2e1b07751 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Sun, 16 Dec 2018 00:38:13 +0400 Subject: [PATCH 07/12] docs: networks/docker-compose: small fixes (#3017) --- Makefile | 1 + docs/networks/docker-compose.md | 66 ++++++++++++++++++--------------- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/Makefile b/Makefile index 6f7874ee..d0f8c439 100644 --- a/Makefile +++ b/Makefile @@ -294,6 +294,7 @@ build-linux: build-docker-localnode: cd networks/local make + cd - # Run a 4-node testnet locally localnet-start: localnet-stop diff --git a/docs/networks/docker-compose.md b/docs/networks/docker-compose.md index a1924eb9..52616b3d 100644 --- a/docs/networks/docker-compose.md +++ b/docs/networks/docker-compose.md @@ -1,20 +1,17 @@ # Docker Compose -With Docker Compose, we can spin up local testnets in a single command: - -``` -make localnet-start -``` +With Docker Compose, you can spin up local testnets with a single command. ## Requirements -- [Install tendermint](/docs/install.md) -- [Install docker](https://docs.docker.com/engine/installation/) -- [Install docker-compose](https://docs.docker.com/compose/install/) +1. [Install tendermint](/docs/install.md) +2. [Install docker](https://docs.docker.com/engine/installation/) +3. [Install docker-compose](https://docs.docker.com/compose/install/) ## Build -Build the `tendermint` binary and the `tendermint/localnode` docker image. +Build the `tendermint` binary and, optionally, the `tendermint/localnode` +docker image. Note the binary will be mounted into the container so it can be updated without rebuilding the image. @@ -25,11 +22,10 @@ cd $GOPATH/src/github.com/tendermint/tendermint # Build the linux binary in ./build make build-linux -# Build tendermint/localnode image +# (optionally) Build tendermint/localnode image make build-docker-localnode ``` - ## Run a testnet To start a 4 node testnet run: @@ -38,9 +34,13 @@ To start a 4 node testnet run: make localnet-start ``` -The nodes bind their RPC servers to ports 26657, 26660, 26662, and 26664 on the host. +The nodes bind their RPC servers to ports 26657, 26660, 26662, and 26664 on the +host. + This file creates a 4-node network using the localnode image. -The nodes of the network expose their P2P and RPC endpoints to the host machine on ports 26656-26657, 26659-26660, 26661-26662, and 26663-26664 respectively. + +The nodes of the network expose their P2P and RPC endpoints to the host machine +on ports 26656-26657, 26659-26660, 26661-26662, and 26663-26664 respectively. To update the binary, just rebuild it and restart the nodes: @@ -52,34 +52,40 @@ make localnet-start ## Configuration -The `make localnet-start` creates files for a 4-node testnet in `./build` by calling the `tendermint testnet` command. +The `make localnet-start` creates files for a 4-node testnet in `./build` by +calling the `tendermint testnet` command. -The `./build` directory is mounted to the `/tendermint` mount point to attach the binary and config files to the container. +The `./build` directory is mounted to the `/tendermint` mount point to attach +the binary and config files to the container. -For instance, to create a single node testnet: +To change the number of validators / non-validators change the `localnet-start` Makefile target: + +``` +localnet-start: localnet-stop + @if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --v 5 --n 3 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2 ; fi + docker-compose up +``` + +The command now will generate config files for 5 validators and 3 +non-validators network. + +Before running it, don't forget to cleanup the old files: ``` cd $GOPATH/src/github.com/tendermint/tendermint # Clear the build folder -rm -rf ./build - -# Build binary -make build-linux - -# Create configuration -docker run -e LOG="stdout" -v `pwd`/build:/tendermint tendermint/localnode testnet --o . --v 1 - -#Run the node -docker run -v `pwd`/build:/tendermint tendermint/localnode - +rm -rf ./build/node* ``` ## Logging -Log is saved under the attached volume, in the `tendermint.log` file. If the `LOG` environment variable is set to `stdout` at start, the log is not saved, but printed on the screen. +Log is saved under the attached volume, in the `tendermint.log` file. If the +`LOG` environment variable is set to `stdout` at start, the log is not saved, +but printed on the screen. ## Special binaries -If you have multiple binaries with different names, you can specify which one to run with the BINARY environment variable. The path of the binary is relative to the attached volume. - +If you have multiple binaries with different names, you can specify which one +to run with the `BINARY` environment variable. The path of the binary is relative +to the attached volume. From e4806f980bfd25eae9d60b9cda7d26ec8b2c68a8 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 15 Dec 2018 15:58:09 -0500 Subject: [PATCH 08/12] Bucky/v0.27.1 (#3022) * update changelog * linkify * changelog and version --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ CHANGELOG_PENDING.md | 10 +--------- version/version.go | 2 +- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ec6b1d9..d7675d29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## v0.27.1 + +*December 15th, 2018* + +Special thanks to external contributors on this release: +@danil-lashin, @hleb-albau, @james-ray, @leo-xinwang + +### FEATURES: +- [rpc] [\#2964](https://github.com/tendermint/tendermint/issues/2964) Add `UnconfirmedTxs(limit)` and `NumUnconfirmedTxs()` methods to HTTP/Local clients (@danil-lashin) +- [docs] [\#3004](https://github.com/tendermint/tendermint/issues/3004) Enable full-text search on docs pages + +### IMPROVEMENTS: +- [consensus] [\#2971](https://github.com/tendermint/tendermint/issues/2971) Return error if ValidatorSet is empty after InitChain + (@leo-xinwang) +- [ci/cd] [\#3005](https://github.com/tendermint/tendermint/issues/3005) Updated CircleCI job to trigger website build when docs are updated +- [docs] Various updates + +### BUG FIXES: +- [cmd] [\#2983](https://github.com/tendermint/tendermint/issues/2983) `testnet` command always sets `addr_book_strict = false` +- [config] [\#2980](https://github.com/tendermint/tendermint/issues/2980) Fix CORS options formatting +- [kv indexer] [\#2912](https://github.com/tendermint/tendermint/issues/2912) Don't ignore key when executing CONTAINS +- [mempool] [\#2961](https://github.com/tendermint/tendermint/issues/2961) Call `notifyTxsAvailable` if there're txs left after committing a block, but recheck=false +- [mempool] [\#2994](https://github.com/tendermint/tendermint/issues/2994) Reject txs with negative GasWanted +- [p2p] [\#2990](https://github.com/tendermint/tendermint/issues/2990) Fix a bug where seeds don't disconnect from a peer after 3h +- [consensus] [\#3006](https://github.com/tendermint/tendermint/issues/3006) Save state after InitChain only when stateHeight is also 0 (@james-ray) + ## v0.27.0 *December 5th, 2018* diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 9854bce5..e9a1d52f 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -1,4 +1,4 @@ -## v0.27.1 +## v0.27.2 *TBD* @@ -19,13 +19,5 @@ Special thanks to external contributors on this release: ### FEATURES: ### IMPROVEMENTS: -- [rpc] Add `UnconfirmedTxs(limit)` and `NumUnconfirmedTxs()` methods to HTTP/Local clients (@danil-lashin) -- [ci/cd] Updated CircleCI job to trigger website build when docs are updated ### BUG FIXES: -- [config] \#2980 fix cors options formatting -- [kv indexer] \#2912 don't ignore key when executing CONTAINS -- [mempool] \#2961 notifyTxsAvailable if there're txs left after committing a block, but recheck=false -- [mempool] \#2994 Don't allow txs with negative gas wanted -- [p2p] \#2715 fix a bug where seeds don't disconnect from a peer after 3h -- [replay] \#3006 saveState only when stateHeight is also 0 diff --git a/version/version.go b/version/version.go index 921e1430..3c1e2f31 100644 --- a/version/version.go +++ b/version/version.go @@ -18,7 +18,7 @@ const ( // TMCoreSemVer is the current version of Tendermint Core. // It's the Semantic Version of the software. // Must be a string because scripts like dist.sh read this file. - TMCoreSemVer = "0.27.0" + TMCoreSemVer = "0.27.1" // ABCISemVer is the semantic version of the ABCI library ABCISemVer = "0.15.0" From 9a6dd96cba96155cfbb590cc522b943d6deda499 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sun, 16 Dec 2018 09:27:16 -0800 Subject: [PATCH 09/12] Revert to using defers in addrbook. (#3025) * Revert to using defers in addrbook. ValidateBasic->Validate since it requires DNS * Update CHANGELOG_PENDING --- CHANGELOG_PENDING.md | 2 ++ node/node.go | 5 +++++ p2p/netaddress.go | 6 ++++++ p2p/node_info.go | 6 +++--- p2p/node_info_test.go | 6 +++--- p2p/pex/addrbook.go | 25 ++++++++++++++++++------- p2p/test_util.go | 2 +- p2p/transport.go | 2 +- 8 files changed, 39 insertions(+), 15 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index e9a1d52f..6742f4e8 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -21,3 +21,5 @@ Special thanks to external contributors on this release: ### IMPROVEMENTS: ### BUG FIXES: + +- [\#3025](https://github.com/tendermint/tendermint/pull/3025) - Revert to using defers in addrbook. Fixes deadlocks in pex and consensus upon invalid ExternalAddr/ListenAddr configuration. diff --git a/node/node.go b/node/node.go index b56a3594..1bb195fb 100644 --- a/node/node.go +++ b/node/node.go @@ -817,6 +817,11 @@ func makeNodeInfo( nodeInfo.ListenAddr = lAddr + err := nodeInfo.Validate() + if err != nil { + panic(err) + } + return nodeInfo } diff --git a/p2p/netaddress.go b/p2p/netaddress.go index f60271bc..5534ded9 100644 --- a/p2p/netaddress.go +++ b/p2p/netaddress.go @@ -175,6 +175,9 @@ func (na *NetAddress) Same(other interface{}) bool { // String representation: @: func (na *NetAddress) String() string { + if na == nil { + return "" + } if na.str == "" { addrStr := na.DialString() if na.ID != "" { @@ -186,6 +189,9 @@ func (na *NetAddress) String() string { } func (na *NetAddress) DialString() string { + if na == nil { + return "" + } return net.JoinHostPort( na.IP.String(), strconv.FormatUint(uint64(na.Port), 10), diff --git a/p2p/node_info.go b/p2p/node_info.go index 99daf7c4..3e02e9c1 100644 --- a/p2p/node_info.go +++ b/p2p/node_info.go @@ -36,7 +36,7 @@ type nodeInfoAddress interface { // nodeInfoTransport validates a nodeInfo and checks // our compatibility with it. It's for use in the handshake. type nodeInfoTransport interface { - ValidateBasic() error + Validate() error CompatibleWith(other NodeInfo) error } @@ -103,7 +103,7 @@ func (info DefaultNodeInfo) ID() ID { return info.ID_ } -// ValidateBasic checks the self-reported DefaultNodeInfo is safe. +// Validate checks the self-reported DefaultNodeInfo is safe. // It returns an error if there // are too many Channels, if there are any duplicate Channels, // if the ListenAddr is malformed, or if the ListenAddr is a host name @@ -116,7 +116,7 @@ func (info DefaultNodeInfo) ID() ID { // International clients could then use punycode (or we could use // url-encoding), and we just need to be careful with how we handle that in our // clients. (e.g. off by default). -func (info DefaultNodeInfo) ValidateBasic() error { +func (info DefaultNodeInfo) Validate() error { // ID is already validated. diff --git a/p2p/node_info_test.go b/p2p/node_info_test.go index c9a72dbc..19567d2b 100644 --- a/p2p/node_info_test.go +++ b/p2p/node_info_test.go @@ -12,7 +12,7 @@ func TestNodeInfoValidate(t *testing.T) { // empty fails ni := DefaultNodeInfo{} - assert.Error(t, ni.ValidateBasic()) + assert.Error(t, ni.Validate()) channels := make([]byte, maxNumChannels) for i := 0; i < maxNumChannels; i++ { @@ -68,13 +68,13 @@ func TestNodeInfoValidate(t *testing.T) { // test case passes ni = testNodeInfo(nodeKey.ID(), name).(DefaultNodeInfo) ni.Channels = channels - assert.NoError(t, ni.ValidateBasic()) + assert.NoError(t, ni.Validate()) for _, tc := range testCases { ni := testNodeInfo(nodeKey.ID(), name).(DefaultNodeInfo) ni.Channels = channels tc.malleateNodeInfo(&ni) - err := ni.ValidateBasic() + err := ni.Validate() if tc.expectErr { assert.Error(t, err, tc.testName) } else { diff --git a/p2p/pex/addrbook.go b/p2p/pex/addrbook.go index d8954f23..cfeefb34 100644 --- a/p2p/pex/addrbook.go +++ b/p2p/pex/addrbook.go @@ -162,26 +162,29 @@ func (a *addrBook) FilePath() string { // AddOurAddress one of our addresses. func (a *addrBook) AddOurAddress(addr *p2p.NetAddress) { - a.Logger.Info("Add our address to book", "addr", addr) a.mtx.Lock() + defer a.mtx.Unlock() + + a.Logger.Info("Add our address to book", "addr", addr) a.ourAddrs[addr.String()] = struct{}{} - a.mtx.Unlock() } // OurAddress returns true if it is our address. func (a *addrBook) OurAddress(addr *p2p.NetAddress) bool { a.mtx.Lock() + defer a.mtx.Unlock() + _, ok := a.ourAddrs[addr.String()] - a.mtx.Unlock() return ok } func (a *addrBook) AddPrivateIDs(IDs []string) { a.mtx.Lock() + defer a.mtx.Unlock() + for _, id := range IDs { a.privateIDs[p2p.ID(id)] = struct{}{} } - a.mtx.Unlock() } // AddAddress implements AddrBook @@ -191,6 +194,7 @@ func (a *addrBook) AddPrivateIDs(IDs []string) { func (a *addrBook) AddAddress(addr *p2p.NetAddress, src *p2p.NetAddress) error { a.mtx.Lock() defer a.mtx.Unlock() + return a.addAddress(addr, src) } @@ -198,6 +202,7 @@ func (a *addrBook) AddAddress(addr *p2p.NetAddress, src *p2p.NetAddress) error { func (a *addrBook) RemoveAddress(addr *p2p.NetAddress) { a.mtx.Lock() defer a.mtx.Unlock() + ka := a.addrLookup[addr.ID] if ka == nil { return @@ -211,14 +216,16 @@ func (a *addrBook) RemoveAddress(addr *p2p.NetAddress) { func (a *addrBook) IsGood(addr *p2p.NetAddress) bool { a.mtx.Lock() defer a.mtx.Unlock() + return a.addrLookup[addr.ID].isOld() } // HasAddress returns true if the address is in the book. func (a *addrBook) HasAddress(addr *p2p.NetAddress) bool { a.mtx.Lock() + defer a.mtx.Unlock() + ka := a.addrLookup[addr.ID] - a.mtx.Unlock() return ka != nil } @@ -292,6 +299,7 @@ func (a *addrBook) PickAddress(biasTowardsNewAddrs int) *p2p.NetAddress { func (a *addrBook) MarkGood(addr *p2p.NetAddress) { a.mtx.Lock() defer a.mtx.Unlock() + ka := a.addrLookup[addr.ID] if ka == nil { return @@ -306,6 +314,7 @@ func (a *addrBook) MarkGood(addr *p2p.NetAddress) { func (a *addrBook) MarkAttempt(addr *p2p.NetAddress) { a.mtx.Lock() defer a.mtx.Unlock() + ka := a.addrLookup[addr.ID] if ka == nil { return @@ -461,12 +470,13 @@ ADDRS_LOOP: // ListOfKnownAddresses returns the new and old addresses. func (a *addrBook) ListOfKnownAddresses() []*knownAddress { - addrs := []*knownAddress{} a.mtx.Lock() + defer a.mtx.Unlock() + + addrs := []*knownAddress{} for _, addr := range a.addrLookup { addrs = append(addrs, addr.copy()) } - a.mtx.Unlock() return addrs } @@ -476,6 +486,7 @@ func (a *addrBook) ListOfKnownAddresses() []*knownAddress { func (a *addrBook) Size() int { a.mtx.Lock() defer a.mtx.Unlock() + return a.size() } diff --git a/p2p/test_util.go b/p2p/test_util.go index 44f27be4..ea788b79 100644 --- a/p2p/test_util.go +++ b/p2p/test_util.go @@ -24,7 +24,7 @@ type mockNodeInfo struct { func (ni mockNodeInfo) ID() ID { return ni.addr.ID } func (ni mockNodeInfo) NetAddress() *NetAddress { return ni.addr } -func (ni mockNodeInfo) ValidateBasic() error { return nil } +func (ni mockNodeInfo) Validate() error { return nil } func (ni mockNodeInfo) CompatibleWith(other NodeInfo) error { return nil } func AddPeerToSwitch(sw *Switch, peer Peer) { diff --git a/p2p/transport.go b/p2p/transport.go index b16db54d..69fab312 100644 --- a/p2p/transport.go +++ b/p2p/transport.go @@ -350,7 +350,7 @@ func (mt *MultiplexTransport) upgrade( } } - if err := nodeInfo.ValidateBasic(); err != nil { + if err := nodeInfo.Validate(); err != nil { return nil, nil, ErrRejected{ conn: c, err: err, From b3141d7d02d5c3e9175eb18e34518227e7a2840a Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 16 Dec 2018 14:05:58 -0500 Subject: [PATCH 10/12] makeNodeInfo returns error (#3029) * makeNodeInfo returns error * version and changelog --- CHANGELOG.md | 12 ++++++++++++ CHANGELOG_PENDING.md | 3 +-- node/node.go | 35 ++++++++++++++++------------------- version/version.go | 2 +- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7675d29..3fb471a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## v0.27.2 + +*December 16th, 2018* + +### IMPROVEMENTS: + +- [node] [\#3025](https://github.com/tendermint/tendermint/issues/3025) Validate NodeInfo addresses on startup. + +### BUG FIXES: + +- [p2p] [\#3025](https://github.com/tendermint/tendermint/pull/3025) Revert to using defers in addrbook. Fixes deadlocks in pex and consensus upon invalid ExternalAddr/ListenAddr configuration. + ## v0.27.1 *December 15th, 2018* diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 6742f4e8..335c6732 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -1,4 +1,4 @@ -## v0.27.2 +## v0.27.3 *TBD* @@ -22,4 +22,3 @@ Special thanks to external contributors on this release: ### BUG FIXES: -- [\#3025](https://github.com/tendermint/tendermint/pull/3025) - Revert to using defers in addrbook. Fixes deadlocks in pex and consensus upon invalid ExternalAddr/ListenAddr configuration. diff --git a/node/node.go b/node/node.go index 1bb195fb..993f1cd1 100644 --- a/node/node.go +++ b/node/node.go @@ -348,20 +348,21 @@ func NewNode(config *cfg.Config, indexerService := txindex.NewIndexerService(txIndexer, eventBus) indexerService.SetLogger(logger.With("module", "txindex")) - var ( - p2pLogger = logger.With("module", "p2p") - nodeInfo = makeNodeInfo( - config, - nodeKey.ID(), - txIndexer, - genDoc.ChainID, - p2p.NewProtocolVersion( - version.P2PProtocol, // global - state.Version.Consensus.Block, - state.Version.Consensus.App, - ), - ) + p2pLogger := logger.With("module", "p2p") + nodeInfo, err := makeNodeInfo( + config, + nodeKey.ID(), + txIndexer, + genDoc.ChainID, + p2p.NewProtocolVersion( + version.P2PProtocol, // global + state.Version.Consensus.Block, + state.Version.Consensus.App, + ), ) + if err != nil { + return nil, err + } // Setup Transport. var ( @@ -782,7 +783,7 @@ func makeNodeInfo( txIndexer txindex.TxIndexer, chainID string, protocolVersion p2p.ProtocolVersion, -) p2p.NodeInfo { +) (p2p.NodeInfo, error) { txIndexerStatus := "on" if _, ok := txIndexer.(*null.TxIndex); ok { txIndexerStatus = "off" @@ -818,11 +819,7 @@ func makeNodeInfo( nodeInfo.ListenAddr = lAddr err := nodeInfo.Validate() - if err != nil { - panic(err) - } - - return nodeInfo + return nodeInfo, err } //------------------------------------------------------------------------------ diff --git a/version/version.go b/version/version.go index 3c1e2f31..caf6c73f 100644 --- a/version/version.go +++ b/version/version.go @@ -18,7 +18,7 @@ const ( // TMCoreSemVer is the current version of Tendermint Core. // It's the Semantic Version of the software. // Must be a string because scripts like dist.sh read this file. - TMCoreSemVer = "0.27.1" + TMCoreSemVer = "0.27.2" // ABCISemVer is the semantic version of the ABCI library ABCISemVer = "0.15.0" From 0533c73a50e1634cf7c60eb608ced25dbfd5fd4b Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sun, 16 Dec 2018 14:19:38 -0500 Subject: [PATCH 11/12] crypto: revert to mainline Go crypto lib (#3027) * crypto: revert to mainline Go crypto lib We used to use a fork for a modified bcrypt so we could pass our own randomness but this was largely unecessary, unused, and a burden. So now we just use the mainline Go crypto lib. * changelog * fix tests * version and changelog --- CHANGELOG.md | 21 ++++++++++++++++----- CHANGELOG_PENDING.md | 2 +- Gopkg.lock | 5 ++--- Gopkg.toml | 3 +-- crypto/armor/armor.go | 2 +- crypto/ed25519/ed25519.go | 2 +- crypto/hash.go | 2 +- crypto/secp256k1/secp256k1.go | 2 +- crypto/xchacha20poly1305/xchachapoly.go | 2 +- crypto/xsalsa20symmetric/symmetric.go | 2 +- crypto/xsalsa20symmetric/symmetric_test.go | 6 ++---- p2p/conn/secret_connection.go | 1 - version/version.go | 2 +- 13 files changed, 29 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fb471a0..0397ebdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## v0.27.3 + +*December 16th, 2018* + +### BREAKING CHANGES: + +* Go API + +- [dep] [\#3027](https://github.com/tendermint/tendermint/issues/3027) Revert to mainline Go crypto library, eliminating the modified + `bcrypt.GenerateFromPassword` + ## v0.27.2 *December 16th, 2018* @@ -84,17 +95,17 @@ message. ### IMPROVEMENTS: - [state] [\#2929](https://github.com/tendermint/tendermint/issues/2929) Minor refactor of updateState logic (@danil-lashin) -- [node] \#2959 Allow node to start even if software's BlockProtocol is +- [node] [\#2959](https://github.com/tendermint/tendermint/issues/2959) Allow node to start even if software's BlockProtocol is different from state's BlockProtocol -- [pex] \#2959 Pex reactor logger uses `module=pex` +- [pex] [\#2959](https://github.com/tendermint/tendermint/issues/2959) Pex reactor logger uses `module=pex` ### BUG FIXES: -- [p2p] \#2968 Panic on transport error rather than continuing to run but not +- [p2p] [\#2968](https://github.com/tendermint/tendermint/issues/2968) Panic on transport error rather than continuing to run but not accept new connections -- [p2p] \#2969 Fix mismatch in peer count between `/net_info` and the prometheus +- [p2p] [\#2969](https://github.com/tendermint/tendermint/issues/2969) Fix mismatch in peer count between `/net_info` and the prometheus metrics -- [rpc] \#2408 `/broadcast_tx_commit`: Fix "interface conversion: interface {} in nil, not EventDataTx" panic (could happen if somebody sent a tx using `/broadcast_tx_commit` while Tendermint was being stopped) +- [rpc] [\#2408](https://github.com/tendermint/tendermint/issues/2408) `/broadcast_tx_commit`: Fix "interface conversion: interface {} in nil, not EventDataTx" panic (could happen if somebody sent a tx using `/broadcast_tx_commit` while Tendermint was being stopped) - [state] [\#2785](https://github.com/tendermint/tendermint/issues/2785) Fix accum for new validators to be `-1.125*totalVotingPower` instead of 0, forcing them to wait before becoming the proposer. Also: - do not batch clip diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 335c6732..2283ff37 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -1,4 +1,4 @@ -## v0.27.3 +## v0.27.4 *TBD* diff --git a/Gopkg.lock b/Gopkg.lock index 0c4779c8..76d6fcb9 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -376,7 +376,7 @@ version = "v0.14.1" [[projects]] - digest = "1:72b71e3a29775e5752ed7a8012052a3dee165e27ec18cedddae5288058f09acf" + digest = "1:00d2b3e64cdc3fa69aa250dfbe4cc38c4837d4f37e62279be2ae52107ffbbb44" name = "golang.org/x/crypto" packages = [ "bcrypt", @@ -397,8 +397,7 @@ "salsa20/salsa", ] pruneopts = "UT" - revision = "3764759f34a542a3aef74d6b02e35be7ab893bba" - source = "github.com/tendermint/crypto" + revision = "505ab145d0a99da450461ae2c1a9f6cd10d1f447" [[projects]] digest = "1:d36f55a999540d29b6ea3c2ea29d71c76b1d9853fdcd3e5c5cb4836f2ba118f1" diff --git a/Gopkg.toml b/Gopkg.toml index c5e625e9..16c1b463 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -81,8 +81,7 @@ [[constraint]] name = "golang.org/x/crypto" - source = "github.com/tendermint/crypto" - revision = "3764759f34a542a3aef74d6b02e35be7ab893bba" + revision = "505ab145d0a99da450461ae2c1a9f6cd10d1f447" [[override]] name = "github.com/jmhodges/levigo" diff --git a/crypto/armor/armor.go b/crypto/armor/armor.go index e3b29a97..c15d070e 100644 --- a/crypto/armor/armor.go +++ b/crypto/armor/armor.go @@ -5,7 +5,7 @@ import ( "fmt" "io/ioutil" - "golang.org/x/crypto/openpgp/armor" // forked to github.com/tendermint/crypto + "golang.org/x/crypto/openpgp/armor" ) func EncodeArmor(blockType string, headers map[string]string, data []byte) string { diff --git a/crypto/ed25519/ed25519.go b/crypto/ed25519/ed25519.go index e077cbda..0c659e73 100644 --- a/crypto/ed25519/ed25519.go +++ b/crypto/ed25519/ed25519.go @@ -7,7 +7,7 @@ import ( "io" amino "github.com/tendermint/go-amino" - "golang.org/x/crypto/ed25519" // forked to github.com/tendermint/crypto + "golang.org/x/crypto/ed25519" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/tmhash" diff --git a/crypto/hash.go b/crypto/hash.go index a384bbb5..c1fb41f7 100644 --- a/crypto/hash.go +++ b/crypto/hash.go @@ -3,7 +3,7 @@ package crypto import ( "crypto/sha256" - "golang.org/x/crypto/ripemd160" // forked to github.com/tendermint/crypto + "golang.org/x/crypto/ripemd160" ) func Sha256(bytes []byte) []byte { diff --git a/crypto/secp256k1/secp256k1.go b/crypto/secp256k1/secp256k1.go index 784409f3..7fc46d63 100644 --- a/crypto/secp256k1/secp256k1.go +++ b/crypto/secp256k1/secp256k1.go @@ -9,7 +9,7 @@ import ( secp256k1 "github.com/tendermint/btcd/btcec" amino "github.com/tendermint/go-amino" - "golang.org/x/crypto/ripemd160" // forked to github.com/tendermint/crypto + "golang.org/x/crypto/ripemd160" "github.com/tendermint/tendermint/crypto" ) diff --git a/crypto/xchacha20poly1305/xchachapoly.go b/crypto/xchacha20poly1305/xchachapoly.go index 115c9190..c7a175b5 100644 --- a/crypto/xchacha20poly1305/xchachapoly.go +++ b/crypto/xchacha20poly1305/xchachapoly.go @@ -8,7 +8,7 @@ import ( "errors" "fmt" - "golang.org/x/crypto/chacha20poly1305" // forked to github.com/tendermint/crypto + "golang.org/x/crypto/chacha20poly1305" ) // Implements crypto.AEAD diff --git a/crypto/xsalsa20symmetric/symmetric.go b/crypto/xsalsa20symmetric/symmetric.go index c51e2459..3228a935 100644 --- a/crypto/xsalsa20symmetric/symmetric.go +++ b/crypto/xsalsa20symmetric/symmetric.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "golang.org/x/crypto/nacl/secretbox" // forked to github.com/tendermint/crypto + "golang.org/x/crypto/nacl/secretbox" "github.com/tendermint/tendermint/crypto" cmn "github.com/tendermint/tendermint/libs/common" diff --git a/crypto/xsalsa20symmetric/symmetric_test.go b/crypto/xsalsa20symmetric/symmetric_test.go index e9adf728..bca0b336 100644 --- a/crypto/xsalsa20symmetric/symmetric_test.go +++ b/crypto/xsalsa20symmetric/symmetric_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/crypto/bcrypt" // forked to github.com/tendermint/crypto + "golang.org/x/crypto/bcrypt" "github.com/tendermint/tendermint/crypto" ) @@ -30,9 +30,7 @@ func TestSimpleWithKDF(t *testing.T) { plaintext := []byte("sometext") secretPass := []byte("somesecret") - salt := []byte("somesaltsomesalt") // len 16 - // NOTE: we use a fork of x/crypto so we can inject our own randomness for salt - secret, err := bcrypt.GenerateFromPassword(salt, secretPass, 12) + secret, err := bcrypt.GenerateFromPassword(secretPass, 12) if err != nil { t.Error(err) } diff --git a/p2p/conn/secret_connection.go b/p2p/conn/secret_connection.go index 1dc66aff..d1b6bce6 100644 --- a/p2p/conn/secret_connection.go +++ b/p2p/conn/secret_connection.go @@ -10,7 +10,6 @@ import ( "net" "time" - // forked to github.com/tendermint/crypto "golang.org/x/crypto/chacha20poly1305" "golang.org/x/crypto/curve25519" "golang.org/x/crypto/nacl/box" diff --git a/version/version.go b/version/version.go index caf6c73f..ace1b41d 100644 --- a/version/version.go +++ b/version/version.go @@ -18,7 +18,7 @@ const ( // TMCoreSemVer is the current version of Tendermint Core. // It's the Semantic Version of the software. // Must be a string because scripts like dist.sh read this file. - TMCoreSemVer = "0.27.2" + TMCoreSemVer = "0.27.3" // ABCISemVer is the semantic version of the ABCI library ABCISemVer = "0.15.0" From 0ff715125bf6bfbee99928ad6561245b177d21f4 Mon Sep 17 00:00:00 2001 From: Zach Date: Sun, 16 Dec 2018 23:34:13 -0500 Subject: [PATCH 12/12] fix docs / proxy app (#2988) * fix docs / proxy app, closes #2986 * counter_serial * review comments * list all possible options * add changelog entries --- CHANGELOG_PENDING.md | 2 ++ abci/cmd/abci-cli/abci-cli.go | 22 +--------------------- cmd/tendermint/commands/run_node.go | 2 +- docs/tendermint-core/using-tendermint.md | 2 +- proxy/client.go | 11 ++++++----- 5 files changed, 11 insertions(+), 28 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 2283ff37..022965bb 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -7,6 +7,8 @@ Special thanks to external contributors on this release: ### BREAKING CHANGES: * CLI/RPC/Config +- [cli] Removed `node` `--proxy_app=dummy` option. Use `kvstore` (`persistent_kvstore`) instead. +- [cli] Renamed `node` `--proxy_app=nilapp` to `--proxy_app=noop`. * Apps diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index 50972ec3..cc3f9c45 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -58,7 +58,7 @@ var RootCmd = &cobra.Command{ PersistentPreRunE: func(cmd *cobra.Command, args []string) error { switch cmd.Use { - case "counter", "kvstore", "dummy": // for the examples apps, don't pre-run + case "counter", "kvstore": // for the examples apps, don't pre-run return nil case "version": // skip running for version command return nil @@ -127,10 +127,6 @@ func addCounterFlags() { counterCmd.PersistentFlags().BoolVarP(&flagSerial, "serial", "", false, "enforce incrementing (serial) transactions") } -func addDummyFlags() { - dummyCmd.PersistentFlags().StringVarP(&flagPersist, "persist", "", "", "directory to use for a database") -} - func addKVStoreFlags() { kvstoreCmd.PersistentFlags().StringVarP(&flagPersist, "persist", "", "", "directory to use for a database") } @@ -152,10 +148,6 @@ func addCommands() { // examples addCounterFlags() RootCmd.AddCommand(counterCmd) - // deprecated, left for backwards compatibility - addDummyFlags() - RootCmd.AddCommand(dummyCmd) - // replaces dummy, see issue #196 addKVStoreFlags() RootCmd.AddCommand(kvstoreCmd) } @@ -291,18 +283,6 @@ var counterCmd = &cobra.Command{ }, } -// deprecated, left for backwards compatibility -var dummyCmd = &cobra.Command{ - Use: "dummy", - Deprecated: "use: [abci-cli kvstore] instead", - Short: "ABCI demo example", - Long: "ABCI demo example", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { - return cmdKVStore(cmd, args) - }, -} - var kvstoreCmd = &cobra.Command{ Use: "kvstore", Short: "ABCI demo example", diff --git a/cmd/tendermint/commands/run_node.go b/cmd/tendermint/commands/run_node.go index 6dabacb1..ef205aa6 100644 --- a/cmd/tendermint/commands/run_node.go +++ b/cmd/tendermint/commands/run_node.go @@ -24,7 +24,7 @@ func AddNodeFlags(cmd *cobra.Command) { cmd.Flags().Bool("fast_sync", config.FastSync, "Fast blockchain syncing") // abci flags - cmd.Flags().String("proxy_app", config.ProxyApp, "Proxy app address, or 'nilapp' or 'kvstore' for local testing.") + cmd.Flags().String("proxy_app", config.ProxyApp, "Proxy app address, or one of: 'kvstore', 'persistent_kvstore', 'counter', 'counter_serial' or 'noop' for local testing.") cmd.Flags().String("abci", config.ABCI, "Specify abci transport (socket | grpc)") // rpc flags diff --git a/docs/tendermint-core/using-tendermint.md b/docs/tendermint-core/using-tendermint.md index 148c874c..2ca8c9e9 100644 --- a/docs/tendermint-core/using-tendermint.md +++ b/docs/tendermint-core/using-tendermint.md @@ -113,7 +113,7 @@ blocks are produced regularly, even if there are no transactions. See _No Empty Blocks_, below, to modify this setting. Tendermint supports in-process versions of the `counter`, `kvstore` and -`nil` apps that ship as examples with `abci-cli`. It's easy to compile +`noop` apps that ship as examples with `abci-cli`. It's easy to compile your own app in-process with Tendermint if it's written in Go. If your app is not written in Go, simply run it in another process, and use the `--proxy_app` flag to specify the address of the socket it is listening diff --git a/proxy/client.go b/proxy/client.go index 87f4e716..c5ee5fe1 100644 --- a/proxy/client.go +++ b/proxy/client.go @@ -6,6 +6,7 @@ import ( "github.com/pkg/errors" abcicli "github.com/tendermint/tendermint/abci/client" + "github.com/tendermint/tendermint/abci/example/counter" "github.com/tendermint/tendermint/abci/example/kvstore" "github.com/tendermint/tendermint/abci/types" ) @@ -64,15 +65,15 @@ func (r *remoteClientCreator) NewABCIClient() (abcicli.Client, error) { func DefaultClientCreator(addr, transport, dbDir string) ClientCreator { switch addr { + case "counter": + return NewLocalClientCreator(counter.NewCounterApplication(false)) + case "counter_serial": + return NewLocalClientCreator(counter.NewCounterApplication(true)) case "kvstore": - fallthrough - case "dummy": return NewLocalClientCreator(kvstore.NewKVStoreApplication()) case "persistent_kvstore": - fallthrough - case "persistent_dummy": return NewLocalClientCreator(kvstore.NewPersistentKVStoreApplication(dbDir)) - case "nilapp": + case "noop": return NewLocalClientCreator(types.NewBaseApplication()) default: mustConnect := false // loop retrying