Commit Graph

23 Commits

Author SHA1 Message Date
s0me0ne-unkn0wn 64660ee8d2 Remove years from copyright notes (#7034)
* Happy New Year!

* Remove year entierly

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove years from copyright notice in the entire repo

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-04-08 20:38:35 +00:00
Aaro Altonen 0e1c932c42 Companion for paritytech/substrate#13592 (#6869)
* Move configs

* Start using `NetworkService` traits from `sc-network`

* Fix stuff

* Remove `sc-network-common` as dependency

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
2023-03-14 12:52:15 +00:00
s0me0ne-unkn0wn 1cb1d03c08 Re-export current primitives in crate root (#6487)
* Re-export current primitives in crate root

* Add missing exports

* restart CI
2023-01-11 11:28:12 +00:00
Andrei Sandu 7f020eb527 approval-distribution: batched approval/assignment sending (#6401)
* Imple batched send

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Add batch tests

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* pub MAX_NOTIFICATION_SIZE

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* spell check

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* spellcheck ...

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Fix comment

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* o.O

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* 2 constants

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Ensure batch size is at least 1 element

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* feedback impl

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
2022-12-13 14:06:05 +02:00
Aaro Altonen 4819d12711 Companion for paritytech/substrate#12441 (#6117)
* Companion for paritytech/substrate#12441

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
2022-10-10 11:13:59 +00:00
Aaro Altonen 2a9800f20a Companion for paritytech/substrate#12264 (#5973)
* Companion for paritytech/substrate#12198

* Use `ProtocolName` from sc-network-common

* Update node service

* Revert Cargo.lock changes

* Fix node service test

* cargo-fmt

* disable cancel-pipeline-test-linux-stable to check companion

* update lockfile for {"substrate"}

Co-authored-by: alvicsam <alvicsam@gmail.com>
Co-authored-by: parity-processbot <>
2022-09-26 13:15:41 +00:00
Dmitry Markin b3480bd51f Use custom type for ProtocolName (#5963)
* Use new ProtocolName in peer_set.rs

* Use new ProtocolName for request-response protocols

* Use new ProtocolName in polkadot-network-bridge

* Import and conversion fixes

* Use ProtocolName re-exported in sc_network

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
2022-09-04 00:02:01 +02:00
Dmitry Markin 13ea167bd7 Change validation & collation protocol names to include genesis hash & fork id (#5876) 2022-08-30 19:50:22 +03:00
asynchronous rob fc4b04db20 Prepare for network protocol version upgrades (#5084)
* explicitly tag network requests with version

* fmt

* make PeerSet more aware of versioning

* some generalization of the network bridge to support upgrades

* walk back some renaming

* walk back some version stuff

* extract version from fallback

* remove V1 from NetworkBridgeUpdate

* add accidentally-removed timer

* implement focusing for versioned messages

* fmt

* fix up network bridge & tests

* remove inaccurate version check in bridge

* remove some TODO [now]s

* fix fallout in statement distribution

* fmt

* fallout in gossip-support

* fix fallout in collator-protocol

* fix fallout in bitfield-distribution

* fix fallout in approval-distribution

* fmt

* use never!

* fmt
2022-04-21 16:34:59 +00:00
Andronik aff88a864a collator-protocol: short-term fixes for connectivity (#4640)
* collator-protocol: add to reserved peers on every relay parent

* bump collator slots from 25 to 100

* collator-protocol: reduce inactivity timeout from 24s to 5s

* try to satisfy spellcheck

* add connection log

* fmt

* bring a warn back

* gather validators across all active leaves
2022-01-04 12:58:47 +01:00
Shawn Tabrizi ff5d56fb76 cargo +nightly fmt (#3540)
* cargo +nightly fmt

* add cargo-fmt check to ci

* update ci

* fmt

* fmt

* skip macro

* ignore bridges
2021-08-02 10:47:33 +00:00
Bernhard Schuster e8652e73db cargo spellcheck (#3067) 2021-05-22 00:15:47 +00:00
Pierre Krieger 64c8b913c3 Companion PR for #8682 (#2958)
* Companion PR for #8682

* Compilation fix

* Update beefy

* update Substrate

Co-authored-by: parity-processbot <>
2021-05-06 16:41:28 +02:00
Robert Klotzner dd3733261b Max notification size -> 100k. (#2735) 2021-04-12 10:26:11 +02:00
Andronik Ordian 7a2e1ef6c1 gossip: do not try to connect if we are not validators (#2786)
* gossip: do not issue a connection request if we are not a validator

* guide updates

* use all relevant authorities when issuing a request

* use AuthorityDiscoveryApi instead

* update comments to the status quo
2021-04-01 18:11:43 +02:00
Andronik Ordian 9ac35d9f2b gossip: choose a random subset on send instead of limiting connections (#2776)
* gossip: choose random subset on send

* naming bikeshed
2021-03-30 20:59:53 +02:00
Robert Klotzner 0a9fe852df Move non runtime related stuff into node/primitives (#2743)
* Remove stuff out of the runtime that does not belong there.

There might be more, but it is a start.

* White space fixes.

* Fix tests.

* Leave whitespace in ui tests alone.

* Add back zstd for no reason.

* Fix browser wasm (hopefully)
2021-03-29 02:15:44 +02:00
Robert Klotzner 59640a38bc Don't accept incoming connections for collators (#2644)
* Don't accept incoming connections for collators

on the `Collation` peer set.

* Better docs.
2021-03-19 07:20:38 +00:00
Sergei Shulepov 09eadfc979 Introduce PerPeerSet utility that allows to segrate based on PeerSet (#2420)
* Introduce PerPeerSet utility that allows to segrate based on PeerSet

* Remove `repr(usize)` from PeerSet
2021-02-11 14:40:46 +00:00
Andronik Ordian 6981a1c366 validator_discovery: pass PeerSet to the request (#2372)
* validator_discovery: pass PeerSet to the request

* validator_discovery: track PeerSet of connected peers

* validator_discovery: fix tests

* validator_discovery: fix long line

* some fixes

* some validator_discovery logs

* log validator discovery request

* Also connect to validators on `DistributePoV`.

* validator_discovery: store the whole state per peer_set

* bump spec versions in kusama, polkadot and westend

* Correcting doc.

* validator_discovery: bump channel capacity

* pov-distribution: some cleanup

* this should fix the test, but it does not

* I just got some brain damage while fixing this

Why are you even reading this???

* wrap long line

* address some review nits

Co-authored-by: Robert Klotzner <robert.klotzner@gmx.at>
2021-02-08 08:57:59 +01:00
Robert Klotzner 0cb1ccd122 Generic request/response infrastructure for Polkadot (#2352)
* Move NetworkBridgeEvent to subsystem::messages.

It is not protocol related at all, it is in fact only part of the
subsystem communication as it gets wrapped into messages of each
subsystem.

* Request/response infrastructure is taking shape.

WIP: Does not compile.

* Multiplexer variant not supported by Rusts type system.

* request_response::request type checks.

* Cleanup.

* Minor fixes for request_response.

* Implement request sending + move multiplexer.

Request multiplexer is moved to bridge, as there the implementation is
more straight forward as we can specialize on `AllMessages` for the
multiplexing target.

Sending of requests is mostly complete, apart from a few `From`
instances. Receiving is also almost done, initializtion needs to be
fixed and the multiplexer needs to be invoked.

* Remove obsolete multiplexer.

* Initialize bridge with multiplexer.

* Finish generic request sending/receiving.

Subsystems are now able to receive and send requests and responses via
the overseer.

* Doc update.

* Fixes.

* Link issue for not yet implemented code.

* Fixes suggested by @ordian - thanks!

- start encoding at 0
- don't crash on zero protocols
- don't panic on not yet implemented request handling

* Update node/network/protocol/src/request_response/v1.rs

Use index 0 instead of 1.

Co-authored-by: Andronik Ordian <write@reusable.software>

* Update node/network/protocol/src/request_response.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* Fix existing tests.

* Better avoidance of division by zoro errors.

* Doc fixes.

* send_request -> start_request.

* Fix missing renamings.

* Update substrate.

* Pass TryConnect instead of true.

* Actually import `IfDisconnected`.

* Fix wrong import.

* Update node/network/bridge/src/lib.rs

typo

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

* Update node/network/bridge/src/multiplexer.rs

Remove redundant import.

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

* Stop doing tracing from within `From` instance.

Thanks for the catch @tomaka!

* Get rid of redundant import.

* Formatting cleanup.

* Fix tests.

* Add link to issue.

* Clarify comments some more.

* Fix tests.

* Formatting fix.

* tabs

* Fix link

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

* Use map_err.

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

* Improvements inspired by suggestions by @drahnr.

- Channel size is now determined by function.
- Explicitely scope NetworkService::start_request.

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
2021-02-03 20:21:09 +00:00
Pierre Krieger 3d75cc2001 Companion PR for adding max notification sizes (#2287)
* Companion PR for adding max notification sizes

* Add TODO

* Missing ;

* =>

* Common limit

* "Update Substrate"

Co-authored-by: parity-processbot <>
2021-01-19 11:27:42 +00:00
Robert Klotzner 32d4670b0d Some refactoring in network-bridge in the course of dealing with #2177 (#2263)
* More doc fixes.

* Minor refactorings in the process of #2177

By having everything peer set related depend directly on the enum the
code becomes more clear and it is also straight forward to add more
peersets/protocols as the compiler will complain if you forget to
implement parts of it.

* Add peer set infos on startup properly

For feature real_overseer.

+ Fixes from review. Thanks @coriolinus and @ordian!

* More structure in network-bridge

Some changes, which would have helped me in groking the code faster.

Entry points/public types more to the top. Factored out implementation
in their own files, to clear up the top-level view.

* Get rid of local ProtocolName type definition.

Does not add much at this level.

* Fix tests + import cleanup.

* Make spaces tabs.

* Clarify what correct parameters to send_message are

* Be more less vague in docs of send_message.

* Apply suggestions from code review

Extend copyright on new files to 2021 as well.

Co-authored-by: Andronik Ordian <write@reusable.software>

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-01-14 10:29:02 +00:00