73 Commits

Author SHA1 Message Date
Anton Kaliaev
922af7c405
int64 height
uint64 is considered dangerous. the details will follow in a blog post.
2017-12-01 19:04:53 -06:00
Anton Kaliaev
b3492356e6 uint64 height (Refs #911) 2017-12-01 17:17:22 -05:00
Zach Ramsay
46ccbcbff6 linting: apply 'gofmt -s -w' throughout 2017-11-27 22:39:11 +00: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
Ethan Buchman
aea8629272 peer interface 2017-09-15 18:40:59 -04:00
Ethan Buchman
88138c38cf mempool: reactor test 2017-09-05 16:25:02 -04:00
Ethan Buchman
311f18bebf mempool: comments 2017-07-17 12:58:10 -04:00
Anton Kaliaev
b4ece65726
standardize key for errors (should be "err") 2017-06-14 12:50:49 +04:00
Anton Kaliaev
f803544195
new logging 2017-05-13 10:24:58 +02:00
Ethan Frey
604bf03f3a Pulled out all config structs (except p2p.PeerConfig) into config package 2017-05-04 22:46:40 -04:00
Ethan Buchman
75b6c5215f fewer structs. remove viper from consensus 2017-05-04 22:43:55 -04:00
Ethan Buchman
7c0f51e24b remove viper from mempool 2017-05-04 22:39:22 -04:00
Ethan Buchman
fcf78a5da7 cleanup go-config/viper and some unnamed imports 2017-04-25 14:54:56 -04:00
Rigel Rozanski
cefb2bede0 adding viper
int

int
2017-04-25 13:42:22 -04:00
Ethan Buchman
56c60fba23 go-p2p -> tendermint/p2p 2017-04-21 18:19:41 -04:00
Ethan Buchman
d1926bcad1 use tmlibs 2017-04-21 18:12:54 -04:00
Anton Kaliaev
6dbe9febce
log warning if peer send failed (Refs #174)
make lint happy

remove dead code

remove not needed go-common dependency

check peer.Send failures (Refs #174)
2017-02-21 11:57:33 +04:00
Ethan Buchman
c147b41013 TMSP -> ABCI 2017-01-12 15:53:32 -05:00
Jae Kwon
a9d8039082 Fix peer memleak; stop goroutine when peer is offline 2016-10-17 11:29:43 -07:00
Ethan Buchman
7d493774c7 log: move some Info to Debug 2016-10-14 20:27:50 -04:00
Ethan Buchman
35d4cca8bb type safe events 2016-10-10 03:10:29 -04:00
Jae Kwon
ad17090a0f No global config 2016-05-08 15:00:58 -07:00
Ethan Buchman
3891e4d66d config: cswal_light, mempool_broadcast, mempool_reap 2016-03-03 06:31:59 +00:00
Jae Kwon
a4f57e164b BroadcastTx results 2016-02-08 00:48:58 -08:00
Ethan Buchman
0be13d1d27 move alert, events, rpc into own repos 2016-01-12 19:15:10 -05:00
Jae Kwon
3e3c0083c7 Make order be decided first; Remove TMSP Commit/Rollback 2016-01-08 16:51:20 -08:00
Jae Kwon
dcc1caaf68 Make Receive() logging consistent 2015-12-31 14:27:05 -08:00
Jae Kwon
08d7980d80 Conform to go-wire new TypeByte behavior 2015-12-21 14:48:44 -08:00
Jae Kwon
c95b89e98c Merge remote-tracking branch 'origin/consensus_refactor' into consensus_refactor_jae 2015-12-14 09:33:11 -08:00
Ethan Buchman
b9e143d956 Fireable -> EventSwitch; rs in EventDataRoundState; fixes from review 2015-12-14 00:38:19 -05:00
Jae Kwon
15b751107e Tweak logging; allow consensus to bypass filter 2015-12-09 09:38:09 -08:00
Jae Kwon
ef43af19ab Tendermint <-> Application refactor 2015-12-01 20:12:01 -08:00
Ethan Buchman
df9ef1e733 check peerMempoolChan for nil on Reset 2015-11-10 13:41:54 -08:00
Jae Kwon
d69b5c5ab6 Conform to go-wire 1.0 2015-11-10 13:10:43 -08:00
Jae Kwon
c4ed55d801 Refactor to move common libraries out of project 2015-10-22 17:39:06 -07:00
Jae Kwon
82c65e423b fix mempool PeerState nil conversion bug 2015-10-17 15:25:18 -07:00
Jae Kwon
28c5e9b4ec variable name changes 2015-10-11 14:57:20 -07:00
Jae Kwon
ceed000c58 Use ResetFor... callback instead of EventSwitch for mempool new blocks 2015-09-29 12:31:34 -04:00
Ethan Buchman
cccb722ba8 mempool tests 2015-09-29 12:30:46 -04:00
Ethan Buchman
12566f51af better mempool queueing 2015-09-28 22:58:02 -04:00
Ethan Buchman
555ecb095d precommit nil if locked and no POL 2015-09-15 14:25:50 -04:00
Jae Kwon
625f23af13 Blockpool better timeouts, download rate observation, quicker switching to consensus; Id -> ID (sorry, this doesn't belong here) 2015-09-11 21:09:00 -07:00
Jae Kwon
e86073ec96 Use rpc/client/ws_client; OnStart() returns error 2015-08-11 11:01:17 -07:00
Jae Kwon
3be3647dc8 tendermint/binary -> tendermint/wire 2015-07-28 12:18:17 -07:00
Jae Kwon
e7c1febb65 Simplify Service/Reactor pattern 2015-07-22 06:21:21 -07:00
Jae Kwon
571a134318 BaseService and BaseReactor refactor and unification 2015-07-20 14:52:24 -07:00
Ethan Buchman
bb4ca1407f info->notice, debug->info 2015-07-19 22:44:40 +00:00
Jae Kwon
d91f073676 uuid branch tidying 2015-07-13 16:00:01 -07:00
Jae Kwon
a9467414d6 Merge remote-tracking branch 'origin/websockets' into develop 2015-04-17 13:20:47 -07:00
Jae Kwon
44565872ae Fixed BlockchainMessage{} Decode issue.
Fixed Warn(UnknownMessage) issues.
2015-04-16 17:53:33 -07:00