Commit Graph

49 Commits

Author SHA1 Message Date
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
Ethan Buchman 4b616344fa update glide, again 2017-10-27 22:36:03 -04:00
Ethan Buchman 21dcb4f290 update glide 2017-10-27 13:55:56 -04:00
Ethan Buchman 3c92bea519 glide: more external deps locked to versions 2017-10-26 00:07:43 -04:00
Ethan Buchman 12c703c1c3 Merge branch 'develop' into 573-wal-issues 2017-10-25 23:56:08 -04:00
Ethan Buchman c595636999 glide 2017-10-25 22:23:55 -04:00
Anton Kaliaev ae538337ba
fix panic: failed to determine gopath: exec: "go" (Refs #782)
```
-bash-4.2$ tendermint show_validators
panic: failed to determine gopath: exec: "go": executable file not found in $PATH

goroutine 1 [running]:
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.gopath(0xc4200632c0, 0x18)
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/os.go:26 +0x1b5
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/os.go:17 +0x13c
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/wire.go:165 +0x50
github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/data.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/go-wire/data/wrapper.go:89 +0x50
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli/setup.go:190 +0x76
main.init()
	/var/lib/jenkins/workspace/03.Build.Package/go/src/github.com/tendermint/tendermint/cmd/tendermint/main.go:42 +0x49```

An error message instead would be nice.
```

Now GoPath() is a function instead of a variable.
2017-10-25 11:19:53 +04:00
Anton Kaliaev c74a359c46
fixes per Bucky's review 2017-10-24 12:14:21 +04:00
Anton Kaliaev 3115c23762
binary format for WAL 2017-10-23 22:27:24 +04:00
Ethan Buchman f188366e26 update glide 2017-10-23 10:04:00 -04:00
Zach Ramsay e2e50bc0fc rpc: use /iavl repo in test (#713) 2017-10-11 10:35:22 -04:00
Ethan Buchman ed5511dc08 glide: update for autofile fix 2017-10-02 23:34:02 -04:00
Ethan Buchman 3e92d295e4 glide for tmlibs 0.3.1 2017-09-22 13:25:10 -04:00
Ethan Buchman 661d336dd5 glide 2017-09-22 12:29:53 -04:00
Ethan Buchman 8311f5c611 abci.Info takes a struct; less merkleeyes 2017-09-22 11:42:40 -04:00
Ethan Buchman df857266b6 update glide 2017-09-22 10:14:05 -04:00
Anton Kaliaev c08618f7e9
expose latency timer on WSClient 2017-08-03 19:10:14 -04:00
Ethan Frey 2e0a4aafa7 Update glide files to proper versions 2017-06-28 13:05:51 +02:00
Ethan Buchman 468982ffe4 fixes 2017-06-23 22:12:45 -04:00
Anton Kaliaev 9dcf130d67
update tmlibs (Refs #504) 2017-06-12 19:25:34 +04:00
Ethan Buchman 772306cac8 update changelog and glide 2017-05-18 06:16:08 -04:00
Ethan Buchman cc2b430e68 update glide and changelog 2017-05-17 00:12:56 +02:00
Anton Kaliaev 91dc87e7c4
update for a new ABCI API 2017-05-16 19:06:35 +02:00
Anton Kaliaev 1dfb95f719
[consensus] color code different consensus instances in consensus tests
(Refs #492)
2017-05-15 09:35:29 +02:00
Anton Kaliaev f8fdbe3dbc
changes as per Bucky's review 2017-05-13 16:22:51 +02:00
Anton Kaliaev c9cd8de9c6
set logger 2017-05-13 10:25:00 +02:00
Anton Kaliaev f803544195
new logging 2017-05-13 10:24:58 +02:00
Ethan Frey dd1f5a2268 Test config parsing in root command 2017-05-05 15:30:39 +02:00
Ethan Buchman 8c3823545d update glide 2017-05-05 00:51:03 -04:00
Ethan Frey 604bf03f3a Pulled out all config structs (except p2p.PeerConfig) into config package 2017-05-04 22:46:40 -04:00
Ethan Frey 194f345470 Use non-standard port so tests don't die when I am running basecoin 2017-04-28 14:45:34 +02:00
Ethan Buchman 2bf7e9c968 update glide 2017-04-27 19:58:12 -04:00
Ethan Buchman fcf78a5da7 cleanup go-config/viper and some unnamed imports 2017-04-25 14:54:56 -04:00
Rigel Rozanski 6e662337ff dont export resetPrivValidator 2017-04-25 13:43:57 -04:00
Rigel Rozanski 270b68a893 glide lock updates 2017-04-25 13:43:22 -04:00
Rigel Rozanski cefb2bede0 adding viper
int

int
2017-04-25 13:42:22 -04:00
Ethan Buchman 3cdd2daf08 fix tests 2017-04-21 18:44:37 -04:00
Ethan Buchman 4e0afc55e6 glide update 2017-04-21 18:35:48 -04:00
Ethan Buchman e160318eef glide update 2017-04-21 18:21:59 -04:00
Ethan Buchman 56c60fba23 go-p2p -> tendermint/p2p 2017-04-21 18:19:41 -04:00
Ethan Buchman 9e82d132ce go-rpc -> tendermint/rpc 2017-04-21 18:19:29 -04:00
Ethan Buchman e6fe6b5b76 go-data -> go-wire/data 2017-04-21 18:13:25 -04:00
Ethan Buchman d1926bcad1 use tmlibs 2017-04-21 18:12:54 -04:00
Ethan Buchman 5da9b3a803 postmerge 2017-04-21 18:09:47 -04:00
Ethan Buchman 23a6a6f8fc move into p2p package 2017-04-21 18:07:52 -04:00
Ethan Buchman eaeb547938 use tmlibs 2017-04-21 17:53:22 -04:00
Ethan Buchman e05052b079 update glide 2017-04-19 00:01:55 -04:00
Anton Kaliaev 06d219db8e
test peer with no auth enc 2017-04-14 12:43:28 +04:00
Anton Kaliaev f88d56b2f8
add glide 2017-04-10 22:47:04 +04:00