Commit Graph

141 Commits

Author SHA1 Message Date
Gus Eggert
b1c051d250
feat: disable resource manager by default (#9003)
* feat: disable resource manager by default

We are disabling this by default for v0.13 as we work to improve the
UX around Resource Manager. It is still usable and can be enabled in
the IPFS config with "ipfs config --bool Swarm.ResourceMgr.Enabled true".

We intend to enable Resource Manager by default in a subsequent
release.

* docs(config): Swarm.ResourceMgr disabled by default

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-06-02 10:31:06 -04:00
Gus Eggert
b8617b9966
fix: adjust rcmgr limits for accelerated DHT client rt refresh (#8982)
* fix: adjust rcmgr limits for accelerated DHT client rt refresh

The Accelerated DHT client periodically refreshes its routing table,
including at startup, and if Resource Manager throttling causes the
client's routing table to be incomplete, then content routing may be
degraded or broken for users.

This adjusts the default limits to a level that empirically doesn't
cause Resource Manager throttling during initial DHT client
bootstrapping. Ideally the Accelerated DHT client would handle this
scenario more gracefully, but this works for now to unblock the 0.13
release.

* Set default outbound conns unconditionally

This also sets the default overall conns as a function of the outbound
and inbound conns, since they are adjusted dynamically, and it makes
the intention of the value clear.

* increase min FD limit
2022-06-02 10:23:42 -04:00
Gus Eggert
5615715c55
feat: log when resource manager limits are exceeded (#8980)
This periodically logs how many times Resource Manager limits were
exceeded. If they aren't exceeded, then nothing is logged. The log
levels are at ERROR log level so that they are shown by default.

The motivation is so that users know when they have exceeded resource
manager limits. To find what is exceeding the limits, they'll need to
turn on debug logging and inspect the errors being logged. This could
collect the specific limits being reached, but that's more complicated
to implement and could result in much longer log messages.
2022-05-19 15:27:44 -04:00
Lucas Molas
f156486208 fix(node/libp2p): disable rcmg checkImplicitDefaults 2022-05-12 15:30:31 +02:00
Gus Eggert
3d527753ff feat: enable Resource Manager by default 2022-05-04 14:08:37 -04:00
Adin Schmahmann
185971b259 fix: add info log indicating that hole punching has been disabled when it is left as the default but the relay client is disabled. 2022-05-03 14:26:09 -04:00
Adin Schmahmann
346fd9d854 fix: when the relay client is disabled and hole punching is left in its default state silently turn off hole punching instead of panicking 2022-05-03 14:26:09 -04:00
Adin Schmahmann
7ad6447453 feat: enable hole-punching by default 2022-05-03 14:26:09 -04:00
Marten Seemann
232ccb4e55
feat: relay v2 discovery (go-libp2p v0.19.0) (#8868)
* update go-libp2p to v0.19.0
* chore: go-namesys v0.5.0
* refactor(config): cleanup relay handling
* docs(config): document updated defaults
* fix(tests): panic during sharness

* fix: t0160-resolve.sh
See https://github.com/ipfs/go-namesys/pull/32

* fix: t0182-circuit-relay.sh
* test: transport encryption

Old tests were no longer working because go-libp2p 0.19 removed
the undocumented 'ls' pseudoprotocol.

This replaces these tests with handshake attempt (name is echoed back on
OK or 'na' is returned when protocol is not available) for tls and noise
variants + adds explicit test that safeguards us against enabling
plaintext by default by a mistake.

* fix: ./t0182-circuit-relay.sh

test is flaky, for now we just restart the testbed when we get
NO_RESERVATION error

* refactor: AutoRelayFeeder with exp. backoff

It starts at feeding peers ever 15s, then backs off each time
until it is done once an hour

Should be acceptable until we have smarter mechanism in go-lib2p 0.20

* feat(AutoRelay): prioritize Peering.Peers

This ensures we feed trusted Peering.Peers in addition to any peers
discovered over DHT.

* docs(CHANGELOG): document breaking changes

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Gus Eggert <gus@gus.dev>
2022-04-28 17:13:15 +02:00
Gus Eggert
74aff245d2
feat: persist limits to Swarm.ResourceMgr.Limits (#8901)
* feat: persist limit changes to config

This changes the "ipfs swarm limit" command so that when limit changes
are applied via the command line, they are persisted to the repo
config, so that they remain in effect when the daemon restarts.

Any existing limit.json can be dropped into the IPFS config easily
using something like:

cat ~/.ipfs/config | jq ".Swarm.ResourceMgr.Limits = $(cat limit.json)" | sponge ~/.ipfs/config

This also upgrades to Resource Manager v0.3.0, which exports the config
schema so that we don't have to maintain our own copy of it.

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-04-28 15:27:16 +02:00
Marcin Rataj
5d712166b2
feat: detect changes in go-libp2p-resource-manager (#8857)
This adds simple check that will scream loud and clear every time
go-libp2p libraries change any of the implicit defaults
related to go-libp2p-resource-manager
2022-04-08 17:43:30 +02:00
Marten Seemann
514411bedb
feat: opt-in Swarm.ResourceMgr (go-libp2p v0.18) (#8680)
* update go-libp2p to v0.18.0

* initialize the resource manager

* add resource manager stats/limit commands

* load limit file when building resource manager

* log absent limit file

* write rcmgr to file when IPFS_DEBUG_RCMGR is set

* fix: mark swarm limit|stats as experimental

* feat(cfg): opt-in Swarm.ResourceMgr

This ensures we can safely test the resource manager without impacting
default behavior.

- Resource manager is disabled by default
    - Default for Swarm.ResourceMgr.Enabled is false for now
- Swarm.ResourceMgr.Limits allows user to tweak limits per specific
  scope in a way that is persisted across restarts
- 'ipfs swarm limit system' outputs human-readable json
- 'ipfs swarm limit system new-limits.json' sets new runtime limits
  (but does not change Swarm.ResourceMgr.Limits in the config)

Conventions to make libp2p devs life easier:
- 'IPFS_RCMGR=1 ipfs daemon' overrides the config and enables resource manager
- 'limit.json' overrides implicit defaults from libp2p (if present)

* docs(config): small tweaks

* fix: skip libp2p.ResourceManager if disabled

This ensures 'ipfs swarm limit|stats' work only when enabled.

* fix: use NullResourceManager when disabled

This reverts commit b19f7c9eca.
after clarification feedback from
https://github.com/ipfs/go-ipfs/pull/8680#discussion_r841680182

* style: rename IPFS_RCMGR to LIBP2P_RCMGR

preexisting libp2p toggles use LIBP2P_ prefix

* test: Swarm.ResourceMgr

* fix: location of opt-in limit.json and rcmgr.json.gz

Places these files inside of IPFS_PATH

* Update docs/config.md

* feat: expose rcmgr metrics when enabled (#8785)

* add metrics for the resource manager
* export protocol and service name in Prometheus metrics
* fix: expose rcmgr metrics only when enabled

Co-authored-by: Marcin Rataj <lidel@lidel.org>

* refactor: rcmgr_metrics.go

* refactor: rcmgr_defaults.go

This file defines implicit limit defaults used when Swarm.ResourceMgr.Enabled

We keep vendored copy to ensure go-ipfs is not impacted when go-libp2p
decides to change defaults in any of the future releases.

* refactor: adjustedDefaultLimits

Cleans up the way we initialize defaults and adds a fix for case
when connection manager runs with high limits.

It also hides `Swarm.ResourceMgr.Limits` until we have a better
understanding what syntax makes sense.

* chore: cleanup after a review

* fix: restore go-ipld-prime v0.14.2

* fix: restore go-ds-flatfs v0.5.1

Co-authored-by: Lucas Molas <schomatis@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-04-07 21:06:35 -04:00
godcong
be3dbc2bd2
fix(discovery): fix daemon not starting due to mdns startup failure (#8704) 2022-03-09 07:08:24 -08:00
Laurent Senta
8d549f03f3 fix: rewrite dependencies over the go-ipfs-config package 2022-03-04 09:45:16 +01:00
Marten Seemann
3674b662db add a test case for libp2p option prioritization 2022-02-28 15:26:06 +04:00
Marten Seemann
ec46f1e6e4 fix prioritization of stream muxers 2022-02-25 11:44:47 +04:00
Thibault Meunier
a93907a40f
feat: DNS.MaxCacheTTL for DNS-over-HTTPS resolvers (#8615)
* feat: Add MaxCacheTTL option for DNS-over-HTTPS resolvers
* Update libp2p/go-doh-resolver dependencies to support Options
* feat: Add `DNS.MaxCacheTTL` config documentation
* docs: DNS.MaxCacheTTL
* chore: go-ipfs-config@v0.19.0
Co-authored-by: Gus Eggert <gus@gus.dev>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-02-10 22:26:14 +01:00
Steven Allen
7f27dbfd15 feat: switch to raw multihashes for blocks
Part of: https://github.com/ipfs/go-ipfs/issues/6815
2021-12-02 09:41:37 -05:00
Marten Seemann
48a6cac00b
feat: Swarm.EnableHolePunching flag (#8562)
* feat: use Swarm.EnableHolePunching flag within libp2p
* docs: Swarm.EnableHolePunching

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2021-11-30 11:18:51 -08:00
Jorropo
c2953ab8f1
feat: Addresses.AppendAnnounce (#8177)
* feat: Addresses.AppendAnnounce

Closes #7791

* fix: deduplicate Swarm.Announce and AppendAnnounce

https://github.com/ipfs/go-ipfs/pull/8177#discussion_r759317772
https://github.com/ipfs/go-ipfs/pull/8177#discussion_r759320332

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-30 17:58:19 +01:00
Adin Schmahmann
52c177ced9
feat: go-libp2p 0.16, UnixFS autosharding and go-datastore with contexts (#8563)
* plumb through go-datastore context changes

* update go-libp2p to v0.16.0
* use LIBP2P_TCP_REUSEPORT instead of IPFS_REUSEPORT
* use relay config
* making deprecation notice match the go-ipfs-config key
* docs(config): circuit relay v2
* docs(config): fix links and headers
* feat(config): Internal.Libp2pForceReachability

This switches to config that supports setting and reading
Internal.Libp2pForceReachability OptionalString flag

* use configuration option for static relays

* chore: go-ipfs-config v0.18.0

https://github.com/ipfs/go-ipfs-config/releases/tag/v0.18.0

* feat: circuit v1 migration prompt when Swarm.EnableRelayHop is set (#8559)
* exit when Swarm.EnableRelayHop is set
* docs: Experimental.ShardingEnabled migration

This ensures existing users of global sharding experiment get notified
that the flag no longer works + that autosharding happens automatically.

For people who NEED to keep the old behavior (eg. have no time to
migrate today) there is a note about restoring it with
`UnixFSShardingSizeThreshold`.

* chore: add dag-jose code to the cid command output

* add support for setting automatic unixfs sharding threshold from the config
* test: have tests use low cutoff for sharding to mimic old behavior
* test: change error message to match the current error
* test: Add automatic sharding/unsharding tests (#8547)
* test: refactored naming in the sharding sharness tests to make more sense

* ci: set interop test executor to convenience image for Go1.16 + Node
* ci: use interop master

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Gus Eggert <gus@gus.dev>
Co-authored-by: Lucas Molas <schomatis@gmail.com>
2021-11-29 19:58:05 +01:00
Dimitris Apostolou
0c2f9d5950
Fix typos (#8548) 2021-11-17 21:16:06 +01:00
Marten Seemann
2589e1f65e enable the legacy mDNS implementation 2021-09-27 17:50:00 -04:00
Lucas Molas
3a84352f18
feat(cli): add daemon option --agent-version-suffix (#8419)
* feat(cli): add daemon option --agent-version-suffix
* fix sharness test when commit is empty (release)
2021-09-21 20:31:08 +02:00
Marten Seemann
c95d6ca08c update go-libp2p to v0.15.0-rc.1 2021-08-19 18:05:04 +02:00
Marten Seemann
b2b8f3866b use a ConnectionManager for filtering addresses 2021-08-19 18:04:48 +02:00
Adin Schmahmann
7448340d20
support bitswap configurability (#8268)
* feat: extract Bitswap fx initialization to its own file
* chore: bump go-bitswap dependency
* feat: bump go-ipfs-config dependency and utilize the new Internal.Bitswap configuration options. Add documentation around the new OptionalInteger config type as well as the Internal.Bitswap options.
* docs(docs/config.md): move the table of contents towards the top of the document and update it

Co-authored-by: Petar Maymounkov <petarm@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Gus Eggert <877588+guseggert@users.noreply.github.com>
2021-08-18 14:15:16 -04:00
Hannah Howard
f63a997c35
IPLD Prime In IPFS: Target Merge Branch (#7976)
* feat: switch to using go-ipld-prime for codecs, path resolution, and the `dag put/get` commands
* fix: `dag put/get` not roundtripping due to an extra new line being added (https://github.com/ipfs/go-ipfs/issues/3503)

More detailed information is in the CHANGELOG.md file. Very high level:
* IPLD codecs (and their plugins) must use go-ipld-prime
* Added support for the dag-json codec
* `dag get/put` use IPLD codec names from the multicodec table
* `dag get` defaults to dag-json output instead of json, but may output with other codecs
* Data model pathing can be achieved using the /ipld prefix. For example, you can use `/ipld/QmFoo/Links/0/Hash` to traverse through a DagPB node
* With `dag get/put` the DagPB field names have been changed to match the ones in the protobuf listed in the specification

Co-authored-by: hannahhoward <hannah@hannahhoward.net>
Co-authored-by: Daniel Martí <mvdan@mvdan.cc>
Co-authored-by: acruikshank <acruikshank@example.com>
Co-authored-by: Steven Allen <steven@stebalien.com>
Co-authored-by: Will Scott <will.scott@protocol.ai>
Co-authored-by: Will Scott <will@cypherpunk.email>
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
Co-authored-by: Eric Myhre <hash@exultant.us>
2021-08-17 13:32:49 -04:00
Steven Allen
2138798ea5 fix: remove some deprecated calls 2021-08-13 14:09:43 -07:00
Petar Maymounkov
cab67f6b66
point ipfs to pinner that syncs on every pin (#8231)
Pinner upgrades and fixes. Faster reindexing. Syncing while reindexing. Syncing on every pin operation. Logging all pin operations.

Co-authored-by: gammazero <gammazero@users.noreply.github.com>
2021-07-29 10:27:05 -07:00
Adin Schmahmann
cf45f1a862 added support for an experimental batched provider system
The batched provider system is enabled when the experimental AcceleratedDHTClient is enabled

There is also an `ipfs stats provide` command which gives stats about the providing/reproviding system when the batched provider system is enabled
2021-05-14 01:47:48 -07:00
Adin Schmahmann
2fd55d198c integrate experimental AcceleratedDHTClient
The experimental AcceleratedDHTClient can be enabled from the config

When enabled it modifies the output of the `ipfs stats dht` command.
2021-05-14 04:31:06 -04:00
Adin Schmahmann
3f7e23e640 chore: update deps 2021-05-12 16:58:35 -04:00
vyzo
664c66c3f3 undo dns neutering from offline mode 2021-05-10 21:04:57 -07:00
vyzo
eb7456d38f update for the new namesys api 2021-05-10 21:04:57 -07:00
vyzo
0b4037c7cd allow overriding implicit defaults with the default resolver
License: MIT
Signed-off-by: vyzo <vyzo@hackzen.org>
2021-05-10 21:04:57 -07:00
vyzo
77d6a08598 better handling of implicit defaults, reuse resolver object for the same URL 2021-05-10 21:04:57 -07:00
vyzo
b8eb1bbd5b the dot is not really an FQDN 2021-05-10 21:04:57 -07:00
vyzo
531e9c137d use NilDNSResolver for offline operation 2021-05-10 21:04:57 -07:00
vyzo
0ef2f8c9ea update resolver config parsing, add eth. resolver by default 2021-05-10 21:04:57 -07:00
vyzo
b6a1ba9617 create custom resolvers from config 2021-05-10 21:04:57 -07:00
vyzo
543c5da34a explicit construction of DNS resolver 2021-05-10 21:03:27 -07:00
Hector Sanjuan
3db9551f79 Extract the namesys and the keystore submodules
Namesys is a very useful submodule. Given a ValueStore and a Datastore it can
resolve and publish /ipns/ paths.

This functionality does not need to be sequestered inside go-ipfs as it can
and should be used without IPFS, for example, for implementing lightweight
IPNS publishing services or for resolving /ipns/ paths.

"keystore" extraction was necessary, as there is a dependency to it in
namesys. Keystore is also a useful module by itself within the stack.

Fixes #6537
2021-03-12 14:09:36 -05:00
Steven Allen
ccc2d23730 feat: remove secio support
We've had a reliable and enabled by default TLS implementation since
0.4.23 (over a year ago) and turned off SECIO in September of last year.
We might as well remove support entirely in the next release and
encourage users to upgrade their networks.

Noise is faster, anyways.
2021-02-25 13:36:40 -08:00
Adin Schmahmann
0b1276db59 Use datastore based pinner 2020-12-04 15:33:31 -05:00
Adin Schmahmann
2ecde1a18c chore: update dht and kbucket 2020-08-25 21:13:18 -04:00
Adin Schmahmann
40738e4fec
Merge pull request #7598 from ipfs/chore/bump-graphsync-dep
Upgrade graphsync deps
2020-08-18 19:53:52 -04:00
Adin Schmahmann
08913c70ad feat: disable secio by default 2020-08-17 08:16:54 -04:00
Peter Rabbitson
90a573354a Upgrade graphsync deps 2020-08-17 12:23:59 +02:00
Marten Seemann
be171d5e3c update QUIC, enable the RetireBugBackwardsCompatibilityMode 2020-07-20 10:29:43 -04:00