Commit Graph

25 Commits

Author SHA1 Message Date
bb9aa85d22 copy events and pubsub packages from tmlibs
Refs #847
2018-05-21 10:51:47 +04:00
c541d58d2f WIP: fix rpc/core 2018-04-05 16:07:29 -07:00
e4492afbad Merge 2018-04-05 08:17:10 -07:00
b40aa91b41 document event subscriptions
Refs #1100
2018-01-12 12:53:34 -06:00
90cdffa067 fixes after my own review (Refs #945) 2017-12-10 11:29:36 -06:00
950a64f756 bring back transparent websocket (Refs #945) 2017-12-10 01:18:10 -06:00
a969e24177 crank context timeouts 2017-11-15 01:42:15 +00:00
61d76a273f fixes from Bucky's and Emmanuel's reviews 2017-10-30 11:12:01 -05:00
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
60a1f49a5c updated json response to match spec by @davebryson 2017-09-18 16:35:50 -04:00
b3796e0aaa rpc: typo fixes 2017-08-16 15:18:55 -04:00
83ec9f773a wrote docs for rpc methods [ci skip]
for all of them except unsafe
2017-08-16 15:17:08 -04:00
f803544195 new logging 2017-05-13 10:24:58 +02:00
4e781961e9 remove TMResult. ::drinks champagne:: 2017-04-28 22:26:23 -04:00
f6f1f1992c Prepare rpc responses for go-data compatibility, still use go-wire 2017-04-28 14:46:04 +02:00
cc6dde96c1 rpc -> rpc/lib and rpc/tendermint -> rpc 2017-04-26 19:57:33 -04:00
992b11c450 premerge2: rpc -> rpc/tendermint 2017-04-21 17:39:56 -04:00
35d4cca8bb type safe events 2016-10-10 03:10:29 -04:00
92736f22e8 Fix unsubscribe 2016-08-23 10:40:42 +01:00
3fdb4c03ab rpc: TMResult and TMEventData 2016-01-13 18:38:55 -05:00
ee449a94c8 move ResultEvent to go-events 2016-01-12 19:15:10 -05:00
fb59255095 use TendermintResult for rpctypes.Result 2016-01-12 19:15:10 -05:00
0be13d1d27 move alert, events, rpc into own repos 2016-01-12 19:15:10 -05:00
96547d0ca8 ws fixes; rpc tests 2016-01-12 19:14:02 -05:00
74cdadec9f Refactor RPC to be more general 2016-01-02 16:23:29 -08:00