* Remove necessity to pass ConsensusEngineId when registering notifications protocol
* Line width
* Fix tests protocol name
* Other renames
* Doc update
* Change issue in TODO
* Update to libp2p-0.29.
* Update dependencies.
* Update Cargo.toml
Co-authored-by: Max Inden <mail@max-inden.de>
* Fix tests.
* Fix tests.
* Fix more tests.
* Update to 0.29.1
* Update ed25519-dalek dependency of sp-core.
* Update Cargo.lock.
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* *: Bump async-std to v1.6.5
Prevent users from using v1.6.4 which faces issues receiving incoming
TCP connections. See https://github.com/async-rs/async-std/issues/888
for details.
* client/network/src/gossip: Use channel instead of condvar
`async_std::sync::Condvar::wait_timeout` uses
`gloo_timers::callback::Timeout` when compiled for
`wasm32-unknown-unknown`. This timeout implementation does not fulfill
the requirement of being `Send`.
Instead of using a `Condvar` use a `futures::channel::mpsc` to signal
progress from the `QueuedSender` to the background `Future`.
* client/network/Cargo.toml: Remove async-std unstable feature
* client/network/src/gossip: Forward all queued messages
* client/network/gossip: Have QueuedSender methods take &mut self
* client/network/gossip: Move queue_size_limit into QueuedSender
The `queue_size_limit` field is only accessed by `QueuedSender`, thus
there is no need to share it between the background future and the
`QueuedSender`.
* client/network/gossip: Rename background task to future
To be a bit picky the background task is not a task in the sense of an
asynchonous task, but rather a background future in the sense of
`futures::future::Future`.
* Re-generate READMEs to fix doc links; set readme field in package manifests
* Re-generate READMEs to fix doc links; set readme field in package manifests
* Re-generate READMEs to fix doc links; set readme field in package manifests
* Re-generate READMEs to fix doc links; set readme field in package manifests
* Revert stuff that shouldn't have been committed
* Revert stuff that shouldn't have been committed
* Fix parent relative link generation
* Manually remove this incorrect link for now.
* client/*: Treat protocol name as str and not [u8]
Notification protocol names are in practice always valid utf8 strings.
Instead of treating them as such in the type system, thus far they were
casted to a [u8] at creation time.
With this commit protocol names are instead treated as valid utf8
strings throughout the codebase and passed as `Cow<'static, str>`
instead of `Cow<'static, [u8]>`. Among other things this eliminates the
need for string casting when logging.
* client/network: Don't allocate when protocol name is borrowed
* *: Update to next libp2p version (likely v0.24.0)
* Revert "*: Update to next libp2p version (likely v0.24.0)"
This reverts commit ffe1545aba6c2557a2843579de331f3fc1c60743.
* */Cargo.toml: Update to libp2p v0.24.0
* client/network/src/service: Handle ConnectionClosed returning Option
* Cargo.*: Test kad usize conversion
* Revert "Cargo.*: Test kad usize conversion"
This reverts commit ad317879782f982cb4a4c76029a72b5b97e82bec.
* Cargo.lock: Update to libp2p-kad v0.22.1
* client/cli/Cargo.toml: Update to libp2p 0.24.0
* Bump version
* update test-utils crates to be ready for publishing
* adding changelog
* Adding automaticly generated READMEs
* fixing versions
* another version mishap
* Update to libp2p-0.23.
Thereby incorporate bandwidth measurement along the
lines previously done by libp2p itself.
* Tweak dependencies for wasm32 compilation.
For wasm32 we need to enable unstable features to
make `task::Builder::local` available.
* Simplify dependencies.
* Simplify.
Leave the calculation of bytes sent/received per second
to the outer layers of the code, subject to their own
individual update intervals.
* Cleanup
* Re-add lost dev dependency.
* Avoid division by zero.
* Remove redundant metric.
* Enable sending of noise legacy handshakes.
* Add comment about monotonic gauge.
* CI
* Upgrade to libp2p v0.19
* Listen on IPv6 by default
* Increase channels sizes
* Use spec-compliant noise protocol
* Show legacy PeerId
* Switch order of Noise protocols
* Switch to crates.io version
* Fix subkey's version
* Fix line width and Wasm build
* I think Wasm is fixed for real this time
* client/network-gossip/bridge: Use bounded channel
Instead of returning an unbounded channel on
`GossipEngine::messages_for` return a bounded channel. For now the
channel length is determined by the amount of past messages cached in
the `ConsensusGossip`.
With a bounded channel, one can't just fire-and-forget style send into
it, but has to first check whether the channel is ready. Thus this
commit restructures `GossipEngine::poll` and introduces a
`ForwardingState` into `GossipEngine`.
* client/network-gossip/bridge: Add quickcheck for different size channels
* client/network-gossip/src/state_machine: Add unit test for on_incoming
Add two unit tests to ensure `on_incoming` is ingoring discarded
messages and reports and ignores messages from unknown peers.
* client/network-gossip/state_machine: Reduce indentation level
* client/network-gossip/bridge: Remove unnecessary into_iter
* client/network-gossip/state_machine: Report success after register check
* client/network-gossip/state_machine: Error not report on unregistered
`peers` contains all the peers we're connected to. If we receive a
message from a peer not in this list, that means there's an internal
problem within the local client. It's not the fault of the peer in
question.
With the above in mind instead of reducing the reputation of such peer,
log an error.
* client/network-gossip: Move sink IO outside of state_machine
`ConsensusGossip` is supposed to be a deterministic state machine.
`GossipEngine` wrapping `ConsensusGossip` should handle IO operations.
This commit moves the `message_sink` IO operations to `GossipEngine`.
More specifically on incoming messages a `GossipEngine` calls
`ConsensusGossip::on_incoming` to validate and register the messages.
`ConsensusGossip` returns the valid messages which are then forwarded by
`GossipEngine` to the upper layer via the `message_sinks`.
* client/network-gossip: Adjust and extend tests
* Update client/network-gossip/src/bridge.rs
Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
This PR refactors the metrics measuring and Prometheus exposing entity in sc-service into its own submodule and extends the parameters it exposes by:
- system load average (over one, five and 15min)
- the TCP connection state of the process (lsof), refs #5304
- number of tokio threads
- number of known forks
- counter for items in each unbounded queue (with internal unbounded channels)
- number of file descriptors opened by this process (*nix only at this point)
- number of system threads (*nix only at this point)
refs #4679
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Ashley <ashley.ruglys@gmail.com>
* Split the Roles bitfield in three
* Forgot to include some changes
* Fix cli test
* More test fixes
* Oh God, merging master broke other tests
* Didn't run the doctests
* Address review
* I'm trying to fix the build blindly because it's taking a good hour to compile on my machine
* Address some review
* Also update the peerset's API to make sense
* Fix peerset tests
* Fix browser node
* client: distinguish between local and network authority
Co-authored-by: André Silva <andre.beat@gmail.com>
A gossip validator returns `ValidationResult::Discard` for messages that
should not be processed nor kept due to not being useful for the node.
Examples are out-of-scope messages or messages with bad signatures. The
corresponding log message did not reflect this, thus the update through
this patch.
One caveat is a finality grandpa neighbor packet. Given that the concept
of neighbor packets is handled in the finality grandpa gossip validator
only, valid neighbor packets are always discarded on the
`client/network-gossip` layer.
* client/network-gossip/src/bridge: Finish when network even stream closes
Previously within `<GossipEngine as Future>::poll` one would poll the
`network_event_stream` ignoring all messages other than
`Poll::Ready(Some())`. Ignoring `Poll::Ready(None)` leads to a panic on
the next poll of the stream, gien that it is not fused.
By design `network_event_stream` does not close unless an unbounded send
into it fails, or the `NetworkWorker` gets shut down.
> The stream never ends (unless the `NetworkWorker` gets shut down).
> (client/network/src/service.rs)
An `unbounded_send` to fail on an unbounded channel is unlikely. The
`NetworkWorker` shutting down is not unlikely. In such case the
`GossipEngine` should shut down as well.
With this patch a `<GossipEngine as Future>` finishes on
`Poll::Ready(None)` returned from `network_event_stream`.
* client/finality-grandpa/communication: Error on gossip engine finished
Have `<NetworkBridge as Future>::poll` return `Poll::Ready(Err)` instead
of `Poll::Ready(Ok)` to be consistent with the handling of the neighbor
packet worker stream and the gossip validator report stream. Both `Err`
as well as `Ok` shut down the `NetworkBridge` as well as the
`VoterWorker`.
* client/network-gossip/src/bridge: Add regression test
* client/network-gossip: Move substrate test client to dev dependencies
* client/network-gossip: Remove TODO
Addressed in a follow up pull request.
* client/network-gossip/bridge: Put match on newline after loop
* client/finality-grandpa/src/observer: Fix regression test
Make sure the event stream sender side is not dropped till the end.
* Version bump
* Split generate_changelog.sh into separate script
Can be run in the format `generate_changelog.sh $previous_version $version`.
* remove early exit from publish_draft_release.sh
* adding changelog
* ci: change last_github_release to also find pre-releases
Co-authored-by: Martin Pugh <pugh@s3kr.it>