Browse Source

Merge pull request #856 from tendermint/small-things

Small things
pull/871/head
Ethan Buchman 7 years ago
committed by GitHub
parent
commit
814f9cb566
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 9 deletions
  1. +19
    -3
      CHANGELOG.md
  2. +2
    -4
      p2p/switch.go
  3. +1
    -1
      p2p/trust/trustmetric.go
  4. +1
    -1
      rpc/lib/types/types.go

+ 19
- 3
CHANGELOG.md View File

@ -27,13 +27,29 @@ BUG FIXES:
- Graceful handling/recovery for apps that have non-determinism or fail to halt - Graceful handling/recovery for apps that have non-determinism or fail to halt
- Graceful handling/recovery for violations of safety, or liveness - 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: 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: 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) ## 0.12.0 (October 27, 2017)


+ 2
- 4
p2p/switch.go View File

@ -507,8 +507,6 @@ func MakeConnectedSwitches(cfg *cfg.P2PConfig, n int, initSwitch func(int, *Swit
return switches return switches
} }
var PanicOnAddPeerErr = false
// Connect2Switches will connect switches i and j via net.Pipe(). // Connect2Switches will connect switches i and j via net.Pipe().
// Blocks until a conection is established. // Blocks until a conection is established.
// NOTE: caller ensures i and j are within bounds. // NOTE: caller ensures i and j are within bounds.
@ -519,14 +517,14 @@ func Connect2Switches(switches []*Switch, i, j int) {
doneCh := make(chan struct{}) doneCh := make(chan struct{})
go func() { go func() {
err := switchI.addPeerWithConnection(c1) err := switchI.addPeerWithConnection(c1)
if PanicOnAddPeerErr && err != nil {
if err != nil {
panic(err) panic(err)
} }
doneCh <- struct{}{} doneCh <- struct{}{}
}() }()
go func() { go func() {
err := switchJ.addPeerWithConnection(c2) err := switchJ.addPeerWithConnection(c2)
if PanicOnAddPeerErr && err != nil {
if err != nil {
panic(err) panic(err)
} }
doneCh <- struct{}{} doneCh <- struct{}{}


+ 1
- 1
p2p/trust/trustmetric.go View File

@ -176,7 +176,7 @@ func (tms *TrustMetricStore) loadFromDB() bool {
// Saves the history data for all peers to the store DB // Saves the history data for all peers to the store DB
func (tms *TrustMetricStore) saveToDB() { 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) peers := make(map[string]peerHistoryJSON, 0)


+ 1
- 1
rpc/lib/types/types.go View File

@ -97,7 +97,7 @@ func NewRPCErrorResponse(id string, code int, msg string, data string) RPCRespon
} }
func (resp RPCResponse) String() string { func (resp RPCResponse) String() string {
if resp.Error != nil {
if resp.Error == nil {
return fmt.Sprintf("[%s %v]", resp.ID, resp.Result) return fmt.Sprintf("[%s %v]", resp.ID, resp.Result)
} else { } else {
return fmt.Sprintf("[%s %s]", resp.ID, resp.Error) return fmt.Sprintf("[%s %s]", resp.ID, resp.Error)


Loading…
Cancel
Save