From 1e05242297fbea15eb5a3c985bed16f13e373de5 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 23 Jul 2018 17:07:14 +0400 Subject: [PATCH 1/5] update changelog and bump version to 0.22.5 --- CHANGELOG.md | 4 ++++ version/version.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff8861a5f..c480be9d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## TBA +## 0.22.5 + +*July 23th, 2018* + BREAKING CHANGES: - [crypto] Refactor `tendermint/crypto` into many subpackages - [libs/common] remove exponentially distributed random numbers diff --git a/version/version.go b/version/version.go index 165f25829..706264372 100644 --- a/version/version.go +++ b/version/version.go @@ -4,13 +4,13 @@ package version const ( Maj = "0" Min = "22" - Fix = "4" + Fix = "5" ) var ( // Version is the current version of Tendermint // Must be a string because scripts like dist.sh read this file. - Version = "0.22.4" + Version = "0.22.5" // GitCommit is the current HEAD set using ldflags. GitCommit string From 948b91e62ec2d46825fde843d0403e4fcc4510fb Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 23 Jul 2018 17:16:43 +0400 Subject: [PATCH 2/5] add missing changelog entries --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c480be9d1..27d5656b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,10 +13,13 @@ BREAKING CHANGES: IMPROVEMENTS: - [abci, libs/common] Generated gogoproto static marshaller methods - [config] Increase default send/recv rates to 5 mB/s +- [p2p] allow persistent peers to be private BUG FIXES - [mempool] fixed a race condition when `create_empty_blocks=false` where a transaction is published at an old height. +- [p2p] dial external IP setup by `persistent_peers`, not internal NAT IP +- [rpc] make `/status` RPC endpoint resistant to consensus halt ## 0.22.4 @@ -32,7 +35,8 @@ FEATURES: BUG FIXES: - [tools/tm-bench] Various fixes - [consensus] Wait for WAL to stop on shutdown -- [abci] Fix #1891, pending requests cannot hang when abci server dies. Previously a crash in BeginBlock could leave tendermint in broken state. +- [abci] Fix #1891, pending requests cannot hang when abci server dies. + Previously a crash in BeginBlock could leave tendermint in broken state. ## 0.22.3 From 9962e598a095dec77579d55ba2e68126b8eb762d Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 23 Jul 2018 21:15:08 +0400 Subject: [PATCH 3/5] reconnect to self-reported address if persistent peer is inbound (#2031) * reconnect to self-reported address if persistent peer is inbound * add a fixme --- p2p/switch.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/p2p/switch.go b/p2p/switch.go index 77c64fca8..636ca6d8e 100644 --- a/p2p/switch.go +++ b/p2p/switch.go @@ -283,7 +283,9 @@ func (sw *Switch) StopPeerForError(peer Peer, reason interface{}) { if peer.IsPersistent() { addr := peer.OriginalAddr() if addr == nil { - panic(fmt.Sprintf("persistent peer %v with no original address", peer)) + // FIXME: persistent peers can't be inbound right now. + // self-reported address for inbound persistent peers + addr = peer.NodeInfo().NetAddress() } go sw.reconnectToPeer(addr) } From f3d519c966feb628dd6210a3e5e53f509c94bd21 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Mon, 23 Jul 2018 15:04:04 -0700 Subject: [PATCH 4/5] crypto: Fix package imports from the refactor --- crypto/armor/armor.go | 2 +- crypto/armor/armor_test.go | 2 +- crypto/encoding/amino/amino.go | 2 +- crypto/encoding/amino/encode_test.go | 2 +- crypto/{xsalsa20Symmetric => xsalsa20symmetric}/symmetric.go | 2 +- .../{xsalsa20Symmetric => xsalsa20symmetric}/symmetric_test.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename crypto/{xsalsa20Symmetric => xsalsa20symmetric}/symmetric.go (98%) rename crypto/{xsalsa20Symmetric => xsalsa20symmetric}/symmetric_test.go (97%) diff --git a/crypto/armor/armor.go b/crypto/armor/armor.go index 4146048ad..c15d070e6 100644 --- a/crypto/armor/armor.go +++ b/crypto/armor/armor.go @@ -1,4 +1,4 @@ -package crypto +package armor import ( "bytes" diff --git a/crypto/armor/armor_test.go b/crypto/armor/armor_test.go index 5eae87c00..4aa23b211 100644 --- a/crypto/armor/armor_test.go +++ b/crypto/armor/armor_test.go @@ -1,4 +1,4 @@ -package crypto +package armor import ( "testing" diff --git a/crypto/encoding/amino/amino.go b/crypto/encoding/amino/amino.go index f87d89882..e3945cb52 100644 --- a/crypto/encoding/amino/amino.go +++ b/crypto/encoding/amino/amino.go @@ -1,4 +1,4 @@ -package crypto +package cryptoAmino import ( amino "github.com/tendermint/go-amino" diff --git a/crypto/encoding/amino/encode_test.go b/crypto/encoding/amino/encode_test.go index 74812aa62..e01206089 100644 --- a/crypto/encoding/amino/encode_test.go +++ b/crypto/encoding/amino/encode_test.go @@ -1,4 +1,4 @@ -package crypto +package cryptoAmino import ( "os" diff --git a/crypto/xsalsa20Symmetric/symmetric.go b/crypto/xsalsa20symmetric/symmetric.go similarity index 98% rename from crypto/xsalsa20Symmetric/symmetric.go rename to crypto/xsalsa20symmetric/symmetric.go index c7cd56752..d2369675d 100644 --- a/crypto/xsalsa20Symmetric/symmetric.go +++ b/crypto/xsalsa20symmetric/symmetric.go @@ -1,4 +1,4 @@ -package crypto +package xsalsa20symmetric import ( "errors" diff --git a/crypto/xsalsa20Symmetric/symmetric_test.go b/crypto/xsalsa20symmetric/symmetric_test.go similarity index 97% rename from crypto/xsalsa20Symmetric/symmetric_test.go rename to crypto/xsalsa20symmetric/symmetric_test.go index 704049e37..d955307ea 100644 --- a/crypto/xsalsa20Symmetric/symmetric_test.go +++ b/crypto/xsalsa20symmetric/symmetric_test.go @@ -1,4 +1,4 @@ -package crypto +package xsalsa20symmetric import ( "testing" From 15b112e669061366e207b9f1a5bc79e5025c632e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 23 Jul 2018 20:58:24 -0400 Subject: [PATCH 5/5] mempool: chan bool -> chan struct{} --- mempool/mempool.go | 8 ++++---- mempool/mempool_test.go | 4 ++-- state/services.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mempool/mempool.go b/mempool/mempool.go index 9f591bf90..e1ed4f260 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -78,7 +78,7 @@ type Mempool struct { recheckCursor *clist.CElement // next expected response recheckEnd *clist.CElement // re-checking stops here notifiedTxsAvailable bool - txsAvailable chan bool // fires once for each height, when the mempool is not empty + txsAvailable chan struct{} // fires once for each height, when the mempool is not empty // Keep a cache of already-seen txs. // This reduces the pressure on the proxyApp. @@ -130,7 +130,7 @@ func NewMempool( // ensuring it will trigger once every height when transactions are available. // NOTE: not thread safe - should only be called once, on startup func (mem *Mempool) EnableTxsAvailable() { - mem.txsAvailable = make(chan bool, 1) + mem.txsAvailable = make(chan struct{}, 1) } // SetLogger sets the Logger. @@ -348,7 +348,7 @@ func (mem *Mempool) resCbRecheck(req *abci.Request, res *abci.Response) { // TxsAvailable returns a channel which fires once for every height, // and only when transactions are available in the mempool. // NOTE: the returned channel may be nil if EnableTxsAvailable was not called. -func (mem *Mempool) TxsAvailable() <-chan bool { +func (mem *Mempool) TxsAvailable() <-chan struct{} { return mem.txsAvailable } @@ -360,7 +360,7 @@ func (mem *Mempool) notifyTxsAvailable() { // channel cap is 1, so this will send once mem.notifiedTxsAvailable = true select { - case mem.txsAvailable <- true: + case mem.txsAvailable <- struct{}{}: default: } } diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index b09bdf0ea..acaa17eec 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -38,7 +38,7 @@ func newMempoolWithApp(cc proxy.ClientCreator) *Mempool { return mempool } -func ensureNoFire(t *testing.T, ch <-chan bool, timeoutMS int) { +func ensureNoFire(t *testing.T, ch <-chan struct{}, timeoutMS int) { timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond) select { case <-ch: @@ -47,7 +47,7 @@ func ensureNoFire(t *testing.T, ch <-chan bool, timeoutMS int) { } } -func ensureFire(t *testing.T, ch <-chan bool, timeoutMS int) { +func ensureFire(t *testing.T, ch <-chan struct{}, timeoutMS int) { timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond) select { case <-ch: diff --git a/state/services.go b/state/services.go index 228a449f1..c51fa9752 100644 --- a/state/services.go +++ b/state/services.go @@ -27,7 +27,7 @@ type Mempool interface { Flush() FlushAppConn() error - TxsAvailable() <-chan bool + TxsAvailable() <-chan struct{} EnableTxsAvailable() } @@ -43,7 +43,7 @@ func (m MockMempool) Reap(n int) types.Txs { retur func (m MockMempool) Update(height int64, txs types.Txs) error { return nil } func (m MockMempool) Flush() {} func (m MockMempool) FlushAppConn() error { return nil } -func (m MockMempool) TxsAvailable() <-chan bool { return make(chan bool) } +func (m MockMempool) TxsAvailable() <-chan struct{} { return make(chan struct{}) } func (m MockMempool) EnableTxsAvailable() {} //------------------------------------------------------