Commit Graph

1256 Commits

Author SHA1 Message Date
ea45550d61 Add Deserialize for ed25519::PublicKey (#21) 2020-06-25 13:15:33 +03:00
d7c1989340 better iterlog (#20) 2020-06-10 18:11:36 +03:00
c36397b7de Report bucket size to prometheus (#19) 2020-06-09 15:17:16 +03:00
b7ec948326 Add prometheus metrics (#18) 2020-06-05 21:15:18 +03:00
3e2ed64faa Weighted routing (#17) 2020-06-05 20:04:53 +03:00
0bd3d9b6b6 Use master branch on fluencelabs/fluence #16 2020-05-20 13:06:15 +03:00
c6a6f0a6ad Merge pull request #15 from fluencelabs/libp2p_0.19.0
Libp2p 0.19.0
2020-05-20 12:42:06 +03:00
0fea4a1986 fix wasm build: imports 2020-05-19 23:17:33 +03:00
b4681cca12 fix wasm build 2020-05-19 23:10:33 +03:00
982e23ad39 fn main() {} 2020-05-19 21:49:51 +03:00
f6a4f61fbb disable ipfs-kad & distributed-key-value-store examples 2020-05-19 21:48:26 +03:00
d78805364d ssh => https 2020-05-19 21:45:41 +03:00
27c30a9f2d arqada => fluence 2020-05-19 19:36:25 +03:00
e6915be539 0.19 WIP 2020-05-19 19:23:44 +03:00
8bc0c9db51 Merge branch 'rust_master' into fluence_master
# Conflicts:
#	examples/distributed-key-value-store.rs
#	examples/ipfs-kad.rs
#	protocols/kad/src/behaviour.rs
#	protocols/kad/src/behaviour/test.rs
#	protocols/kad/src/lib.rs
#	protocols/kad/src/query/peers/closest.rs
2020-05-19 19:11:50 +03:00
34faf94538 Publish 0.19.0 (#1579) v0.19.0 2020-05-18 15:45:21 +02:00
162a0be0c2 Display the identity hash of PeerIds when relevant (#1576)
* Display the identity hash of PeerIds when relevant

* Add CHANGELOG entry
2020-05-18 12:42:51 +02:00
2fbd1a5503 Keep consistency with Upgrade Inbound by using PING_SIZE (#1578)
although 32 is prefect fine in our case, it would be consistent to use the const value PING_SIZE.

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-05-18 11:14:31 +02:00
bbc67351d3 Extend feature-flags to allow choosing runtime for libp2p-tcp (#1471)
* Extend feature-flags to allow choosing runtime for libp2p-tcp

* Added CHANGELOG entry

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-05-18 10:37:42 +02:00
82156deac5 Support /dns protocol in multiaddr (#1575)
* Add /dns protocol support to multiaddr

The /dns protocol has been added to the spec and has had a de-facto
meaning for years.
See https://github.com/multiformats/multiaddr/pull/100

This adds address parsing and encoding support for /dns to the multiaddr
format library.

* Cover Dns protocol in multiaddr property tests

* transports/dns: Support the /dns protocol

* Support /dns protocol in address translation

* Translate an FQDN URL into a /dns multiaddr

* transports/websocket: Support /dns multiaddr

* Use the /dns protocol in websocket redirects

The whole thing with back-translating from an redirect URL looks a bit
baroque, but at least now the transport does not completely ignore IPv6
addresses resolved from a hostname in a redirect URL.

* Add CHANGELOG entry

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-05-18 10:21:55 +02:00
3a96ebf57f More insight into Kademlia queries. (#1567)
* [libp2p-kad] Provide more insight and control into Kademlia queries.

More insight: The API allows iterating over the active queries and
inspecting their state and execution statistics.

More control: The API allows aborting queries prematurely
at any time.

To that end, API operations that initiate new queries return the query ID
and multi-phase queries such as `put_record` retain the query ID across all
phases, each phase being executed by a new (internal) query.

* Cleanup

* Cleanup

* Update examples and re-exports.

* Incorporate review feedback.

* Update CHANGELOG

* Update CHANGELOG

Co-authored-by: Max Inden <mail@max-inden.de>
2020-05-16 10:43:09 +02:00
c271f6f56b Make the number of events buffered to/from tasks configurable (#1574)
* Make the number of events buffered to/from tasks configurable

* Assign a PR number

* Fix comment

* Apply suggestions from code review

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

* Rename variables

* Apply suggestions from code review

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-05-15 14:40:10 +02:00
a378a1daec Make trust graph a public field (#14) before_0_19 2020-05-14 17:45:07 +03:00
f737645609 Print latency logs after ClosestIter has finished (#13) 2020-05-14 17:44:07 +03:00
2eb4622a74 Show PeerId as pubkey-inlining if possible, add .as_public_key() #11 2020-05-14 17:40:50 +03:00
0443fea157 Update to latest multihash. (#1566)
* Update to latest multihash.

* Update changelog.

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-05-13 17:51:11 +02:00
a83654ca4c Add a method to create a pre shared key when you already have the raw bytes (#1570) 2020-05-13 17:08:12 +02:00
06721128f1 protocols/kad: Remove unnecessary PeerId conversion for fixed iter (#1573)
`FixedPeersIter` requires the initial set of peers to be passed as
`PeerId`s and not as `Key<PeerId>`s. This commit removes the unnecessary
conversion.
2020-05-13 16:47:02 +02:00
70e797112f protocols/kad/query/closest: Make quickcheck deterministic (#1571)
Instead of creating unconstrained random number generators in quickcheck
tests to generate test data, have quickcheck provide a `Seed` to seed
those random number generators and thus make the test execution
deterministic / reproducible.
2020-05-12 21:31:20 +02:00
5ba7c4831b Permit concurrent dialing attempts per peer. (#1506)
* Permit concurrent dialing attempts per peer.

This is a follow-up to https://github.com/libp2p/rust-libp2p/pull/1440
and relates to https://github.com/libp2p/rust-libp2p/issues/925.
This change permits multiple dialing attempts per peer.
Note though that `libp2p-swarm` does not yet make use of this ability,
retaining the current behaviour. The essence of the changes are that the
`Peer` API now provides `Peer::dial()`, i.e. regardless of the state in
which the peer is. A dialing attempt is always made up of one or more
addresses tried sequentially, as before, but now there can be multiple
dialing attempts per peer. A configurable per-peer limit for outgoing
connections and thus concurrent dialing attempts is also included.

* Introduce `DialError` in `libp2p-swarm`.

For a cleaner API and to treat the case of no addresses
for a peer as an error, such that a `NetworkBehaviourAction::DialPeer`
request is always matched up with either `inject_connection_established`
or `inject_dial_error`.

* Fix rustdoc link.

* Add `DialPeerCondition::Always`.

* Adapt to master.

* Update changelog.
2020-05-12 13:10:18 +02:00
44c0c76981 protocols/kad/query/fixed: Decrease num_waiting on failure (#1572)
Make sure to decrease `num_waiting` when being notified of a peer
failure to allow an additional peer to be queried.

Given that `FixedPeersIter` is initialized with `replication_factor` by
`QueryPool` this bug will not surface today.
2020-05-12 12:23:40 +02:00
bd5e81fedb Spec-compliant Noise Protocol (#1545)
* Add spec-compliant x25519 protocol.

* Cosmetic protobuf spec compliance.

* Keep support for IK/IX. Update changelog.

* Update docs.

* CI
2020-05-06 14:30:23 +02:00
69fd8ac195 Update CI to clang-10 (#1565) 2020-05-06 13:50:18 +02:00
5a8a294f84 #10 Serialize array of records via protobuf janus-v0.0.5 2020-04-30 12:17:04 +03:00
1be34fd7a3 protocols/gossipsub: Correct max transmit size error handling (#1558)
If a user sends a message that is over the maximum transmission size gossipsub
will disconnect from the peer being sent the message.

This PR updates the logic to simply emit an error, not send the over-sized
message but maintain the long-lived streams for future messages.

Co-authored-by: Age Manning <Age@AgeManning.com>
2020-04-28 16:18:35 +02:00
3d4ae5da4b fix: NetworkBehaviour crash if ignoring a non-last struct field (#1554)
Macro was using field_n (field index including ignored fields) for calculations instad of
enum_n (field index excluding ignored fields). When calculating te nesting the calculation
was made between the number of non-ignored fields and a field_n that lead to and overflow.

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-28 11:38:25 +02:00
bdbab32392 tcp: Set IPV6_V6ONLY for IPv6 listeners. (#1555)
* tcp: Set IPV6_V6ONLY for IPv6 listeners.

The current behaviour of listening on an IPv6 address varies depending
on the operating system's IP address stack implementation. Some support
IPv4-mapped IPv6 addresses (e.g. Linux and newer versions of Windows)
so a single IPv6 address would support IPv4-mapped addresses too.
Others do not (e.g. OpenBSD). If they do, then some support them by
default (e.g. Linux) and some do not (e.g. Windows).

This PR attempts to implement the same behaviour accross operating
systems. The strategy is as follows:

Disable IPv4-mapped IPv6 addresses, hence the socket option IPV6_V6ONLY
is always set to true.

This allows binding two sockets to the same port and also avoids the
problem of comparing mixed addresses which leads issues such as #1552.

* Update CHANGELOG and address review concerns.

* Update CHANGELOG.md

Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-24 19:07:27 +02:00
403315dab4 ProtoRecords 2020-04-21 21:45:29 +03:00
122bb921d7 Merge branch 'fluence_master' into memory_store_set 2020-04-21 21:40:48 +03:00
9a865e3735 pub use proto::Record 2020-04-21 21:38:08 +03:00
eb837aad33 make record_{to,from}_proto public 2020-04-21 21:27:35 +03:00
838edad224 impl Hash 2020-04-21 19:54:44 +03:00
51bdf2757d Fix kad behaviour test.rs 2020-04-21 19:54:30 +03:00
8bdd21759c Merge pull request #9 from fluencelabs/merge_libp2p_0_18
Merge libp2p 0.18
2020-04-20 20:39:41 +03:00
190992b780 https => ssh 2020-04-20 19:44:31 +03:00
807217653a fluence janus branch 2020-04-20 19:36:17 +03:00
5e49b42b77 Merge Libp2p 0.18 & 0.18.1 2020-04-20 19:34:21 +03:00
9863c11cd3 Merge branch 'master' into fluence_master
# Conflicts:
#	CHANGELOG.md
#	Cargo.toml
#	core/Cargo.toml
#	misc/core-derive/Cargo.toml
#	misc/peer-id-generator/Cargo.toml
#	muxers/mplex/Cargo.toml
#	muxers/yamux/Cargo.toml
#	protocols/deflate/Cargo.toml
#	protocols/floodsub/Cargo.toml
#	protocols/gossipsub/Cargo.toml
#	protocols/identify/Cargo.toml
#	protocols/kad/Cargo.toml
#	protocols/kad/src/behaviour.rs
#	protocols/kad/src/behaviour/test.rs
#	protocols/mdns/Cargo.toml
#	protocols/noise/Cargo.toml
#	protocols/ping/Cargo.toml
#	protocols/plaintext/Cargo.toml
#	protocols/pnet/Cargo.toml
#	protocols/secio/Cargo.toml
#	swarm/Cargo.toml
#	swarm/src/lib.rs
#	transports/dns/Cargo.toml
#	transports/tcp/Cargo.toml
#	transports/uds/Cargo.toml
#	transports/wasm-ext/Cargo.toml
#	transports/websocket/Cargo.toml
2020-04-20 19:29:58 +03:00
8d8901302b Better routing table printing (#8) works_with_janus 2020-04-20 16:22:13 +03:00
f187fd4d1c CHANGELOG: Add changelog entry for 9f981a4bb6 (#1550) 2020-04-20 10:05:17 +02:00