diff --git a/CHANGELOG.md b/CHANGELOG.md index eded412a0..7edcad3ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,13 +27,29 @@ BUG FIXES: - Graceful handling/recovery for apps that have non-determinism or fail to halt - Graceful handling/recovery for violations of safety, or liveness -## 0.12.1 (TBA) +## 0.13.0 (TBA) + +BREAKING CHANGES: +- types: EventBus and EventBuffer have replaced EventSwitch and EventCache; event types have been overhauled +- node: EventSwitch methods now refer to EventBus +- rpc/lib/types: RPCResponse is no longer a pointer; WSRPCConnection interface has been modified +- rpc/client: WaitForOneEvent takes an EventsClient instead of types.EventSwitch +- rpc/client: Add/RemoveListenerForEvent are now Subscribe/Unsubscribe FEATURES: -- new unsubscribe_all WebSocket RPC endpoint +- rpc: new `/unsubscribe_all` WebSocket RPC endpoint +- p2p/trust: new trust metric for tracking peers. See ADR-006 IMPROVEMENTS: -- New events system using tmlibs/pubsub +- New asynchronous events system using `tmlibs/pubsub` +- logging: Various small improvements +- consensus: Graceful shutdown when app crashes +- tests: Fix various non-deterministic errors +- p2p: more defensive programming + +BUG FIXES: +- consensus: fix panic where prs.ProposalBlockParts is not initialized +- p2p: fix panic on bad channel ## 0.12.0 (October 27, 2017) diff --git a/p2p/switch.go b/p2p/switch.go index 617acbc33..b56e84a81 100644 --- a/p2p/switch.go +++ b/p2p/switch.go @@ -507,8 +507,6 @@ func MakeConnectedSwitches(cfg *cfg.P2PConfig, n int, initSwitch func(int, *Swit return switches } -var PanicOnAddPeerErr = false - // Connect2Switches will connect switches i and j via net.Pipe(). // Blocks until a conection is established. // NOTE: caller ensures i and j are within bounds. @@ -519,14 +517,14 @@ func Connect2Switches(switches []*Switch, i, j int) { doneCh := make(chan struct{}) go func() { err := switchI.addPeerWithConnection(c1) - if PanicOnAddPeerErr && err != nil { + if err != nil { panic(err) } doneCh <- struct{}{} }() go func() { err := switchJ.addPeerWithConnection(c2) - if PanicOnAddPeerErr && err != nil { + if err != nil { panic(err) } doneCh <- struct{}{} diff --git a/p2p/trust/trustmetric.go b/p2p/trust/trustmetric.go index 84a11b1ca..eaed78e3a 100644 --- a/p2p/trust/trustmetric.go +++ b/p2p/trust/trustmetric.go @@ -176,7 +176,7 @@ func (tms *TrustMetricStore) loadFromDB() bool { // Saves the history data for all peers to the store DB func (tms *TrustMetricStore) saveToDB() { - tms.Logger.Info("Saving TrustHistory to DB", "size", tms.size()) + tms.Logger.Debug("Saving TrustHistory to DB", "size", tms.size()) peers := make(map[string]peerHistoryJSON, 0) diff --git a/rpc/lib/types/types.go b/rpc/lib/types/types.go index d0c3d6787..bac7c2409 100644 --- a/rpc/lib/types/types.go +++ b/rpc/lib/types/types.go @@ -97,7 +97,7 @@ func NewRPCErrorResponse(id string, code int, msg string, data string) RPCRespon } func (resp RPCResponse) String() string { - if resp.Error != nil { + if resp.Error == nil { return fmt.Sprintf("[%s %v]", resp.ID, resp.Result) } else { return fmt.Sprintf("[%s %s]", resp.ID, resp.Error)