Commit Graph

575 Commits

Author SHA1 Message Date
Ethan Buchman 775bb85efb p2p/pex: wait to connect to all peers in reactor test 2018-01-23 21:30:53 -05:00
Ethan Buchman 21ce5856b3 p2p: notes about ListenAddr 2018-01-23 21:26:19 -05:00
Ethan Buchman 3090b05eb4 p2p: use conn.Close when peer is nil 2018-01-21 16:26:59 -05:00
Ethan Buchman 44e967184a p2p: tmconn->conn and types->p2p 2018-01-21 00:34:41 -05:00
Ethan Buchman 0d7d16005a fixes 2018-01-20 21:44:30 -05:00
Ethan Buchman 5b5cbaa66a p2p: use sub dirs 2018-01-20 21:35:37 -05:00
Ethan Buchman 03550c7076 wip addrbook 2018-01-20 21:33:43 -05:00
Ethan Buchman 930fde056a p2p: add back lost func 2018-01-20 21:28:00 -05:00
Ethan Buchman 8d758560d8 p2p/trustmetric: non-deterministic test 2018-01-20 21:24:22 -05:00
Ethan Buchman 7b87cdaed8 p2p: seed disconnects after sending addrs 2018-01-20 21:24:22 -05:00
Ethan Buchman c2f97e6454 p2p: seed mode fixes from rebase and review 2018-01-20 21:24:22 -05:00
Ethan Buchman 88eb3e7af0 some minor renames 2018-01-20 21:24:20 -05:00
caffix 949211a137 added a test for PEX reactor seed mode 2018-01-20 21:23:48 -05:00
Ethan Buchman 8171628ee5 make tests run faster 2018-01-19 00:59:09 -05:00
Ethan Buchman bc19e7843c
Merge branch 'develop' into p2p-consolidate 2018-01-18 18:30:37 -05:00
Ethan Buchman fc7915ab4c fixes from review 2018-01-14 13:03:57 -05:00
Zach Ramsay 26aaa283a9 p2p: remove deprecated Dockerfile 2018-01-14 13:51:28 +00:00
Zach a29c67563c Update p2p README, closes #1102 2018-01-14 13:50:34 +00:00
Ethan Buchman 17f7a9b510 improve seed dialing logic 2018-01-14 03:56:15 -05:00
Ethan Buchman 3df5fd21cd better abuse handling in pex 2018-01-14 03:22:01 -05:00
Ethan Buchman 68237911ba NetAddress.Same checks ID or DialString 2018-01-14 01:15:37 -05:00
Ethan Buchman f9e4f6eb6b reorder peer.go methods 2018-01-14 01:15:37 -05:00
Ethan Buchman 8b74a8d6ac NodeInfo not a pointer 2018-01-14 01:15:33 -05:00
Ethan Buchman 08f84cd712 a little more moving around 2018-01-13 23:56:57 -05:00
Ethan Buchman 452d10f368 cleanup switch 2018-01-13 17:37:52 -05:00
Ethan Buchman 7667e11973 remove RemoteAddr from NodeInfo 2018-01-13 17:36:03 -05:00
Ethan Buchman 53a5498fc5 more fixes from review 2018-01-13 17:34:12 -05:00
Ethan Buchman e4d52401cf some fixes from review 2018-01-13 16:06:51 -05:00
Ethan Buchman 9670519a21 remove PoW from ID 2018-01-13 15:50:59 -05:00
Ethan Buchman b1485b181a Merge branch 'p2p-consolidate' into p2p-id 2018-01-13 15:20:23 -05:00
Ethan Buchman c1e167e330 note in trust metric test 2018-01-13 15:11:13 -05:00
Ethan Buchman e2b3b5b58c dial_persistent_peers -> dial_peers with persistent option 2018-01-13 14:50:58 -05:00
Anton Kaliaev 075ae1e301
minimal test for dialing seeds in pex reactor 2018-01-09 18:29:29 -06:00
Anton Kaliaev 705d51aa42
move dialSeedsIfAddrBookIsEmptyOrPEXFailedToConnect into PEX reactor 2018-01-09 17:54:29 -06: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
Adrian Brink f602de437e
Move P2P docs into docs folder 2018-01-03 10:49:47 +01: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 bc71840f06 more p2p docs 2018-01-01 16:30:36 -05:00
Ethan Buchman 1acb12edf5 p2p docs 2017-12-31 17:11:09 -05:00
Ethan Buchman 14c812a39c tmlibs timer fix 2017-12-25 11:11:55 -05:00
Ethan Buchman 652d1e3de8
Merge pull request #979 from tendermint/934-node-fails-to-parse-seeds
strip protocol if defined
2017-12-19 12:26:32 -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 d7cb2f850d more logs in p2p 2017-12-16 13:36:52 -05:00
Ethan Buchman bfe0a4a8ac more logging 2017-12-16 13:36:52 -05:00
Ethan Buchman 0ec7909ec3 more logging in p2p and consensus 2017-12-16 13:36:52 -05:00
Anton Kaliaev c513649df4
strip protocol if defined
Fixes #934
2017-12-15 13:36:08 -06:00
Anton Kaliaev a6911825b0
PanicCrisis is deprecated 2017-12-15 13:35:49 -06:00
Ethan Buchman 068d83bce8
Merge pull request #677 from tendermint/blockchain-test-store
blockchain: add tests for BlockStore
2017-12-15 13:33:55 -05:00
Ethan Buchman 78a682e4b6 blockchain: test fixes 2017-12-15 12:07:48 -05:00
Ethan Buchman 462b755a60
activate PEX reactor by default 2017-12-13 12:25:48 -06:00
Ethan Buchman 64f056b57d Merge branch '916-remove-sleeps-from-tests' into develop 2017-12-12 16:43:36 -05:00
Ethan Buchman 90df9fa1bf p2p/trust: remove extra channels 2017-12-12 16:43:19 -05:00
caffix eae6e6381e trust metric is now a service and the test ticker has been added 2017-12-12 15:33:42 -05:00
Petabyte Storage 8be708fe5b fix spelling and makefile gometalinter.v2 2017-12-11 20:48:15 -08:00
Ethan Buchman 5511bd8e85 p2p: exponential backoff on reconnect. closes #939 2017-12-11 13:41:09 -05:00
Ethan Buchman a37c1143ca adr: update 007 trust metric usage 2017-12-10 19:00:44 -05:00
Zach 12c5a57415
determinisitic linter (#902)
* linter: address gosimple lints

* linter: make deterministic & a rebase fix

* lint/rpc: fix a gosimple lint

* run linter in CI

* fix rebase mistake

* fix makefile

* ugh

* revert Makefile

* add metalinter to CI

* try this

* linter: last little fix

* need glide

* better

* okayy circle, have it your way

* lints: gosimple

* pr comments
2017-12-10 17:44:22 +00:00
caffix 44f62e5e27 built the WaitForStop functionality into the Stop method 2017-12-09 13:25:28 -05:00
caffix 5d464364a8 fixed the racy test and removed all the calls to Sleep 2017-12-08 15:51:18 -05:00
Anton Kaliaev c609b18698
tolerate unresolvable seeds (Refs #880) 2017-12-07 13:17:09 -06:00
Ethan Buchman 58b4a8395b
Merge pull request #917 from tendermint/trust-metric-cleanup
Trust metric cleanup
2017-12-06 02:11:38 -05:00
Ethan Buchman e101aa9fc8 fix for legacy gowire 2017-12-06 01:21:14 -05:00
Ethan Buchman cb9a1dbb4f p2p/trust: lock on Copy() 2017-12-01 23:35:17 -05:00
Ethan Buchman 814541f6d9 p2p/trust: split into multiple files and improve function order 2017-12-01 23:35:12 -05: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 9529f12c28 more linting 2017-11-27 22:39:12 +00:00
Ethan Buchman 55b81cc1a1 address linting FIXMEs 2017-11-27 22:39:12 +00:00
Zach Ramsay 478a10aa41 Write doesn't need error checked 2017-11-27 22:39:12 +00:00
Zach Ramsay d033470817 lil fixes 2017-11-27 22:39:12 +00:00
Zach Ramsay 7ad8a8ab55 Tests almost passing 2017-11-27 22:39:12 +00:00
Zach Ramsay a15c7f221d linting: moar fixes 2017-11-27 22:39:11 +00:00
Zach Ramsay d7cb291fb2 errcheck; sort some stuff out 2017-11-27 22:39:11 +00:00
Zach Ramsay 15651a931e linting errors: tackle p2p package 2017-11-27 22:39:11 +00: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 57ea4987f7 linting: apply errcheck part1 2017-11-27 22:39:11 +00:00
Zach Ramsay 1721543e5c linting: apply misspell 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 94e400a5d6
Merge pull request #896 from tendermint/normalize-priority-and-id
normalize priority and id and remove pointers in ChannelDescriptor
2017-11-27 17:05:38 +00:00
Petabyte Storage 59b3dcb5cf normalize priority and id and remove pointers in ChannelDescriptor 2017-11-25 22:01:23 -08:00
caffix 887cb6d0cd added public methods to handle locking within the trust metric 2017-11-22 23:42:38 -05:00
caffix aeaf2d0b20 Merge branch 'develop' of https://github.com/tendermint/tendermint into develop 2017-11-22 23:11:01 -05:00
Ethan Buchman e845987503 p2p: disable trustmetric test while being fixed 2017-11-22 20:20:53 +00:00
Ethan Buchman 531b1197a7
Merge pull request #843 from tendermint/refactor-mconnection-with-go-wire-1
WIP: begin parallel refactoring: go-wire Write methods and MConnection
2017-11-22 19:34:22 +00:00
Ethan Buchman e997db7a23
Merge pull request #859 from tendermint/fix/addrbook
Fix/addrbook
2017-11-21 15:31:48 +00:00
Ethan Buchman c4b695f78d minor fixes from review 2017-11-21 15:30:19 +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
caffix 9c8100043e made changes to address suggestions from the PR comments 2017-11-20 19:15:11 -05: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
caffix 4087326f45 fixed race condition reported in issue #881 2017-11-20 16:47:05 -05:00
Ethan Buchman f9bc22ec6a p2p: fix comment on addPeer (thanks @odeke-em) 2017-11-20 21:36:01 +00:00
Ethan Buchman 26cd99c66e p2p: fix non-routable addr in test 2017-11-20 19:56:44 +00:00
Emmanuel Odeke 5c34d087d9
p2p: use bytes.Equal for key comparison
Updates https://github.com/tendermint/tendermint/issues/850

My security alarms falsely blarred when I skimmed and noticed
keys being compared with `==`, without the proper context
so I mistakenly filed an issue, yet the purpose of that
comparison was to check if the local ephemeral public key
was just the least, sorted lexicographically.

Anyways, let's use the proper bytes.Equal check, to save future labor.
2017-11-18 23:34:27 -07:00
Ethan Buchman 53f15fde07 update changelog 2017-11-17 00:04:03 +00:00
Ethan Buchman af0db599b0 minor fixes 2017-11-16 23:57:00 +00:00
Ethan Buchman 104368bd84
Merge pull request #787 from caffix/develop
Initial Trust Metric Implementation
2017-11-16 23:51:53 +00:00
Ethan Buchman 99461a178e
Merge pull request #857 from gguoss/patch-1
Failed to compile comment code
2017-11-16 18:35:18 +00:00
Ethan Buchman feb3230160 some comments 2017-11-16 04:43:07 +00:00
Ethan Buchman be1a16a601 p2p/pex: simplify ensurePeers 2017-11-16 04:30:38 +00:00
Ethan Buchman 8e044b0e6d p2p/addrbook: some comments 2017-11-16 04:30:23 +00:00
Ethan Buchman 40e93a5f9e p2p/addrbook: fix addToOldBucket 2017-11-16 04:08:46 +00:00
Ethan Buchman 435eb6e2b3 p2p/addrbook: add non-terminating test 2017-11-16 04:04:54 +00:00
Ethan Buchman 8c88cc017a p2p/addrbook: addAddress returns error. more defensive PickAddress 2017-11-16 03:59:54 +00:00
Ethan Buchman ed95cc160a p2p/addrbook: simplify PickAddress 2017-11-16 02:31:47 +00:00
Ethan Buchman 2f067a3f65 p2p/addrbook: addrNew/Old -> bucketsNew/Old 2017-11-16 02:28:11 +00:00
Ethan Buchman 498a82784d p2p/addrbook: comments 2017-11-16 02:25:00 +00:00
Guanghua Guo b5708825a7
Failed to compile comment code 2017-11-16 09:45:58 +08:00
caffix a724ffab25 added changes based on PR comments to the proposal 2017-11-15 17:59:48 -05: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 49faa79bdc
Merge pull request #848 from tendermint/p2p-catch-conn.SetDeadline-errors
p2p: peer should respect errors from SetDeadline
2017-11-15 03:34:58 +00:00
Emmanuel Odeke 7b0fa6c889
p2p: peer should respect errors from SetDeadline
Noticed while auditing the code that we aren't respecting
(*net.Conn) SetDeadline errors which return after
a connection has been killed and is simultaneously
being used.

For example given program, without SetDeadline error checks
```go
package main

import (
  "log"
  "net"
  "time"
)

func main() {
  conn, err := net.Dial("tcp", "tendermint.com:443")
  if err != nil {
    log.Fatal(err)
  }
  go func() {
    <-time.After(400 * time.Millisecond)
    conn.Close()
  }()
  for i := 0; i < 5; i++ {
    if err := conn.SetDeadline(time.Now().Add(time.Duration(10 * time.Second))); err != nil {
      log.Fatalf("set deadline #%d, err: %v", i, err)
    }
    log.Printf("Successfully set deadline #%d", i)
    <-time.After(150 * time.Millisecond)
  }
}
```

erraneously gives
```shell
2017/11/14 17:46:28 Successfully set deadline #0
2017/11/14 17:46:29 Successfully set deadline #1
2017/11/14 17:46:29 Successfully set deadline #2
2017/11/14 17:46:29 Successfully set deadline #3
2017/11/14 17:46:29 Successfully set deadline #4
```

However, if we properly fix it to respect that error with
```diff
--- wild.go 2017-11-14 17:44:38.000000000 -0700
+++ main.go 2017-11-14 17:45:40.000000000 -0700
@@ -16,7 +16,9 @@
    conn.Close()
  }()
  for i := 0; i < 5; i++ {
-   conn.SetDeadline(time.Now().Add(time.Duration(10 * time.Second)))
+   if err := conn.SetDeadline(time.Now().Add(time.Duration(10 *
time.Second))); err != nil {
+     log.Fatalf("set deadline #%d, err: %v", i, err)
+   }
    log.Printf("Successfully set deadline #%d", i)
    <-time.After(150 * time.Millisecond)
  }
```

properly catches any problems and gives
```shell
$ go run main.go
2017/11/14 17:43:44 Successfully set deadline #0
2017/11/14 17:43:45 Successfully set deadline #1
2017/11/14 17:43:45 Successfully set deadline #2
2017/11/14 17:43:45 set deadline #3, err: set tcp 10.182.253.51:57395:
use of closed network connection
exit status 1
```
2017-11-14 18:01:51 -07:00
caffix 8b7649b90c enhancements made in response to PR full review comments 2017-11-14 18:26:06 -05:00
caffix 687834c99e added initial trust metric test routines 2017-11-14 18:26:06 -05:00
caffix 54c25ccbf5 integrated trust metric store as per PR comments 2017-11-14 18:26:06 -05:00
caffix e160a6198c added initial trust metric design doc and code 2017-11-14 18:26:06 -05:00
Ethan Buchman e69d36d54f some more robust sleeps 2017-11-14 22:31:23 +00:00
Emmanuel Odeke 62c1bc0a20
p2p: comment on the wg.Add before go saveRoutine()
Just noticed while auditing the code in p2p/addrbook.go,
wg.Add(1) but no subsequent defer.
@jaekwon and I had a discussion offline and we agreed to
comment about why the code was that way and why
we shouldn't move the wg.Add(1) into .saveRoutine() because
if go a.saveRoutine() isn't started before anyone invokes
a.Wait(), then we'd have raced a.saveRoutine().
2017-11-13 18:14:58 -07:00
Petabyte Storage 3863885c71 WIP: begin parallel refactoring with go-wire Write methods and MConnection 2017-11-12 22:11:15 -08:00
Anton Kaliaev a1cdc2b68a
set logger for peer's MConnection 2017-11-09 14:57:40 -05: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
Ethan Buchman dd47884661
Merge pull request #820 from tendermint/790-use-tickers-instead-of-time-Sleep
prefer tickers to time.Sleep
2017-11-08 00:53:42 +00:00
Petabyte Storage 51c9211cf4 add test for MConnection TrySend and Send 2017-11-07 23:35:25 +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
Anton Kaliaev e0daca5693
fixes from Bucky's review 2017-11-07 18:20:24 -05:00
Ethan Buchman 37ce171061 p2p/connetion: remove panics, test error cases 2017-11-07 23:00:52 +00:00
Ethan Buchman e01986e2b3 p2p: update readme, some minor things 2017-11-07 23:00:49 +00:00
Anton Kaliaev 2d4ad02356
prefer tickers to time.Sleep (Refs #790) 2017-11-07 15:38:25 -05: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
Petabyte Storage 6b366b2443 fix test using uncommon names 2017-10-28 20:29:11 -07:00
Petabyte Storage ceedd4d968 remove unnecessary plus [ci skip] 2017-10-25 22:28:20 -04:00
Ethan Buchman 0bbf38141a blockchain/pool: some comments and small changes 2017-10-23 10:13:46 -04:00
Zach Ramsay 136b6a7673 rpc/lib: remove dead files, closes #710 2017-10-04 17:45:15 -04:00
Zach Ramsay f23d47e5d2 upnp: keep a link 2017-10-04 17:19:49 -04:00
Zach Ramsay d56b44f3a5 all: no more anonymous imports 2017-10-04 16:40:45 -04:00
Emmanuel Odeke 925696ca65 Merge branch 'p2p-prune-unused-IPRangeCount-funcs' into develop 2017-09-22 21:09:41 -06:00
Ethan Buchman ddb3d8945d p2p: allow listener with no external connection 2017-09-22 10:13:23 -04: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
Emmanuel Odeke 5138bcb1c7
p2p: delete unused and untested *IPRangeCount functions
Fixes #602

Delete unused and untested functions:
- AddToIPRangeCounts
- CheckIPRangeCounts
2017-09-15 14:03:01 -06:00
Ethan Buchman 54c63726b0 p2p: minor comment fixes 2017-09-06 16:40:21 -04:00
Ethan Buchman cb80ab2965 Merge remote-tracking branch 'orijtech/p2p-full-test-PeerSet' into develop 2017-09-06 16:40:07 -04:00
Emmanuel Odeke c48e772115
p2p: fully test PeerSet, more docs, parallelize PeerSet tests
* Full test PeerSet and check its concurrent guarantees
* Improve the doc for PeerSet.Has and remove unnecessary
defer for a path that sets a variable, make it fast anyways.
* Parallelize PeerSet tests with t.Parallel()
* Document functions in peer_set.go more.
2017-09-06 02:47:31 -06:00
Ethan Buchman cc2b418f7f p2p: test fix 2017-09-05 17:10:11 -04:00
Ethan Buchman 88138c38cf mempool: reactor test 2017-09-05 16:25:02 -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 75df0d91ba comments from review 2017-07-10 13:39:23 -04:00
Ethan Buchman 5f6b996d22 breakup some long lines; add more comments to consensus reactor 2017-07-09 18:38:59 -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
Ethan Buchman 2750343de5 Merge branch 'apply-megacheck' into unstable 2017-06-23 21:38:22 -04:00
Ethan Buchman 3c0128a680 undo some megacheck suggestions 2017-06-23 21:36:47 -04:00
Anton Kaliaev b4ece65726
standardize key for errors (should be "err") 2017-06-14 12:50:49 +04:00
zramsay bf5181d9ca address PR comments 2017-05-30 13:27:08 -04:00
zramsay cf31f8d06f core: apply megacheck vet tool (unused, gosimple, staticcheck) 2017-05-29 23:11:40 -04:00
Anton Kaliaev 4fe67652ff
move SetLogger down 2017-05-14 00:24:58 +02:00
Anton Kaliaev c5bccc5474
set missing logger on switch
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x882cec]

goroutine 328 [running]:
github.com/tendermint/tendermint/p2p.(*Switch).DialPeerWithAddress(0xc42000a500, 0xc4202088d0, 0xc420403500, 0x0, 0x0, 0x0)
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/switch.go:324 +0x2fc
github.com/tendermint/tendermint/p2p.(*PEXReactor).ensurePeers.func1(0xc4201663f0, 0xc4202088d0)
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/pex_reactor.go:280 +0x3e
created by github.com/tendermint/tendermint/p2p.(*PEXReactor).ensurePeers
        /home/vagrant/go/src/github.com/tendermint/tendermint/p2p/pex_reactor.go:284 +0x5d4
```
2017-05-13 17:05:44 +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
Anton Kaliaev bc4e6566e7
[p2p] refactor upnp to use new logger 2017-05-13 10:24:59 +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 57527f9f67 One silly tests passes on osx, fails on linux... comment out so i can develop 2017-05-05 18:48:39 +02:00
Ethan Buchman 46151720f8 fix tests 2017-05-04 22:46:41 -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 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 75b6c5215f fewer structs. remove viper from consensus 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 56c60fba23 go-p2p -> tendermint/p2p 2017-04-21 18:19:41 -04:00
Ethan Buchman 93c58d0b24 remove glide and license from rpc and p2p 2017-04-21 18:08:25 -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
Jae Kwon fa956596dc Merge remote-tracking branch 'origin/config' into develop 2015-10-11 18:18:53 -07:00
Ethan Buchman cccb722ba8 mempool tests 2015-09-29 12:30:46 -04:00
Ethan Buchman bb662b8861 more config options 2015-09-25 11:58:11 -04:00
Jae Kwon 4e6ea7f9f7 Merge pull request #143 from tendermint/versioning
more versioning
2015-09-22 18:48:07 -07:00
Ethan Buchman b54522c60f more versioning 2015-09-16 05:08:06 +00:00
Ethan Buchman 555ecb095d precommit nil if locked and no POL 2015-09-15 14:25:50 -04:00
Jae Kwon 1c17ea3b14 blockchain parameter && log tweaks 2015-09-11 21:09:27 -07:00
Jae Kwon 21d45023d3 various bug fixes 2015-09-11 21:09:01 -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 afc3e3b6c7 mconnection constants adjustment 2015-08-12 22:36:06 -07:00
Jae Kwon 1b9fd811a1 RPCResponse.Result && EventData are registered interfaces; -skip_upnp option 2015-08-11 11:01:18 -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 3be3647dc8 tendermint/binary -> tendermint/wire 2015-07-28 12:18:17 -07:00
Jae Kwon f91bc8d8c3 Retries for net.Listen to account for MacOSX socket close delay 2015-07-23 17:56:12 -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 3a9b465c75 Fix MConnection race condiiton 2015-07-20 17:02:18 -07:00
Jae Kwon c0a64d74be Service log prettify 2015-07-20 17:02:18 -07: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
Jae Kwon c30d38270c base_service draft and some samples 2015-07-19 17:42:01 -07:00
Ethan Buchman a28d924966 move some logs to debug 2015-07-19 22:44:40 +00: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 84705caefb fix nil-pointer error in SecretConnection handshake 2015-07-16 01:08:07 -07:00
Jae Kwon 9e2b138c35 Added link to doc above MakeSecretConnection 2015-07-15 15:38:29 -07:00
Jae Kwon 9ef79e59bb Godeps <- golang.org/x/crypto/nacl etc 2015-07-15 14:56:52 -07: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 a8d03bddc9 added sts-final doc 2015-07-15 14:16:30 -07:00
Jae Kwon d13a593afd Parallel syntax change; SecretConnection implements net.Conn 2015-07-15 12:13:10 -07:00
Jae Kwon 5b41cc4fa5 Added secret_connection benchmark test 2015-07-15 04:07:03 -07:00
Jae Kwon 4981a5993d fixed handshake test; wrote broken read/write test 2015-07-14 22:35:32 -07:00
Jae Kwon dbef516659 failing tests for secret_connection 2015-07-14 18:41:24 -07:00
Jae Kwon 402b3a3e52 draft of secret_connection 2015-07-14 17:52:54 -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 fca9e7f9ce send pexRequest to random peer in ensurePeers if no addrs to dial 2015-07-12 02:16:33 +00:00
Ethan Buchman 555dab4fd6 limit number of allowed connections per ip 2015-07-12 02:16:33 +00:00
Ethan Buchman d0610845dc peers use uuid to avoid duplicate connections 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 fadfc673e3 better upnp error msgs 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
Jae Kwon d95234435a Fix bug in merkle/iavl_proof; TODO maybe read zero length slices as nil? 2015-07-08 18:27:16 -07:00
Jae Kwon 1f34236948 Limit binary data to 21MB 2015-07-07 18:35:21 -07:00
Jae Kwon e4435a8d1e Log embellishment 2015-07-05 17:07:45 -07:00
Jae Kwon 7983113024 logging of base p2p messages 2015-07-05 16:31:25 -07:00
Jae Kwon 6781b21d32 Split ReadBinary into ReadBinary/ReadBinaryPtr. 2015-06-26 16:43:41 -07:00
Jae Kwon 9965dd5de6 uint* to int* whereever appropriate; https://www.reddit.com/r/golang/comments/2q5vdu/int_vs_uint/ 2015-06-25 20:28:34 -07:00
Ethan Buchman 33566375af don't trust peer's node info 2015-06-17 17:55:16 -04:00
Ethan Buchman 57ff919d50 godep 2015-06-09 23:17:19 -04:00