Commit Graph

244 Commits

Author SHA1 Message Date
Pierre Krieger 4720f0fdda Move the legacy protocol handshake to the legacy substream (#5938)
* Move the legacy protocol handshake to the legacy substream

* Fix tests

* Remove line that wasn't supposed to be committed

* Remove hack

* Rework how it's done

* Some little changes

* update_chain wasn't doing its thing

* Fix service tests not calling update_chain

* Update client/network/src/protocol/generic_proto/behaviour.rs

Co-authored-by: Max Inden <mail@max-inden.de>

* [WIP]

* Revert "[WIP]"

This reverts commit 2b892e6a7637c0b1297e6ecdbb919321c9098ff5.

* Update client/network/src/protocol.rs

Co-authored-by: Max Inden <mail@max-inden.de>

* Fix received message not being handshake

* Update client/network/src/protocol/generic_proto/behaviour.rs

Co-authored-by: Max Inden <mail@max-inden.de>

Co-authored-by: Max Inden <mail@max-inden.de>
2020-07-15 09:29:10 +00:00
Pierre Krieger 4613dc2af4 Remove legacy Clogged event (#6652) 2020-07-14 15:43:08 +00:00
Pierre Krieger 150ef0a40a Deduplicate some dependencies (#6628) 2020-07-10 09:28:10 +00:00
Bastian Köcher 94cddee160 Improve transaction submission (#6599)
* Improve transaction submission

Before this pr the transaction pool validated each transaction, even if
the transaction was already known to the pool. This pr changes the
behavior to first check if we are already aware of a transaction and
thus, to only validate them if we don't know them yet. However, there is
still the possibility that a given transaction is validated multiple
times. This can happen if the transaction is added the first time, but
is not yet validated and added to the validated pool.

Besides that, this pr fixes the wrong metrics of gossiped transactions
in the network. It also moves some metrics to the transaction pool api,
to better track when a transaction actually is scheduled for validation.

* Make sure we don't submit the same transaction twice from the network concurrently

* Remove added listener call

* Feedback

* Ignore banned on resubmit
2020-07-08 17:42:42 +02:00
Max Inden faa72caf91 *: Update to libp2p v0.21.1 (#6559)
* *Cargo.toml: Update versions

* client/network/src/discovery: Adjust to Kademlia  API changes

* client/network: Adjust to one_shot.rs changes

* client/network/discovery: Log address list on trace level

* client/network/discovery: Ignore RoutablePeer and PendingRoutablePeer

* Commit Cargo.lock

* Finish update

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-07-08 14:00:30 +00:00
Pierre Krieger 8ca05879e8 Send Status message on all newly-opened legacy substreams (#6593)
* Send Status message on all newly-opened legacy substreams

* Fix tests
2020-07-08 11:44:51 +00:00
Max Inden 62f306d972 client/network: Rename DebugInfoBehaviour to PeerInfoBehaviour (#6556)
Information retrieved via `DebugInfoBehaviour` is not only used for
debugging purposes, e.g. disconnecting from nodes not responding to
pings, using external addresses retrieved via indentify, ...

In order for the name to reflect the usage of the module this commit
renames it.
2020-07-08 09:08:47 +00:00
Max Inden 635310c8d4 client/network: Remove unused Result returned by NetworkWorker (#6552) 2020-07-02 15:18:08 +02:00
Bastian Köcher 53be6ec510 Support synching of blocks that are not new_best (#6508)
* Start

* Remove debug println

* Add tests
2020-06-30 14:44:52 +00:00
Toralf Wittner 3de2a88075 Update to libp2p v0.20.1 (#6465)
* Update to libp2p-0.20.0

* Update to `libp2p-0.20.1`.

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-06-30 08:02:51 +00:00
Benjamin Kampmann f6ebd5f87d Releasing rc4 – Rhinoceros (#6515)
Co-authored-by: Martin Pugh <pugh@s3kr.it>
2020-06-25 23:18:43 +02:00
Cecile Tonglet 4bf044eac6 Ensure the listen addresses are consistent with the transport (#6436)
* Initial commit

Forked at: 82bdf1a891
No parent branch.

* Ensure the listen addresses are consistent with the transport

* Update client/network/src/error.rs

* Update client/network/src/service.rs

* Better implementation

* Fix bad previous impl

* add boot_nodes

* reserved nodes

* test boot nodes

* reserved nodes tests

* add public_addresses and make specific error type

* Update client/network/src/error.rs

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-06-23 17:26:00 +02:00
Max Inden bd79b3debc client/network/service: Add primary dimension to connection metrics (#6472)
* client/network/service: Add primary dimension to connection metrics

Two nodes can be interconnected via one or more connections. The first
of those connections is called the primary connection.

This commit adds another dimension to the
`sub_libp2p_connections_{closed,opened}_total` metrics to differentiate
primary and non-primary connections being opened / closed.

By intuition more than one connection between two nodes is rare.
Tracking the fact whether a connection is primary or not will help prove
or disprove this intuition.

* .maintain/monitoring: Ensure to sum over all connections_closed variants

* client/network/service: Rename is_primary to is_first

* client/network/service: Split by metric name with two additional metrics

* Revert ".maintain/monitoring: Ensure to sum over all connections_closed variants"

This reverts commit 2d2f93e414440b9fc9e8f7fae6fe48bd95af6b8f.

* client/network/service: Remove labels from distinct metrics
2020-06-23 17:25:42 +02:00
Roman Borschel 6aa8965f33 Avoid panic on dropping a sc_network::service::out_events::Receiver. (#6458)
* Avoid panic on dropping a `Receiver`.

* CI
2020-06-23 10:51:35 +02:00
André Silva d9776d8233 network: remove unused variable (#6460) 2020-06-22 20:41:37 +02:00
Nikolay Volf 36d2eefdc9 change everything to transaction (#6440) 2020-06-21 12:34:19 +02:00
Arkadiy Paronyan 7b34438178 Validate encoding of extrinsics passed to runtime (#6442)
* Validate encoding of extrinsics passed to runtime

* Bump codec version explicitly
2020-06-19 19:27:16 +00:00
Nikolay Volf 6e85555e0b add network propagated metrics (#6438) 2020-06-19 17:40:39 +03:00
Bastian Köcher 7858828d98 Update sync chain info on own block import (#6424)
Before we only updated the chain info of sync when we have imported
something using the import queue. However, if you import your own
blocks, this is not done using the import queue and so sync is not
updated. If we don't do this, it can lead to sync switching to "major
sync" mode because sync is not informed about new blocks. This
especially happens on Cumulus, where a collator is selected multiple
times to include its block into the relay chain and thus, sync switches
to major sync mode while the node is still building blocks.
2020-06-19 16:00:58 +02:00
Pierre Krieger dd7830d481 Remove --legacy-network-protocol CLI flag (#6411) 2020-06-19 00:23:58 +02:00
Pierre Krieger 527cc35afb Increase network buffer sizes even more (#6080) 2020-06-18 11:55:45 +00:00
arkpar 850ee8b43a Revert "Block packet size limit"
This reverts commit 08e0747d2b.
2020-06-18 10:43:03 +02:00
arkpar 08e0747d2b Block packet size limit 2020-06-18 10:39:54 +02:00
Pierre Krieger fec43fe6d7 Remove penalty on duplicate Status message (#6377) 2020-06-18 09:34:53 +02:00
Svyatoslav Nikolsky 194b3dfb17 fix BlockAttributes encoding (#6281) 2020-06-16 22:51:45 +02:00
Pierre Krieger 0787b189fa Use /dns/ instead of /dns4/ (#6369) 2020-06-16 22:49:44 +02:00
Roman Borschel 731e7d77c7 Find the alive incoming entry on disconnect. (#6320)
When a peer in `Incoming` state disconnects, the "alive" entry
in the `incoming` list for that peer must be updated (set to `false`).
Currently the entry that is updated may be an earlier entry for the
same peer that is already no longer alive. This can happen if a
peer repeatedly connects (incoming) and disconnects between invocations to
`poll()` of the behaviour.
2020-06-11 11:55:55 +02:00
Roman Borschel 273f31b7aa Avoid self-lookups in Authority Discovery (#6317)
* Ensure authority discovery avoids self-lookups.

Thereby additionally guard the `NetworkService` against
adding the local peer to the PSM or registering a
"known address" for the local peer.

* Clarify comments.

* See if returning errors is ok.
2020-06-10 18:50:37 +02:00
Denis Pisarev f9c0c6a719 New CI image (#6223)
* fix (ci): hotfix Docker release

* change (ci): moving to the tested CI image with a proper name

* change (ci): rename substrate-ci-linux

* Reduce the lots_of_incoming_peers_works test load (#6314)

* change (ci): moving to the tested CI image with a proper name

* change (ci): rename substrate-ci-linux

* Reduce the lots_of_incoming_peers_works test load (#6314)

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-06-10 13:12:21 +02:00
Pierre Krieger 07b984b609 Add a test for lots of nodes connecting at the same time (#6247)
* Add a test for lots of nodes connecting at the same time

* Do small change
2020-06-09 16:30:34 +02:00
Cecile Tonglet 8034285da4 Allow adding a prefix to the informant (#6174)
* Initial commit

Forked at: 1d93746b64
Parent branch: origin/master

* Add a Service Configuration's field + adapt informant + provide means to CLI

* CLEANUP

Forked at: 1d93746b64
Parent branch: origin/master

* fix tests

* fixed bad path to object

* Change OutputFormat enum to struct

* Add informant_prefix to builder and service

* Revert "Change OutputFormat enum to struct"

This reverts commit cd86c583c92668426c35cc174401155bf2880c1f.

* Revert "fix tests"

This reverts commit a3c306ebe94720f350c5bc74b9c5fcde2565d340.

* Revert "Add a Service Configuration's field + adapt informant + provide means to CLI"

This reverts commit 9c2e7267423305705916c30d605893524113c8e3.

* Implementation using the ServiceBuilder

* reduce line length

* fix line width again

* WIP

Forked at: 1d93746b64
Parent branch: origin/master

* WIP

Forked at: 1d93746b64
Parent branch: origin/master

* WIP

Forked at: 1d93746b64
Parent branch: origin/master

* use struct instead of enum

* WIP

Forked at: 1d93746b64
Parent branch: origin/master

* Update client/service/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* improve doc

* Update client/service/src/builder.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/service/src/builder.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* change code

* Update client/informant/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* enable_color

* reorg log

* remove macro

* Removed builder for informant prefix

* fix doc

* Update client/informant/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/informant/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/informant/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/informant/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/service/src/builder.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/service/src/builder.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update client/service/src/builder.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-06-09 14:29:01 +02:00
Nikolay Volf 65ba701f50 Fix transaction pool & network issues (#6288)
* fix & tweaks

* address review

* line width
2020-06-08 23:58:08 +02:00
Benjamin Kampmann 881072e590 Intent to release rc3 (#6290) 2020-06-08 23:29:52 +02:00
Pierre Krieger 34b7cc8a7a Sentry nodes and validator nodes also imply reserved (#6251) 2020-06-04 23:57:02 +02:00
Arkadiy Paronyan 31921c4eb9 Use number of downloaded blocks for test (#6234) 2020-06-04 23:41:48 +02:00
Pierre Krieger 3fef099893 Fix service tests not calling update_chain (#6232) 2020-06-04 12:06:44 +00:00
Pierre Krieger e77490714d Fix libp2p features (#6229)
* Fix libp2p features

* Remove the opt-level of some now-unused crates
2020-06-03 13:24:44 +00:00
Gavin Wood 4adac40c07 Generalised proxies (#6156)
* Initial work

* It should work

* Fix node

* Fix tests

* Initial test

* Tests

* Expunge proxy functionality from democracy and elections

* Allow different proxy types

* Repotted

* Build

* Build

* Making a start on weights

* Undo breaking change

* Line widths.

* Fix

* fix tests

* finish benchmarks?

* Storage name!

* Utility -> Proxy

* proxy weight

* add proxy weight

* remove weights

* Update transfer constraint

* Again, fix constraints

* Fix negation

* Update frame/proxy/Cargo.toml

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Remove unneeded event.

* Grumbles

* Apply suggestions from code review

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-06-02 18:15:15 +02:00
Pierre Krieger 7a969aa401 Remove ReportHandle (#6213) 2020-06-02 17:16:53 +02:00
Nikolay Volf 5759cee2e9 Update import metrics and add verification time (#6170)
* refactor import reporting and add time

* Update primitives/consensus/common/src/metrics.rs

Co-authored-by: Max Inden <mail@max-inden.de>

* remove (crate)

* fix longer lines

* swap names to avoid api breaking

Co-authored-by: Max Inden <mail@max-inden.de>
2020-06-01 11:08:59 +02:00
Pierre Krieger cf185302fa Improve the log messages printed when a listener closes (#6162)
* Improve the log messages printed when a listener closes

* Oops, didn't finish the expired listen addrs thing
2020-05-27 19:55:54 +02:00
Pierre Krieger e2e44f005c Add a warning when the user passes a legacy PeerId (#6158)
* Add a warning when the user passes a legacy PeerId

* Update client/network/src/config.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-05-27 19:55:13 +02:00
Pierre Krieger 9906a2e39d Don't iterate over peers in generic_proto::behaviour::poll (#6142)
* Don't iterate over peers in generic_proto::behaviour::poll

* Improve comment

* Rework to use DelayIds
2020-05-26 21:23:32 +02:00
Benjamin Kampmann b64f55089d Releasing rc2 (#6136) 2020-05-26 14:32:23 +02:00
Benjamin Kampmann fb32ac8c51 Tagging as rc1 2020-05-25 18:30:48 +02:00
Pierre Krieger d18a55d391 Bump to libp2p v0.19.1 (#6125) 2020-05-25 17:26:36 +02:00
Pierre Krieger c6e23b615f Add a note about the deprecation of register_notifications_protocol (#6111) 2020-05-22 12:43:55 +02:00
Arkadiy Paronyan 5bf9e63181 Optimize network poll (#6099) 2020-05-21 13:54:50 +02:00
Pierre Krieger c8339f9694 Turn a SmallVec into VecDeque for performances (#6091)
* Turn a SmallVec into VecDeque for performances

* Fix the other SmallVecs
2020-05-20 21:12:49 +02:00
Pierre Krieger 717fa95bc7 Restore the empty line after the license (#6088) 2020-05-20 13:08:27 +00:00