Commit Graph

184 Commits

Author SHA1 Message Date
Ethan Buchman e4d52401cf some fixes from review 2018-01-13 16:06:51 -05:00
Ethan Buchman b1485b181a Merge branch 'p2p-consolidate' into p2p-id 2018-01-13 15:20:23 -05:00
Ethan Buchman e2b3b5b58c dial_persistent_peers -> dial_peers with persistent option 2018-01-13 14:50:58 -05:00
Anton Kaliaev e4897b7bdd
rename manual peers to persistent peers 2018-01-09 16:18:05 -06:00
Anton Kaliaev 28fc15028a
distinguish between seeds and manual peers in the config/flags
- we only use seeds if we can’t connect to peers in the addrbook.
- we always connect to nodes given in config/flags

Refs #864
2018-01-09 16:03:24 -06:00
Ethan Buchman 488ae529ad p2p: authenticate peer ID 2018-01-01 23:23:11 -05:00
Ethan Buchman 6e823c6e87 p2p: support addr format ID@IP:PORT 2018-01-01 23:08:20 -05:00
Ethan Buchman 7d35500e6b p2p: add ID to NetAddress and use for AddrBook 2018-01-01 22:39:08 -05:00
Ethan Buchman a17105fd46 p2p: peer.Key -> peer.ID 2018-01-01 22:39:05 -05:00
Ethan Buchman b289d2baf4 persistent node key and ID 2018-01-01 21:21:42 -05:00
Ethan Buchman f2e0abf1dc p2p: reorder some checks in addPeer; add comments to NodeInfo 2018-01-01 21:21:39 -05:00
Ethan Buchman 528154f1a2 p2p: PrivKey need not be Ed25519 2018-01-01 19:44:01 -05:00
Ethan Buchman cb3ac6987e remove some debugs 2017-12-19 10:11:37 -05:00
Ethan Buchman 5d04ccbe51 excessive logging. update tmlibs for timer fix 2017-12-16 19:16:08 -05:00
Ethan Buchman 5511bd8e85 p2p: exponential backoff on reconnect. closes #939 2017-12-11 13:41:09 -05:00
Anton Kaliaev c609b18698
tolerate unresolvable seeds (Refs #880) 2017-12-07 13:17:09 -06:00
Anton Kaliaev 691e266bef
ignore ErrAlreadyStarted when starting addrbook in PEXReactor 2017-11-29 10:53:30 -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
Ethan Buchman 55b81cc1a1 address linting FIXMEs 2017-11-27 22:39:12 +00:00
Zach Ramsay 15651a931e linting errors: tackle p2p package 2017-11-27 22:39:11 +00:00
Zach Ramsay 1721543e5c linting: apply misspell 2017-11-27 22:39:11 +00:00
Ethan Buchman 75463b8331
Merge pull request #877 from tendermint/p2p-switch-DialSeeds-undeterministically
p2p: make Switch.DialSeeds use a new PRNG per call
2017-11-21 15:24:29 +00:00
Emmanuel Odeke 031e10133c
p2p: make Switch.DialSeeds use a new PRNG per call
Fixes https://github.com/tendermint/tendermint/issues/875

Ensure that every DialSeeds call uses a new PRNG seeded from
tendermint/tmlibs/common.RandInt which internally uses
crypto/rand to seed its source.
2017-11-20 15:28:42 -07:00
Ethan Buchman f9bc22ec6a p2p: fix comment on addPeer (thanks @odeke-em) 2017-11-20 21:36:01 +00:00
Ethan Buchman af0db599b0 minor fixes 2017-11-16 23:57:00 +00:00
Emmanuel Odeke 3f9dff9aac
p2p: netPipe for <Go1.10 in own file with own build tag
Follow up of 283544c7f3
putting <Go1.10 implementation of netPipe in its own
file and protect it with its separate build tag.
2017-11-14 22:23:48 -07:00
Emmanuel Odeke 283544c7f3
p2p: use fake net.Pipe since only >=Go1.10 implements SetDeadline
Fixes https://github.com/tendermint/tendermint/issues/851

Go1.9 and below's net.Pipe did not implement the SetDeadline
method so after commit
e2dd8ca946
this problem was exposed since now we check for errors.

To counter this problem, implement a simple composition for
net.Conn that always returns nil on SetDeadline instead of
tripping out.

Added build tags so that anyone using go1.10 when it is released
will be able to automatically use net.Pipe's net.Conns
2017-11-14 22:03:23 -07:00
Ethan Buchman c931279960 p2p: some fixes re @odeke-em issues #813,#816,#817 2017-11-08 17:54:29 +00:00
Ethan Buchman 9f6a09277e
Merge pull request #812 from tendermint/808-make-connected-switches
MakeConnectedSwitches: connect first switch to others
2017-11-08 00:54:23 +00:00
Anton Kaliaev 7869e541f6
change MakeConnectedSwitches to not connect to itself
and a test for it
2017-11-07 18:33:00 -05:00
Ethan Buchman e01986e2b3 p2p: update readme, some minor things 2017-11-07 23:00:49 +00:00
Anton Kaliaev e785697a64
connect first switch to others (Refs #808) 2017-11-06 23:43:40 -05:00
Petabyte Storage fe9ff62297 fix comment typos 2017-10-28 22:01:45 -07:00
Ethan Buchman b50339e8e7 p2p: sw.AddPeer -> sw.addPeer 2017-09-21 15:47:41 -04:00
Ethan Buchman aea8629272 peer interface 2017-09-15 18:40:59 -04:00
Ethan Buchman daa258ea6d p2p: put maxMsgPacketPayloadSize, recvRate, sendRate in config
Updates #628
2017-09-01 21:44:15 -04:00
caojingqi 086544e367 p2p: sw.peers.List() is empty in sw.OnStart 2017-07-10 20:43:38 -04:00
Ethan Buchman 74a3a2b56a fix comments 2017-07-09 18:01:25 -04:00
Adrian Brink b07d01f102 Add more comments on public functions and extra logging during 'enterPrevote'
Signed-off-by: Adrian Brink <adrian@brink-holdings.com>
2017-07-09 20:35:48 +02:00
Ethan Buchman e6cecb9595 p2p: fix test 2017-07-07 13:33:15 -04:00
Ethan Buchman 3c10f7a122 add p2p flush throttle to config 2017-07-07 13:08:52 -04:00
Ethan Buchman 0d1fa8e884 fixes from review 2017-06-28 11:12:45 -04:00
Anton Kaliaev b4ece65726
standardize key for errors (should be "err") 2017-06-14 12:50:49 +04:00
Anton Kaliaev 4fe67652ff
move SetLogger down 2017-05-14 00:24:58 +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
Ethan Buchman 16509ac3db
p2p: fix race by peer.Start() before peers.Add() 2017-05-13 10:24:59 +02: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 92bafa7ecd consensus: fix tests 2017-05-04 22:46:13 -04:00
Ethan Buchman 57151d6043 p2p: use cmn instead of . 2017-05-04 22:43:55 -04:00
Ethan Buchman 5d660e073a remove viper from p2p 2017-05-04 22:43:55 -04:00
Ethan Buchman fcf78a5da7 cleanup go-config/viper and some unnamed imports 2017-04-25 14:54:56 -04:00
Ethan Buchman 23a6a6f8fc move into p2p package 2017-04-21 18:07:52 -04:00
Jae Kwon c4ed55d801 Refactor to move common libraries out of project 2015-10-22 17:39:06 -07: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 908fd11665 more explicit _, err := Start() checking 2015-08-11 11:01:17 -07:00
Jae Kwon e86073ec96 Use rpc/client/ws_client; OnStart() returns error 2015-08-11 11:01:17 -07:00
Jae Kwon e7c1febb65 Simplify Service/Reactor pattern 2015-07-22 06:21:21 -07:00
Ethan Buchman 8e50bf15de panic wrapper functions 2015-07-21 10:46:05 -04:00
Jae Kwon 1d362a71ed Stop the peer to stop the mconn 2015-07-20 15:02:12 -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
Ethan Buchman e087284a4f update logger package for new level 'notice' 2015-07-19 22:43:58 +00:00
Ethan Buchman 95765db7eb actually stop peer on failed Add 2015-07-19 22:41:19 +00:00
Ethan Buchman dc7b912881 crypto byte arrays are fixed length 2015-07-17 17:19:16 -04:00
Ethan Buchman ba70bffa23 add handshakeTimeout, bound chunkLength, comments 2015-07-17 03:58:57 -04:00
Jae Kwon e4c351f5fc UUID -> PubKeyEd25519 2015-07-15 14:31:03 -07:00
Jae Kwon fd64547ce7 Put a SecretConnection before the MConnection; Node Priv/PubKeys 2015-07-15 14:17:20 -07:00
Jae Kwon d91f073676 uuid branch tidying 2015-07-13 16:00:01 -07:00
Jae Kwon bdc2711f27 p2p comment prettify 2015-07-13 13:17:47 -07:00
Ethan Buchman f2ccfff18e respect maxNumPeers. closes #59 2015-07-12 18:31:24 +00:00
Ethan Buchman 0728539bc1 limit num connections per ip range 2015-07-12 17:54:34 +00:00
Ethan Buchman af5b763112 avoid connection to self 2015-07-12 16:49:12 +00:00
Ethan Buchman 555dab4fd6 limit number of allowed connections per ip 2015-07-12 02:16:33 +00:00
Ethan Buchman 9521e4e4e7 add peer to addrbook on AddPeer, after handshake 2015-07-12 02:16:33 +00:00
Ethan Buchman 3f7f3dd37f add git commit hash to nodeInfo 2015-07-12 02:16:33 +00:00
Jae Kwon 5107988fb5 Call peer.stop() if we're not going to start() it 2015-07-11 13:25:42 -07:00
Ethan Buchman 33566375af don't trust peer's node info 2015-06-17 17:55:16 -04:00
Ethan Buchman 4f94e0f200 only allow one connection per ip 2015-05-01 18:06:15 -07:00
Jae Kwon f1703249ff ... 2015-04-23 18:40:44 -07:00
Ethan Buchman 0e80059e79 versioning 2015-04-23 16:53:28 -07:00
Jae Kwon 9513f601de Removed Log.File, all log goes out to stdout. 2015-04-22 11:07:34 -07:00
Jae Kwon 2ba6f86f2e Add Network to SignBytes, to prevent network clashes 2015-04-20 23:59:52 -07:00
Jae Kwon dc1fddd1d8 Added NodeInfo (still need to add to AddrBook); Proper Handshake 2015-04-20 15:29:01 -07:00
Jae Kwon c72eb1be99 fix for{go func} scope issue 2015-04-17 11:08:03 -07:00
Jae Kwon a09051438c Intermediate... working on debora 2015-04-08 11:35:17 -07:00
Jae Kwon f271ab7256 various changes. removed debora temporarily 2015-04-03 16:15:52 -07:00
Jae Kwon 13b6508ecd Package import path change 2015-04-01 17:30:16 -07:00
Jae Kwon c74b5522a1 fixied IsListening() 2015-04-01 14:52:25 -07:00
Ethan Buchman 60f166e823 tendermint2 2015-03-31 15:33:31 -07:00
Jae Kwon 7171823fc6 Fix blockpool bugs and clean up log messages. 2015-03-25 23:04:17 -07:00
Jae Kwon bd6d9d646d start peer before AddPeer() on reactors. 2015-03-25 13:22:46 -07:00
Jae Kwon 94c3a51760 bug fix in daemon -- network name only, no chain hash 2015-03-25 12:13:32 -07:00
Jae Kwon aed4bbf0f0 Fix switch tests 2015-03-25 02:36:59 -07:00
Jae Kwon 08a83aa9fb Reactors can be stopped or started at any time. 2015-03-25 00:15:18 -07:00
Jae Kwon 0237d284cc Channel bytes are spelled fully, "XXXChannel" 2015-03-24 12:00:27 -07:00
Jae Kwon 43a0c253f8 Merge pull request #39 from tendermint/development
Development
2015-03-21 17:41:41 -07:00
Ethan Buchman a2938fd35b p2p: fix switch test for Broadcast returning success channel 2015-03-18 23:27:28 -07:00