Commit Graph

173 Commits

Author SHA1 Message Date
Ethan Buchman 5b1f987ed1 mempool: remove Peer interface. use p2p.Peer 2017-12-26 20:24:12 -05:00
Ethan Buchman d2db202a2d mempool: assert -> require in test 2017-12-02 23:41:09 -05:00
Ethan Buchman 9af8da7aad update for new abci int types 2017-12-02 01:47:55 -05:00
Ethan Buchman c9be2b89f9 mempool: return error on cached txs 2017-12-02 01:15:11 -05:00
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 86af889dfb remove unnecessary casts (Refs #911) 2017-12-01 17:17:22 -05:00
Anton Kaliaev b3492356e6 uint64 height (Refs #911) 2017-12-01 17:17:22 -05:00
Anton Kaliaev 1e19860585
fixes from my own review 2017-11-29 14:24:18 -06:00
Anton Kaliaev f65e357d2b
adapt Tendermint to new abci.Client interface
which was introduced in https://github.com/tendermint/abci/pull/130
2017-11-29 14:23:44 -06:00
Anton Kaliaev 69b5da766c
service#Start, service#Stop signatures were changed
See https://github.com/tendermint/tmlibs/issues/45
2017-11-29 10:38:58 -06:00
Emmanuel Odeke 3595b5931a
mempool: implement Mempool.CloseWAL
Fixes https://github.com/tendermint/tendermint/issues/890

Add a CloseWAL method to Mempool to close the underlying WAL file
and then discard it so that further writes to it will have no effect.
2017-11-27 21:37:25 -07:00
Zach Ramsay 68e7983c70 linting errors: afew more 2017-11-27 22:39:11 +00:00
Zach Ramsay 8f0237610e linting errors: clean it all up 2017-11-27 22:39:11 +00:00
Zach Ramsay b75d4f73e7 errcheck: PR comment fixes 2017-11-27 22:39:11 +00:00
Zach Ramsay 331857c9e6 linting: apply errcheck part2 2017-11-27 22:39:11 +00:00
Zach Ramsay 46ccbcbff6 linting: apply 'gofmt -s -w' throughout 2017-11-27 22:39:11 +00:00
Ethan Buchman e69d36d54f some more robust sleeps 2017-11-14 22:31:23 +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 ac2ef9e0ea Merge pull request #750 from tendermint/feature/cleanup
Cleanup of code and code docs
2017-10-23 11:14:15 -04:00
Adrian Brink 819f81f702 Change NOTE to CONTRACT 2017-10-23 11:04:45 -04:00
Adrian Brink 782a836db0 Cleanup of code and code docs
This cleans up some of the code in the state package
2017-10-23 11:04:45 -04:00
Anton Kaliaev f908dd0e55 only notify when there are some txs (Refs #753) 2017-10-23 10:31:00 -04:00
Anton Kaliaev 54f2cc9709
[docs] add how to read logs guide [ci skip] 2017-10-04 18:35:22 +04: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 c5a657f540 consensus: test proposal heartbeat 2017-08-10 01:24:23 -04:00
Ethan Buchman fb47ca6d35 fixes from review 2017-08-04 21:36:11 -04:00
Ethan Buchman 3444bee47f fixes from review; use mempool.TxsAvailable() directly 2017-07-28 23:42:43 -04:00
Ethan Buchman fc3fe9292f fixes from review 2017-07-28 22:12:11 -04:00
Ethan Buchman 678a9a2e42 TxsAvailable tests 2017-07-28 22:11:45 -04:00
Ethan Buchman 124032e3e9 NoEmptyBlocks config option 2017-07-28 22:11:45 -04:00
Ethan Buchman 4beac54bd9 no empty blocks 2017-07-28 22:11:45 -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
spring1843 cf686d4f83 Fix commonly misspelled words 2017-05-20 21:43:00 -07:00
Anton Kaliaev 91dc87e7c4
update for a new ABCI API 2017-05-16 19:06:35 +02:00
Anton Kaliaev f8fdbe3dbc
changes as per Bucky's review 2017-05-13 16:22:51 +02:00
Anton Kaliaev f803544195
new logging 2017-05-13 10:24:58 +02:00
Ethan Buchman 46151720f8 fix tests 2017-05-04 22:46:41 -04:00
Ethan Frey 6b059e0063 Accept relative paths in all configs, TODO: must SetRoot 2017-05-04 22:46:40 -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 Buchman 4982cb4d1f fix tests for state and mempool 2017-05-04 22:43:55 -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 cbe6dbe7a1 handshake replay through consensus using mockApp 2017-02-16 17:56:45 -05:00