Commit Graph

110 Commits

Author SHA1 Message Date
Pierre Krieger 90eef10d5c Address review in #1884 (#1906) 2019-03-01 11:40:57 +01:00
Pierre Krieger c21d7436cc Add an RPC request for the state of the network (#1884)
* Add an RPC request for the state of the network

* Fix concerns

* Fix tests

* Replace comment with TODO

* Rename the RPC
2019-02-28 19:28:38 +01:00
Gregory Terzian bc15fa31ff Add connected peers to protocol, use in sync provider (#1857)
* add connected peers to protocol, use in sync provider

* use PeerId::random

* address comments`

* docs

* fix import of PeerId

* rewrite rpc tests using PeerId::random

* whitespace

* nits

* remove option around peer id and remove field

* further removal of the option around peer id

* fix rpc tests
2019-02-27 18:50:47 +01:00
Pierre Krieger 733ce7d616 Split Substrate messages into multiple substreams (#1796)
* Split Substrate messages into multiple substreams

* Add back Clogged event
2019-02-25 11:55:45 +01:00
Andrew Jones 22aa8482ae Use BandwidthLogging struct from libp2p (#1847)
* Delete existing

* Use bandwidth from libp2p
2019-02-21 19:19:25 +01:00
Pierre Krieger 2b71b3e84b Update to libp2p v0.4 (#1836) 2019-02-21 10:04:53 +01:00
Pierre Krieger 8a3f52bdd8 Fix #1825 (#1828)
* Fix #1825

* Add comment
2019-02-21 10:02:27 +01:00
Roman Borschel cf71350186 Ensure config directory exists. (#1802)
Ensure the config directory exists before trying to write the public key file.
It is the responsibility of obtain_private_key to do so, as per the purpose
of this function.
2019-02-15 09:52:35 +01:00
Stanislav Tkach ff5e4ca87e Migrate everything to the 2018 edition (#1758) 2019-02-13 11:45:59 +01:00
Pierre Krieger 6e26c52191 Add debug name in node infos (#1769) 2019-02-12 18:03:46 +01:00
Pierre Krieger 9e999cdd81 Make network-libp2p's Service generic over the message (#1708)
* Make network-libp2p's Service generic over the message

* Apply suggestions from code review

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

* Fix warning
2019-02-12 15:36:15 +01:00
Pierre Krieger d93769b0fd Fix infinite loop in reserved mode (#1759) 2019-02-11 15:04:23 +00:00
Pierre Krieger 35a4aa638c Make the discovery test more strict (#1721) 2019-02-11 13:47:14 +01:00
Pierre Krieger bf2dd5f419 Reduce the spam from network misbehaviours (#1750)
* Reduce the spam from network misbehaviours

* Add protocol id to misbehaviour
2019-02-11 11:39:14 +01:00
Pierre Krieger 3509b69c4c Remove warning about empty list of identify addresses (#1739) 2019-02-08 15:39:15 +03:00
Pierre Krieger 7afe69066f Fix panic in custom protocol handler (#1723) 2019-02-07 16:16:41 +00:00
Pierre Krieger 0da92bf114 Protect against flood of addresses (#1718) 2019-02-07 14:54:59 +01:00
Pierre Krieger b6fd967dfb Update libp2p to v0.3 (#1634)
* Update libp2p

* Some more diagnostics

* 30 seconds back to 5 seconds

* Bump libp2p-core and improve test

* Fix runtime Cargo.lock

* More work

* Finish upgrade to libp2p 0.3

* Add a maximum of 60 seconds for the rounds

* Remove env_logger

* Update Cargo.lock

* Update Cargo.lock in test-runtime

* Fix test compilation

* Make the test pass

* Add identify addresses to Kademlia

* Don't connect to nodes we're already connected to

* Add warning for non-Substrate nodes

* Fix external address not added

* Start in Enabled mode
2019-02-06 16:39:22 +01:00
Gregory Terzian a2d2ed69ab Rewrite network protocol/service to use channels (#1340)
* rewrite network protocol/service to use channels

* remove use of unwrap

* re-introduce with_spec

* remove unnecessary mut

* remove unused param

* improve with_spec, add with_gossip

* rename job to task

* style: re-add comma

* remove extra string allocs

* rename use of channel

* turn TODO into FIXME

* remove mut in match

* remove Self in new

* pass headers by value to network service

* remove network sender from service

* remove TODO

* better expect

* rationalize use of network sender in ondemand
2019-02-06 12:54:02 +01:00
Pierre Krieger ec790acf4d Print the local node address again (#1628) 2019-01-30 23:33:14 +01:00
Svyatoslav Nikolsky 2037c52fbe make --port 30334 work again (#1620) 2019-01-30 14:46:39 +01:00
Benjamin Kampmann ab4c70b379 Update dependencies (#1527)
* update to latest env_logger

* roundabout dependency update

* Update to latest vengen

* Update rand to 0.6

* Update to latest rng shuffle API

* Roundabout update of dependencies

* Update rustc_hex

* Update wasm

* Fix logging setup in tests

* revert to fix test
2019-01-25 12:44:41 +01:00
Bastian Köcher 27a882bfac Refactor CLI handling (#1368)
* Rework cli handling

* Update readme

* Adds support for custom subcommands and extra run parameters

* Update readme

* Fixes compilation after master merge

* Make "Run" the default subcommand

Actually its hidden to the outside that is an subcommand.

* Rewrite CLI to work without breaking old CLI behavior

* Some cleanup

* Fix incorrect config setup

* Update README

* Fixes after merge

* Fixes incorrect README
2019-01-25 10:48:46 +00:00
Pierre Krieger a1586df41b Report the average network bandwidth (#1551)
* Report the average network bandwidth

* Fix concerns
2019-01-25 10:34:34 +00:00
Pierre Krieger d30a8e0bc3 Log the clogging networking messages (#1532) 2019-01-23 15:24:25 +01:00
Pierre Krieger cd86643f33 Report when peer is clogged (#1528) 2019-01-23 14:30:20 +01:00
Pierre Krieger 3c7d6c7b72 Add some networking tests (#1480) 2019-01-21 19:26:12 +01:00
Pierre Krieger f67c2cc181 Store identification info about the remote (#1500)
* Store identification info about the remote

* Add node name on the wire

* Fix tests
2019-01-21 14:33:25 +01:00
Pierre Krieger 763d133173 Put back support for WebSockets in the transport (#1486) 2019-01-19 12:41:17 +01:00
Pierre Krieger b009b42a68 Update network-libp2p to edition 2018 (#1481) 2019-01-19 12:38:52 +01:00
Pierre Krieger f1f32ac620 Don't queue messages after shutdown (#1476) 2019-01-19 12:37:07 +01:00
Pierre Krieger eb000fb1ae Remove warning for large buffer (#1357) 2019-01-17 09:33:39 +01:00
Pierre Krieger 9018d752dc Update libp2p-kad and libp2p-secio (#1447)
* Update libp2p-kad and libp2p-secio

* Fix concern
2019-01-16 12:59:24 -03:00
Xiliang Chen 623775ad96 enable dns transport (#1433) 2019-01-15 11:23:32 +01:00
Pierre Krieger a0d458aa06 Update to latest libp2p (#1386)
* Update to latest libp2p

* Fix indentations

* Add basic test

* Apply suggestions from code review

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

* Remove Mutex from topology

* Remove unused method

* Fix concerns
2019-01-14 13:38:36 +01:00
Benjamin Kampmann ab12c739ff Upgrade the rocksdb dependency to 0.11 (#1398) 2019-01-11 16:40:36 +01:00
Pierre Krieger 42c30609d3 Update ring to 0.13 and subtle to 2.0 (#1383) 2019-01-10 13:32:27 +01:00
Xiliang Chen eb3503b0c7 expose peer information via rpc (#1362)
* expose peer information via rpc

* fixes tests

* cleanup

Co-Authored-By: xlc <xlchen1291@gmail.com>

* Update docs

Co-Authored-By: xlc <xlchen1291@gmail.com>

* Add missing docs

* keep original type for PeerInfo best_hash/best_number

* cleanup

* Update mod.rs
2019-01-09 12:18:24 +01:00
Alexander Krupenkin e14da81084 Fix duplicate sources (paritytech/polkadot#62) (#1351) 2019-01-09 11:26:17 +01:00
Shawn Tabrizi c4010edb75 Updating parking_lot dependencies to 0.7.1 (#1361) 2019-01-08 11:15:42 +01:00
Jordan Beauchamp da822276dd Move create network folder structure to top level of start_service (#1224)
Fixes issue where the network folder is not created when run
with '--node-key' arg
2018-12-07 10:08:20 +01:00
Andrew Jones c36998aeaf Default boot_nodes to local node in build-spec (#1181)
* Default to local bootnode with build-spec

* Rexport libp2p stuff via network crate

* Remove unused imports and fix where formatting

* Remove spurious blank lines

* Remove unnecessary else clause
2018-12-01 16:47:40 +08:00
azban a2ba7b71d6 network-libp2p: add derive to ServiceEvent (#1118) 2018-11-15 12:34:44 +01:00
Luke Schoen 037f9dde10 docs: Extends #999. Remove disused package readmes. Rename to sr-metadata. Fix Readme Rustdoc names (#1016)
* docs: Remove safe-mix since is no longer local dependency

* docs: Fix existing packages link. Still only includes Substrate Core

* docs: Remove empty package Readmes. Remove old docs links. Rename to Readme

* docs: Remove link to old docs

* misc: Merge latest from master. Renaem to sr-metadata. Fix list of RustDoc package names

* Rename substrate-metadata to sr-metadata, since it is in the "srml" subdirectory

* Change example to use package name that opens all packages in RustDocs

* Fix list of packages names that are available to open in RustDocs

* fix typo

* fix ordering of CLI options and add missing backslash
2018-11-12 21:18:06 +01:00
Pierre Krieger b76ba06472 Some minor TODOs removal (#1102)
* Only reconnect if topology changed

* Minor changes
2018-11-12 17:54:57 +01:00
David 7eef5cc3f8 Update substrate to use libp2p master as of nov 9 (#1095)
* WIP

* Use latest lip2p master
2018-11-09 13:32:29 +00:00
Pierre Krieger fcae7ac582 Switch to libp2p master (#931) 2018-11-05 19:22:26 +01:00
Wei Tang 2604474880 Multiple storage root support (#902)
* Implement a non generic version of child delta trie

* Use delta_trie_root in state_machine

* Expand InMemory backend to support multi-storage

* Create Consolidate trait

* Fix all crate compile and remove unused OverlayedChanges::drain

* Implement child storage root support and overlay changes

* Add child storage reader

* Add child storage writer

* Implement child storage cleaning

* Fix light backend compile

* Add all required ext functions for wasm executor

* Add ext def to io

* Add all io functions

* Fix nostd compile

* Add simple test

* Remove unnecessary vec copy in child_storage_root_transaction

* Use values_mut/for_each to make it shorter

* Use extend to shorter a for loop

* Move record_all_keys to trie so it's easier to generic them later

* space -> tab

* Remove to_owned in debug format

* Clean out all to_owned

* Break debug_trace to multiple lines

* Remove 0..

* UserError copy/paste typo

* Replace Vec::from_raw_parts by slice::from_raw_parts

* Use iter::empty()

* Wrap some long lines

* Wrap a missing line

* Remove unnecessary map

https://github.com/paritytech/substrate/pull/856#discussion_r226222663

* Call ext_free after from_raw_parts

* Fix tests in other crates
2018-10-18 18:54:02 +02:00
Pierre Krieger 15fe5f7540 Remove the packet ID system (#900) 2018-10-16 12:57:42 +01:00
Pierre Krieger 8050979660 Rename min-peers and max-peers CLI options (#909) 2018-10-16 08:34:59 +01:00