Commit Graph

125 Commits

Author SHA1 Message Date
Pierre Krieger 6130ff3f46 Don't pass the Endpoint as message (#2814) 2019-06-06 22:12:55 +02:00
Pierre Krieger e18dc6d53c Update to libp2p 0.9.1 (#2804) 2019-06-06 11:50:22 +02:00
Benjamin Kampmann eaa0ab014a Move import lock onto backend (#2797)
* Drop import_lock from client, move it into backend, impl default version via static mutex

* still need to allow depcretion because of client.backend

* additional docs

* Remove default impl of get_import_lock, impl on instances

* Bump parking_lot to 0.8.0 accross the board
2019-06-05 15:46:01 +02:00
Pierre Krieger 9ae3082ef0 Update to libp2p 0.9 (#2783)
* Update to libp2p 0.9

* Fix browser-WASM
2019-06-04 20:11:17 +02:00
Pierre Krieger 9904da17bb Add warning about secp256k1 network keys (#2764) 2019-06-03 14:48:46 +02:00
Pierre Krieger 25b88f1a1f Allow passing an optional transport to network-libp2p (#2680)
* Allow passing an optional transport

* Fix tests

* Fix Cargo.lock

* Fix Cargo.lock again?!?!
2019-05-28 12:54:02 +02:00
Pierre Krieger e7d12e2915 Fix not connected peers being connected peers (#2692) 2019-05-27 12:01:07 +02:00
Tomasz Drwięga c162fc5ff1 Expunge error-chain (feat. tomaka) (#2662)
* Remove error_chain

* Expunge error-chain from rpc and service.

* Expunge from transaction pool.

* Expunge from node/cli

* Expunge from keystore.

* Remove some boilerplate.

* Fix remaining stuff.

* Improve on deprecation message.

* Fix issues.

* Fix trnsaction pool tests.

* Fix the rest.

* Fix borked merge.

* Update lock
2019-05-24 10:35:31 +01:00
Pierre Krieger d05f35f764 Make info! string less ambiguous (#2661) 2019-05-23 10:06:38 +01:00
Pierre Krieger 85ce4623ce Update to libp2p 0.8 (#2607)
* Update to libp2p 0.8

* Fix CLI tests

* Zeroize
2019-05-20 15:47:52 +02:00
Pierre Krieger c4e3970d9f Keep node information about disconnection (#2596)
* Keep node information about disconnection

* Fix line widths
2019-05-15 18:11:41 +02:00
Pierre Krieger 5bde98e95a Increase tolerance for bandwidth usage in test (#2576) 2019-05-14 14:40:06 +02:00
Pierre Krieger d974189e3c Make the behaviour in libp2p generic (#2525)
* Make the behaviour in libp2p generic

* Fix indentation

* Fix bad merge
2019-05-13 20:55:39 +02:00
André Silva 9d23d2a25a Bump master to v2.0.0 (#2514)
* bump crates to v2.0.0

* fix crate authors

* bump node runtime spec_version

* remove unused import for no-std
2019-05-10 16:55:15 +02:00
Pierre Krieger 4aa44ab280 Rewrite the PSM (#2440)
* Rewrite the PSM

* Fix disconnecting from reserved peers

* Minor adjustements

* Address review

* Reputation changes adjustements

* More adjustements

* Adjust all reputations

* More fixes and adjustments

* Improve proof

* Remove the possible panic

* Make sure reputation reaches 0
2019-05-10 14:08:42 +02:00
Pierre Krieger 2dea51cd3b Add some crate-level documentation to network-libp2p (#2483) 2019-05-06 13:10:37 +02:00
Pierre Krieger 82cb52a400 Show more information when too many addresses are reported (#2473)
* Show more information when too many addresses are reported

* Update core/network-libp2p/src/behaviour.rs

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>
2019-05-06 09:32:35 +02:00
Pierre Krieger 8ca343ca8c Add reputation system to network crate (#2454) 2019-05-04 13:51:06 +02:00
Pierre Krieger 52472238bd Drop connections when the handler gets disabled (#2439)
* Drop connections when the handler gets disabled

* Add test
2019-05-02 21:03:04 +02:00
Pierre Krieger 586dce10ed Simplify the code of connection_keep_alive (#2438) 2019-05-02 20:32:05 +02:00
Pierre Krieger dbff5c4962 Add reason for closing and fix multiple substreams (#2437) 2019-05-01 09:42:54 +02:00
Pierre Krieger 0b6490854d Make libp2p compile for wasm32-unkown-unknown (#2412)
* Make libp2p compile for wasm32-unkown-unknown

* Fix tests

* Add some crates
2019-04-29 16:07:40 +02:00
Pierre Krieger 9d7a72027c Fix #2403 (#2404)
* Fix #2403

* Apply suggestions from code review

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>
2019-04-29 12:05:20 +02:00
Pierre Krieger 48d53a35b7 Allow multiple substreams (#2379)
* Allow multiple substreams

* Update core/network-libp2p/src/custom_proto/handler.rs

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>
2019-04-27 16:33:42 +02:00
Michael Müller a0e0d9b03d Fix typos and markdown (#2388)
* Fix typos

* Align properly

* Update core/consensus/slots/src/lib.rs

Co-Authored-By: cmichi <mich@elmueller.net>

* Update core/network/src/test/mod.rs

Co-Authored-By: cmichi <mich@elmueller.net>

* Update core/finality-grandpa/src/communication/mod.rs

Co-Authored-By: cmichi <mich@elmueller.net>

* Update core/consensus/common/src/import_queue.rs

Co-Authored-By: cmichi <mich@elmueller.net>
2019-04-26 14:09:13 +02:00
Pierre Krieger f3df7250e9 Remove the multiplexed networking system (#2373)
* Remove the multiplexed networking system

* Rename BackCompat to Normal

* Remove CustomMessageId

* Fix tests
2019-04-25 11:39:57 +02:00
Pierre Krieger 5b3e31266b Silence the spam a little bit (#2362) 2019-04-24 11:58:08 +02:00
Pierre Krieger 3f06fe32f3 Update to libp2p v0.7.0 (#2343)
* Update to libp2p master

* Fix tests

* More tests fixing
2019-04-23 18:46:30 +01:00
Sergei Pepyakin e2bb429711 Use serde derive feature. (#2351)
* core/primitives

* sr-primitives

* sr-primitives

* srml-treasury

* substrate-executor

* substrate-keystore

* network-libp2p

* substrate-service

* srml-system

* substrate-rpc

* sr-version

* substrate-telemetry

* substrate-test-runtime

* substrate-transaction-pool

* node-template-runtime

* node-primitives

* srml-consensus

* srml-contract

* srml-democracy

* srml-finality-tracker

* srml-grandpa

* srml-metadata

* srml-support

* Clean

* Update locks
2019-04-23 18:42:42 +02:00
Pierre Krieger b483c5608f ProtocolId can now be more than 3 bytes (#2350) 2019-04-23 17:15:21 +01:00
Pierre Krieger 648dcc2728 Add warnings about breaking changes in network (#2348) 2019-04-23 16:34:47 +02:00
mattrutherford 778bf0256f Telemetry - change NetworkState from string to json (#2338)
* change NetworkState from string to json in telemetry
2019-04-22 18:30:01 +01:00
Marek Kotewicz 294115c67d substrate-network-libp2p uses tokio_timer::clock::Clock to get current time (#2296) 2019-04-19 13:24:53 +02:00
Pierre Krieger 0ae060d4d1 Use ed25519 by default for network keys (#2290) 2019-04-17 12:03:00 +02:00
Pierre Krieger decddaab0f Fix state inconsistency between handler and behaviour (#2220)
* Fix state inconsistency between handler and behaviour

* Fix the error! being in the wrong place
2019-04-05 19:07:09 +02:00
Marek Kotewicz b01136c90d Peerset::discovered accepts many peer ids (#2213)
* Peerset::discovered accepts many peer ids

* Improve tracing in peerset
2019-04-05 14:44:46 +02:00
Marek Kotewicz 1142bcde97 simplification of peerset api (#2123)
* Introduction of PeersetHandle

* integrate PeersetHandle with the rest of the codebase

* fix compilation errors

* more tests for peerset, fixed overwriting bug in add_reserved_peer

* Slots data structure and bugfixes for peerset

* bend to pressure

* updated lru-cache to 0.1.2 and updated linked-hash-map to 0.5.2

* peerset discovered list is now a LinkedHashMap

* fix review suggestions

* split back Peerset and PeersetHandle

* test for Peerset::discovered

* applied review suggestions

* fixes to peerset::incoming

* peerset disconnects are all instantaneous

* instantaneous drop in peerset finished

* Peerset::set_reserved_only can also reconnect nodes

* Peerset scores cache uses lru-cache

* remove redundant function call and comment from Peerset::on_set_reserved_only

* add_peer returns SlotState enum

* apply review suggestions

* is_reserved -> is_connected_and_reserved
2019-04-04 19:40:40 +02:00
Arkadiy Paronyan 301844dd56 Disconnect on protocol timeout (#2212) 2019-04-04 18:01:28 +02:00
Pierre Krieger e89ce263bd Minor logging improvements in libp2p (#2162) 2019-04-02 09:38:44 +02:00
Gav Wood eca163ba64 Bump version to 1.0.0 globally (#2149)
* Bump versionb globally

* Rebuild and fix

* Rename fixes

* Rebuild

* Minor fix and code formatting for validator election

* Fix tests

* More test fixes

* Fix several bugs in phragmen elections.

* Rebuild, remove pointless closures
2019-04-01 15:16:06 +02:00
Pierre Krieger 3dfda381d5 Add support for mDNS (#2153)
* Use libp2p 0.6.0 instead of a custom branch

* Add support for mDNS

* Fix tests

* Nit
2019-03-31 19:47:15 -04:00
Pierre Krieger d4a4022dd1 Use libp2p 0.6.0 instead of a custom branch (#2150) 2019-03-30 20:53:20 +00:00
Arkadiy Paronyan e3516d2bf4 Track peers in network-libp2p (#2135) 2019-03-28 17:21:53 +01:00
Pierre Krieger a9420424b2 Improvements to system_networkState (#2088) 2019-03-26 14:45:11 +01:00
Pierre Krieger 4fe70ee639 Forgot to handle Banned in inject_connected (#2107)
* Forgot to handle Banned in inject_connected

* Also add debug for the state
2019-03-25 14:48:43 +01:00
Pierre Krieger 44db5f44e3 Directly connect if notice that ban has expired (#2100) 2019-03-24 11:49:38 +01:00
Pierre Krieger b6c54b5c40 Always accept incoming connections (#2101) 2019-03-24 11:48:53 +01:00
Pierre Krieger a1f3b0b529 Fix hardcoded values in the PSM config (#2103) 2019-03-24 11:29:45 +01:00
Pierre Krieger 418edcfbac Don't print dozens of the times the handler init warning (#2089) 2019-03-23 12:44:35 +01:00
Pierre Krieger 6e394464b8 Replace NodeIndex with PeerId everywhere (#2077)
* Replace NodeIndex with PeerId

* Fix tests

* More test fixing

* Whitespace
2019-03-23 10:34:28 +01:00