Commit Graph

3863 Commits

Author SHA1 Message Date
Gus Eggert
a09c8df24d
fix: remove timeout on default DHT operations (#9783)
* fix: remove timeout on default DHT operations

This removes the timeout by default for DHT operations. In particular
this causes issues with ProvideMany requests which can take an
indeterminate amount of time, but really these should just respect
context timeouts by default. Users can still specify timeouts here if
they want, but by default they will be set to "0" which means "no
timeout".

This is unlikely to break existing users of custom routing, because
there was previously no utility in configuring a router with timeout=0
because that would cause the router to immediately fail, so it is
unlikely (and incorrect) if anybody was using timeout=0.

* fix: remove 5m timeout on ProvideManyRouter

For context see
5fda291b66

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-03-30 16:08:43 -04: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
Arthur Gavazza
e89cce63fd
feat: add identify option to swarm peers command
Fixes #9578
2023-03-30 04:34:57 +00:00
Jorropo
3ab1086f71 chore: migrate go-libipfs to boxo
Resolves #9677, #9676, #9675, #9736
2023-03-28 22:05:25 -04:00
Jorropo
1e3b6c9857 feat: add tracing to the commands client 2023-03-28 22:05:25 -04: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
Jorropo
bb020ea1ef fix: deadlock while racing ipfs dag import and ipfs repo gc
This fixes a deadlock introduced in 1457b4fd4a.

We can't use the coreapi here because it will try to take the PinLock (RLock) again, so revert this small part of 1457b4fd4a.

This used cause a deadlock when concurrently running `ipfs dag import` concurrently with the GC.

The bug is that `ipfs dag import` takes an RLock with the PinLock.
*the cars are imported, leaving a wide window of time*
Then GC Takes a Lock on that same RWMutex while taking the GC Lock (it  blocks because it waits for the RLock to be released).
Then the car imports are finished and `ipfs dag import` tries to aqcuire the PinLock (doing an RLock) again in `Api().Pin`.

However at this point the RWMutex is starved, the runtime put a fence in front of RLocks if a Lock has been waiting for too lock (else you could have an endless stream of RLock / RUnlock forever delaying a Lock to ever go through).

The issue is that `ipfs dag import`'s original RLock which is blocking everyone will be released once it returns, which only happens when `Api().Pin` completes.

So we have a deadlock (ABA kind ?), because `ipfs dag import` waits on the GC Lock, which waits on `ipfs dag import`.

Calling the Pinner directly does not acquire the PinLock again, and thus does not have this issue.
2023-03-26 05:40:18 +02:00
Michael Muré
1457b4fd4a
feat: improve dag/import (#9721)
- don't bypass the CoreApi
- don't use a goroutine and return channel for `importWorker`, when what's happening is really just a synchronous call
- only `PinLock()` when we are going to pin
- use `cid.Set` instead of an explicit map
- fail the request early if any pinning fail, no need to try to pin more if the request failed already
2023-03-22 03:06:40 +01:00
Henrique Dias
ed671e8489 fix: canonicalize user defined headers 2023-03-17 23:40:35 +01:00
Henrique Dias
63b2a0e069
fix: apply API.HTTPHeaders to /webui redirect 2023-03-17 15:14:10 +01:00
Gus Eggert
23b5abfb7a feat: add heap allocs to 'ipfs diag profile' 2023-03-17 10:09:33 -04:00
Jorropo
a3b417779c fix: future proof with > rcmgr.DefaultLimit for new enum rcmgr values 2023-03-16 13:41:24 +01:00
Jorropo
e870dcdc0e fix: preserve Unlimited StreamsInbound in connmgr reconciliation
Fixes #9695
2023-03-16 13:41:24 +01:00
Jorropo
1f5763f787 chore: deprecate the pubsub api
Fixes #9717
2023-03-15 04:42:02 +01:00
Laurent Senta
877d091d75 fix: --verify forgets the verified key 2023-03-13 09:54:10 -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
Jorropo
7986196414 feat: Reduce RM code footprint
Co-Authored-By: Antonio Navarro Perez <antnavper@gmail.com>
2023-03-06 12:46:58 +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
Marten Seemann
a3366c522a
chore: update go-libp2p to v0.26 (#9656)
Co-authored-by: Henrique Dias <hacdias@gmail.com>
2023-02-24 10:34:10 +01:00
Michael Muré
86da181f7f
feat(pinning): connect some missing go context (#9557)
Co-authored-by: Henrique Dias <hacdias@gmail.com>
2023-02-22 16:56:59 +01:00
Henrique Dias
ed4d6b7d41 test: remove gateway tests migrated to go-libipfs 2023-02-15 00:24:36 +01:00
Jorropo
0ff406170d fix: update rcmgr for go-libp2p v0.25 2023-02-14 22:19:46 +01:00
Marten Seemann
a00f5cae23 chore: update go-libp2p to v0.25.1 2023-02-14 22:19:46 +01:00
Henrique Dias
fb7f7b15b3
fix: restore wire format for /api/v0/routing/get|put (#9639)
Closes #9638
2023-02-10 02:41:45 +01:00
Henrique Dias
b58356939e
refactor(gw): move Host (DNSLink and subdomain) handling to go-libipfs (#9624)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-02-07 03:44:24 +01:00
Henrique Dias
14649aa8ba
refactor: new go-libipfs/gateway API, deprecate Gateway.Writable (#9616) 2023-02-02 02:50:46 +01:00
Henrique Dias
8d3b3154c9
refactor: use gateway from go-libipfs (#9588) 2023-01-31 11:02:31 +01:00
Antonio Navarro Perez
633c497f63 Adjust inbound connection limits depending on memory. 2023-01-30 11:01:03 +01:00
Dan McQuillan
7cb8082bbe
feat: ipfs-webui 2.22.0 2023-01-28 08:32:50 +01:00
Jorropo
b3c98bb085 chore: bump go-libipfs remove go-bitswap 2023-01-27 23:07:01 +01:00
Henrique Dias
a3c70a11e6
feat(gateway): IPNS record response format (IPIP-351) (#9399)
* feat(gateway): IPNS record response format
* docs(rpc): mark as experimental: routing provide, get, put

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-01-27 04:46:50 +01:00
Henrique Dias
94e7f79805
fix(ipns): honour --ttl flag in 'ipfs name publish' (#9471)
* fix: honour --ttl flag in 'ipfs name publish'
* docs(cli): ipfs name inspect --help

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-01-27 02:33:13 +01:00
Mohsin Zaidi
9652f24f6c
feat: Pubsub.SeenMessagesStrategy (#9543)
* feat: expire messages from the cache based on last seen time
* docs: Pubsub.SeenMessagesStrategy

Ref. https://github.com/libp2p/go-libp2p-pubsub/pull/513

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-01-27 00:24:35 +01:00
Jorropo
f20c980f2d chore: bump go-libipfs to replace go-block-format
Includes changes from:
- https://github.com/ipfs/go-block-format/pull/37
- https://github.com/ipfs/go-libipfs/pull/58
2023-01-26 16:55:48 +01:00
Steve Loeppky
9327ee64ce
fix: clarity: no user supplied rcmgr limits of 0 (#9563)
Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-01-22 20:04:18 +01:00
Henrique Dias
c706c638fc
fix(gateway): undesired conversions to dag-json and friends (#9566)
* fix(gateway): do not convert unixfs/raw into dag-* unless explicit
* fix(gateway): keep only dag-json|dag-cbor handling
* fix: allow requesting dag-json as application/json
- adds bunch of additional tests including JSON file on UnixFS
- fix: dag-json codec (0x0129) can be returned as plain json
- fix: json codec (0x0200) cna be retrurned as plain json
* fix: using ?format|Accept with CID w/ codec works
* docs(changelog): cbor and json on gateway

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-01-21 04:21:18 +01:00
Jorropo
8328bab28d fix: ensure connmgr is smaller then autoscalled ressource limits
Fixes #9545
2023-01-20 19:25:38 +01:00
Jorropo
b84cd11566
fix: typo in ensureConnMgrMakeSenseVsResourcesMgr 2023-01-20 15:29:54 +01:00
Jorropo
73ebad1892 fix: refuse to start if connmgr is smaller than ressource limits and not using none connmgr
Fixes: #9548
2023-01-19 01:40:48 +01:00
Henrique Dias
255e64e49e
chore: migrate from go-ipfs-files to go-libipfs/files (#9535) 2023-01-13 14:27:03 +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
Marcin Rataj
f6825ab662 fix(gateway): JSON when Accept is a list
Block/CAR responses always had single explicit type, and we did not bother
with implementing/testing lists.

With the introduction of JSON people may start passing a list.
This is the most basic fix which will return on the first matching
type (in order). This does not implements weights (can be added in
future, if needed).

Closes #9520
2023-01-11 22:18:52 +01:00
Antonio Navarro Perez
8cdc86d8c4 fix: disable provide over HTTP with Routing.Type=auto (#9511)
Closes https://github.com/ipfs/kubo/issues/9504
2023-01-04 13:56:15 +01:00
Jorropo
ffb635d797
Merge pull request #9492 from ipfs/default-webtransport
feat: turn on WebTransport by default
2022-12-12 22:57:09 +01:00
Jorropo
e927dc8e59 fix: correct libp2p transports TODO comments 2022-12-12 22:26:48 +01:00
Jorropo
16d189b8b8 feat: turn on WebTransport by default
Fixes #9292
2022-12-12 21:56:55 +01:00
Henrique Dias
7bdb341132
feat: fast directory listings with DAG Size column (#9481)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-12-12 21:45:13 +01:00
Jorropo
a3e09af203 fix: silence staticcheck warning for fx.Extract usage
See https://github.com/ipfs/kubo/pull/9423#issuecomment-1341038770
2022-12-12 03:47:17 +01:00
Jorropo
f08b439d48 update go-libp2p to v0.24.0 2022-12-12 03:47:17 +01:00
Marcin Rataj
15093a0011 fix: support /quic-v1 in webui v0.21
https://github.com/ipfs/ipfs-webui/releases/tag/v2.21.0
2022-12-10 00:45:50 +01:00