Commit Graph

137 Commits

Author SHA1 Message Date
Ethan Buchman 7c3cf316f1 rpc/wsevents: small cleanup 2017-10-31 15:16:08 -04: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
Silas Davis f6adddb4a8
Replace ResultsCh with ResponsesCh 2017-10-24 17:45:13 +01:00
Ethan Buchman 7a6876bc62 Merge pull request #768 from tendermint/feature/merkleeyes-to-iavl
Feature/merkleeyes to iavl
2017-10-23 11:07:21 -04:00
Ethan Buchman b234f7aba2 Merge pull request #741 from tendermint/client-compile-time-assertions
rpc/client: use compile time assertions instead of methods
2017-10-17 03:41:24 -04:00
Emmanuel Odeke 5f218a43fd
rpc/client: use compile time assertions instead of methods 2017-10-13 14:30:54 -06:00
Anton Kaliaev 7518c4a9be
[rpc] update comment [ci skip] 2017-10-13 15:03:21 +04:00
Anton Kaliaev db413aadfd
fixes from @cloudhead review 2017-10-13 15:03:21 +04:00
Anton Kaliaev 5433e5771e
support historical abci queries (Refs #482) 2017-10-13 15:03:20 +04:00
Zach Ramsay e2e50bc0fc rpc: use /iavl repo in test (#713) 2017-10-11 10:35:22 -04:00
Zach Ramsay d56b44f3a5 all: no more anonymous imports 2017-10-04 16:40:45 -04:00
Anton Kaliaev 45ff7cdd0c rewrite ws client to expose a callback instead of a channel
callback gives more power to the publisher. plus it is optional
comparing to a channel, which will block the whole client if you won't
read from it.
2017-10-02 13:00:20 -04:00
Alexandre Thibault ce36a0111a rpc: subscribe on reconnection (#689)
* rpc: subscribe on reconnection

* rpc: fix unit tests
2017-10-02 13:00:20 -04:00
Ethan Buchman 8311f5c611 abci.Info takes a struct; less merkleeyes 2017-09-22 11:42:40 -04:00
Ethan Buchman 3089bbf2b8 Amount -> Power. Closes #166 2017-09-21 14:59:27 -04:00
Ethan Buchman f0f1ebe013 rpc: Block and Commit take pointers; return latest on nil 2017-09-03 16:07:37 -04:00
Ethan Buchman e2e8746044 rpc: historical validators 2017-09-03 16:07:37 -04:00
Anton Kaliaev d578f7f81e
biff up WS client
What's new:
- auto reconnect
- ping/pong
- colored tests
2017-08-03 19:10:14 -04:00
Anton Kaliaev eaec0c8ea5
deduplicate tests in rpc/test and rpc/client (Refs #496) 2017-06-16 17:14:27 +04:00
Ethan Buchman c7cd62b449 Merge branch 'master' into develop 2017-05-29 10:53:33 -04:00
Ethan Buchman bd7ec18c19 fix tests 2017-05-26 12:17:32 -04:00
spring1843 cf686d4f83 Fix commonly misspelled words 2017-05-20 21:43:00 -07:00
Ethan Buchman 6afee8f117 rpc: fix tests 2017-05-04 22:45:13 -04:00
Ethan Buchman 4e781961e9 remove TMResult. ::drinks champagne:: 2017-04-28 22:26:23 -04:00
Ethan Buchman 07e59e63f9 TMEventDataInner 2017-04-28 17:57:06 -04:00
Ethan Frey 6c60c07f16 BROKEN: attempt to replace go-wire.JSON with json.Unmarshall in rpc 2017-04-28 16:24:06 +02:00
Ethan Frey f6f1f1992c Prepare rpc responses for go-data compatibility, still use go-wire 2017-04-28 14:46:04 +02:00
Ethan Buchman c930f43cbe rpc: fix tests 2017-04-27 19:56:14 -04:00
Ethan Buchman cc6dde96c1 rpc -> rpc/lib and rpc/tendermint -> rpc 2017-04-26 19:57:33 -04:00
Ethan Frey bd93f76950 Improve rpc to properly format any alias for []byte in URIClient 2017-04-25 17:17:51 +02:00
Ethan Buchman 9e82d132ce go-rpc -> tendermint/rpc 2017-04-21 18:19:29 -04:00
Ethan Buchman c55d83281a move into rpc package 2017-04-21 18:05:39 -04:00
Ethan Buchman 992b11c450 premerge2: rpc -> rpc/tendermint 2017-04-21 17:39:56 -04:00
Ethan Frey 90abc61c56 Improve go-data json support in rpc 2017-04-21 16:55:37 -04:00
Anton Kaliaev 5e5fb37774
rename TxID to Hash 2017-04-21 18:39:02 +03:00
Ethan Buchman f4d0076344 TxResult includes Tx. /tx only works if indexer active 2017-04-18 19:56:41 -04:00
Ethan Frey 20458564b2 Expose Tx method in the clients 2017-04-13 21:49:21 +02:00
Ethan Buchman 7fb0e8b30b Merge branch 'feature/tx-proof' into feature/237-tx-indexing
Conflicts:
	types/tx.go
2017-04-12 18:48:39 -04:00
Ethan Buchman ac86e664c7 Revert "Undo last two commits"
This reverts commit d1fc37ff9e.
2017-04-11 15:44:36 -04:00
Ethan Frey d1fc37ff9e Undo last two commits 2017-04-11 12:57:06 +02:00
Ethan Buchman 7fbe8e47d4 fix tests 2017-04-10 17:32:48 -04:00
Ethan Frey e4e17a2c95 Play well with go-{rpc,crypto,data}:develop 2017-04-10 21:16:41 +02:00
Ethan Buchman 692691938c remove comment 2017-03-02 23:57:28 -05:00
Ethan Buchman a200505ae5 Merge pull request #422 from tendermint/fix-race
Fix race
2017-03-02 23:56:18 -05:00
Ethan Buchman 8ba79252c8 types: use mtx on PartSet.String() 2017-03-02 23:50:59 -05:00
Ethan Frey 21501815dd Fix EventSwitch usage in WaitForOneEvent 2017-02-27 14:55:29 +01:00
Ethan Frey d56cb2ab4b fix typo 2017-02-24 23:40:05 +01:00
Ethan Frey 4fead237f0 Client embeds EventSwitch, client.HTTP properly un/subscribes events over websocket 2017-02-24 21:26:17 +01:00
Ethan Frey 6282fad518 Clean up event switch add helper function 2017-02-24 19:59:40 +01:00
Ethan Frey 175bb329e4 Expose EventSwitch on top of websocket client 2017-02-24 19:15:22 +01:00
Ethan Frey 9be3064904 Expose and test EventSwitch in client.Local 2017-02-24 17:51:19 +01:00
Ethan Frey 98450ee2db Client: DumpConsensusState, not DialSeeds. Cleanup 2017-02-24 17:05:15 +01:00
Ethan Frey 931af6a072 Combine local and http into client package, unify tests with table-driven tests 2017-02-24 17:05:15 +01:00
Ethan Frey 202146e4ce Fix up checktx/delivertx in broadcastTx(A)sync 2017-02-24 17:05:15 +01:00
Ethan Frey 9693795c4c Move common code to merkleeyes/testutil 2017-02-24 17:05:15 +01:00
Ethan Frey cd9ee9d84b cleanup 2017-02-24 17:05:15 +01:00
Ethan Frey 42a9b847ec Make all client tests safe to run in parallel 2017-02-24 17:05:15 +01:00
Ethan Frey d92a5b1074 Reworked WaitForHeight to avoid race conditions 2017-02-24 17:05:14 +01:00
Ethan Frey f7f7cf576a Fix race condition in websocket event listening 2017-02-24 17:05:14 +01:00
Ethan Frey 26f4b5c98e Clean up package names 2017-02-24 17:05:14 +01:00
Ethan Frey 70f19e809b Add MockStatus, WaitForHeight helper 2017-02-24 17:05:14 +01:00
Ethan Frey 0905332f1d MockClient for real abci app 2017-02-24 17:05:14 +01:00
Ethan Frey df172fa840 Provide mock interfaces for calling abci app over tendermint rpc 2017-02-24 17:05:14 +01:00
Ethan Frey ce044dbb76 Extracted Clients into a consistent interface, fixed type issue in http.Client 2017-02-24 17:05:14 +01:00
Ethan Frey 7c26be3242 Begin implementation of local client 2017-02-24 17:05:13 +01:00
Ethan Frey bf1ee89b27 Moved httpclient into subpackage 2017-02-24 17:05:13 +01:00
Ethan Frey 64feaa05f4 Full test coverage for rpc client 2017-02-24 17:05:13 +01:00
Ethan Frey 5ea3f24304 test info 2017-02-24 17:05:13 +01:00
Ethan Frey c9d36cd713 Add dependencies, pull out HTTPClient test code 2017-02-24 17:05:13 +01:00
Ethan Frey d971416d12 collision merge of light-client code 2017-02-24 17:05:12 +01:00
Ethan Buchman 0be13d1d27 move alert, events, rpc into own repos 2016-01-12 19:15:10 -05:00
Ethan Buchman 96547d0ca8 ws fixes; rpc tests 2016-01-12 19:14:02 -05:00
Jae Kwon 74cdadec9f Refactor RPC to be more general 2016-01-02 16:23:29 -08:00
Jae Kwon 53f74d052f Fix deadlock bug in websocket client impl 2015-12-07 21:11:12 -08:00
Jae Kwon e12f9d10e7 Bare consensus refactor 2015-11-01 11:34:08 -08:00
Jae Kwon c4ed55d801 Refactor to move common libraries out of project 2015-10-22 17:39:06 -07: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 1b9fd811a1 RPCResponse.Result && EventData are registered interfaces; -skip_upnp option 2015-08-11 11:01:18 -07:00
Jae Kwon e86073ec96 Use rpc/client/ws_client; OnStart() returns error 2015-08-11 11:01:17 -07:00
Jae Kwon 3949d3f21d ws_client fixes 2015-08-11 11:01:17 -07:00
Jae Kwon 60310cc23f websocket server sends pings; added ws_client; events refactor 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 a84d4320df websockets accept rpc requests 2015-07-23 17:57:15 -07:00
Ethan Buchman bb4ca1407f info->notice, debug->info 2015-07-19 22:44:40 +00:00
Ethan Buchman 57ff919d50 godep 2015-06-09 23:17:19 -04:00
Jae Kwon 3565db4eef Refactor RPC/*, tendermint/config for debora+barak 2015-05-17 16:19:58 -07:00