524 Commits

Author SHA1 Message Date
Ethan Buchman
a557bb4d0b
Merge pull request #185 from tendermint/bucky/merge-master
Bucky/merge master
2018-04-02 22:26:22 +03:00
Jae Kwon
382e99d06e Add IsTypedNil 2018-04-02 01:47:42 -07:00
Ethan Buchman
41302c206a Merge branch 'master' into develop
* Update changelog
2018-03-31 19:36:05 +03:00
Anton Kaliaev
898216d419
add SplitAndTrim func (#183)
Refs https://github.com/tendermint/tendermint/issues/1380
2018-03-29 12:04:01 +02:00
Anton Kaliaev
0f2811441f
[pubsub] fix unsubscribing (#181)
* [pubsub] fix unsubscribing

by giving it the same exact query, which was used to subscribe

Refs https://github.com/tendermint/tendermint/issues/1368

* use original query to unsubscribe

Refs #1368

* modify the unit test the issue is fixed
2018-03-28 16:04:46 +02:00
Christopher Goes
6e26392209 Return config parse errors (#182) 2018-03-28 15:35:52 +02:00
Jae Kwon
e9cf47606c Merge panics into errors in Parallel 2018-03-25 00:04:47 +01:00
Jae Kwon
87c0473730
New Error (#180)
* New Error can capture Stacktrace
* Intelligent ErrorWrap
* Review fixes
2018-03-24 22:19:44 +01:00
Ethan Buchman
24da7009c3
Merge pull request #178 from tendermint/release/v0.7.1
Release/v0.7.1
2018-03-22 19:38:39 -04:00
Ethan Buchman
db3d1cb7fa changelog and version 2018-03-22 19:36:57 -04:00
Alexander Simmerl
d46b9afb79 Simplify WriteFileAtomic
We can make the implementation more robust by adjusting our assumptions
and leverage explicit file modes for syncing. Additionally we going to
assume that we want to clean up and can't really recover if thos
operations (file close and removal) fail.

* utilise file mode for majority of concerns
* improve test coverage by covering more assumptions
* signature parity with ioutil.WriteFile
* always clean up

Replaces #160
2018-03-22 19:36:24 -04:00
Emmanuel T Odeke
97bdad8262 common: NewBitArray never crashes on negatives (#170)
Fixes #169
Fixes https://github.com/tendermint/tendermint/issues/1322

The previous code was very trusting assuming that
rational actors will use this code. However, Byzantine
actors don't care and in the case of the linked issue
negative lengths can be sent to this code unfettered
having been received from a peer.

This code is essentially just a sign change from
`==`
to
`<=`

and we've gutted out that attack by being more defensive.
2018-03-22 19:36:24 -04:00
Ethan Buchman
c0549ec943
Merge pull request #175 from tendermint/bucky/changelog
update version, changelog
2018-03-22 19:09:06 -04:00
Ethan Buchman
dc1042eb5f finish changelog 2018-03-22 13:55:55 -04:00
Ethan Buchman
b6400af7ac update version, changelog 2018-03-21 05:15:30 +01:00
Ethan Buchman
a86b1d8f75
Merge pull request #171 from tendermint/feature/xla-writefileatomic
Simplify WriteFileAtomic
2018-03-21 05:04:14 +01:00
Jae Kwon
4e5c655944 Parallel reaps automatically before returning 2018-03-20 23:08:51 +01:00
Jae Kwon
4caf943f49 Parallel returns a TaskResultSet 2018-03-20 21:43:58 +01:00
Jae Kwon
db48010e81 Add return parameter to Parallel 2018-03-20 19:58:05 +01:00
Jae Kwon
bf24f2dcc5
Implement better Parallel (#174)
* Implement better Parallel
2018-03-20 19:24:18 +01:00
Alexander Simmerl
bb65f097fd
Simplify WriteFileAtomic
We can make the implementation more robust by adjusting our assumptions
and leverage explicit file modes for syncing. Additionally we going to
assume that we want to clean up and can't really recover if thos
operations (file close and removal) fail.

* utilise file mode for majority of concerns
* improve test coverage by covering more assumptions
* signature parity with ioutil.WriteFile
* always clean up

Replaces #160
2018-03-19 09:38:28 +01:00
Emmanuel T Odeke
4b0058dd64 common: remove {Left, Right}PadString (#168)
Fixes #134

Those functions are unused in the whole Tendermint Github
organization plus they were unnecessariy verbose and could
have been concisely replaced with

```go
func RightPadString(s string, totalLength uint) string {
       return fmt.Sprintf("% *s", totalLength, s)
}

func LeftPadString(s string, totalLength uint) string {
       return fmt.Sprintf("% -*s", totalLength, s)
}
```

delete them anyways
2018-03-18 15:19:23 +04:00
Emmanuel T Odeke
b1c9b82531 common: NewBitArray never crashes on negatives (#170)
Fixes #169
Fixes https://github.com/tendermint/tendermint/issues/1322

The previous code was very trusting assuming that
rational actors will use this code. However, Byzantine
actors don't care and in the case of the linked issue
negative lengths can be sent to this code unfettered
having been received from a peer.

This code is essentially just a sign change from
`==`
to
`<=`

and we've gutted out that attack by being more defensive.
2018-03-18 15:17:11 +04:00
Jae Kwon
b0e0dc5de3
Implement DebugDB (#166) 2018-03-18 01:52:28 +01:00
Jae Kwon
3412587036 Fix race condition in random.go 2018-03-18 01:50:15 +01:00
Jae Kwon
9b9a9e7f8c Add Error Type for switching 2018-03-17 16:32:49 +01:00
Jae Kwon
99437a96fb Add efficient implementation of fmt and use for errors. 2018-03-17 15:23:22 +01:00
Jae Kwon
bb875303c2 Add NewErrorWithCause() 2018-03-17 14:44:12 +01:00
Jae Kwon
de36bfe31c Add TMLibs/Error from Cosmos-SDK/Error 2018-03-17 13:56:39 +01:00
Jae Kwon
90cd89eab0
Unexpose r.rand (#167) 2018-03-17 05:18:22 -07:00
Jae Kwon
6d61ca3bb5 New -> NewRand 2018-03-17 12:34:23 +01:00
Jae Kwon
536c27de8e
common/random.go supports seeding and *Rand (#121)
* common/random.go supports seeding and *Rand
* Ensure determinism
2018-03-17 04:28:53 -07:00
Jae Kwon
d289c9286e
Implement NewPrefixDB (#164)
* encodeByteSlice uses uvarint for length instead of varint
* Implemented NewPrefixDB
* Fix flowrate test (#165)
* Complete implementation and fix tests
* Add tests for MemBatch Write[Sync]
2018-03-15 09:43:23 -07:00
Jae Kwon
b1cc688a61 encodeByteSlice uses uvarint for length instead of varint (#161) 2018-03-12 09:46:31 +04:00
Simon Vadée
066fe82a92 pubsub implements service.OnReset (#156) 2018-03-06 11:29:18 +04:00
Zaki Manian
26f2ab65f8 Switch to dep from glide (#155) 2018-02-27 16:01:49 +04:00
Ethan Buchman
1b9b5652a1 changelog date 2018-02-20 22:00:20 -05:00
Ethan Buchman
3e79f9e198
Merge pull request #154 from tendermint/develop
v0.7.0 (aka "sdk2")
2018-02-20 21:55:52 -05:00
Ethan Buchman
c6163bdab2 version bump and changelog 2018-02-19 17:05:36 -05:00
Ethan Buchman
a0f652dc2e
Merge pull request #151 from tendermint/fix/nit
minor nit
2018-02-14 11:57:38 -05:00
Ethan Buchman
737c30c19d minor nit 2018-02-12 19:12:24 -05:00
Ethan Buchman
c858b3ba78
Merge pull request #150 from tendermint/tm-1205-add-quit-method-to-service
add Quit method to Service interface
2018-02-12 18:39:26 -05:00
Anton Kaliaev
a57340ffb5
add Quit method to Service interface
remove deprecated QuitService
2018-02-12 11:40:42 +04:00
Anton Kaliaev
52ce4c20f8
Fix RepeatTimer memory leak (#137)
fix RepeatTimer memory leak (Refs #137)

* test case

* drain channels on reset

Leaking memory:
```
leaktest.go:144: leaktest: leaked goroutine: goroutine 116 [chan send]:
        github.com/tendermint/tmlibs/common.(*RepeatTimer).fireRoutine(0xc42006a410, 0xc4203403c0, 0xc42031b2c0)
                /go/src/github.com/tendermint/tmlibs/common/repeat_timer.go:160 +0x6e
        created by github.com/tendermint/tmlibs/common.(*RepeatTimer).reset
                /go/src/github.com/tendermint/tmlibs/common/repeat_timer.go:196 +0xe9
```

The alternative solution could be draining channels on the client side.

* add one more select instead of draining

thanks to Jae
2018-02-09 13:31:32 +04:00
Ethan Buchman
82ab92da9a
Merge pull request #139 from tendermint/expose-channel-on-clist
add waitCh as an alternative to waitGroup
2018-02-09 01:18:39 -05:00
Ethan Buchman
35bb398b1f
Merge pull request #147 from tendermint/reduce-bitArray-fragility
common/BitArray: reduce fragility with methods
2018-02-08 15:31:30 -05:00
Emmanuel Odeke
763dc21393
common/BitArray: reduce fragility with methods
Fixes https://github.com/tendermint/tmlibs/issues/145
Fixes https://github.com/tendermint/tmlibs/issues/146

The code in here has been fragile when it comes to nil
but these edge cases were never tested, although they've
showed up in the wild and were only noticed because
the reporter actually read the logs otherwise
we'd have never known.

This changes covers some of these cases and adds some tests.
2018-02-06 01:12:24 -08:00
Anton Kaliaev
19e818fdf7
Merge pull request #142 from tendermint/ishex-fragility
common: IsHex should be able to handle 0X prefixed strings
2018-02-05 13:14:53 +04:00
Anton Kaliaev
91b41ddd59
add waitCh as an alternative to waitGroup
new methods:
 - [CList] WaitChan()
 - [CElement] NextWaitChan()
 - [CElement] PrevWaitChan()

Refs https://github.com/tendermint/tendermint/pull/1173
2018-02-05 11:36:36 +04:00
Ethan Buchman
deaaf014d8
Merge pull request #141 from tendermint/no-wire
merkle: remove go-wire dep by copying EncodeByteSlice
2018-02-03 01:57:27 -05:00