Commit Graph

587 Commits

Author SHA1 Message Date
Ethan Buchman 71f13cc071 drop metalinter 2017-12-29 10:42:02 -05:00
Jae Kwon a171d90611 Fix possibly incorrect usage of conversion 2017-12-29 10:28:00 -05:00
Ethan Buchman 558f8e7769 fix recursion 2017-12-29 10:28:00 -05:00
Ethan Buchman 76433d9040 little things 2017-12-29 10:28:00 -05:00
Jae Kwon 6b5d08f7da RepeatTimer fix 2017-12-29 10:27:54 -05:00
Ethan Buchman 6372c415a5
Merge pull request #113 from tendermint/hotfix/clist
Fix #112 by using RWMutex per element
2017-12-28 22:23:02 -05:00
Jae Kwon b31397aff5 Fix GoLevelDB Iterator which needs to copy a temp []byte 2017-12-28 18:30:56 -08:00
Jae Kwon e47ce81422 Comment fixes from Emmanuel 2017-12-28 03:05:55 -08:00
Jae Kwon 93c05aa8c0 Add back on HexBytes 2017-12-27 13:52:32 -08:00
Jae Kwon b25df389db Remove Bytes, just use []byte; Use protobuf for KVPair/KI64Pair 2017-12-26 04:40:35 -08:00
Jae Kwon bf644b0984 Do not shadow assert 2017-12-26 00:36:58 -08:00
Jae Kwon 6ec8c1602f Update Makefile 2017-12-25 22:41:40 -08:00
Jae Kwon 0f8ebd024d
Update clist.go
Add more justification of synchrony primitives in documentation.
2017-12-25 22:28:15 -08:00
Jae Kwon 2fd8f35b74 Fix #112 by using RWMutex per element 2017-12-25 21:12:14 -08:00
Jae Kwon 797bcdd9e0 Remove common/http 2017-12-25 17:46:21 -08:00
Jae Kwon f2a8e95248 Add KI64Pair(s) 2017-12-25 11:40:05 -08:00
Ethan Buchman 218acc2224
Merge pull request #107 from tendermint/fix/cmn
Fix/cmn
2017-12-21 16:30:45 -05:00
Ethan Buchman e2d7f1aa41 cmn: fix race 2017-12-21 14:21:15 -05:00
Ethan Buchman b0b740210c cmn: fix repeate timer test with manual ticker 2017-12-21 11:15:17 -05:00
Ethan Buchman a25ed5ba1b cmn: fix race condition in prng 2017-12-21 10:02:25 -05:00
Jae Kwon b70ae4919b Update glide file 2017-12-19 20:47:22 -08:00
Jae Kwon ca56a274bd Nil bytes are OK for Get/Set etc
And s/Release/Close/g
2017-12-19 20:36:37 -08:00
Anton Kaliaev c8ddf156a7
Merge pull request #104 from tendermint/revert-94-feature/timer-refactor
Revert "Refactor throttle timer"
2017-12-19 16:32:21 -06:00
Anton Kaliaev e17e8e425f
Revert "Refactor throttle timer" 2017-12-19 16:23:20 -06:00
Anton Kaliaev be2b0fa31e
Merge pull request #103 from tendermint/revert-95-feature/repeat-timer
Revert "Refactor repeat timer"
2017-12-19 16:22:48 -06:00
Anton Kaliaev 70e30f74e6
Revert "Refactor repeat timer" 2017-12-19 16:16:16 -06:00
Anton Kaliaev 4ddf212286
Merge pull request #100 from tendermint/internal-randSource
common: no more relying on math/rand.DefaultSource
2017-12-19 12:54:54 -06:00
Jae Kwon 4ce8448d7f
Nil keys are OK, deprecate BeginningKey/EndingKey (#101)
* Nil keys are OK, deprecate BeginningKey/EndingKey
2017-12-17 13:11:28 -08:00
Jae Kwon aab2d70dd3
Sdk2 kvpair (#102)
* Canonical KVPair in common
* Simplify common/Bytes to just hex encode
2017-12-17 13:04:15 -08:00
Emmanuel Odeke 8638961f02
common: Rand* warnings about cryptographic unsafety
Lesson articulated by @jaekwon on why we need 80 bits
of entropy at least before we can think of cryptographic
safety. math/rand's seed is a max of 64 bits so can never
be cryptographically secure.

Also added some benchmarks for RandBytes
2017-12-15 22:41:36 -07:00
Ethan Buchman e3bffd8fbd readme 2017-12-16 00:04:06 -05:00
Ethan Buchman 9226659413
Merge pull request #98 from tendermint/sdk2-iterator
Sdk2 iterator
2017-12-15 15:58:48 -05:00
Ethan Buchman 66b0e8fa2d fix c level db iterator 2017-12-15 15:58:23 -05:00
Ethan Buchman 225eace316 dont run metalinter on circle ... 2017-12-15 15:14:48 -05:00
Emmanuel Odeke a7b20d4e46
db: Simplify exists check, fix IsKeyInDomain signature, Iterator Close
+ *FSDB.HasKey now uses common.FileExists to test for file existence
+ IsKeyInDomain takes key as a []byte slice instead of as a string
to avoid extraneous []byte<-->string conversions for start and end
+ Iterator.Close() instead of Iterator.Release()
+ withDB helper to encapsulate DB creation, deferred cleanups
so that for loops can use opened DBs and discard them ASAP

Addressing accepted changes from review with @jaekwon
2017-12-15 02:58:51 -07:00
Emmanuel Odeke cdc7988823
common: use genius simplification of tests from @ebuchman
Massive test simplication for more reliable tests from @ebuchman
2017-12-15 02:14:08 -07:00
Ethan Buchman b5f465b4ec common: use names prng and mrand 2017-12-15 00:23:25 -05:00
Emmanuel Odeke 29471d75cb
common: no more relying on math/rand.DefaultSource
Fixes https://github.com/tendermint/tmlibs/issues/99
Updates https://github.com/tendermint/tendermint/issues/973

Removed usages of math/rand.DefaultSource in favour of our
own source that's seeded with a completely random source
and is safe for use in concurrent in multiple goroutines.
Also extend some functionality that the stdlib exposes such as
* RandPerm
* RandIntn
* RandInt31
* RandInt63

Also added an integration test whose purpose is to be run as
a consistency check to ensure that our results never repeat
hence that our internal PRNG is uniquely seeded each time.
This integration test can be triggered by setting environment variable:
`TENDERMINT_INTEGRATION_TESTS=true`
for example
```shell
TENDERMINT_INTEGRATION_TESTS=true go test
```
2017-12-14 00:18:30 -07:00
Ethan Buchman a2f7898b6d db: fix c and go iterators 2017-12-13 22:28:37 -05:00
Ethan Buchman d4aeca8ce3 fixes from @melekes 2017-12-13 20:11:11 -05:00
Ethan Buchman 318982c0ba checkKeyCondition -> IsKeyInDomain 2017-12-13 01:34:00 -05:00
Anton Kaliaev a80b66268f
Merge pull request #97 from tendermint/rm-root-flag
remove deprecated --root flag
2017-12-12 23:29:36 -06:00
Anton Kaliaev 541780c6df
uncomment tests 2017-12-12 23:23:49 -06:00
Jae Kwon 5636a02d03 Remove GetError() from Iterator 2017-12-12 19:19:26 -08:00
Ethan Buchman edf07760d6 db: fsdb iterator 2017-12-12 21:08:38 -05:00
Ethan Buchman bcacaf164b db: cleveldb iterator 2017-12-12 20:58:35 -05:00
Ethan Buchman 3e5dbef6a2 db: goleveldb iterator 2017-12-12 20:38:03 -05:00
Ethan Buchman 39e40ff5ce db: memdb iterator 2017-12-12 20:06:50 -05:00
Ethan Buchman bb115d4d61 cleanupDBDir 2017-12-12 19:28:52 -05:00
Ethan Buchman ba8c5045b5 db: fixes to fsdb and clevledb 2017-12-12 19:22:08 -05:00