* babe: waive fees on report_equivocation
* grandpa: waive fees on report_equivocation
* babe: add test for fee waiving on valid equivocation report
* grandpa: add test for fee waiving on valid equivocation report
* grandpa: remove stray comment
This pr makes the `--file` argument optional to `generate-node-key`.
If the argument is not given, the secret node key will be printed to
`stdout`. The public node key will always be printed to `stderr`.
* client/authority-discovery: Throttle DHT requests
Instead of passing one DHT query for each authority down to the network
every query interval, only pass MAX_IN_FLIGHT_LOOKUPS at a given point
in time, triggering new ones when previous ones return.
* client/authority-discovery/worker/test: Fix wrong constant
* Refactor sc-network/service metrics.
1. Aggregate sc-network metrics into a submodule, introducing
two more sourced metrics to avoid duplicate atomics.
2. Decouple periodic sc-service network metrics from other
metrics, so that they can be updated independently.
* Update client/service/src/metrics.rs
* Update client/service/src/metrics.rs
This edge count is used for weighing, and it is somewhat trivial to review and verify that the current implementation was ignoring `votes16` field of the struct. As reminder, the struct is like this:
```rust
struct Compact {
votes1: ... ,
votes2: ...,
...,
votes16: ...,
}
```
I already will fix this in https://github.com/paritytech/substrate/pull/7007, but since it might take a while, this one can go in asap and make it to the very next runtime.
* grandpa: report metrics on prevotes and precommits cast
* Update client/finality-grandpa/src/environment.rs
Co-authored-by: Max Inden <mail@max-inden.de>
* Update client/finality-grandpa/src/environment.rs
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Max Inden <mail@max-inden.de>
* Stop sending messages on legacy substream altogether
* Ensure that handshake is sent back even in case of back-pressure
* Update client/network/src/protocol/generic_proto/handler/group.rs
Co-authored-by: Max Inden <mail@max-inden.de>
* Also process OpenRequest and Closed
* Also process OpenRequest and Closed
* Fix bad merge
* God I'm so lost with all these merges
* Immediately return Closed
* Add warning for sending on non-registered protocol
* Register GrandPa protocol in tests
* Update client/network/src/protocol/generic_proto/handler/group.rs
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Max Inden <mail@max-inden.de>
* frame/authority-discovery: Have authorities() return both current and next
Authority address lookups on the DHT happen periodically (every 10
mintues) and are rather slow (~10 seconds).
In order to smooth the transition period between two sessions, have the
runtime module return both the current as well as the next authority
set. Thereby the client authority module will:
1. Publish its addresses one session in advance.
2. Prefetch the addresses of authorities of the next session in advance.
* frame/authority-discovery: Deduplicate authority ids
* frame/authority-discovery: Don't dedup on_genesis authorities
* frame/authority-discovery: Remove mut and sort on comparison in tests
* frame/authority-discovery: Use BTreeSet for deduplication
* Ensure that handshake is sent back even in case of back-pressure
* Update client/network/src/protocol/generic_proto/handler/group.rs
Co-authored-by: Max Inden <mail@max-inden.de>
* Also process OpenRequest and Closed
* Fix bad merge
* God I'm so lost with all these merges
* Immediately return Closed
Co-authored-by: Max Inden <mail@max-inden.de>
* client/cli/src/config: Warn on low file descriptor limit
Substrate sets the soft file descriptor limit to the hard limit at
startup. In the case of the latter being low already (< 10_000) a
Substrate node under high demand might run into issues e.g. when opening
up new TCP connections or persisting data to the database.
With this commit a warn message is printed to stderr.
* client/cli/Cargo.toml: Update to fdlimit 0.2.0
* 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
* Implement request-responses protocols
* Add tests
* Fix sc-cli
* Apply suggestions from code review
Co-authored-by: Max Inden <mail@max-inden.de>
* Fix naming
* Fix other issues
* Other naming fix
* Fix error logging
* Max sizes to u64
* Don't kill connections on refusal to process
* Adjust comment
Co-authored-by: Max Inden <mail@max-inden.de>
* Better prime election.
* improve docs
* more sensible variable names
* link to Borda count wiki
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* grandpa: use bytes type for justification rpc notification
* grandpa: always create justification if there are rpc subscribers
* grandpa: wording
* grandpa: replace notify_justification macro with function
* grandpa: prefer Option<&T> over &Option<T>
* Add `--verify` flag to benchmark execution
* make it so `--verify` can be used for getting the actual benchmarks
* undo manual testing
* oops
* use benchmark config struct
* verify is default on, docs update
* remove clone
* improve formatting
* fix test
* bump impl for ci
* Generate CHT roots on a full client
* add changes_trie_root function
* Add a test
* Line widths
* Fix sc-service-test
* Clarify comments
* Revert comments