Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move go-libp2p-autonat to p2p/host/autonat #1273

Merged
merged 162 commits into from
Jan 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
f0b7fc9
protobuf
vyzo May 5, 2018
1ad785c
basic client
vyzo May 5, 2018
76d49e1
add E_BAD_REQUEST to protobuf
vyzo May 6, 2018
6d61b52
service implementation
vyzo May 6, 2018
645e280
NAT autodetection
vyzo May 6, 2018
a713aff
remove left-over design notes
vyzo May 6, 2018
7fc0024
don't delete autonat peers on disconnect, just mark them as disconnected
vyzo May 6, 2018
ae91177
we only track autonat peers
vyzo May 6, 2018
edf41b4
fix autonat peer tracking
vyzo May 6, 2018
82a7aa9
add TODO in service about skipping private network addresses
vyzo May 6, 2018
bd18d4e
add network notifee
vyzo May 6, 2018
e9f8bf9
don't try to dial private network addresses
vyzo May 6, 2018
8af7aac
add localhost to private addr ranges
vyzo May 6, 2018
ea2e287
no need to select; it's a one shot sync
vyzo May 7, 2018
1c0355d
typed NATStatus constants
vyzo May 7, 2018
da3f7b5
bump initial autodiscovery delay to 15s
vyzo May 7, 2018
2584bc5
AutoNATState is AmbientAutoNAT
vyzo May 8, 2018
003e697
variables for background delays
vyzo May 8, 2018
f36100a
named magic number incantations
vyzo May 9, 2018
7f690dc
refactor getPeers for locked scope
vyzo May 9, 2018
bdb5781
don't throw away read errors; log them.
vyzo May 9, 2018
9c5851a
simplify autonat client itnerface
vyzo May 9, 2018
55cd73a
mutex hat
vyzo May 11, 2018
889081e
docstrings and another mutex hat.
vyzo May 11, 2018
7ea67c6
improve docstring for NewAutoNAT
vyzo May 11, 2018
81477e5
improve NATStatusUknown docstring
vyzo May 11, 2018
ce8aa43
fix typo
vyzo May 12, 2018
30134cf
regenerate protobuf
vyzo Sep 7, 2018
fc32ec3
svc: construct dialer host without listen addrs
vyzo Sep 8, 2018
9d20474
accept libp2p options for the dialer constructor in NewAutoNATService
vyzo Sep 8, 2018
a023467
make service dialback timeout configurable; useful for tests
vyzo Sep 8, 2018
bc61d55
basic service tests
vyzo Sep 8, 2018
b88d3b6
test for ambient autonat functionality
vyzo Sep 8, 2018
9d3db84
address review comments
vyzo Sep 29, 2018
744bf71
use the protocol list by identify, don't emit chatter on every connec…
vyzo Sep 29, 2018
c640cd8
add observed address to the dialback set
vyzo Oct 3, 2018
8c66f57
ensure test hosts are only on loopback
vyzo Oct 3, 2018
cb0e193
add /libp2p prefix in protocol string
vyzo Oct 3, 2018
88ad7b7
configurable throttle for service rate limiter
vyzo Oct 3, 2018
2d5d58c
call AutoNATService.peers something else (reqs)
vyzo Oct 3, 2018
5ada32f
use more peer dial errors for increased confidence in NATPrivate state
vyzo Oct 4, 2018
ab67096
use more peers if less than 3 are connected
vyzo Oct 4, 2018
bff416b
adjust AutoNATRetryInterval in autonat tests
vyzo Oct 4, 2018
d15e65b
increase identify delay to 500ms
vyzo Oct 12, 2018
810238c
jenkins file
vyzo Oct 12, 2018
590aed0
Add configurable Identify delay, with default value of 5 secs
vyzo Oct 16, 2018
0710dd3
add docstring for confidence
vyzo Oct 16, 2018
2c67a96
extract service from package
vyzo Oct 16, 2018
0bc8c80
add docstring for IsPublicAddr
vyzo Oct 16, 2018
3342355
service implementation
vyzo Oct 16, 2018
b11fa1c
move addr.go to go-multiaddr-net
vyzo Oct 16, 2018
605e4e6
IsPublicAddr lives in multiaddr-net
vyzo Oct 16, 2018
9a4502a
add address factory
vyzo Oct 17, 2018
00f3153
make getAddrs a static argument (not variadic)
vyzo Oct 18, 2018
a45f261
Merge pull request #2 from libp2p/feat/extract-svc
vyzo Oct 18, 2018
c98eb14
update test for AutoNATClient constructor change
vyzo Oct 25, 2018
179ba24
track autonat peer addresses
vyzo Dec 20, 2018
77a2de0
Merge pull request #7 from libp2p/feat/peer-addrs
vyzo Dec 21, 2018
fb9be13
gx publish 1.0.7
Kubuxu Feb 18, 2019
a615c18
mutex protect Status to pacify the race detector
vyzo Mar 2, 2019
5ab68af
lock peer table in test to pacify the race detector
vyzo Mar 2, 2019
6d26667
Merge pull request #17 from libp2p/fix/issue-16
vyzo Mar 5, 2019
3b89938
remove Jenkinsfile.
raulk Mar 11, 2019
53419e7
remove Jenkinsfile.
raulk Mar 11, 2019
58baf56
reduce dialback timeout to 15s
vyzo Mar 31, 2019
60c946c
Merge pull request #17 from libp2p/feat/short-timeout
vyzo Apr 1, 2019
a79b935
parallelize dialbacks
vyzo Apr 1, 2019
3c9b530
reset confidence when there is a public<->private transition
vyzo Apr 1, 2019
7c7e813
use anonymous struct for collecting dialback results
vyzo Apr 2, 2019
946f564
add comments for status flips dropping confidence to 0
vyzo Apr 2, 2019
0bdfbe0
don't flip to status unknown on first faiulure, use the confidence level
vyzo Apr 2, 2019
7970ca4
defer wg.Done
vyzo Apr 3, 2019
c0eb2b1
Merge pull request #20 from libp2p/feat/parallel-dialback
vyzo Apr 4, 2019
17bfd15
full close the autonat stream
Stebalien Apr 9, 2019
745284d
fully close the autonat client stream
Stebalien Apr 9, 2019
09f1d4e
Merge pull request #20 from libp2p/fix/full-close
Stebalien Apr 9, 2019
676df1b
Merge pull request #21 from libp2p/fix/full-close
Stebalien Apr 9, 2019
0df8d18
migrate to consolidated types. (#23)
raulk May 26, 2019
9ad01ee
migrate to consolidated types. (#21)
raulk May 26, 2019
afa8538
Update autonat.proto
prestonvanloon Sep 24, 2019
14cc005
Merge pull request #26 from prestonvanloon/patch-1
vyzo Sep 25, 2019
2a821c4
chore(dep): update
Stebalien Oct 28, 2019
53f3cc4
Merge pull request #27 from libp2p/chore/update-deps
Stebalien Oct 28, 2019
373245d
Emit events when NAT status changes (#25)
magik6k Jun 25, 2019
44def81
unit tests for event updation
aarshkshah1992 Feb 6, 2020
0713eb4
Merge pull request #38 from aarshkshah1992/feat/autonat-evt-completion
vyzo Feb 6, 2020
51b740b
Merge pull request #37 from libp2p/stabilize
vyzo Feb 6, 2020
b952c16
rate limiting and selectivity of autonat svc
willscott Feb 13, 2020
10b0a94
cleaner addrToIP implementation
willscott Feb 21, 2020
426d729
cleanup addrToIP logic
willscott Feb 25, 2020
9dcbc44
limit autonat-svc to LocalRoutabilityPublic nodes
willscott Feb 25, 2020
44e9abe
address review comments
willscott Feb 26, 2020
370d2ef
Add option for forcing service startup
willscott Feb 27, 2020
3a21c6d
skip locally held addresses
willscott Feb 27, 2020
4ef5784
Merge branch 'feat/ratelimit' into feat/delaystart
willscott Mar 2, 2020
3069cfe
unadvertise autonat service when private.
willscott Mar 3, 2020
b7f53da
force net connection in autonat svc
willscott Mar 4, 2020
edaee9d
update to single event type
willscott Mar 5, 2020
41ac79c
mitigate race in test
willscott Mar 6, 2020
43e6a96
additional tests
willscott Mar 9, 2020
5817227
bump to new go-multiaddr-net
willscott Mar 10, 2020
f7a9551
Merge pull request #45 from libp2p/feat/delaystart
willscott Mar 10, 2020
96fc42d
Simplify Autonat Structure
willscott Mar 11, 2020
eee717b
change autonat interface to use functional options
willscott Mar 12, 2020
4548d1e
remove a foot-gun
willscott Mar 12, 2020
e617762
Merge branch 'service' into feat/merged
willscott Mar 12, 2020
c28fb84
Merge pull request #53 from libp2p/feat/opt
willscott Mar 16, 2020
e1841d8
Integrate service into autonat
willscott Mar 12, 2020
58d9855
Merge pull request #54 from libp2p/feat/merged
willscott Mar 18, 2020
5c496af
Add option to force nat into a specified reachability state
willscott Mar 18, 2020
3ec0ac0
simplify service enable/disable interface
willscott Mar 19, 2020
42a3e6f
switch enablement to not happen in svc constructor
willscott Mar 19, 2020
c216665
Merge pull request #55 from libp2p/feat/override
Stebalien Mar 20, 2020
09d3ae4
skip dial attempts to non-public peers (#59)
willscott Mar 23, 2020
0d304cb
factor out dial policy (#62)
willscott Mar 25, 2020
10fc365
Run Autonat Service while in unknown connectivity mode
willscott Apr 7, 2020
70bf3c1
Merge pull request #75 from libp2p/feat/unknownservice
willscott Apr 8, 2020
f6bfa82
react to incoming events
willscott Mar 25, 2020
92a3a76
clarify dialPolicy comment
willscott Apr 16, 2020
9e9bcd1
refactor / separation of events and scheduling
willscott Apr 23, 2020
439837b
address nits
willscott Apr 30, 2020
f2f7911
Merge pull request #65 from libp2p/feat/incomingevent
willscott Apr 30, 2020
9db24a7
fix: a type switch nit
Stebalien Apr 30, 2020
fc59437
Merge pull request #83 from libp2p/fix/switch-nit
Stebalien Apr 30, 2020
67e4a6d
upgrade deps + interoperable uvarint delimited writer/reader. (#95)
raulk Jul 30, 2020
ec8d960
static nat shouldn't call host.Addrs()
willscott Aug 3, 2020
50313bd
feat: update to go-libp2p-core 0.7.0
Stebalien Sep 2, 2020
87e9356
chore: update pb
Stebalien Sep 2, 2020
be059b4
Merge pull request #97 from libp2p/feat/rw-stream
Stebalien Sep 2, 2020
fad8fa6
fix: stream read timeout
aarshkshah1992 Dec 17, 2020
bb295a9
replace the port number for double NAT mapping
huo-ju Feb 18, 2021
f193d0e
a better implementation to replace the port number for double NAT map…
huo-ju Feb 19, 2021
31eb896
bug fixed. don't jump out of the loop if obsaddr be replaced
huo-ju Feb 19, 2021
aab65a0
Update svc.go
huo-ju Feb 22, 2021
f9b60bf
improve readability from the review comments
huo-ju Feb 22, 2021
7c1a12b
Merge pull request #101 from huo-ju/master
willscott Feb 22, 2021
f66422d
fix: simplify address replacement
Stebalien Feb 25, 2021
69ad32b
Merge pull request #102 from libp2p/feat/replace-addr
Stebalien Feb 25, 2021
9aafa35
Merge pull request #99 from libp2p/fix/timeout-incoming-stream-reads
Stebalien Feb 25, 2021
3d1b86d
fix staticcheck
marten-seemann May 5, 2021
bf03b19
Merge pull request #103 from libp2p/fix-staticcheck
marten-seemann May 5, 2021
b5fc65d
disable failing integration test
marten-seemann Aug 25, 2021
ed8d4d6
Merge pull request #108 from libp2p/disable-failing-integration-test
marten-seemann Aug 25, 2021
a984268
set both read and write deadline in the stream handler
marten-seemann Aug 25, 2021
21eb6be
also set a deadline on the stream opened by the client
marten-seemann Aug 25, 2021
a3f6310
add missing stream reset when the server sent the wrong message type
marten-seemann Aug 25, 2021
0eefbaa
Merge pull request #107 from libp2p/fix-deadlines
Stebalien Aug 25, 2021
9002f31
remove context from constructor, implement a proper Close method
marten-seemann Aug 29, 2021
ab45096
add Close method to interface, fix closing of StaticAutoNAT
marten-seemann Aug 29, 2021
8961023
remove unused context form autoNATService
marten-seemann Aug 30, 2021
8cc74d3
Merge pull request #109 from libp2p/clean-shutdown
marten-seemann Aug 30, 2021
d2bf1c6
feat: plumb through contexts from peerstore (#111)
guseggert Nov 10, 2021
287375a
chore: update go-log to v2 (#114)
marten-seemann Dec 7, 2021
d70ee3d
clean up dialer peerstore after each dial
marten-seemann Dec 10, 2021
60188e3
Merge pull request #115 from libp2p/cleanup-peerstore
marten-seemann Dec 10, 2021
2486dd7
speed up the tests (#119)
marten-seemann Dec 21, 2021
c63fd46
fix flaky tests (#120)
marten-seemann Dec 22, 2021
09b1f8a
fix flaky TestAutoNATServiceRateLimitJitter (#121)
marten-seemann Dec 22, 2021
cfb9b36
fix flaky TestAutoNATIncomingEvents (#123)
marten-seemann Dec 22, 2021
d3f7b82
Merge remote-tracking branch 'p2p/host/autonat/master' into merge-repo
marten-seemann Dec 22, 2021
741348e
update import paths to use p2p/host/autonat
marten-seemann Dec 20, 2021
5eeba53
don't use a separate Go module for the autonat tests
marten-seemann Jan 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import (
"github.com/libp2p/go-libp2p-core/transport"
"github.com/libp2p/go-libp2p-peerstore/pstoremem"

"github.com/libp2p/go-libp2p/p2p/host/autonat"
"github.com/libp2p/go-libp2p/p2p/host/autorelay"
bhost "github.com/libp2p/go-libp2p/p2p/host/basic"
routed "github.com/libp2p/go-libp2p/p2p/host/routed"
circuitv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client"
relayv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay"
"github.com/libp2p/go-libp2p/p2p/protocol/holepunch"

autonat "github.com/libp2p/go-libp2p-autonat"
blankhost "github.com/libp2p/go-libp2p-blankhost"
discovery "github.com/libp2p/go-libp2p-discovery"
swarm "github.com/libp2p/go-libp2p-swarm"
Expand Down
2 changes: 0 additions & 2 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,6 @@ github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS
github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo=
github.com/libp2p/go-libp2p-asn-util v0.1.0 h1:rABPCO77SjdbJ/eJ/ynIo8vWICy1VEnL5JAxJbQLo1E=
github.com/libp2p/go-libp2p-asn-util v0.1.0/go.mod h1:wu+AnM9Ii2KgO5jMmS1rz9dvzTdj8BXqsPR9HR0XB7I=
github.com/libp2p/go-libp2p-autonat v0.7.0 h1:rCP5s+A2dlhM1Xd66wurE0k7S7pPmM0D+FlqqSBXxks=
github.com/libp2p/go-libp2p-autonat v0.7.0/go.mod h1:uPvPn6J7cN+LCfFwW5tpOYvAz5NvPTc4iBamTV/WDMg=
github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ=
github.com/libp2p/go-libp2p-blankhost v0.3.0 h1:kTnLArltMabZlzY63pgGDA4kkUcLkBFSM98zBssn/IY=
github.com/libp2p/go-libp2p-blankhost v0.3.0/go.mod h1:urPC+7U01nCGgJ3ZsV8jdwTp6Ji9ID0dMTvq+aJ+nZU=
Expand Down
2 changes: 0 additions & 2 deletions examples/ipfs-camp-2019/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,6 @@ github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS
github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo=
github.com/libp2p/go-libp2p-asn-util v0.1.0 h1:rABPCO77SjdbJ/eJ/ynIo8vWICy1VEnL5JAxJbQLo1E=
github.com/libp2p/go-libp2p-asn-util v0.1.0/go.mod h1:wu+AnM9Ii2KgO5jMmS1rz9dvzTdj8BXqsPR9HR0XB7I=
github.com/libp2p/go-libp2p-autonat v0.7.0 h1:rCP5s+A2dlhM1Xd66wurE0k7S7pPmM0D+FlqqSBXxks=
github.com/libp2p/go-libp2p-autonat v0.7.0/go.mod h1:uPvPn6J7cN+LCfFwW5tpOYvAz5NvPTc4iBamTV/WDMg=
github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ=
github.com/libp2p/go-libp2p-blankhost v0.3.0 h1:kTnLArltMabZlzY63pgGDA4kkUcLkBFSM98zBssn/IY=
github.com/libp2p/go-libp2p-blankhost v0.3.0/go.mod h1:urPC+7U01nCGgJ3ZsV8jdwTp6Ji9ID0dMTvq+aJ+nZU=
Expand Down
2 changes: 0 additions & 2 deletions examples/pubsub/chat/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@ github.com/libp2p/go-flow-metrics v0.0.3 h1:8tAs/hSdNvUiLgtlSy3mxwxWP4I9y/jlkPFT
github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs=
github.com/libp2p/go-libp2p-asn-util v0.1.0 h1:rABPCO77SjdbJ/eJ/ynIo8vWICy1VEnL5JAxJbQLo1E=
github.com/libp2p/go-libp2p-asn-util v0.1.0/go.mod h1:wu+AnM9Ii2KgO5jMmS1rz9dvzTdj8BXqsPR9HR0XB7I=
github.com/libp2p/go-libp2p-autonat v0.7.0 h1:rCP5s+A2dlhM1Xd66wurE0k7S7pPmM0D+FlqqSBXxks=
github.com/libp2p/go-libp2p-autonat v0.7.0/go.mod h1:uPvPn6J7cN+LCfFwW5tpOYvAz5NvPTc4iBamTV/WDMg=
github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ=
github.com/libp2p/go-libp2p-blankhost v0.3.0 h1:kTnLArltMabZlzY63pgGDA4kkUcLkBFSM98zBssn/IY=
github.com/libp2p/go-libp2p-blankhost v0.3.0/go.mod h1:urPC+7U01nCGgJ3ZsV8jdwTp6Ji9ID0dMTvq+aJ+nZU=
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ require (
github.com/libp2p/go-conn-security-multistream v0.3.0
github.com/libp2p/go-eventbus v0.2.1
github.com/libp2p/go-libp2p-asn-util v0.1.0
github.com/libp2p/go-libp2p-autonat v0.7.0
github.com/libp2p/go-libp2p-blankhost v0.3.0
github.com/libp2p/go-libp2p-circuit v0.4.0
github.com/libp2p/go-libp2p-core v0.13.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,6 @@ github.com/libp2p/go-flow-metrics v0.0.3 h1:8tAs/hSdNvUiLgtlSy3mxwxWP4I9y/jlkPFT
github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs=
github.com/libp2p/go-libp2p-asn-util v0.1.0 h1:rABPCO77SjdbJ/eJ/ynIo8vWICy1VEnL5JAxJbQLo1E=
github.com/libp2p/go-libp2p-asn-util v0.1.0/go.mod h1:wu+AnM9Ii2KgO5jMmS1rz9dvzTdj8BXqsPR9HR0XB7I=
github.com/libp2p/go-libp2p-autonat v0.7.0 h1:rCP5s+A2dlhM1Xd66wurE0k7S7pPmM0D+FlqqSBXxks=
github.com/libp2p/go-libp2p-autonat v0.7.0/go.mod h1:uPvPn6J7cN+LCfFwW5tpOYvAz5NvPTc4iBamTV/WDMg=
github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ=
github.com/libp2p/go-libp2p-blankhost v0.3.0 h1:kTnLArltMabZlzY63pgGDA4kkUcLkBFSM98zBssn/IY=
github.com/libp2p/go-libp2p-blankhost v0.3.0/go.mod h1:urPC+7U01nCGgJ3ZsV8jdwTp6Ji9ID0dMTvq+aJ+nZU=
Expand Down
Loading