754 Commits

Author SHA1 Message Date
Giovanni Petrantoni
5e4934bcce Merge branch 'master' into publish-backporting 2020-07-02 17:44:23 +09:00
Giovanni Petrantoni
4f5c97e27c remove topics from pubsubpeer (was unused) 2020-07-01 17:44:26 +09:00
Giovanni Petrantoni
d9e0ca6091 getGossipPeers fixes 2020-07-01 17:26:42 +09:00
Giovanni Petrantoni
a976c22dae triage publish nil peers (issue is on master too but just hidden behind a if/in) 2020-07-01 16:54:28 +09:00
Jacek Sieka
b49c619ca8
export public field types (#248)
* export public field types

* one more
2020-07-01 09:22:29 +02:00
Giovanni Petrantoni
ec00c7fc50
Peer resultification and defect only (#245)
* Peer resultification and defect only

* Fixing some tests

* test fixes

* Rename peer into peerid

* better result error message in identify

* further merge fixes
2020-07-01 08:25:09 +02:00
Giovanni Petrantoni
f49e59cb4e improve fanout replenish behavior further 2020-06-30 11:36:47 +09:00
Giovanni Petrantoni
509d84f03d restore trace vs debug in gossip 2020-06-30 11:28:45 +09:00
Giovanni Petrantoni
9d33390239 restore utility module import 2020-06-30 00:17:58 +09:00
Dmitriy Ryajov
c788a6a3c0
Cleanup resources (#246)
* consolidate reading in lpstream

* remove debug echo

* tune log level

* add channel cleanup and cancelation handling

* cancelation handling

* cancelation handling

* cancelation handling

* cancelation handling

* cleanup and cancelation handling

* cancelation handling

* cancelation

* tests

* rename isConnected to connected

* remove testing trace

* comment out debug stacktraces

* explicit raises
2020-06-29 09:15:31 -06:00
Giovanni Petrantoni
680dcfd9cb cleanups 2020-06-30 00:10:11 +09:00
Giovanni Petrantoni
3a657135dc Merge branch 'master' into publish-backporting 2020-06-29 22:02:58 +09:00
Giovanni Petrantoni
3dd28adc9f restore old replenishFanout 2020-06-29 10:46:59 +09:00
Giovanni Petrantoni
2356f6ab68 make sure to not remove peers from gossip table 2020-06-29 10:45:06 +09:00
Jacek Sieka
aa6756dfe0
allow message id provider to be specified (#243)
* don't send public key in message when not signing (information leak)
* don't run rebalance if there are peers in gossip (see #242)
* don't crash randomly on bad peer id from remote
2020-06-28 09:56:38 -06:00
Giovanni Petrantoni
d4ca9691d0 test interop fixes 2020-06-28 16:37:27 +09:00
Giovanni Petrantoni
3f39eeb189 fix test's trypublish 2020-06-28 12:50:11 +09:00
Giovanni Petrantoni
31d79ebed8 fix flood tests 2020-06-28 11:58:12 +09:00
Giovanni Petrantoni
f98d2b635d internal test fixes 2020-06-28 11:03:33 +09:00
Giovanni Petrantoni
b7382eaf25 exclude non gossip from fanout 2020-06-28 10:55:44 +09:00
Giovanni Petrantoni
8e2c9301a0 use g.peers for fanout (todo: don't include flood peers) 2020-06-28 10:53:43 +09:00
Dmitriy Ryajov
902880ef1f
consolidate reading in lpstream (#241)
* consolidate reading in lpstream

* remove debug echo

* throw if not enough bytes where read

* tune log level

* set eof flag

* test readExactly to fail on not enough bytes
2020-06-27 11:33:34 -06:00
Giovanni Petrantoni
0ddfb31f67 fix internal tests 2020-06-27 20:49:53 +09:00
Giovanni Petrantoni
ccb323ad0f big publish refactor, replenish and balance 2020-06-27 20:24:29 +09:00
Giovanni Petrantoni
dc3c568dc0 wip... lvalues don't work properly sadly... 2020-06-27 14:59:48 +09:00
Giovanni Petrantoni
1a2f336eb5 use var semantics to optimize table access 2020-06-27 13:35:07 +09:00
Dmitriy Ryajov
7a95f1844b
Concurrent dials (#238)
* count published messages

* don't call `switch.dial` in `subscribeToPeer`

* add secureconn constructor

* close in the correct order

* concurent dial lock and track in/out conns better

* make tests pass

* add todo comment

* disconect peers that open too many connections

* wip

* do connection and muxer tracking in one place

* prevent nil pointer in observers

* drop connections when peers is over max

* prevent channel leaks

* don't use closure to handle channel
2020-06-24 09:08:44 -06:00
Ștefan Talpalaru
83b6ead857
Azure: fix MinGW-w64 caching (#239) 2020-06-23 16:38:17 +02:00
Giovanni Petrantoni
ee6e545878
multistream select make sure to not report NA (#235)
* multistream select make sure to not report NA but rather empty string if all fails

Also re-enable tests

* avoid using bad constructs, make multistream.select flow crystal clear
2020-06-22 15:38:48 -06:00
Jacek Sieka
6331b04cb4
secp: requiresInit updates (#237)
* secp: requiresInit updates

* fix
2020-06-22 19:03:15 +02:00
Jacek Sieka
b99fd88deb
logging fixes 2020-06-21 11:14:19 +02:00
Giovanni Petrantoni
9429f2f5eb
Gossip heartbeat fixes (#232)
* refactor heartbeat management in gossipsub

* remove locking within heartbeat
2020-06-20 19:58:22 +09:00
Giovanni Petrantoni
7852c6dd0f
Noise and eth2/nbc fixes (#226)
* Remove noise padding payload (spec removed it)

* add log scope in secure

* avoid defect array out of range in switch secure when "na"

* improve identify traces

* wip noise fixes

* noise protobuf adjustments (trying)

* add more debugging messages/traces, improve their actual contents

* re-enable ID check in noise

* bump go daemon tag version

* bump go daemon tag version

* enable noise in daemonapi

* interop testing, (both secio and noise will be tested)

* azure cache bump (p2pd)

* CI changes

- Travis: use Go 1.14
- azure-pipelines.yml: big cleanup
- Azure: bump cache keys
- build 64-bit p2pd on 32-bit Windows
- install both Mingw-w64 architectures

* noise logging fixes

* alternate testing between noise and secio

* increase timeout to avoid VM errors in CI (multistream tests)

* refactor heartbeat management in gossipsub

* remove locking within heartbeat

* refactor heartbeat management in gossipsub

* remove locking within heartbeat

Co-authored-by: Ștefan Talpalaru <stefantalpalaru@yahoo.com>
2020-06-20 19:56:55 +09:00
Dmitriy Ryajov
7a1c1c2ea6
fixing some key not found exceptions (#231) 2020-06-19 15:19:07 -06:00
Dmitriy Ryajov
5b28e8c488
Cleanup lpstream, Connection and BufferStream (#228)
* count published messages

* don't call `switch.dial` in `subscribeToPeer`

* don't use delegation in connection

* move connection out to own file

* don't breakout on reset

* make sure to call close on secured conn

* add lpstream tracing

* don't breackdown by conn id

* fix import

* remove unused lable

* reset  connection on exception

* add additional metrics for skipped messages

* check for nil in secure.close
2020-06-19 11:29:43 -06:00
Dmitriy Ryajov
719744f46a
Small fixes (#230)
* count published messages

* don't call `switch.dial` in `subscribeToPeer`

* make sure sending doesn't fail

* add `contains`

* review comment from prev pr
2020-06-19 11:29:25 -06:00
Dmitriy Ryajov
5f75e5adc6
don't use switch.dial in subscribeToPeer (#227)
* count published messages

* don't call `switch.dial` in `subscribeToPeer`
2020-06-17 20:12:32 -06:00
Dmitriy Ryajov
fe828d87d8
count published messages (#224) 2020-06-16 22:14:02 -06:00
Giovanni Petrantoni
224c2613e3
Remove noise padding payload (spec removed it) (#222) 2020-06-16 17:34:02 -06:00
Jacek Sieka
523eed65ce
metrics: use eth2 name for peers metric (#223) 2020-06-16 14:43:45 -06:00
Giovanni Petrantoni
0d81acafa8 Fix multistream select trace proto logging 2020-06-16 12:02:47 +09:00
Dmitriy Ryajov
9d9f793b4f
add metrics for sent messages by topic and peer (#220) 2020-06-15 17:39:03 -06:00
Dmitriy Ryajov
3c4c10d871
con't crash on nil ptr 2020-06-15 13:37:25 -06:00
Dmitriy Ryajov
7cb6c81159
Don't modify iterables while iterating them (#219)
* don't modify iterables while iterating

* assert handlers to properly close connections
2020-06-15 12:30:09 -06:00
Dmitriy Ryajov
9cd47fe816
add a logScope to make tracing less ugly (#218)
* add a logScope to make tracing less ugly

* don't crash on nil pointer
2020-06-15 12:10:41 -06:00
Dmitriy Ryajov
85b56d0b3a
Observedaddr (#217)
* send correct observerAddr

* run tests with info log level

* set observedaddr for channels
2020-06-12 19:56:17 -06:00
Oskar Thorén
f97e2deec7
Make methods in FloodSub, GossipSub public (#216)
Similar to https://github.com/status-im/nim-libp2p/pull/193 but doing it for all
methods to avoid this issue in PubSub in the future. Got hit by this behavior
again in rpcHandler and took me a while to figure out.

See https://github.com/oskarth/nim-private-method-skipping-case/ for minimal
repro
2020-06-12 17:54:12 -06:00
Dmitriy Ryajov
ac04ca6e31
make sure keys exist and more metrics (#215) 2020-06-11 20:20:58 -06:00
Dmitriy Ryajov
55a294a5c9
better pubsub metrics (#214) 2020-06-11 12:09:34 -06:00
Dmitriy Ryajov
6b196ad7b4
remove pubsub peer on disconnect (#212)
* remove pubsub peer on disconnect

* make sure lock is aquired

* add $

* count upgrades/dials/disconnects
2020-06-11 08:45:59 -06:00