1240 Commits

Author SHA1 Message Date
folex
d67804fdd8 make kademlia.trust public 2020-05-12 03:16:33 +03:00
folex
a731464acf remove cx from logs 2020-05-09 17:50:12 +03:00
folex
2c8c37f00e trace => warn 2020-05-09 17:42:38 +03:00
folex
33177eed65 kad handler logs 2020-05-09 17:40:54 +03:00
folex
3cc004462b remove \n 2020-05-09 17:09:46 +03:00
folex
11d47ac71c Remove Records 2020-05-08 20:40:57 +03:00
folex
8a0efdb443 fix log 2020-05-07 21:08:09 +03:00
folex
1e330d9e19 println => debug 2020-05-07 18:34:12 +03:00
folex
9aab8add5d add +ms to finished, print kademlia events 2020-05-07 15:38:37 +03:00
folex
eaddad6117 print iterlog in all cases 2020-05-07 14:23:05 +03:00
folex
546407bf28 zero negative 2020-05-07 01:03:16 +03:00
folex
757c4a6d9c ignore Instant in PeerState::Waiting 2020-05-07 01:01:31 +03:00
folex
fbf8968be1 log empty log 2020-05-07 00:49:01 +03:00
folex
be7de46542 print em logs 2020-05-07 00:39:56 +03:00
folex
6d14ca74c4 trace => info 2020-05-07 00:27:19 +03:00
folex
81f15b5ec5 add iterlog 2020-05-06 23:56:38 +03:00
folex
91c94f5537 as_public_key() 2020-04-30 17:06:30 +03:00
folex
082953e34c base58 inline in Debug 2020-04-30 16:48:51 +03:00
folex
c9da72704e remove unnecessary .to_base58() 2020-04-30 16:34:26 +03:00
folex
5060703f2b Display PeerId as inlining base58 2020-04-30 16:07:59 +03:00
folex
5a8a294f84
#10 Serialize array of records via protobuf janus-v0.0.5 2020-04-30 12:17:04 +03:00
folex
403315dab4 ProtoRecords 2020-04-21 21:45:29 +03:00
folex
122bb921d7 Merge branch 'fluence_master' into memory_store_set 2020-04-21 21:40:48 +03:00
folex
9a865e3735 pub use proto::Record 2020-04-21 21:38:08 +03:00
folex
eb837aad33 make record_{to,from}_proto public 2020-04-21 21:27:35 +03:00
folex
838edad224 impl Hash 2020-04-21 19:54:44 +03:00
folex
51bdf2757d Fix kad behaviour test.rs 2020-04-21 19:54:30 +03:00
folex
8bdd21759c
Merge pull request #9 from fluencelabs/merge_libp2p_0_18
Merge libp2p 0.18
2020-04-20 20:39:41 +03:00
folex
190992b780 https => ssh 2020-04-20 19:44:31 +03:00
folex
807217653a fluence janus branch 2020-04-20 19:36:17 +03:00
folex
5e49b42b77 Merge Libp2p 0.18 & 0.18.1 2020-04-20 19:34:21 +03:00
folex
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
folex
8d8901302b
Better routing table printing (#8) works_with_janus 2020-04-20 16:22:13 +03:00
Max Inden
f187fd4d1c
CHANGELOG: Add changelog entry for 9f981a4bb6 (#1550) 2020-04-20 10:05:17 +02:00
Max Inden
9f981a4bb6
src/query/peers/closest: Consider K_VALUE peers at initialization (#1536)
* protocols/kad/query/peers/closest: Consider K_VALUE nodes at init

By considering `K_VALUE` at `ClosestPeersIter` initialization, the initial peer
set length is independent of `num_results` and thus of the `replication_factor`.

* protocols/kad/src/behaviour/test: Enable building single nodes

Introduces the `build_node` function to build a single not connected
node. Along the way replace the notion of a `port_base` with returning
the actual `Multiaddr` of the node.

* protocols/kad/behaviour/test: Fix bootstrap test initialization

When looking for the closest node to a key, Kademlia considers
ALPHA_VALUE nodes to query at initialization. If `num_groups` is larger
than ALPHA_VALUE the remaining locally known nodes will not be
considered. Given that no other node is aware of them other than node 1,
they would be lost entirely. To prevent the above restrict `num_groups`
to be equal or smaller than ALPHA_VALUE.

* protocols/kad/behaviour/test: Fix put_record and get_provider

In the past, when trying to find the closest nodes to a key, Kademlia
would consider `num_result` amount of nodes to query out of all the
nodes it is aware of.

Both the `put_record` and the `get_provider` tests initialized their
swarms in the same way. The tests took the replication factor to use as
an input. The number of results to get was equal to the replication
factor. The amount of swarms to start was twice the replication factor.
Nodes would be grouped in two groups a replication factor nodes. The
first node would be aware of all of the nodes in the first group. The
last node of the first group would be aware of all the nodes in the
second group.

By coincidence (I assume) these numbers played together very well. At
initialization the first node would consider `num_results` amount of
peers (see first paragraph). It would then contact each of them. As the
first node is aware of the last node of the first group which in turn is
aware of all nodes in the second group, the first node would eventually
discover all nodes.

Recently the amount of nodes Kademlia considers at initialization when
looking for the nodes closest to a key was changed to only consider
ALPHA nodes.

With this in mind playing through the test setup above again would
result in (1) `replication_factor - ALPHA` nodes being entirely lost as
the first node would never consider them and (2) the first node probably
never contacting the last node out of the first group and thus not
discovering any nodes of the second group.

To keep the multi hop discovery in place while not basing ones test
setup on the lucky assumption of Kademlia considering replication factor
amount of nodes at initialization, this patch alters the two tests:

Build a fully connected set of nodes and one addition node (the first
node). Connect the first node to a single node of the fully connected
set (simulating a boot node). Continue as done previously.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
2020-04-17 19:57:35 +02:00
Pierre Krieger
87b5efb3e8
Make sure inject_dial_failure is called (#1549)
* Make sure inject_dial_failure is called

* Update CHANGELOG

* Make libp2p-kad tests pass

* Fix again

* Update swarm/src/lib.rs

Co-Authored-By: Toralf Wittner <tw@dtex.org>

* Revert "Fix again"

This reverts commit 80c0d3d908aff282d492f213d2ce34d12489167d.

* Bump versions and CHANGELOG

* Oops, didn't bump libp2p-swarm in libp2p

Co-authored-by: Toralf Wittner <tw@dtex.org>
v0.18.1
2020-04-17 18:13:16 +02:00
Max Inden
77a34c0a0d
protocols/kad/query/peers/closest: Make at_capacity use max (#1548)
When not making progress for `parallelism` time a `ClosestPeersIter`
becomes `State::Stalled`. When stalled an iterator is allowed to make
more parallel requests up to `num_results`. If `num_results` is smaller
than `parallelism` make sure to still allow up to `parallelism` requests
in-flight.

Co-Authored-By: Roman Borschel <romanb@users.noreply.github.com>
2020-04-16 15:33:09 +02:00
Pierre Krieger
aa71158e5c
Publish 0.18.0 (#1547) v0.18.0 2020-04-09 16:54:01 +02:00
Roman Borschel
d2eebf2619
Treat connection limit errors as pending connection errors. (#1546)
* Treat connection limit errors as pending connection errors.

* Remove handler from network event.

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-09 16:22:49 +02:00
Thomas Eizinger
803eb10dcd
Disambiguate calls to NetworkBehaviour::inject_event (#1543)
* Disambiguate calls to NetworkBehaviour::inject_event

There is a gnarly edge-case with the custom-derive where rustc
cannot disambiguate the call if:

- The NetworkBehaviourEventProcess trait is imported
- We nest NetworkBehaviours that use the custom-derive

* Update misc/core-derive/src/lib.rs

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

* Fix build and add CHANGELOG

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-09 16:01:26 +02:00
Pierre Krieger
8adf474b38
Fix parsed is null error (#1535)
* Fix parsed is null error

* Update CHANGELOG
2020-04-09 15:36:52 +02:00
Joonas Koivunen
80ea2f6fd7
feat: allow sent messages seen as subscribed (#1520)
* feat: allow sent messages seen as subscribed

minor feature to allow mimicing the behaviour expected by ipfs api tests.

* refactor: rename per review comments

* refactor: rename Floodsub::options to config

* chore: update changelog

* Update CHANGELOG.md

Co-Authored-By: Max Inden <mail@max-inden.de>

Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-09 15:15:17 +02:00
Max Inden
c1191d5f83
protocols/kad/behaviour: Return peers independent of record existence (#1544)
A node receiving a `GetRecord` request first checks whether it has the
given record. If it does have the record it does not return closer
nodes.

A node that knows the record for the given key is likely within a
neighborhood of nodes that know the record as well. In addition the node
likely knows its neighboorhood well.

When querying for a key with a quorum of 1 the above behavior of only
returning the record but not any close peers is fine. Once one queries
with a higher quorum having a node respond with the record as well as
close nodes is likely going to speed up the query, given that the
returned peers probably know the record as well.
2020-04-08 10:31:45 +02:00
vms
f67e9533e7
Merge pull request #7 from fluencelabs/fix
Fix patch for libp2p 0.17
2020-04-06 14:38:07 +03:00
vms
9d078e87ea another fix 2020-04-06 14:26:00 +03:00
vms
774661c756 are you kidding me? 2020-04-06 13:53:19 +03:00
vms
910ffd580c wip 2020-04-06 13:48:36 +03:00
vms
1c309b5e41 fix patching 2020-04-06 13:25:11 +03:00
vms
865a23e465
Merge pull request #6 from fluencelabs/libp2p_0.17
libp2p 0.17
2020-04-06 13:12:05 +03:00
vms
077b3301ab libp2p 0.17 2020-04-06 12:55:56 +03:00