Commit Graph

55 Commits

Author SHA1 Message Date
Marcin Rataj
82467bc936 refactor: rename to kubo 2022-07-06 18:40:37 +02:00
Marcin Rataj
61f0710100
fix: remove mdns_legacy & Discovery.MDNS.Interval
* fix: remove mdns_legacy

We've been running both implementations for a long, long time.
It is time to remove legacy version and lower the number of LAN packets
IPFS node produces.

See https://github.com/ipfs/go-ipfs/pull/9048#discussion_r906814717
for the Interval removal rational.
2022-06-27 04:17:40 +02: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
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
Laurent Senta
8d549f03f3 fix: rewrite dependencies over the go-ipfs-config package 2022-03-04 09:45:16 +01: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
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
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
vyzo
664c66c3f3 undo dns neutering from offline mode 2021-05-10 21:04:57 -07:00
vyzo
531e9c137d use NilDNSResolver for offline operation 2021-05-10 21:04:57 -07:00
vyzo
543c5da34a explicit construction of DNS resolver 2021-05-10 21:03:27 -07:00
Steven Allen
e164af1f2a feat: add a transport config section
This way, users can disable transports (especially QUIC), and set muxer/security
transport priorities.
2020-06-16 15:15:47 -07:00
Steven Allen
d48b80b30e feat: add noise support
We can add a proper configuration option in a followup patch after the RC.
2020-05-25 23:46:48 -07:00
Steven Allen
978091a626 feat: implement peering service
MVP for #6097

This feature will repeatedly reconnect (with a randomized exponential backoff)
to peers in a set of "peered" peers.

In the future, this should be extended to:

1. Include a CLI for modifying this list at runtime.
2. Include additional options for peers we want to _protect_ but not connect to.
3. Allow configuring timeouts, backoff, etc.
4. Allow groups? Possibly through textile threads.
5. Allow for runtime-only peering rules.
6. Different reconnect policies.

But this MVP should be a significant step forward.
2020-05-25 20:24:41 -07:00
Steven Allen
4714c0cecc feat: enable QUIC by default
But only if private networks are disabled.
2020-05-22 13:48:58 -07:00
Steven Allen
03c1f769d7 fix: remove strict signature verification option
Signature verification is now always strict.
2020-05-22 13:48:26 -07:00
@RubenKelevra
2dc1f691f1 quic: remove experimental status and add it to the default config 2020-05-22 04:54:19 +02:00
Steven Allen
1f23fc000c feat: add autonat config options
1. Enable AutoNATService on _all_ nodes by default. If it's an issue, we can
disable it in RC3 but this will give us the best testing results.
2. Expose options to configure AutoNAT rate limiting.
2020-04-14 20:54:58 -07:00
Steven Allen
f28b8fce66 feat: tls by default
Switches to TLS as the default security transports.
2020-03-29 19:12:54 -07:00
Steven Allen
ad543f0724 feat: update go-libp2p & go-bitswap
Uses the new libp2p AutoNAT option.
2020-03-24 14:54:09 -07:00
Steven Allen
46d26af0b6 feat(graphsync): mount the graphsync libp2p protocol
This won't fetch files from graphsync but will serve them.

fixes #6830
2020-02-26 09:11:15 -08:00
Steven Allen
8f3b274080 fix: move away from deprecated peer ID functions 2019-12-14 19:48:31 +01:00
Adin Schmahmann
36494e493a ipns(pubsub): utilize persistent pubsub value store 2019-12-11 11:52:05 -05:00
Steven Allen
208a340eb1
Merge pull request #6686 from kishansagathiya/fix/typo
Fix typo
2019-09-30 07:27:45 -07:00
Kishan Mohanbhai Sagathiya
f0253dd108 Fix typo 2019-09-28 15:15:41 +05:30
Steven Allen
853ed0be5d chore: fix deprecation warnings 2019-09-26 15:38:12 -07:00
Steven Allen
9f1f958432 fix: close peerstore on stop
fixes #6627
2019-09-05 17:20:14 -07:00
Steven Allen
1a55676bf9 make gossipsub the default routing protocol for pubsub
Pubsub is experimental anyways.
2019-07-15 10:02:42 -07:00
Sander Pick
f2635d1f5e
libp2p: moves discovery after host listen
Prevents the MDNS server from starting when the host has zero addresses.

Re: https://github.com/libp2p/go-libp2p/issues/652

Signed-off-by: Sander Pick <sanderpick@gmail.com>
2019-06-05 20:32:51 -07:00
Raúl Kripalani
e8c2852179 migrate to go-libp2p-core.
closes #6391

License: MIT
Signed-off-by: Raúl Kripalani <raul@protocol.ai>
2019-05-31 23:23:52 -07:00
Michael Avila
4feff27a89
Group imports correctly 2019-05-29 16:21:09 -07:00
Michael Avila
992ec291bc
Give argument intent revealing name (and add comment) 2019-05-29 16:20:33 -07:00
Michael Avila
a87558e02c
Move more cfg out of groups
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-05-29 16:20:31 -07:00
Michael Avila
e8c9207da3
Move cfg out to groups
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-05-29 16:20:31 -07:00
Michael Avila
6d6ce8fba7
Introduce first strategic provider: do nothing
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-05-29 16:20:31 -07:00
Steven Allen
7e7d802557 pubsub: avoid using pubsub defaults from upstream 2019-05-20 13:28:29 -07:00
Łukasz Magiera
3652e0c5f3
core: Use correct default for connmgr lowWater
Most people weren't affected by this as those values are set in config at init, but for others it would be rather hard to debug.
2019-05-20 17:41:16 +02:00
Steven Allen
b57956c5fb core: fix autonat construction
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-05-01 15:21:29 -07:00
Łukasz Magiera
e133058487 constructor: break down libp2p logic
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-30 00:09:42 +02:00
Łukasz Magiera
ed514b9177 Invert constructor config handling
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-29 23:37:37 +02:00
Łukasz Magiera
9bcf072ccb WIP cleanup config handling in core
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-29 17:43:26 +02:00
Łukasz Magiera
c4debb5912 constructor: Add few docstrings
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-23 13:31:01 +02:00
Łukasz Magiera
456084e613 constructor: drop P2P prefix from libp2p related units
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-23 13:30:58 +02:00
Łukasz Magiera
da473d286f constructor: move libp2p related stuff to subpackage
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-23 13:30:25 +02:00
Marten Seemann
ed3729d3ca enable support for TLS handshakes, configure secio as the default
License: MIT
Signed-off-by: Marten Seemann <martenseemann@gmail.com>
2019-04-17 23:12:21 -07:00
Łukasz Magiera
bf380b8738 Cleanup routing related units
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00