Commit Graph

40 Commits

Author SHA1 Message Date
Arthur Gavazza
726eabead4
feat: add deduplication ratio to 'ipfs dag stat' (#9787) 2023-06-06 15:17:45 +02:00
Nikhilesh Susarla
6eef0b4eef
fix: 'ipfs routing findpeer' explicitly fails when searching for self (#9903) 2023-06-01 12:19:29 +02:00
Henrique Dias
c10b804449
feat: Gateway.DeserializedResponses config flag (#9789)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-05-30 00:59:34 +02:00
Henrique Dias
e3126eb3e0
chore: upgrade boxo and fix test function signature (#9896) 2023-05-25 15:36:33 +02:00
Lucas Molas
63561f3baf
feat(bootstrap): save connected peers as backup bootstrap peers (#8856)
* feat(bootstrap): save connected peers as backup temporary bootstrap ones
* fix: do not add duplicated oldSavedPeers, not using tags, reuse
randomizeList
* test: add regression test
* chore: add changelog

---------

Co-authored-by: Henrique Dias <hacdias@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-05-25 14:39:49 +02:00
Jorropo
da28fbc65a chore: use assert.NoError instead of assert.Nil for errors 2023-05-16 15:42:54 +02:00
Henrique Dias
65b8d530b0
test: add streaming delegated routing test (#9874) 2023-05-16 14:05:22 +02:00
Henrique Dias
13c379604f
fix(gateway): redirect /ipns/b58mh to /ipns/cidb36 (#9785) 2023-05-16 13:09:39 +02:00
Henrique Dias
0e7331c952
feat: update boxo with routing streaming 2023-05-10 08:14:48 +00:00
Henrique Dias
c178c51835
fix: deadlock on retrieving WebTransport addresses (#9857)
Co-authored-by: Marco Polo <git@marcopolo.io>
2023-05-08 16:11:03 +02:00
Gus Eggert
03a98280e3 test: port twonode test to Go, remove multinode test
The multinode test is effectively the same as the twonode test. There
are some problems with it too: it *looks* like it's testing the
Websocket transport with the "listentype,ws" IPTB attribute, but that
attribute doesn't actually exist in ipfs/iptb-plugins, so it does
nothing, so that test actually just runs the same test twice (Yamux
disabled). Furthermore, this is just the same test as in the mplex
twonode test. So this just removes the useless multinode test
entirely.

Also, this removes the part of the twonode test that checks the amount
of data transferred over Bitswap. This is an implementation detail of
Bitswap, it's not appropriate to test this in an end-to-end test as it
depends on algorithmic details of how Bitswap works, and has nothing
to do with transports. This is probably more appropriate as a perf or
benchmark test of Bitswap.

This also moves equivalent functionality from jbenet/go-random-files
into the testutils package. This just copies the code and modifies it
slightly for better ergonomics.
2023-04-10 14:57:15 -04:00
Gus Eggert
0e55ca9377 feat: add experimental optimistic provide
This adds the ability to enable "optimistic provide" to the default
DHT client, which enables faster provides and reprovides.

For more information about optimistic provide, see:

https://protocollabs.notion.site/Optimistic-Provide-2c79745820fa45649d48de038516b814

Note that this feature only works when using non-custom router
types. This does not include the ability to enable optimistic provide
on custom routers for now, to minimize the footprint of this
experimental feature. We intend on continuing to test this and improve
the UX, which may or may not involve adding configuration for it to
custom routers. We also plan on refactoring/redesigning custom routers
more broadly so I don't want this to add more effort for maintainers
and confusion for users.
2023-04-06 16:49:46 -04:00
Gus Eggert
1b3e4438fc
chore: upgrade OpenTelemetry dependencies (#9736) 2023-04-05 11:44:14 +00:00
Gus Eggert
fd830b3c1a
test: fix flaky content routing over HTTP test (#9772) 2023-04-05 11:10:32 +00:00
Henrique Dias
55587d8e41
feat!: make --empty-repo default (#9758)
Context:
https://github.com/ipfs/kubo/pull/9758#pullrequestreview-1366898875
2023-03-31 15:06:23 +02:00
Adin Schmahmann
353dd49be2
refactor: switch gateway code to new API from go-libipfs (#9681)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Henrique Dias <hacdias@gmail.com>
2023-03-30 13:20:37 +00:00
Gus Eggert
a24cfb89a5
test: port remote pinning tests to Go (#9720)
This also means that rb-pinning-service-api is no longer required for
running remote pinning tests. This alone saves at least 3 minutes in
test runtime in CI because we don't need to checkout the repo, build
the Docker image, run it, etc.

Instead this implements a simple pinning service in Go that the test
runs in-process, with a callback that can be used to control the async
behavior of the pinning service (e.g. simulate work happening
asynchronously like transitioning from "queued" -> "pinning" ->
"pinned").

This also adds an environment variable to Kubo to control the MFS
remote pin polling interval, so that we don't have to wait 30 seconds
in the test for MFS changes to be repinned. This is purely for tests
so I don't think we should document this.

This entire test suite runs in around 2.5 sec on my laptop, compared to
the existing 3+ minutes in CI.
2023-03-30 07:46:35 -04:00
Arthur Gavazza
e89cce63fd
feat: add identify option to swarm peers command
Fixes #9578
2023-03-30 04:34:57 +00:00
Gus Eggert
9fb09dd398
test: port routing DHT tests to Go (#9709) 2023-03-29 19:28:55 -04:00
Gus Eggert
f4d361dd4e
test: fix autoclient flakiness (#9769)
The test trims all whitespace bytes from the output of 'ipfs cat' but
if the random bytes end in a whitespace char then it trims that too,
resulting in random test failure.

Instead this updates the test harness to only trim a single trailing
newline char, so that it doesn't end up chomping legitimate output.
2023-03-29 11:56:25 -04:00
Gus Eggert
4c49967d9c feat: add client-side metrics for routing-v1 client 2023-03-27 18:19:28 -04:00
Gus Eggert
60ba0b1821 test: increase max wait time for peering assertion
The peering test is flaky and fails waiting for peers to be connected
to each other, I don't know if this will fix it, but worth trying.
2023-03-27 23:32:04 +02:00
Henrique Dias
88d431c812
feat: remove writable gateway (#9743)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-03-27 15:19:55 +02:00
Henrique Dias
b975593920
feat(gateway): invalid CID returns 400 Bad Request (#9726) 2023-03-20 14:14:38 +01:00
Henrique Dias
63b2a0e069
fix: apply API.HTTPHeaders to /webui redirect 2023-03-17 15:14:10 +01:00
Jorropo
a3b417779c fix: future proof with > rcmgr.DefaultLimit for new enum rcmgr values 2023-03-16 13:41:24 +01:00
Jorropo
8b05cf05b0 test: add test for presarvation of unlimited configs for inbound systems 2023-03-16 13:41:24 +01:00
Gus Eggert
684d9dc79f test: fix flaky rcmgr test 2023-03-15 22:45:56 -04:00
Gus Eggert
676e557daf test: port peering test from sharness to Go
This is the slowest test in the sharness test suite, because it has
very long sleeps. It usually takes 2+ minutes to run.

This new impl runs all peering tests in about 20 seconds, since it
polls for conditions instead of sleeping, and runs the tests in
parallel.

This also has an additional test case for a peer that was never online
and then connects.
2023-03-13 10:54:53 -04:00
Gus Eggert
0d94bac30c feat: add "autoclient" routing type
This routing type is the same as "auto" but it creates the DHT in
"client" mode and hence does not start a DHT server.
2023-03-09 08:18:14 -05:00
Gus Eggert
fdbe363eb1 test: parallelize more of rcmgr Go tests 2023-03-09 08:18:14 -05:00
Gus Eggert
ad5a0fea0e test: port legacy DHT tests to Go 2023-03-09 08:18:14 -05:00
Jorropo
7986196414 feat: Reduce RM code footprint
Co-Authored-By: Antonio Navarro Perez <antnavper@gmail.com>
2023-03-06 12:46:58 +01:00
Gus Eggert
145795b148 test: port rcmgr sharness tests to Go 2023-02-28 15:34:23 +01:00
Henrique Dias
1794649bf2
feat(gateway): error handling improvements (500, 502, 504) (#9660)
* fix(gateway): return 500 for all /ip[nf]s/id failures
* fix: replace deprecated structs
* chore: bump go-libipfs to version from main
2023-02-28 02:21:50 +01:00
Henrique Dias
4db6ae1772
fix(gateway): return HTTP 500 on ErrResolveFailed (#9589) 2023-02-22 03:22:03 +01:00
Gus Eggert
5d864faac7 test: port gateway sharness tests to Go tests 2023-01-17 21:27:54 +01:00
Antonio Navarro Perez
3bc9b675a0
fix: stats dht command when Routing.Type=auto (#9538)
Fixes default auto mode, but Routing.Type=custom needs more work.
Continued in https://github.com/ipfs/kubo/issues/9482
2023-01-13 00:38:38 +01:00
Gus Eggert
430a65ad5f feat: port pins CLI test 2022-12-16 07:39:52 -05:00
Gus Eggert
579175f81d feat: add basic CLI tests using Go Test
This is intended as a replacement for sharness. These are vanilla Go
tests which can be run in your IDE for quick iteration on end-to-end
CLI tests.

This also removes IPTB by duplicating its functionality in the test
harness. This isn't a big deal...IPTB's complexity is mostly around
the fact that its state needs to be saved to disk in between `iptb`
command invocations, and that it uses Go plugins to inject
functionality, neither of which are relevant here.

If we merge this, we'll have to live with bifurcated tests for a while
until they are all migrated. I'd recommend we self-enforce a rule
that, if we need to touch a sharness test, we migrate it and one more
test over to Go tests first. Then eventually we will have migrated
everything.
2022-12-12 09:43:09 -05:00