Commit Graph

67 Commits

Author SHA1 Message Date
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
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