Commit Graph

574 Commits

Author SHA1 Message Date
Will Scott 85a83edf80
defer subscription closes 2020-02-27 10:10:42 -08:00
Will Scott f5386bdf79
autorelay triggers on NAT events
better use of the event bus between these two
2020-02-26 19:38:50 -08:00
Steven Allen 7ba322244e emit identify events and avoid advertising localhost
* fix(identify): announce localhost as long as one side of the connection is local (#742)
* identify: emit events on completion/failure. (#660)
* identify: Update addr advertise logic to exclude localhost addrs… (#657)

This is a rollup of the stabilize fixes.

Co-authored-by: bigs <cole@protocol.ai>
Co-authored-by: Raúl Kripalani <raul@protocol.ai>
2020-02-21 12:45:25 -05:00
Steven Allen 9ee9d94ea2
chore(ci): fix a flaky test (#787)
Timing tests never work well in CI.
2020-02-05 18:05:37 +00:00
Steven Allen 76944c4fc8
Merge pull request #705 from libp2p/feat/static-relays
options to configure static relays for autorelay
2020-01-17 05:22:16 -08:00
optman 3f43dfe646 enable non-public address port mapping announcement 2020-01-15 18:38:39 +08:00
Steven Allen 9073eaaf8f fix: demote stream deadline errors to debug logs
Otherwise, we spam an error every time we try to negotiate a protocol on a
closed stream (e.g., when the underlying connection closes on us).
2020-01-03 09:14:43 -08:00
Steven Allen e5d28696f5 feat(host): recursively resolve addresses
We currently only resolve /dnsaddr addresses once. This patch resolves up to 32
dnsaddr addresses per dial.

fixes https://github.com/libp2p/go-libp2p/issues/744
2019-12-16 15:53:51 +01:00
Hector Sanjuan 7e49c66219 Identify: Make activation threshold configurable
Also: fix the comments and try to explain how the activation/aliveness of
addresses happen (and write the correct defaults).
2019-11-05 12:18:55 +01:00
Steven Allen 94d7efc58e chore(dep): update libp2p-core and protobuf
* Enforces 2048 bit RSA keys when using OpenSSL
* Updates go-multiaddr-dns for /dns support.
* Update gogo/protobuf and regenerate all protobufs.
2019-10-28 16:41:54 -07:00
vyzo 9cd56c0bab use a global variable for default relays
and rename DefaultRelays option to DefaultStaticRelays.
2019-10-08 13:01:29 +03:00
Steven Allen 1938505f5a dep: update go-multiaddr
for https://github.com/multiformats/go-multiaddr/issues/108
2019-09-18 23:02:37 -07:00
Raúl Kripalani 9cf6af474b add godocs. 2019-08-28 11:50:26 +01:00
vyzo 235848850e options to configure known relays for autorelay 2019-08-16 13:02:03 +03:00
Steven Allen e337633824 set a default client-version using go modules
This should help us improve network stats on who's using libp2p.
2019-08-12 19:13:22 -07:00
Steven Allen d73a51776e new: allow overriding the user-agent with an option
Instead of using a global variable.

This also:

* Adds an option to the identify service to set the user agent.
* Removes the ability to pass an identify service to NewHost as any reasonable
  Identify service already needs to be constructed with an instance of the host.
2019-08-12 19:13:21 -07:00
Cole Brown c261182d50 Adjust test timings for Ed25519 2019-08-02 18:05:59 -04:00
Cole Brown a80fc34f3a Update deps, mocknet tests 2019-08-02 18:05:59 -04:00
vyzo b3085753dc autorelay: ensure candidate relays can hop 2019-08-02 21:14:01 +03:00
Steven Allen 2fbe88f546
Merge pull request #667 from libp2p/fix/listen-addrs-mdns
mdns: always use interface addresses
2019-07-22 15:42:39 -07:00
Christian Muehlhaeuser c73d2b9c8e Added missing error check in test (#683) 2019-07-22 13:46:45 +01:00
Christian Muehlhaeuser 169f2d4139 Avoid unnecessary conversions (#685)
No need to convert these types.
2019-07-22 13:46:15 +01:00
Christian Muehlhaeuser 038cff7946 Simplify increments (#684) 2019-07-22 13:45:37 +01:00
Raúl Kripalani 5df2167ca9
Removed ineffectual assignments (#682)
We don't use `cs` here, drop it.
2019-07-22 13:45:02 +01:00
Christian Muehlhaeuser 0603b30056 Make use of time.Until & time.Since (#681)
No need to manually subtract timestamps.
2019-07-22 13:44:47 +01:00
Christian Muehlhaeuser 40cb489097 Fixed typos (#680)
Just a few nit-picky typo fixes.
2019-07-22 13:44:24 +01:00
Christian Muehlhaeuser a7ce9cc593
Removed ineffectual assignments
We don't use `cs` here, drop it.
2019-07-22 02:38:39 +02:00
Steven Allen 554a8e7bed mdns: always use interface addresses
We don't want to use the transformed/munged host addresses for local
announcements. Ideally, we'd take a more scientific approach to this (i.e.,
"host, please give me addresses relative to X") but we can't do that yet.
2019-07-15 21:04:05 -07:00
Raúl Kripalani 1cec1b9191 remove superfluous goroutine; avoid t.Fatal from goroutines. 2019-07-10 18:29:46 +01:00
Raúl Kripalani 8e4bc2ee2c fix #672: wait until done; fix ponger response. 2019-07-10 15:54:09 +01:00
Raúl Kripalani 9797b07de4 TestStreamsStress: reduce node count, increase stream density. 2019-07-10 14:52:26 +01:00
Steven Allen 3755b9afd6 test: full-close streams in stream stress test 2019-07-04 13:18:27 -07:00
Steven Allen 4c28cc75df test: fix test fallout from notify push 2019-07-04 13:11:48 -07:00
Steven Allen 3a41aa03ac test: mark helpers 2019-07-04 12:56:20 -07:00
Steven Allen 97f639055e test: ensure double-closing the host doesn't cause any issues 2019-07-04 12:47:33 -07:00
Steven Allen 428d7135a5 doc: ensure nobody tries to add teardown logic to the host close function again 2019-07-04 12:46:17 -07:00
Steven Allen 2f06021e0c fix: use the goprocess for closing
fixes #668
2019-07-04 12:32:01 -07:00
Raúl Kripalani e69d17141c
integrate the event bus, handle protocol update events, make identify emit deltas (#659) 2019-06-24 14:44:47 +01:00
Steven Allen 1449765980 basic_host: ensure we close correctly when the context is canceled
As long as we _accept_ a context, we need to obey it.
2019-06-13 11:14:44 -07:00
Raúl Kripalani d87f89314c
Consolidate abstractions and core types into go-libp2p-core (#601) 2019-05-26 22:55:46 +01:00
Steven Allen 192e96f186 test: increase delay for backpressure
CI is really slow.
2019-05-21 20:18:09 -07:00
Steven Allen 97d03a46b4 test: add a small delay to deal with write coalescing 2019-05-21 17:08:35 -07:00
vyzo 3437213b5f close connection manager 2019-05-21 14:03:28 +03:00
vyzo 70c4f155e7 advertise for relay services every 30min 2019-05-17 22:14:16 +03:00
vyzo 0a221500fd update use of discovery.FindPeers for new interface 2019-05-17 22:05:57 +03:00
Steven Allen 95cc0beda9
Merge pull request #626 from libp2p/fix/ping
ping: return a stream of results
2019-05-08 14:01:01 -07:00
Steven Allen 1b9cf3e2cb test: disable flaky autorelay test in CI
This keeps breaking travis.
2019-05-07 15:53:37 -07:00
Steven Allen d0ab45164c ping: simplify ping loop 2019-05-07 15:47:55 -07:00
Steven Allen d3d5351d81 ping: return a stream of results
Otherwise, we can't return errors. This is a breaking change but unlikely to
have a large impact on anyone but go-ipfs.

Part of https://github.com/ipfs/go-ipfs/issues/6298
2019-05-07 15:47:52 -07:00
vyzo b8616c65b3 use cancelable background context in identify 2019-05-07 21:33:19 +03:00
vyzo ba00011d34 avoid intermediate allocation in relayAddrs
now that we have the lock for the duration of the method, we don't need the intermediate
relays array. This removes it, and also extends the pre-allocation of the result array
by 2 so that it can cover two localhost and two private address bindings.
2019-04-22 20:26:02 +03:00
vyzo 97f1e71e86 cache relayAddrs for a short period of time 2019-04-22 19:48:01 +03:00
vyzo abfb4c8901 fix bug in findRelaysOnce: it connects to all relays 2019-04-21 11:18:24 +03:00
Steven Allen 776a53a370 autorelay: break findRelays into multiple functions and avoid the goto
(@stebalien is picky and opinionated...)
2019-04-20 14:26:48 -07:00
Steven Allen 9fc5c962b6
Merge pull request #598 from libp2p/feat/moar-relays
autorelay: curtail addrsplosion
2019-04-20 13:46:20 -07:00
vyzo 8d073cec9e kill the parallel query logic in selectRelays; let it be random
the presence of stashed query results from discovery in the peerstore _biases_ the
selection towards fully DHT nodes, which penalizes dedicated relays.
2019-04-20 13:34:13 +03:00
vyzo 35e805dc41 add ignore list to account for connection failures 2019-04-20 11:50:06 +03:00
vyzo 4629431a12 some tweaks
- select 25 of 50 relays instead of 20
- increase connect timeout to 30s
2019-04-20 11:17:10 +03:00
vyzo f9e182f747 gate max number of retries in findRelays 2019-04-20 06:31:51 +03:00
vyzo 1a8111970b reduce scope of the lock, pre-allocate result slice in relayAddrs 2019-04-20 06:25:37 +03:00
vyzo 5c9299a45c pacify the race detector 2019-04-20 01:52:56 +03:00
vyzo 4727d5b849 don't preallocate result array, we don't know how long it will be 2019-04-20 01:40:29 +03:00
vyzo c09717275b compute relay address set dynamically 2019-04-20 00:54:44 +03:00
vyzo f4f924e1d4 don't track relay addrs, use the peerstore 2019-04-20 00:04:26 +03:00
vyzo bd22c49b0d remove redundant private addr check when constructing our relay address set
findRelays cleans up address sets now for addrsplosion, and this removes private
addrs as well.
2019-04-19 20:49:54 +03:00
vyzo f17a4a8667 preallocate map in sameAddrs 2019-04-19 20:03:53 +03:00
vyzo ebc5d16f5d use a map in sameAddrs to avoid quadratic behaviour 2019-04-19 20:03:53 +03:00
vyzo 3697552406 handle misbehaving peers in identify push 2019-04-19 20:03:53 +03:00
vyzo c73f68bdb4 explicit Start method for basic host 2019-04-19 20:03:53 +03:00
vyzo c9b2f468ba reduce peer count in TestFuzzManyPeers when running under the race detector 2019-04-19 20:03:53 +03:00
vyzo 5845909754 add initialization delay in basic host background task 2019-04-19 20:03:53 +03:00
vyzo 7502fc44c9 add a background task in basic host that periodically pushes identify if needed 2019-04-19 20:03:53 +03:00
vyzo 8fa257cdf0 track context given in identify constructor and use it to gate identify push 2019-04-19 20:03:53 +03:00
vyzo bf651ca7c7 use a single, NoDial context in identify push 2019-04-19 20:03:53 +03:00
vyzo 9b2731e5bb used named constants for dns address protocols 2019-04-19 19:48:28 +03:00
vyzo a8d14f9b02 use addresses from the peerstore if available 2019-04-19 14:09:56 +03:00
vyzo ff4b98a6fc some more addrsplosion tests 2019-04-19 13:58:45 +03:00
vyzo 21c4e1d298 test for privately bound port first when cleaning up addrsplosion 2019-04-19 13:58:10 +03:00
vyzo 528c473840 filter relay addrs in address set cleanup 2019-04-19 13:53:27 +03:00
vyzo 9d7f6b83e5 rewrite isDNSAddr to use ma.SplitFirst 2019-04-19 13:48:18 +03:00
vyzo e82eabe130 cover the case where we can't select a default port in addrsplosion clean up 2019-04-18 14:49:42 +03:00
vyzo a331f99b65 addrsplosion test 2019-04-18 14:42:31 +03:00
vyzo 433a0c0908 extract cleanupAddrSet and implement better heuristic 2019-04-18 14:42:06 +03:00
vyzo 4a4b14819a add comment about eliding the lock on addrs read 2019-04-18 11:42:20 +03:00
vyzo a88ae79f6f use transientTTL for invalidated addrs instead of 0 2019-04-16 21:09:15 +03:00
vyzo 06391d4f2f replace peer addresses in identify 2019-04-16 11:49:32 +03:00
vyzo 27f465ee35 some better logging 2019-04-14 21:30:59 +03:00
vyzo 0830634938 limit number of FindPeer queries in relay selection 2019-04-14 21:19:19 +03:00
vyzo 0c69da9409 move the address invalidation check outside the lock 2019-04-14 17:50:22 +03:00
vyzo 8d5c11c072 fix private->public->private transition issues with address set 2019-04-14 17:40:16 +03:00
vyzo e8e2ab1930 limit relay selection to 20 2019-04-14 17:01:17 +03:00
vyzo c8b8014fd0 gate retry wait with the context 2019-04-14 16:36:52 +03:00
vyzo 376379b5b8 retry to find relays if we fail to connect to any 2019-04-14 16:34:11 +03:00
vyzo 4a6e767da2 log and ignore relay peers with empty address sets 2019-04-14 16:03:58 +03:00
vyzo 081bb0f7ed small tweak in autorelay test 2019-04-14 15:55:45 +03:00
vyzo 8c7da83b55 also check private addresses when looking for 4001 2019-04-14 15:47:46 +03:00
vyzo da65fd74a6 fix and reinstate autorelay test 2019-04-14 15:37:20 +03:00
vyzo 45d2888617 don't drop ephemeral ports in address set clean up 2019-04-14 15:37:01 +03:00
vyzo c9f627e221 increase FindPeer timeout to 30s 2019-04-14 15:06:15 +03:00
vyzo 31dfaf6029 increase relay advertising boot delay to 15min 2019-04-14 14:53:30 +03:00
vyzo 1138fb6040 only determine default port if it is in a public addr 2019-04-14 14:37:33 +03:00
vyzo becb89a245 shuffle relay set before queries 2019-04-14 14:32:31 +03:00
vyzo 39f2b7ad45 fix selectRelays to return promptly when there are query errors 2019-04-14 14:25:30 +03:00
vyzo 765ed0e1a6 select 50 relays 2019-04-14 14:13:36 +03:00
vyzo 9863e22d4a rework relay selection logic 2019-04-14 14:06:13 +03:00
vyzo aa03a9b839 clean up relay address sets to curtail addrsplosion 2019-04-14 12:58:41 +03:00
vyzo a1ebc4d852 reduce relay find peer and connect timeout to 30s 2019-04-13 23:46:41 +03:00
vyzo ffd4981247 increase autorelay discovery limit to 1k 2019-04-13 22:36:29 +03:00
vyzo 1e48e15da7 respect NoDial option in routed host 2019-04-10 23:12:14 +03:00
vyzo a4776e6174 fix panic in observed address activation check
The activated check cleans up, which leads to panics with concurrent reads.
This moves the seenBy set clean up into gc, where it belongs
2019-04-09 21:52:40 +03:00
vyzo efdc140264 raise activation channel capacity to 16 2019-04-09 20:35:36 +03:00
vyzo fe7ba05e38 delete empty address sets on observed address set gc 2019-04-09 14:00:03 +03:00
vyzo 17001b24dd use a read/write lock for observed address set 2019-04-09 13:40:46 +03:00
vyzo f4af8d493d fix identify tests 2019-04-09 13:20:38 +03:00
vyzo 9b8192b7d2 initialize ttl in ObservedAddrSet 2019-04-09 13:19:54 +03:00
vyzo b8a152f593 use a background worker for updating/gcing the observed address set 2019-04-09 12:44:13 +03:00
vyzo e76c8a9c38 don't eagerly update the observed address set in Addrs
allocates and eats a lot of cpu time under the lock;
let a background worker gc periodically.
2019-04-09 12:13:30 +03:00
Steven Allen 316f0867f6 identify: avoid parsing/printing multiaddrs 2019-04-08 18:43:11 -07:00
Steven Allen aebe405680 test: disable TestAddAddrsProfile when the race detector is enabled 2019-04-08 18:30:59 -07:00
whyrusleeping a7eb2efe4b move things outside of the lock in obsaddr 2019-04-08 16:14:05 -07:00
Steven Allen 9fbcf243f9
Merge pull request #577 from libp2p/fix/only-reported-addrs
identify: be more careful about the addresses we store
2019-04-08 10:20:09 -07:00
Steven Allen bcbf7a59c1 identify: only record observed addresses that match an address we're announcing
This is should prevent us from, e.g., announcing relay addresses _just_ because
a peer tells us we're reachable through a relay.
2019-04-08 10:15:42 -07:00
Steven Allen 7093262620 relay: update documentation 2019-04-06 08:12:29 -07:00
vyzo 45df977d57 bump relay record limit to 50 2019-04-06 12:22:12 +03:00
Steven Allen 5b665643c7 relay: only stop advertising relay addresses if we fully disconnect 2019-04-05 19:54:31 -07:00
Steven Allen 80ada8a7d6 relay: no more wrapping
We don't need the host wrappers, we can just replace the filter AddrsFactory.

Also, always filter out relay addresses.
2019-04-05 19:54:26 -07:00
Steven Allen 544c412193 identify: only store _reported_ multiaddrs
We still tell the remote host about the observed addr but we don't store it.
That way, we give them a chance to decide if they want to actually use and
advertise it.

Ideally, we'd distinguish between local information and signed routing
information but we don't do that yet.

This should reduce the address explosion issue where peers learn about
multiple (bad) observed addresses for the same peer. It should also give peers
more control over how they can be dialed.
2019-04-05 13:57:50 -07:00
vyzo 62531f9a10 reduce autorelay boot delay to 20s 2019-04-03 17:27:03 +03:00
vyzo bace7d4ceb autorelay: correctly handle private->public transition 2019-04-03 12:02:49 +03:00
vyzo c3b5ece119 reduce autorelay discovery timeout to 30s 2019-04-03 11:51:26 +03:00
vyzo e2412502a6 reduce autorelay boot delay to 30s 2019-04-03 11:44:16 +03:00
Steven Allen 16a60f9751 reduce nat error level 2019-03-28 02:20:06 +00:00
vyzo 9a5a437772
Merge pull request #563 from libp2p/fix/simplify-unspecific-relay
relay: simplify declaration of multiaddr var
2019-03-18 15:43:59 +02:00
Lars Gierth 7741442478 relay: simplify declaration of multiaddr var 2019-03-18 13:29:00 +01:00
lnykww 5da711dc6c Fix UDP listen on a Unspecified Address and Dial from the Unspecified Address
LocalMultiaddr May return the Unspecified Address, if so, we need to
check if we listen on the Unspecified address and they were equal.
2019-03-14 10:57:19 +08:00
Leonhard Markert 2a7478131a
Fix typos in p2p/net/README.md
"Requet" -> "Request", "tls" -> "TLS"
2019-03-07 03:23:01 +00:00
Steven Allen 5c51323aa2 mock: increase tolerance for latency tests
These were exceeding their tolerances when run under the race detector on CI.
2019-03-06 12:01:08 -08:00
Steven Allen 5b643cde2d mock: reduce peer count in FuzzManyPeers when the race detector is enabled 2019-03-06 11:27:28 -08:00
Steven Allen e96aefc3b3 autorelay: disable consistantly failing auto-relay test 2019-03-06 11:21:25 -08:00
Steven Allen 58f40b9d11 mocknet: fix data race 2019-03-06 11:08:14 -08:00
Steven Allen 8c8f08e36f natmgr: rename refresh to sync 2019-03-06 10:56:49 -08:00
Steven Allen 3617750071 better nat mapping
1. Update to work with https://github.com/libp2p/go-libp2p-nat/pull/14.
2. Avoid observed addrs when our NAT tells us about external addrs.
3. Ignore bad addrs reported by our NAT. Substitute with observed addrs.
4. Fix https://github.com/libp2p/go-libp2p/issues/428.
2019-03-06 10:56:49 -08:00
Jakub Sztandera 533d9866c6 gx publish 6.0.34 2019-02-18 16:01:43 +01:00
Matt Joiner 3b8d83ffdc
Resolve addrs with P2P instead of IPFS (#539) 2019-02-16 12:43:11 +11:00
iulianpascalau b8e47c5dea mock package:
- changed GetStreams function from mock_conn.go to call allStreams which has the same functionality but is concurrent safe
- changed protocol field from mock_stream to be concurrent safe. Taken the implementation from swarm_stream.go
2019-02-14 20:19:03 +02:00
vyzo 7fa37513fd increase initial relay advertisement delay to 30s 2019-02-14 19:26:13 +02:00
vyzo 3a993345d0 use PeerRouting in autorelay to find relay peer addresses 2019-02-12 10:56:54 +02:00
vyzo c5f50f9c2d don't advertise the raw public address in autorelay 2018-12-21 11:20:09 +02:00
Steven Allen 758b516603 mock: export ratelimiter as RateLimiter
Technically a breaking change because I changed the constructor casing but
nobody's using this outside of libp2p (yet), mostly because the type hasn't been
exported.
2018-12-18 21:22:17 -08:00
vyzo a4827ae9dd
Merge pull request #500 from libp2p/feat/autorelay-option
explicit option to enable autorelay
2018-12-05 17:36:47 +02:00
vyzo e0429051e6
Merge pull request #495 from libp2p/fix/advertise-relay
Add delay in initial relay advertisement to allow the dht time to bootstrap
2018-12-05 17:36:16 +02:00
vyzo 5d0a6e23ce use select for initial advertisement delay 2018-12-05 10:02:56 +02:00
vyzo a1b5b9ed53 explicit option to enable autorelay 2018-12-04 12:09:52 +02:00
Abhishek Upperwal 36a2645306 removing redundant if condition 2018-12-02 01:00:46 +05:30
Abhishek Upperwal 3ae2d75e46 added comments for clarity 2018-12-02 00:56:46 +05:30
Abhishek Upperwal 88d98287ff suppressing error msg for NoSecurity option 2018-11-30 16:54:25 +05:30
vyzo 31eb77d446 add delay in initial relay advertisement to allow the dht time to bootstrap 2018-11-29 12:24:40 +02:00
Steven Allen 053f59e053
Merge pull request #480 from libp2p/fix/mock-connect
mocknet: fix NewStream and self dials
2018-11-09 09:26:16 -08:00
Steven Allen 79ba610d21 mocknet: create a connection on NewStream if we need one
That's what the Swarm does and that's what the function's documentation says it
does.
2018-11-08 13:10:16 -08:00
Steven Allen a8e25bf270 mocknet: refuse to connect to self
The swarm does this as well and most of our services will fail if we don't have
this.
2018-11-08 13:10:07 -08:00
Steven Allen 00ba6a165a deflake identify test
This was probably failing (rarely) due to the fact that we're shrinking the
timeout asynchronously (I think?).
2018-11-08 10:49:57 -08:00
Steven Allen f4229470cb mocknet: use peer ID in peer address
RandLocalTCPAddress is mostly useful when we *actually* want to listen on a real
address. Unfortunately, when running a bunch of tests, we can actually run
out.

With this change, a collision means we have a duplicate peer ID so yeah...

fixes #473
2018-11-07 15:42:29 -08:00
vyzo a309f09606 Add note to relay docs about internal interface instability 2018-11-06 09:50:25 +02:00
vyzo 5a1c09c4af use advertised addrs for autonat dial back, not all addrs 2018-11-04 10:52:29 +02:00
vyzo 5d8988f3ee add comment about the unstable nature of BasicHost.PushIdentify 2018-11-04 10:52:29 +02:00
vyzo 69144bd78b extend autorelay test to verify pushing of relay addrs
also check that we don't initially advertise any.
2018-11-04 10:52:29 +02:00
vyzo 0dfca3ba5d increase test AutoNATIdentifyDelay to 100ms
macosx seems to fail intermittently, and that race is the likely culprit.
2018-11-04 10:52:29 +02:00
vyzo 7b324b14b5 remove BasicRouting interface; use PeerRouting and upcast for discovery 2018-11-04 10:52:29 +02:00
vyzo c2d846a7c3 fix go vet issue 2018-11-04 10:52:29 +02:00
vyzo fdfa224699 document doUpdateAddrs 2018-11-04 10:52:29 +02:00
vyzo 4be7ada37b tag relay connections 2018-11-04 10:52:29 +02:00
vyzo e96605d1a3 use /p2p multiaddr 2018-11-04 10:52:29 +02:00
vyzo 84400e22f2 fix typo 2018-11-04 10:52:29 +02:00
vyzo 4f90393629 add a comment 2018-11-04 10:52:29 +02:00
vyzo 67aba4d501 move relay selection strategy out of line 2018-11-04 10:52:29 +02:00
vyzo cc2dd22028 make randezvous key a constant 2018-11-04 10:52:29 +02:00
vyzo 2993fd9a68 add autorelay documentation 2018-11-04 10:52:29 +02:00
vyzo a7e1bf0f15 call the routing interface BasicRouting, alias to top level type 2018-11-04 10:52:29 +02:00
vyzo 89aef893e6 don't adveretise unspecific relay addrs in RelayHost 2018-11-04 10:52:29 +02:00
vyzo dcb8fd2813 fix inverted address selection logic in test 2018-11-04 10:52:29 +02:00
vyzo ee69383c2c extend autorelay test to verify connectivity 2018-11-04 10:52:29 +02:00
vyzo b62c83bd5c better limit adjustment for relay discovery 2018-11-04 10:52:29 +02:00
vyzo f6c38c9d91 filter unspecific relay address 2018-11-04 10:52:29 +02:00
vyzo c6d1eebf15 autorelay test 2018-11-04 10:52:29 +02:00
vyzo 7fabe39290 parallel identify push 2018-11-04 10:52:29 +02:00
vyzo 477c19aac1 reduce boot delay to 60s 2018-11-04 10:52:29 +02:00
vyzo 0ff7393349 fix announced relay address 2018-11-04 10:52:29 +02:00
vyzo 6bdfcac0b4 use AllAddrs as the address factory in autonat 2018-11-04 10:52:29 +02:00
vyzo 5c623f269f name the autorelay logger as such 2018-11-04 10:52:29 +02:00
vyzo 9795a01ba3 configurable boot delay for autorelay 2018-11-04 10:52:29 +02:00
vyzo a5858912d6 autorelay hosts 2018-11-04 10:52:29 +02:00
vyzo a89e74a155 basic host: export AddrsFactory, provide method to push identify 2018-11-04 10:52:29 +02:00
vyzo 4ea04c23b3 identify: implement identify push protocol 2018-11-04 10:52:29 +02:00
Steven Allen 80c5998236 *really* fix the race in mock 2018-10-24 12:58:51 -07:00
Steven Allen 841a6272c6 fix a data-race in the mock net
This was causing https://github.com/ipfs/go-ipfs/pull/5637#issuecomment-432792969
2018-10-24 12:41:12 -07:00
Steven Allen 63256192d7 fix buggy addr equal in test 2018-10-24 08:44:26 -07:00
Steven Allen 7eaeeaa9fe
Merge pull request #461 from libp2p/fix/remove-protocol-version-check
don't disconnect on protocol version mismatch
2018-10-24 07:35:23 -07:00
Steven Allen dd7868a1a7 don't disconnect on protocol version mismatch
Sending a protocol version is nice. However, this "disconnect if our versions
are different" logic makes the version entirely useless (because we can't change
it).

Really, each indevidual protocol is versioned so let's just leave it at that. If
we make a breaking change that requires a protocol bump, we can do that and
then switch on the other side's version. However, we'll have to wait for the
entire network to upgrade for that to work.
2018-10-24 07:00:42 -07:00
vyzo 48e0effd6a resolve import cycle in ping test 2018-10-19 12:47:08 +03:00
vyzo 0fa1c25479 ping service in basic host 2018-10-19 12:28:58 +03:00