* refactor globals snapshot
* ignore test
* update pwasm-utils ref
* line width
* add doc comment for internal struct
* add explanation for iteration
* Demote rustdoc to a comment
* use 0.14
Co-authored-by: Sergei Shulepov <sergei@parity.io>
* client/network/src/discovery: Adjust to Kademlia API changes
* client/network: Add peers to DHT only if protocols match
With https://github.com/libp2p/rust-libp2p/pull/1628 rust-libp2p allows
manually controlling which peers are inserted into the routing table.
Instead of adding each peer to the routing table automatically, insert
them only if they support the local nodes protocol id (e.g. `dot`)
retrieved via the `identify` behaviour.
For now this works around
https://github.com/libp2p/rust-libp2p/issues/1611. In the future one
might add more requirements. For example one might try to exclude
light-clients.
* Cargo.toml: Remove crates.io patch for libp2p
* client/network/src/behaviour: Adjust to PeerInfo name change
* client/network/src/discovery: Rework Kademlia event matching
* client/network/discovery: Add trace on adding peer to DHT
* client/network/discovery: Retrieve protocol name from kad behaviour
* client/network/discovery: Fix formatting
* client/network: Change DiscoveryBehaviour::add_self_reported signature
* client/network: Document manual insertion strategy
* client/network/discovery: Remove TODO for ignoring DHT address
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* Add NetworkService::send_notifications
* Doc
* Doc
* API adjustment
* Address concerns
* Make it compile
* Start implementation
* Progress in the implementation
* Change implementation strategy again
* More work before weekend
* Finish changes
* Minor doc fix
* Revert some minor changes
* Apply suggestions from code review
* GroupError -> NotifsHandlerError
* Apply suggestions from code review
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* state_transition_waker -> close_waker
* Apply suggestions from code review
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* Finish renames in service.rs
* More renames
* More review suggestsions applied
* More review addressing
* Final change
* 512 -> 2048
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* 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>
* 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
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.
* 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>
* 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
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.
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.
* 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.
* 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>