* handle executor should_panic test better
* Revert "reduce should panic, due to extended error messages"
This reverts commit c0805940184a62cd9302603ad911c3591e70a60c.
* remove excessive constraints
* remove duplicate documentation messages for error variants
* reduce T: constraints to the abs minimum
* whoops
* fewer bounds again
Co-authored-by: Bernhard Schuster <bernhard@parity.io>
* Log outgoing notifications too
* Update client/network/src/protocol/generic_proto/handler.rs
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Addie Wagenknecht <addie@nortd.com>
Co-authored-by: Max Inden <mail@max-inden.de>
* chore/error: remove from str conversion and add deprecation notifications
* fixup changes
* fix test looking for gone ::Msg variant
* another test fix
* one is duplicate, the other is not, so duplicates reported are n-1
* darn spaces
Co-authored-by: Andronik Ordian <write@reusable.software>
* remove pointless doc comments of error variants without any value
* low hanging fruits (for a tall person)
* moar error type variants
* avoid the storage modules for now
They are in need of a refactor, and the pain is rather large
removing all String error and DefaultError occurences.
* chore remove pointless error generic
* fix test for mocks, add a bunch of non_exhaustive
* max line width
* test fixes due to error changes
* fin
* error outputs... again
* undo stderr adjustments
* Update client/consensus/slots/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* remove closure clutter
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* more error types
* introduce ApiError
* extract Mock error
* ApiError refactor
* even more error types
* the last for now
* chore unused deps
* another extraction
* reduce should panic, due to extended error messages
* error test happiness
* shift error lines by one
* doc tests
* white space
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Into -> From
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* remove pointless codec
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* avoid pointless self import
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bernhard Schuster <bernhard@parity.io>
Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Remove `RpcMetrics` weirdness
The metrics was returning an error when prometheus was not given. This
was a really weird setup, especially when compared to all other metrics
that just do nothing if there is no registry.
* Fix browser build
* Inform sync explicitly about new best block
Instead of "fishing" the new best block out of the processed blocks, we
now tell sync directly that there is a new best block. It also makes
sure that we update the corresponding sync handshake to the new best
block. This is required for parachains as they first import blocks and
declare the new best block after being made aware of it by the relay chain.
* Adds test
* Make sure async stuff had time to run
* Build every wasm crate in its own project with wasm-builder
Building all wasm crates in one workspace was a nice idea, however it
just introduced problems:
1. We needed to prune old members, but this didn't worked for old git
deps.
2. We locked the whole wasm workspace while building one crate. This
could lead to infinitely locking the workspace on a crash.
Now we just build every crate in its own project, this means we will
build the dependencies multiple times. While building the dependencies
multiple times, we still decrease the build time by around 30 seconds
for Polkadot and Substrate because of the new parallelism ;)
* Remove the requirement on wasm-builder-runner
This removes the requirement on wasm-builder-runner by using the new
`build_dep` feature of cargo. We use nightly anyway and that enables us
to use this feature. This solves the problem of not mixing
build/proc-macro deps with normal deps. By doing this we get rid off
this complicated project structure and can depend directly on
`wasm-builder`. This also removes all the code from wasm-builder-runner
and mentions that it is deprecated.
* Copy the `Cargo.lock` to the correct folder
* Remove wasm-builder-runner
* Update docs
* Fix deterministic check
Modified-by: Bastian Köcher <git@kchr.de>
* Try to make the ui test happy
* Switch to `SKIP_WASM_BUILD`
* Rename `SKIP_WASM_BINARY` to the correct name...
* Update utils/wasm-builder/src/builder.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update utils/wasm-builder/src/builder.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* client/authority-discovery: Publish and query on exponential interval
When a node starts up publishing and querying might fail due to various
reasons, for example due to being not yet fully bootstrapped on the DHT.
Thus one should retry rather sooner than later. On the other hand, a
long running node is likely well connected and thus timely retries are
not needed. For this reasoning use an exponentially increasing interval
for `publish_interval`, `query_interval` and
`priority_group_set_interval` instead of a constant interval.
* client/authority-discovery/src/interval.rs: Add license header
* .maintain/gitlab: Ensure adder collator tests are run on CI
* Remove necessity to pass ConsensusEngineId when registering notifications protocol
* Line width
* Fix tests protocol name
* Other renames
* Doc update
* Change issue in TODO
* Use inbound peerslot slots when a substream is received, rather than a connection
* Refactor PeerState
* Some bugfixes
* Fix warnings so that CI runs, gmlrlblbl
* Bugfixes
* Update docs
* Apply suggestions from code review
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
* Clean up Banned state
* Refactor connections state
* Fix possibility of Enabled with no Opening or Open connection
* Line width
* Add some debug_asserts! and fix TODO
* Refactor legacy handler
* Rewrite group.rs entirely [part 1]
* Rewrite group.rs entirely [part 2]
* Remove faulty assertion
Because of the asynchronous nature of the behaviour <-> handler communications, it is possible to receive notifications while in the Closing state
* Don't poll the legacy substream is not Open
* Tolerate when not all substreams are accepted
* Remove TODOs
* Dummy commit to make CI log interesting things
* Try race condition fix
* Revert "Try race condition fix"
This reverts commit 0675c659d06195c30f8c5bc13e2d88141d57a3ba.
* Correctly rebuild pending_opening
* Minor tweaks
* Printlns for CI debugging
* Revert "Printlns for CI debugging"
This reverts commit e7852a231f4fc418898767aaa27c9a4358e12e8b.
* Revert "Dummy commit to make CI log interesting things"
This reverts commit 259ddd74088e53e7c6a9b0a62a8d1573a0063ce3.
* mv group.rs ../handler.rs
* Apply suggestions from code review
Co-authored-by: Max Inden <mail@max-inden.de>
* Banned => Backoff
* Mention the actual PeerStates
* OpenDesired -> OpenDesiredByRemote
* OpeningThenClosing
* Add doc links to PeerState
* Simplify increment logic
* One more debug_assert
* debug_assert!
* OpenDesiredByRemote
* Update client/network/src/protocol/generic_proto/behaviour.rs
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
* Enable local addresses in DHT when chain type == `Local` | `Development`
This pr changes when to add local addresses to DHT. Instead of only
checking if `--discover-local` and `--dev` are present, we now also
check if the chain type is `Local` or `Development`.
* Update the docs!
* Don't log with colors when we are writing to a tty
This fixes a regression that was introduced by the switch to tracing.
Before we killed all colors before writing to a tty, this pr brings the
behaviour back.
* Remove accidentally added crate
* Review feedback
* More feedback
* Update client/cli/src/logging.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Update client/cli/src/logging.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Export app-crypto specific keystore functions
* Also add back the insert function
* Switch KeystoreContainer to an enum
* Only export the bare minimal for LocalKeystore and fix service compile
* fix: should return Arc
* Add docs stating that functions only available in local keystore
* Remove insert and generate functions
* fix: generate function should be available in test
* Add keypair function to trait
* Revert "Add keypair function to trait"
This reverts commit ad921b09ca73d3c09298e3a51b562ef8e0067781.
* Add note for local_keystore function in service
* babe: backoff authoring blocks when finality lags
* babe: move backoff authoring params to default constructor
* babe: deduplicate the test a bit
* babe: set backoff constants in service
* babe: use better names for backoff authoring block parameters
* babe: remove last unwrap
* babe: slight style tweak
* babe: fix comment
* slots: move backoff block authorship logic to SimpleSlotWorker
* aura: append SlotInfo in on_slot
* slots: use the correct types for parameters
* slots: fix review comments
* aura: add missing backoff authoring blocks parameters
* slots: add comments for default values
* slots: add additional checks in test
* slots: update implementation for new master
* slots: revert the change to SlotInfo
* Fix review comments
* slots: rework unit tests for backing off claiming slots
* slots: add test for asymptotic behaviour for slot claims
* slots: address review comments
* slots: add test for max_interval
* slots: add assertion for intervals between between claimed slots
* slots: remove rustfmt directive
* slots: another attempt at explaining authoring_rate
* slots: up unfinalized_slack to 50 by default
* slots: add tests for time to reach max_interval
* slots: fix typo in comments
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* slots: additional tweaks to comments and info calls
* slots: rename to BackoffAuthoringOnFinalizedHeadLagging
* slots: make the backing off strategy generic
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* slots: implement backoff trait for () for simplicity
* slots: move logging inside backing off function to make it more specific
* aura: add missing function parameter
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
The genesis header doesn't have the BABE pre-digest and we insert `0` as
slot number. The slot lenience calculation will return the maximum in
this situation. Besides returning the maximum which is not bad at all,
it also prints some a debug message that can be confusing in the first
moment. To prevent printing this debug message, we now just return early
when we see that the parent block is the genesis block.
* Make the maximum block size configurable
This pr makes the maximum block size configurable. The maximum block
size is used after proposing a new block to check if the new block is
not exceeding the maximum.
* Update primitives/consensus/common/src/evaluation.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* Added comment
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
* 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>
* Make authority discovery configurable
This pr makes the authority discovery configurable. So, instead of
having default values for the query interval, publish interval etc this
pr adds a configuration to make these values changeable. This will be
useful for tests where authority discovery is required.
* Update client/authority-discovery/src/worker.rs
Co-authored-by: Max Inden <mail@max-inden.de>
* Update client/authority-discovery/src/lib.rs
Co-authored-by: Max Inden <mail@max-inden.de>
* Update client/authority-discovery/src/lib.rs
Co-authored-by: Max Inden <mail@max-inden.de>
* Update client/authority-discovery/src/lib.rs
Co-authored-by: Max Inden <mail@max-inden.de>
* Fix compilation
* line width
Co-authored-by: Max Inden <mail@max-inden.de>
* Print an error if an nregistered notifications protocol is used
* Print an error if an nregistered notifications protocol is used
* Update client/network/src/service.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>