6645 Commits

Author SHA1 Message Date
Anton Kaliaev
668698584d
[autofile] test GroupReader more extensively (Refs #69) 2017-10-30 12:48:51 -05:00
Anton Kaliaev
61d76a273f
fixes from Bucky's and Emmanuel's reviews 2017-10-30 11:12:01 -05:00
Anton Kaliaev
6d18e2f447
do not send whole round state via eventHub
Fixes

```
WARNING: DATA RACE
Write at 0x00c4200715b8 by goroutine 24:
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterPrevote.func1()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:359 +0x3f
  github.com/tendermint/tendermint/consensus.(*ConsensusState).enterPrevote()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:897 +0x8de
  github.com/tendermint/tendermint/consensus.(*ConsensusState).addProposalBlockPart()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:1303 +0x701
  github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:560 +0x88c
  github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine()
      /go/src/github.com/tendermint/tendermint/consensus/state.go:525 +0x6d2

Previous read at 0x00c4200715b8 by goroutine 19:
  github.com/tendermint/tendermint/consensus.makeRoundStepMessages()
      /go/src/github.com/tendermint/tendermint/consensus/reactor.go:415 +0x192
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).broadcastNewRoundStep()
      /go/src/github.com/tendermint/tendermint/consensus/reactor.go:377 +0x3c
  github.com/tendermint/tendermint/consensus.(*ConsensusReactor).broadcastNewRoundStepsAndVotes.func1()
      /go/src/github.com/tendermint/tendermint/consensus/reactor.go:350 +0x275
```
2017-10-30 00:32:23 -05:00
Anton Kaliaev
1c1c68df8d
fixes from my own review 2017-10-30 00:32:23 -05:00
Anton Kaliaev
f6539737de
new pubsub package
comment out failing consensus tests for now

rewrite rpc httpclient to use new pubsub package

import pubsub as tmpubsub, query as tmquery

make event IDs constants
EventKey -> EventTypeKey

rename EventsPubsub to PubSub

mempool does not use pubsub

rename eventsSub to pubsub

new subscribe API

fix channel size issues and consensus tests bugs

refactor rpc client

add missing discardFromChan method

add mutex

rename pubsub to eventBus

remove IsRunning from WSRPCConnection interface (not needed)

add a comment in broadcastNewRoundStepsAndVotes

rename registerEventCallbacks to broadcastNewRoundStepsAndVotes

See https://dave.cheney.net/2014/03/19/channel-axioms

stop eventBuses after reactor tests

remove unnecessary Unsubscribe

return subscribe helper function

move discardFromChan to where it is used

subscribe now returns an err

this gives us ability to refuse to subscribe if pubsub is at its max
capacity.

use context for control overflow

cache queries

handle err when subscribing in replay_test

rename testClientID to testSubscriber

extract var

set channel buffer capacity to 1 in replay_file

fix byzantine_test

unsubscribe from single event, not all events

refactor httpclient to return events to appropriate channels

return failing testReplayCrashBeforeWriteVote test

fix TestValidatorSetChanges

refactor code a bit

fix testReplayCrashBeforeWriteVote

add comment

fix TestValidatorSetChanges

fixes from Bucky's review

update comment [ci skip]

test TxEventBuffer

update changelog

fix TestValidatorSetChanges (2nd attempt)

only do wg.Done when no errors

benchmark event bus

create pubsub server inside NewEventBus

only expose config params (later if needed)

set buffer capacity to 0 so we are not testing cache

new tx event format: key = "Tx" plus a tag {"tx.hash": XYZ}

This should allow to subscribe to all transactions! or a specific one
using a query: "tm.events.type = Tx and tx.hash = '013ABF99434...'"

use TimeoutCommit instead of afterPublishEventNewBlockTimeout

TimeoutCommit is the time a node waits after committing a block, before
it goes into the next height. So it will finish everything from the last
block, but then wait a bit. The idea is this gives it time to hear more
votes from other validators, to strengthen the commit it includes in the
next block. But it also gives it time to hear about new transactions.

waitForBlockWithUpdatedVals

rewrite WAL crash tests

Task:
test that we can recover from any WAL crash.

Solution:
the old tests were relying on event hub being run in the same thread (we
were injecting the private validator's last signature).

when considering a rewrite, we considered two possible solutions: write
a "fuzzy" testing system where WAL is crashing upon receiving a new
message, or inject failures and trigger them in tests using something
like https://github.com/coreos/gofail.

remove sleep

no cs.Lock around wal.Save

test different cases (empty block, non-empty block, ...)

comments

add comments

test 4 cases: empty block, non-empty block, non-empty block with smaller part size, many blocks

fixes as per Bucky's last review

reset subscriptions on UnsubscribeAll

use a simple counter to track message for which we panicked

also, set a smaller part size for all test cases
2017-10-30 00:32:22 -05:00
Petabyte Storage
fe9ff62297 fix comment typos 2017-10-28 22:01:45 -07:00
Ethan Buchman
7c85f15a6c
Merge pull request #798 from petabytestorage/fix-test-uncommon-names
fix test using uncommon names
2017-10-28 23:47:31 -04:00
Petabyte Storage
6b366b2443 fix test using uncommon names 2017-10-28 20:29:11 -07:00
Emmanuel Odeke
a8b77359df
rpc/lib/server: separate out Notifications test
Addressing feedback from @ebuchman
2017-10-28 15:24:40 -07:00
Emmanuel Odeke
e7fab7d4bf rpc/lib/server: update with @melekes and @ebuchman feedback 2017-10-28 15:11:21 -07:00
Emmanuel Odeke
59556ab030 rpc/lib/server: add handlers tests
Follow up of PR https://github.com/tendermint/tendermint/pull/724
For https://github.com/tendermint/tendermint/issues/708

Reported initially in #708, this bug was reconfirmed
by the fuzzer.

This fix ensures that:
* if the user doesn't pass in `"id"` that we send them back
a message in an error telling them to send `"id"`. Previously
we let the handler return a 200 with nothing.
* passing in nil `params` doesn't crash
* not passing in `params` doesn't crash
* passing in non-JSON parseable data to `params` doesn't crash
2017-10-28 15:11:21 -07:00
Emmanuel Odeke
b0cf4b4757
PubKeyFromBytes: return zero value PubKey on error
Fixes https://github.com/tendermint/go-crypto/issues/48.

This previously skewed up my fuzzing tests so ensure
that on error we return the zero value PubKey.
2017-10-28 14:11:22 -07:00
Ethan Buchman
128e2a1d9e Merge branch 'master' into develop 2017-10-28 00:09:03 -04:00
Ethan Buchman
e236302256
Merge pull request #793 from tendermint/release-v0.12.0
Release v0.12.0
v0.12.0
2017-10-28 00:06:53 -04:00
Ethan Buchman
dfe28c8855 test: update for abci-cli consolidation. shell formatting 2017-10-27 23:09:50 -04:00
Ethan Buchman
4b616344fa update glide, again 2017-10-27 22:36:03 -04:00
Ethan Buchman
dd20358a26
Merge pull request #47 from tendermint/release-v0.4.1
Release v0.4.1
2017-10-27 22:28:35 -04:00
Ethan Buchman
d2b1a7096e changelog 2017-10-27 22:17:34 -04:00
Ethan Buchman
377d3c7e11 fix from revert 2017-10-27 22:04:22 -04:00
Ethan Buchman
6405618220 Revert "Upgrade keys to use bcrypt with salts (#38)"
This reverts commit 8e7f0e7701f92206679ad093d013b9b162427631.
2017-10-27 22:02:44 -04:00
Ethan Buchman
87badb090f Revert "Parameterize and lower bcrypt cost"
This reverts commit dfc4cdd2d71513e4a9922d679c74f36357c4c862.
2017-10-27 21:58:02 -04:00
Ethan Buchman
1ecd580061
Merge pull request #773 from tendermint/docs-staging
docs improvements
2017-10-27 16:18:56 -04:00
Ethan Buchman
21dcb4f290 update glide 2017-10-27 13:55:56 -04:00
Ethan Buchman
d1f00be7a0
Merge pull request #46 from tendermint/develop
Develop
2017-10-27 12:57:37 -04:00
Ethan Buchman
8630b724b2 version and changelog 2017-10-27 12:57:26 -04:00
Ethan Frey
ad31f6a953 osx + hid = <3 2017-10-27 18:46:21 +02:00
Ethan Buchman
dc33aad9b4
Merge pull request #122 from tendermint/develop
Develop
2017-10-27 12:25:50 -04:00
Ethan Buchman
c9612f094b glide 2017-10-27 12:13:16 -04:00
Ethan Buchman
d973cb5df9 changelog and version 2017-10-27 12:12:34 -04:00
Ethan Buchman
d9525c0fb6
Merge pull request #70 from tendermint/develop
Develop
2017-10-27 12:05:43 -04:00
Ethan Buchman
944d36ab00 changelog 2017-10-27 12:04:31 -04:00
Ethan Buchman
b2b35d7dc1 update changelog 2017-10-27 11:54:20 -04:00
Ethan Buchman
a1501dcde8 version bump 2017-10-27 11:54:20 -04:00
Ethan Buchman
b14c996698 update changelog 2017-10-27 11:52:10 -04:00
Ethan Buchman
3319ad03b8
Merge pull request #791 from tendermint/740-no-wal-after-fast-sync
dont catchupReplay on wal if we fast synced
2017-10-27 11:49:54 -04:00
Ethan Buchman
092eb701c7 cmn: Kill 2017-10-27 11:01:40 -04:00
Ethan Buchman
fe1c60b5cf consensus: kill process on app error 2017-10-27 10:55:20 -04:00
Ethan Buchman
591dd9e662 dont catchupReplay on wal if we fast synced 2017-10-27 10:46:19 -04:00
Ethan Buchman
66de53292e Merge pull request #117 from tendermint/cobra-not-urfave
use spf13/cobra instead of urfave/cli
2017-10-27 02:47:21 -04:00
Ethan Buchman
42145a82bd version and changelog 2017-10-26 20:57:33 -04:00
Greg Szabo
8e0ed4ddd0 genesis deployment fixes 2017-10-26 19:44:58 -04:00
Ethan Buchman
57346134a5 keys: transactions.go -> types.go 2017-10-26 16:43:32 -04:00
Ethan Frey
db5603e374 Merge pull request #45 from tendermint/bugfix/nano-hid
Bugfix: ledger nano/hid compiles on osx/golang1.9
2017-10-26 06:52:52 -07:00
Ethan Buchman
bb6c15b00a CHANGELOG [ci skip] 2017-10-26 09:42:46 -04:00
Zach Ramsay
f013ee5cf9 cli: use cobra's new ExactArgs() feature 2017-10-26 08:51:43 -04:00
Zach Ramsay
461191d2f7 cli: clean up error handling 2017-10-26 08:37:42 -04:00
Zach
b5bdb6ec54 Merge pull request #119 from tendermint/93-fix-console-output
fix console output
2017-10-26 07:58:16 -04:00
Ethan Frey
5d8890530a Update glide deps, nano/hid for osx/golang1.9 2017-10-26 12:00:42 +02:00
Ethan Frey
c496dea2e5 Merge pull request #42 from tendermint/feature/bcrypt-usability
Bcrypt usability
2017-10-26 11:59:32 +02:00
Ethan Buchman
6af28ead87 Merge pull request #672 from tendermint/573-wal-issues
Add checksum and length to CS WAL record
2017-10-26 00:31:38 -04:00