Commit Graph

110 Commits

Author SHA1 Message Date
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
Pierre Krieger 7469713dea Fix #2073 (#2087) 2019-03-22 18:21:24 +01:00
Pierre Krieger b712795aa2 Fix #1777 (#2072) 2019-03-21 16:49:21 +01:00
Pierre Krieger 90c6f85db5 Add a substrate-peerset crate (#2042)
* Add a substrate-peerset crate

* Some adjustements

* More adjustements

* Use a temporary libp2p branch

* Add back-off mechanism

* Fix RPC tests

* Some adjustements

* Another libp2p bugfix

* Do a round-robin in the peerset

* Use a real dependency instead of a patch for libp2p

* Initialize reserved nodes correctly

* Better diagnostic for no address

* Don't allocate slots if in reserved only

* Ban node on dial failure

* Fix indentation
2019-03-21 14:02:28 +01:00
Pierre Krieger b5957a6aa2 Show the remote PeerId in the handler's logs (#2057) 2019-03-20 17:18:53 +01:00
Pierre Krieger 98a88a7d42 Start the handler init timer later (#2041) 2019-03-20 09:29:58 +01:00
Pierre Krieger 002143d0a2 Remove support for multiple network protocols (#2005)
* Remove support multiple network protocols

* Address concerns

* Add back debug_asserts
2019-03-19 11:56:56 +01:00
Roman Borschel 57387ef585 libp2p-0.5.0 (#1971)
* Update libp2p. Add support for ed25519 node (network) keys.

  * Update networking to the changes from https://github.com/libp2p/rust-libp2p/pull/972.
  * Add support for using ed25519 keys for libp2p networking.
  * Add support for reading libp2p secret keys from (external) files.

* Adapt to changes from https://github.com/libp2p/rust-libp2p/pull/992

* More tests.

* Cosmetics

* Deduplicate tests.

* Remove quickcheck from tests that don't use extra random inputs.

* Remove quickcheck.

* Swap new/default impls for NetworkConfiguration.

* Use libp2p-0.5.0 from crates.io.

* Post-rebase update.

* Remove unnecessary wildcard pattern.

* Combine two overlapping tests.
2019-03-19 11:16:25 +01:00
Pierre Krieger 35a67b31e5 Add a 16MiB hard limit to Substrate packets (#2009) 2019-03-15 14:52:22 +01:00
Pierre Krieger e91426ac77 Add a warning when banning or dropping reserved peers (#1976) 2019-03-12 15:43:22 +01:00
Pierre Krieger ead437d0f4 Remove dialing without a PeerId 2019-03-12 11:47:08 +01:00
Pierre Krieger a3a5031d9d Add timeouts for initialization and opening (#1948)
* Add timeouts for initialization and opening

* Don't keep alive opening and init

* Reset deadline when timer error
2019-03-11 12:09:03 +01:00
Pierre Krieger 0a300b061e Remove the error from network-libp2p (#1950) 2019-03-11 11:40:22 +01:00
Pierre Krieger 97fd1831e9 Fix old connections not being reused (#1934)
* Fix old connections not being reused

* Address issues
2019-03-07 22:15:40 +01:00
Bastian Köcher 7927054f86 Update copyrights to 2019 (#1932) 2019-03-06 15:04:28 +01:00
Gav Wood 828cd9580a Stash/controller model for staking (#1782)
* First steps to stash/controller separation

* More drafting

* More drafting

* Finish draft.

* Optimisation

* Remove accidental commit

* Make it build.

* Fix linked map for traits.

* Fix Option<_> variant.

*  Improve naming a tad

* Rebuild runtime

* Builds!

* First test.

* Bump RT version

* Minor fix

* Update Mock

* adds the correct reward testcase (+staking eras which was already ok)

* fixes the basic staking testcase to work properly (along with a small fix in the module)

* New logic to avoid controller transferring stash.

* Fix some build issues.

* adding some comments to tests

* Fix impls.

* adds a few more lines to explain the test case

* More fixes.

* gets the basic test up and running again

* Fix rest of build

* Rebuild wasm

* Fix docs.

* fix staking test with new chnages

* updating some tests, pending questions

* More working tests

* adds double staking test

* Docs

* remove invalid slashing test

* Payee stuff.

* Fix build

* Docs

* Fix test

* Fix a couple of tests

* Layout plan for finishing tests before Pragmen

* Add some working tests

* re-build staking and reward tests

* Add more tests

* fix offline grace test

* Nominator should have payee checked for cleanup

* adds more nomination tets

* adds validator prefs tests

* Fix and clean up some TODOs

* Fix a couple of issues

* Fix tests

* noting warnings from tests

* final fix of local tests

* Fix slot_stake bug

* Half baked test

* Add logic to limit `unstake_threshold` set in storage

* Make sure to check before writing!

Almost forgot this one

* Move a couple of comments

* fix last broken slot_stake test

* Ignore broken test
2019-03-02 14:31:48 +01:00