220 Commits

Author SHA1 Message Date
Steven Allen
95964c0eac
Merge pull request #422 from libp2p/feat/advertise-multihash
Provider records use multihashes instead of CIDs
2020-01-02 15:05:36 -08:00
Aarsh Shah
b19ac720dd routing table should not have all the peers 2019-12-20 15:03:57 +08:00
Adin Schmahmann
a4b38eebee feat(dht): provider records use multihashes instead of CIDs 2019-12-19 12:00:51 -05:00
Steven Allen
dd3d8fbb9d
Merge pull request #425 from libp2p/fix/refresh-wait
fix: always send the result channel when triggering a refresh
2019-12-13 10:32:02 +01:00
Steven Allen
e512351145 fix: always send the result channel when triggering a refresh
Otherwise, we'll just return a channel that will never be signaled.
2019-12-13 10:11:32 +01:00
Steven Allen
2e6adb8c2b
Merge pull request #400 from libp2p/feat/disable-providers
feat: allow disabling value and provider storage/messages
2019-12-12 18:05:53 +01:00
Steven Allen
3c3e567143 fix: try to re-add existing peers when the routing table is empty
Otherwise, we could decide to _not_ add a peer, disconnect from most peers, and
be unable to query the DHT even if we're technically connected to a peer in the
DHT.
2019-12-11 18:17:27 +01:00
Steven Allen
50a9858ef6 feat(dht): switch to a single RefreshRoutingTable function returning a channel 2019-12-10 17:28:30 +01:00
Steven Allen
0be0cbc50e feat: refresh and wait
We'd like to be able to refresh then _wait_ for the refresh to finish in the testground DHT tests. That way, we can:

1. Start and disable _auto_ refresh.
2. Bootstrap.
3. Refresh a couple of times till we're stable.
4. Wait to _stop_ refreshing.
5. Disconnect from and forget about all peers _not_ in our routing tables.
6. Run the actual tests without interference from the bootstrapping logic.
2019-12-10 15:41:20 +01:00
Steven Allen
2a39785d3f fix(options): make the disable providers/values options consistent 2019-12-06 09:47:22 -05:00
Steven Allen
52747fc1f0 feat: allow disabling value and provider storage/messages
fixes #274
2019-12-05 19:11:46 -05:00
Steven Allen
ef319676a9 chore: rename bootstrap to refresh
As pointed out by raul, bootstrapping and refreshing are not the same thing.
Bootstrapping is the initial setup (i.e., connect to some initial nodes to get
started). Refreshing is the process of refreshing the routing table.
2019-11-05 23:33:53 +00:00
Aarsh Shah
7cce5bdd96 make bootstrap synchronous & get tests to work 2019-11-02 00:37:15 +08:00
Aarsh Shah
00fffba0aa Update dht_bootstrap.go
1) on connecting to a new peer  -> trigger self & bucket bootstrap if RT size goes below thereshold
2) accept formatting & doc suggestions in the review
3) remove RT recovery code for now -> will address in a separate PR once #383 goes in

changes as per review
2019-10-11 14:10:19 +09:00
Aarsh Shah
f4630f62d5 1) seed RT whenever it becomes empty
2) seed RT if empty before starting bootstrap incase 1 hasn't fired
3) pass bootstrap config as option while creating Dht
4) replace all bootstrap function with 1 function
2019-10-11 13:17:36 +09:00
Aarsh Shah
5329454a0f removed cfg.Queries param from bootstrap 2019-10-11 13:13:53 +09:00
Aarsh Shah
36578e2be3 Striped locks for atomic Dht updates (#374)
Implement striped locking for datastore puts.
2019-07-22 20:47:45 -07:00
Raúl Kripalani
31765355df
migrate to consolidated types. (#344) 2019-05-26 23:33:15 +01:00
Steven Allen
95a6c2509f providers: use raw cids as map keys 2019-04-13 09:18:28 -07:00
Matt Joiner
86d78dc072
golangci-lint run -D errcheck (#298) 2019-03-14 11:07:15 +11:00
Steven Allen
6eafd65baa thread context to prep (#286)
We usually _explicitly_ call connect before calling `prep` but we may disconnect
somewhere in-between. We _don't_ want to get stuck here dialing if the context
has been canceled.
2019-03-07 18:53:16 +11:00
Matt Joiner
08c34b4d83
New node methods for tools and otherwise (#265)
* Add IpfsDHT.{Bootstrap{Random,Self},Peer{Id,Key}}
* Include client mode tests, support for Ping, and uncruft setupDHTs
* Include xerrors in deps
2019-03-06 08:10:38 +11:00
Steven Allen
c78d1e6786 fix(dialQueue): account for failed dials
fixes #276
2019-02-26 19:57:54 -07:00
Raúl Kripalani
120a585ebf Revert "Test go mod in travis and use major versioning in import paths (#236)"
This reverts commit 7e68ac3c60c15243c7d2e622b91aed92245a2677.
2019-02-12 14:12:53 +00:00
Adrian Lanzafame
7e68ac3c60 Test go mod in travis and use major versioning in import paths (#236) 2019-02-12 17:38:06 +11:00
Matt Joiner
8a62a14374
Deflake TestFindPeerQuery (#245)
* Rework TestFindPeersQuery

Unravel the logic and create a minimal test case that isn't flaky.

* Use testing.T.Logf

* Skip the original test in short mode

* Add comments for the arguments to testFindPeerQuery

* Qualify aberrant package name

* Use redundant package names

* gx import testify 1.3.0.
2019-02-05 10:35:37 +11:00
Matt Joiner
8b37385468 Rename log to logger 2019-02-03 13:14:35 +11:00
Matt Joiner
b598d08a51 Reduce noise in the bootstrap tests 2019-01-31 14:59:23 +11:00
Matt Joiner
2d2bb5513c
Tidy up bootstrapping (#235)
* Remove signal bootstrapping

Remove IpfsDHT.BootstrapOnSignal.

* Type check expected interfaces on IpfsDHT

* Simplify the bootstrap logic

* Tidy up a few other things

* Include BootstrapOnce

* Add comment about duplicating sanity checks

* Use existing import naming convention

* Defer error wrapping until we need it

* Restore existing query count behaviour
2019-01-31 10:06:56 +11:00
Steven Allen
201eea5e0b
Revert "Tidy up bootstrapping" 2019-01-24 14:06:38 -08:00
Matt Joiner
9055bd6981 Include BootstrapOnce 2019-01-24 09:52:56 +11:00
Matt Joiner
f423e38edd Simplify the bootstrap logic 2019-01-24 09:52:56 +11:00
Matt Joiner
69392ff66f Remove signal bootstrapping
Remove IpfsDHT.BootstrapOnSignal.
2019-01-24 09:52:55 +11:00
Hector Sanjuan
110dae4320
Revert "Remove signal bootstrapping" 2019-01-23 13:28:20 +01:00
Matt Joiner
b33ea78537 Remove signal bootstrapping
Remove IpfsDHT.BootstrapOnSignal.
2019-01-22 15:47:33 +11:00
Kevin Atkinson
a303c45371 gx update and fix code to use new Cid type 2018-09-11 21:54:47 -04:00
Łukasz Magiera
307660c78d SearchValue: Make -1 quorum mean infinite on get 2018-08-10 12:06:32 +02:00
Łukasz Magiera
e28b133f80 SearchValue: add backward-compatible GetValues 2018-08-10 12:06:32 +02:00
Łukasz Magiera
547c0a7170 SearchValue: simplify error handling further 2018-08-10 12:06:32 +02:00
Łukasz Magiera
ad37d996f6 SearchValue: add a test 2018-08-10 12:06:32 +02:00
Łukasz Magiera
64d1622c72 SearchValue: simplify error handling 2018-08-10 12:06:32 +02:00
Łukasz Magiera
e260fe510f Implement SearchValue 2018-08-10 12:06:32 +02:00
Steven Allen
2093a7192e cleanup tests and timeouts a bit
Addresses CR and ensures that we don't wait 10m for tests that should never take
more than 5s.
2018-06-25 16:58:34 -07:00
Steven Allen
97131ef4c2 remove random print from test 2018-06-15 14:13:07 -07:00
Steven Allen
203962c1c5 add tests for 161 and 162 2018-06-15 14:04:35 -07:00
Steven Allen
95067a1cc4 improve the dht tests 2018-06-13 19:37:29 -07:00
Steven Allen
6c4aa35c94 validate and compare record on local put 2018-06-13 17:01:53 -07:00
Steven Allen
7ecca973f3 fix for swarm refactor 2018-06-04 21:45:38 -07:00
Erin Swenson-Healey
a909366b1e improve DHT protocol test 2018-06-04 11:33:49 -07:00
Erin Swenson-Healey
15fe77a9f5 add test for DHTs using different protocols 2018-06-01 16:06:18 -07:00