Christian Muehlhaeuser
169f2d4139
Avoid unnecessary conversions ( #685 )
No need to convert these types.
5 years ago
Christian Muehlhaeuser
40cb489097
Fixed typos ( #680 )
Just a few nit-picky typo fixes.
5 years ago
Raúl Kripalani
e69d17141c
integrate the event bus, handle protocol update events, make identify emit deltas ( #659 )
5 years ago
Raúl Kripalani
d87f89314c
Consolidate abstractions and core types into go-libp2p-core ( #601 )
6 years ago
Steven Allen
d0ab45164c
ping: simplify ping loop
6 years ago
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
6 years ago
vyzo
3697552406
handle misbehaving peers in identify push
6 years ago
vyzo
8fa257cdf0
track context given in identify constructor and use it to gate identify push
6 years ago
vyzo
bf651ca7c7
use a single, NoDial context in identify push
6 years ago
vyzo
a88ae79f6f
use transientTTL for invalidated addrs instead of 0
6 years ago
vyzo
06391d4f2f
replace peer addresses in identify
6 years ago
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
6 years ago
vyzo
efdc140264
raise activation channel capacity to 16
6 years ago
vyzo
fe7ba05e38
delete empty address sets on observed address set gc
6 years ago
vyzo
17001b24dd
use a read/write lock for observed address set
6 years ago
vyzo
f4af8d493d
fix identify tests
6 years ago
vyzo
9b8192b7d2
initialize ttl in ObservedAddrSet
6 years ago
vyzo
b8a152f593
use a background worker for updating/gcing the observed address set
6 years ago
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.
6 years ago
Steven Allen
316f0867f6
identify: avoid parsing/printing multiaddrs
6 years ago
Steven Allen
aebe405680
test: disable TestAddAddrsProfile when the race detector is enabled
6 years ago
whyrusleeping
a7eb2efe4b
move things outside of the lock in obsaddr
6 years ago
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.
6 years ago
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.
6 years ago
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.
6 years ago
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 .
6 years ago
Jakub Sztandera
533d9866c6
gx publish 6.0.34
6 years ago
Abhishek Upperwal
36a2645306
removing redundant if condition
6 years ago
Abhishek Upperwal
3ae2d75e46
added comments for clarity
6 years ago
Abhishek Upperwal
88d98287ff
suppressing error msg for NoSecurity option
6 years ago
Steven Allen
00ba6a165a
deflake identify test
This was probably failing (rarely) due to the fact that we're shrinking the
timeout asynchronously (I think?).
6 years ago
vyzo
7fabe39290
parallel identify push
6 years ago
vyzo
4ea04c23b3
identify: implement identify push protocol
6 years ago
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.
6 years ago
vyzo
48e0effd6a
resolve import cycle in ping test
6 years ago
vyzo
a768598c50
free standing Ping function
6 years ago
Can ZHANG
92ec4b2d18
Updates due to code review
6 years ago
Can ZHANG
96df62bd5b
Changes on discussion
- map internal -> []{external -> { observer -> [time, direction] } }
- some cleaning
6 years ago
Can ZHANG
b4e4d496ea
Fix test
6 years ago
Can ZHANG
d859fb0dd7
Track more info for observed addresses
6 years ago
QYuan
38abbc9128
Delete extra comments
6 years ago
Steven Allen
e436bcc391
always remove connection from identify service map
fixes #419
Also call FullClose in a goroutine; no need to block this.
(not happy with that but I'm starting to think we need to rethink stream
closing, again...)
6 years ago
Steven Allen
f6ad991bb5
update gogo protobuf
and regenerate protobuf files
6 years ago
Steven Allen
2e13245085
reset when we fail in identify
6 years ago
Steven Allen
72df25af76
always reset ping streams when done
Currently, we leak a stream. We could use FullClose but, IMO, it's not worth it.
We might as well just reset and walk away.
6 years ago
Steven Allen
b4428fda58
reduce error to warning and log the error
This happens all the time in tests where we intentionally use fake keys for
performance.
Anyways, users probably don't want their logs spammed with errors they can't do
anything about.
6 years ago
Steven Allen
41c6834850
refactor for transport changes
Also, make the libp2p constructor fully useful. There should now be no need to
manually construct a swarm/host.
7 years ago
Steven Allen
5f75373b53
make the identify test less racy
7 years ago
Steven Allen
d7c4c0a202
add test for forgetting address records
7 years ago
Steven Allen
ea95a94e78
register identify service netNotify
This way, we actually process disconnect notifications (and reduce the lifetime
on peer addr records).
7 years ago