We were using the wrong syntax and that will be dropped with Rust 2021.
The compiler already starts to hint the wrong syntax with warnings. So,
we fix this here.
* Move AuRa digest from client to primitives
This makes the digest stuff usable from inside the runtime ;)
* Update primitives/runtime/src/generic/digest.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Review feedback
* Make BABE use the new functionality
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Make `on_slot` return the block with the post header
Before this pr `on_slot` returned the pre block. However this is wrong,
because adding some post digest changes the hash of the header. Thus,
we need to make sure to return the correct block that uses the post
header.
* Update primitives/consensus/common/src/block_import.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Ensure we spawn the block import worker as an essential task
This pr ensures that we spawn the block import worker as an essential
task. This is quite important as we need to bring down the node when the
block import is done. Besides that it adds some debug output to the
block import worker.
* Don't be stupid :D
* A clean new attempt
* Checkpoint to move remote.
* A lot of dependency wiring to make it feature gated.
* bad macro, bad macro.
* Undo the DB mess.
* Update frame/support/src/traits.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* Apply suggestions from code review
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
* unbreak the build
* Update frame/try-runtime/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Update utils/frame/try-runtime/cli/Cargo.toml
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Update frame/try-runtime/Cargo.toml
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Address most review grumbles.
* Fix build
* Add some comments
* Remove allowing one pallet at a time.
* More grumbles.
* relocate remote-ext
* Fix build
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Fix tracing tests (#8022)
* Fix tracing tests
The tests were not working properly.
1. Some test was setting a global subscriber, this could lead to racy
conditions with other tests.
2. A logging test called `process::exit` which is completly wrong.
* Update client/tracing/src/lib.rs
Co-authored-by: David <dvdplm@gmail.com>
* Review comments
Co-authored-by: David <dvdplm@gmail.com>
* Fix tracing spans are not being forwarded to spawned task (#8009)
* Fix tracing spans are not being forwarded to spawned task
There is a bug that tracing spans are not forwarded to spawned task. The
problem was that only the telemetry span was forwarded. The solution to
this is to use the tracing provided `in_current_span` to capture the
current active span and pass the telemetry span explictely. We will now
always enter the span when the future is polled. This is essentially the
same strategy as tracing is doing with its `Instrumented`, but now
extended for our use case with having multiple spans active.
* More tests
* Proper test for telemetry and prefix span
* WIP
* Fix test (need to create & enter the span at the same time)
* WIP
* Remove telemtry_span from sc_service config
* CLEANUP
* Update comment
* Incorrect indent
* More meaningful name
* Dedent
* Naming XD
* Attempt to make a more complete test
* lint
* Missing licenses
* Remove user data
* CLEANUP
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* CLEANUP
* Apply suggestion
* Update bin/node/cli/tests/telemetry.rs
Co-authored-by: David <dvdplm@gmail.com>
* Wrapping lines
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: David <dvdplm@gmail.com>
* Add a `send_request` to `NetworkService`.
This function delivers responses via a provided sender and also allows
for sending requests to currently not connected peers.
* Document caveats of send_request better.
* Fix compilation in certain cases.
* Update docs + introduce IfDisconnected enum
for more readable function calls.
* Doc fix.
* Rename send_request to detached_request.
* Whitespace fix - arrrgh
* Update client/network/src/service.rs
spaces/tabs
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
* Update client/network/src/request_responses.rs
Documentation fix
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* Update client/network/src/service.rs
Typo.
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* Update client/network/src/service.rs
Better docs.
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* Update client/network/src/service.rs
Typo.
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* Update client/network/src/service.rs
Doc improvements.
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* Remove error in logs on dialing a peer.
This is now valid behaviour.
* Rename detached_request to start_request.
As suggested by @romanb.
* Fix merged master.
* Fix too long lines.
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* Fix tracing tests
The tests were not working properly.
1. Some test was setting a global subscriber, this could lead to racy
conditions with other tests.
2. A logging test called `process::exit` which is completly wrong.
* Update client/tracing/src/lib.rs
Co-authored-by: David <dvdplm@gmail.com>
* Review comments
Co-authored-by: David <dvdplm@gmail.com>
* client/network: Re-enable light_client_handler.rs unit tests
* client/network: Add scaffolding for light client using req-resp
* client/network: Make it compile
* client/network: Rename OutEvent SendRequest
* client/network: Restructure light client request client and handler
* client/network: Rename light client request client to sender
* client/network: Remove light client prepare_request
* client/network/src/light: Rework configuration
* client/network: Formatting
* client/network/light: Remove RequestId
* client/network/light: Make request functions methods
* client/network/light: Refactor request wrapping
* client/network/light: Fix warnings
* client/network/light: Serialize request in method
* client/network/light: Make returning response a method
* client/network/light: Depend on request response to timeout requests
* client/network: Fix test compilation
* client/network/light: Re-enable connection test
* client/network/light: Re-enable timeout test
* client/network/light: Re-enable incorrect_response test
* client/network/light: Re-enable wrong_response_type test
* client/network/light: Re-enable retry_count_failures test
* client/network/light: Re-enable issue_request tests
* client/network/light: Re-enable send_receive tests
* client/network/light: Deduplicate test logic
* client/network/light: Remove unused imports
* client/network/light: Handle request failure
* client/network/light: Move generate_protocol_config
* client/network: Fix test compilation
* client/network: Rename light client request client to sender
* client/network: Handle too-many-requests error
* client/network: Update outdated comments
* client/network/light: Choose any peer if none has best block defined
* .maintain: Replace sentry-node with local-docker-test-network
Sentry nodes are deprecated. Thus there is no need for
`.maintain/sentry-node` to spin up a sentry node test environment.
Instead this commit rewrites the setup to contain two full-connected
validators and one light client.
With the steps below one can now spin up a local test network with
two validators, one light-client, Prometheus and Grafana.
- cargo build --release
- sudo docker-compose -f .maintain/local-docker-test-network/docker-compose.yml up
* client/network/light: Handle oneshot cancellation
* client/network/light: Do not reduce retry count on missing peer
* client/network/request-response: Assert in debug request id to be unique
* client/network/light: Choose same limit as block request protocol
* client/network: Report reputation changes via response
Allow request response protocol handlers to issue reputation changes, by
sending them back along with the response payload.
* client/network: Remove resolved TODOs
* Fix tracing spans are not being forwarded to spawned task
There is a bug that tracing spans are not forwarded to spawned task. The
problem was that only the telemetry span was forwarded. The solution to
this is to use the tracing provided `in_current_span` to capture the
current active span and pass the telemetry span explictely. We will now
always enter the span when the future is polled. This is essentially the
same strategy as tracing is doing with its `Instrumented`, but now
extended for our use case with having multiple spans active.
* More tests
* Sync: Fix issue of not freeing a block announcement slot
There was a bug that when the block announcement validation returned an
error, the slot reserved for this validation wasn't freed. This could
lead to a situation where we rejected any block announcement from such a
peer for that the block announcement returned an error multiple times.
* Better logging
* Fuck I'm dumb
* 🤦