Commit Graph

280 Commits

Author SHA1 Message Date
Arkadiy Paronyan 0299710f33 Companion for substrate #7868 (#2253)
* Update for new service config

* Naming

* "Update Substrate"

Co-authored-by: parity-processbot <>
2021-01-14 20:25:19 +01:00
Andronik Ordian deff43fd30 small cleanup (#2267)
* session_info: fix authorities docstring

* overseer: more consistent metrics naming

* session_info: mention ordering

* use correct bucket sizes

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
2021-01-14 10:41:19 +00:00
Robert Klotzner 32d4670b0d Some refactoring in network-bridge in the course of dealing with #2177 (#2263)
* More doc fixes.

* Minor refactorings in the process of #2177

By having everything peer set related depend directly on the enum the
code becomes more clear and it is also straight forward to add more
peersets/protocols as the compiler will complain if you forget to
implement parts of it.

* Add peer set infos on startup properly

For feature real_overseer.

+ Fixes from review. Thanks @coriolinus and @ordian!

* More structure in network-bridge

Some changes, which would have helped me in groking the code faster.

Entry points/public types more to the top. Factored out implementation
in their own files, to clear up the top-level view.

* Get rid of local ProtocolName type definition.

Does not add much at this level.

* Fix tests + import cleanup.

* Make spaces tabs.

* Clarify what correct parameters to send_message are

* Be more less vague in docs of send_message.

* Apply suggestions from code review

Extend copyright on new files to 2021 as well.

Co-authored-by: Andronik Ordian <write@reusable.software>

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-01-14 10:29:02 +00:00
dependabot[bot] 96f80ac3e3 Bump rand from 0.8.1 to 0.8.2 (#2266)
Bumps [rand](https://github.com/rust-random/rand) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.1...0.8.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-14 09:16:32 +01:00
Sergei Shulepov ff341a7bdb Copy para host config for rococo-staging (#2260) 2021-01-13 20:38:58 +01:00
Bernhard Schuster d7adf8f201 metered mpsc channels (#2235) 2021-01-13 17:40:27 +01:00
Bastian Köcher 844a574d40 Adds propose parachain pallet (#2243)
* Adds propose parachain pallet

* Update runtime/rococo/src/propose_parachain.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Fix runtime benchmarks

* Get rid of staking

* Fix benchmarking feature..

* Remove accidentally added crate

* Bump Rococo spec_version

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-01-12 11:25:31 +01:00
dependabot[bot] 978bd86205 Bump log from 0.4.11 to 0.4.13 (#2249)
Bumps [log](https://github.com/rust-lang/log) from 0.4.11 to 0.4.13.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.11...0.4.13)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-12 10:52:02 +01:00
dependabot[bot] 4b80c33e4b Bump tempfile from 3.1.0 to 3.2.0 (#2251)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-12 09:28:19 +01:00
Guillaume Thiolliere a3682f8d9d bump codec minor version (#2247) 2021-01-11 23:00:07 +01:00
Sergei Shulepov 6c3c7d54b0 Pass relay_storage_root into ValidationParams (#2245)
Prior this commit, a PVF wasn't able to access this property.
2021-01-11 20:29:04 +01:00
Robert Habermeier aedf089691 alternate availability store schema (#2237)
* alternate availability store schema

* improvements

* tweaks

* new DB schema and skeleton

* expand skeleton and tweaks

* handle backing and inclusion

* let finality be handled later

* handle finalized blocks

* implement query methods

* implement chunk storing

* StoreAvailableData

* fix an off-by-one

* implement pruning

* reinstate subsystem trait impl

* reinstate metrics

* fix warnings

* remove chunks_cache

* oops

* actually store the available data

* mockable pruning interval

* fix tests

* spacing

* fix code grumbles

* guide improvements

* make time mockable

* implement a mocked clock for testing

* return DB errors

* Update node/core/av-store/Cargo.toml

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update roadmap/implementers-guide/src/node/utility/availability-store.md

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update roadmap/implementers-guide/src/node/utility/availability-store.md

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* review grumbles & clarity

* fix review grumbles

* Add docs

Co-authored-by: Andronik Ordian <write@reusable.software>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Andronik Ordian <write@reusable.software>
2021-01-11 17:46:09 +00:00
dependabot[bot] f9ce261707 Bump pin-project from 1.0.3 to 1.0.4 (#2240)
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v1.0.3...v1.0.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-11 14:27:48 +01:00
dependabot[bot] ceaeab453f Bump smallvec from 1.6.0 to 1.6.1 (#2239)
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.6.0...v1.6.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-11 10:17:41 +01:00
Robert Habermeier 03e39cf5bc subsystems have an unbounded channel to the overseer (#2236)
* subsystems have an unbounded channel to the overseer

* Update node/overseer/src/lib.rs

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

* bump Cargo.lock

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
2021-01-08 21:08:59 +00:00
Bastian Köcher 475915ff10 Do not send empty view updates to peers (#2233)
* Do not send empty view updates to peers

It happened that we send empty view updates to our peers, because we
only updated our finalized block. This could lead to situations where we
overwhelmed sub systems with too many messages. On Rococo this lead to
constant restarts of our nodes, because some node apparently was
finalizing a lot of blocks.

To prevent this, the pr is doing the following:

1. If a peer sends us an empty view, we report this peer and decrease it
reputation.

2. We ensure that we only send a view update when the `heads` changed
and not only the `finalized_number`.

3. We do not send empty `ActiveLeavesUpdates` from the overseer, as this
makes no sense to send these empty updates. If some subsystem is relying
on the finalized block, it needs to listen for the overseer signal.

* Update node/network/bridge/src/lib.rs

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

* Don't work if they're are no added heads

* Fix test

* Ahhh

* More fixes

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
2021-01-08 13:05:19 -05:00
Fedor Sakharov 8f293e18c3 Exit from av-store loop on fatal error. (#2232)
* Fuse receive stream in Context

* Revert "Fuse receive stream in Context"

This reverts commit ddd26fa98f0ca1afbc22064e93010e4193a058b2.

* Exit on node shutdown from av-store loop

* Filter only context error
2021-01-08 12:40:46 +01:00
Fedor Sakharov c0102aafa7 Avoid cloning and multiple entry calls (#2226) 2021-01-07 22:01:23 +00:00
Robert Habermeier 9dee08af2f Batch messages to network bridge and introduce a timeout to SubsystemContext::send_message (#2197)
* guide: batch network messages

* bridge: batch

* av-dist: batch outgoing messages

* time-out message sends in subsystem context

* Update node/subsystem/src/messages.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Revert "time-out message sends in subsystem context"

This reverts commit d49be62557ec37c8a350b93718acad723df704ef.

* Update node/network/availability-distribution/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-01-07 16:01:03 -05:00
Fedor Sakharov b97f52a4c8 Optimizations of av-store (#2223)
* Store all chunks and in a single transaction

* Adds chunks LRU to store

* Add pruning records metrics

* Use honest cache instead of LRU

* Remove unnecessary optional cache

* Fix review nits that are fixable
2021-01-07 21:00:30 +00:00
Bastian Köcher 0d614374e9 Switch to latest Jaeger and improve the spans (#2216)
* Switch to latest Jaeger and improve the spans

* Update node/jaeger/src/lib.rs

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>

* Use better span in bitfield signing

* Update node/core/bitfield-signing/src/lib.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Andronik Ordian <write@reusable.software>
2021-01-07 20:44:20 +01:00
Pierre Krieger 5ce24c4962 Companion PR for refactoring priority groups (#2095)
* Companion PR for refactoring priority groups

* Fix non reserved node

* Try fix tests

* Missing import

* Fix warning

* Change protocols order

* Fix test

* Renames

* Update syn dependency to make it compile again after merging master

* "Update Substrate"

Co-authored-by: parity-processbot <>
2021-01-07 14:25:09 +00:00
felix 2a05e69210 4 additional bootnodes added (#2213) 2021-01-07 11:59:02 +01:00
Andronik Ordian a0a5f4cf88 upgrade a few dependencies (companion for 7831) (#2205)
* upgrade a few dependencies

* "Update Substrate"

Co-authored-by: parity-processbot <>
2021-01-06 20:38:25 +01:00
felix 9d07e99c2c added new bootnode to chain spec's (#2204)
* added new bootnode to chain spec's

* remove trailing newline
2021-01-06 14:30:15 +01:00
Peter Goodspeed-Niklaus cd58c02cd3 Add metrics timing message passing from OverseerSubsystemContext to Overseer::route_message (#2201)
* add timing setup to OverseerSubsystemContext

* figure out how to initialize the rng

* attach a timer to a portion of the messages traveling to the Overseer

This timer only exists / logs a fraction of the time (configurable
by `MESSAGE_TIMER_METRIC_CAPTURE_RATE`). When it exists, it tracks
the span between the `OverSubsystemContext` receiving the message
and its receipt in `Overseer::run`.

* propagate message timing to the start of route_message

This should be more accurate; it ensures that the timer runs
at least as long as that function. As `route_message` is async,
it may not actually run for some time after it is called (or ever).

* fix failing test

* rand_chacha apparently implicitly has getrandom feature

* change rng initialization

The previous impl using `from_entropy` depends on the `getrandom`
crate, which uses the system entropy source, and which does not
work on `wasm32-unknown-unknown` because it wants to fall back to
a JS implementation which we can't assume exists.

This impl depends only on `rand::thread_rng`, which has no documentation
stating that it's similarly limited.

* remove randomness in favor of a simpler 1 of N procedure

This deserves a bit of explanation, as the motivating issue explicitly
requested randomness. In short, it's hard to get randomness to compile
for `wasm32-unknown-unknown` because that is explicitly intended to be
as deterministic as practical. Additionally, even though it would never
be used for consensus purposes, it still felt offputting to intentionally
introduce randomness into a node's operations. Except, it wasn't really
random, either: it was a deterministic PRNG varying only in its state,
and getting the state to work right for that target would have required
initializing from a constant.

Given that it was a deterministic sequence anyway, it seemed much simpler
and more explicit to simply select one of each N messages instead of
attempting any kind of realistic randomness.

* reinstate randomness for better statistical properties

This partially reverts commit 0ab8594c328b3f9ce1f696fe405556d4000630e9.

`oorandom` is much lighter than the previous `rand`-based implementation,
which makes this easier to work with.

This implementation gives each subsystem and each child RNG a distinct
increment, which should ensure they produce distinct streams of values.
2021-01-06 14:25:04 +01:00
dependabot[bot] 82ee539db6 Bump pin-project from 1.0.2 to 1.0.3 (#2209)
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v1.0.2...v1.0.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-06 11:43:21 +01:00
Bastian Köcher 453b6fffb6 Improve the unbacked-span (#2206)
This ensures that we also record the first `import_statement` that will
lead to the creation of the `unbacked-span`.
2021-01-05 21:36:40 +00:00
dependabot[bot] 8d05d228fe Bump smallvec from 1.5.1 to 1.6.0 (#2183)
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.5.1...v1.6.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-05 14:40:44 +00:00
Bastian Köcher 5be092894e Add one Jaeger span per relay parent (#2196)
* Add one Jaeger span per relay parent

This adds one Jaeger span per relay parent, instead of always creating
new spans per relay parent. This should improve the UI view, because
subsystems are now grouped below one common span.

* Fix doc tests

* Replace `PerLeaveSpan` to `PerLeafSpan`

* More renaming

* Moare

* Update node/subsystem/src/lib.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* Skip the spans

* Increase `spec_version`

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-01-05 15:09:25 +01:00
Bastian Köcher 03b31c6ba3 Use correct ROC currency name (#2195) 2021-01-04 21:47:56 +01:00
Robert Habermeier 41102a6ff9 Improve Network Spans (#2169)
* utility functions for erasure-coding threshold

* add candidate-hash tag to candidate jaeger spans

* debug implementation for jaeger span

* add a span to each live candidate in availability dist.

* availability span covers only our piece

* fix tests

* keep span alive slightly longer

* remove spammy bitfield-gossip-received log

* Revert "remove spammy bitfield-gossip-received log"

This reverts commit 831a2db506d66f64ea516af3caf891e8643f5c43.

* add claimed validator to bitfield-gossip span

* add peer-id to handle-incoming span

* add peer-id to availability distribution span

* Update node/network/availability-distribution/src/lib.rs

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

* Update erasure-coding/src/lib.rs

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

* Update node/subsystem/src/jaeger.rs

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
2021-01-04 17:29:53 +00:00
Sergei Shulepov a864eaa093 Add relay storage root to persisted validation data (#2161)
* Cont.: Implement the state root obtaining during inclusion

During inclusion now we obtain the storage root by passing it through
the inclusion_inherent.

* Fix tests

* Bump rococo spec version

* Reorder the parent header into the end

of the inclusion inherent.

When the parent header is in the beginning, it shifts the other two
fields, so that a previous version won't be able to decode that. If
we put the parent header in the end, the other two fields will stay
at their positions, thus make it possible to decode with the previous
version.

That allows us to perform upgrade of rococo runtime without needing of
simultanuous upgrade of nodes and runtime, or restart of the network.

* Squash a stray tab
2021-01-04 11:58:20 -05:00
Bastian Köcher 930978ce77 Improve unbacked span (#2191)
We need to make sure to drop the import-statement child span before the
parent span is dropped.
2021-01-04 16:12:03 +01:00
Bastian Köcher 9e55472154 Improve jaeger spans for bitfield signing (#2189) 2021-01-04 13:36:31 +00:00
Robert Habermeier eefebc6cfc differentiate spans for erasure-coding and storage (#2185) 2021-01-02 21:47:27 +00:00
Bastian Köcher b24159722e Companion for Substrate#7795 (#2180)
* Companion for Substrate#7795

https://github.com/paritytech/substrate/pull/7795

* Fix missing test

* "Update Substrate"

Co-authored-by: parity-processbot <>
2020-12-29 23:39:17 +00:00
dependabot[bot] f06dc3a306 Bump serde_json from 1.0.60 to 1.0.61 (#2178)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.60 to 1.0.61.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.60...v1.0.61)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-29 09:52:52 +01:00
dependabot[bot] 4bd7cc7b70 Bump thiserror from 1.0.22 to 1.0.23 (#2173)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.22 to 1.0.23.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.22...1.0.23)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-28 14:45:25 +00:00
Bastian Köcher bb856698a4 Support variable session length for Rococo chains at genesis (#2167)
This pr adds support to change the session length of a Rococo chain at
genesis. This is rather useful because Rococo has a session length of
1 hour, while on rococo-local you will now get 1 minute. This improves
the dev experience, because a parachain is only going live at the
start of a new session.
2020-12-24 15:25:15 -05:00
Robert Habermeier 01d271caeb Fix statement distribution: forward statements to other peers. (#2146)
* add candidate hash statement circulation span

* add relay-parent to hash-span

* Some typos and misspellings in docs I found, during my studies. (#2144)

* Fix stale link to overseer docs

* Some typos and mispellings in docs/comments

I found during studying how Polkadot works.

* Rococo V1 (#2141)

* Update to latest master and use 30 minutes sessions

* add bootnodes to chainspec

* Update Substrate

* Update chain-spec

* Update Cargo.lock

* GENESIS

* Change session length to one hour

* Bump spec_version to not fuck anything up ;)

Co-authored-by: Erin Grasmick <erin@parity.io>

* avoid creating duplicate unbacked spans when we see extra statements (#2145)

* improve jaeger spans for statement distribution

* tweak and add failing test for repropagation

* make a change that gets the test passing

* guide: clarify

* remove semicolon

Co-authored-by: Robert Klotzner <eskimor@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Erin Grasmick <erin@parity.io>
2020-12-20 18:52:07 -05:00
Robert Habermeier e95be77eb6 overseer: observe stalled subsystems and shut down (#2148)
* overseer: observe stalled subsystems and shut down

* notify on send_message failure as well
2020-12-20 20:30:02 +00:00
Robert Habermeier 3e7b3ff4b5 avoid creating duplicate unbacked spans when we see extra statements (#2145) 2020-12-18 18:53:35 -05:00
Bastian Köcher fa1eafb536 Rococo V1 (#2141)
* Update to latest master and use 30 minutes sessions

* add bootnodes to chainspec

* Update Substrate

* Update chain-spec

* Update Cargo.lock

* GENESIS

* Change session length to one hour

* Bump spec_version to not fuck anything up ;)

Co-authored-by: Erin Grasmick <erin@parity.io>
2020-12-18 18:32:21 -05:00
Robert Klotzner 9ebb9015d3 Some typos and misspellings in docs I found, during my studies. (#2144)
* Fix stale link to overseer docs

* Some typos and mispellings in docs/comments

I found during studying how Polkadot works.
2020-12-18 18:31:43 -05:00
Robert Habermeier 2c1a78782e fix bug where we over-eagerly remove backing spans for candidates we validate ourselves (#2142)
* fix bug where we over-eagerly remove backing spans for candidates we validate ourselves

* jaeger: watch importing of statements
2020-12-18 13:40:37 -05:00
Pierre Krieger a141a6fbc9 Fix Jaeger service name (#2140) 2020-12-18 16:09:33 +00:00
dependabot[bot] 4be033f499 Bump mick-jaeger from 0.1.1 to 0.1.2 (#2139)
Bumps [mick-jaeger](https://github.com/tomaka/mick-jaeger) from 0.1.1 to 0.1.2.
- [Release notes](https://github.com/tomaka/mick-jaeger/releases)
- [Commits](https://github.com/tomaka/mick-jaeger/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-18 12:09:37 +01:00
Robert Habermeier 38276b08a4 Add candidate info to OccupiedCore (#2134)
* guide: add candidate information to OccupiedCore

* add descriptor and hash to occupied core type

* guide: add candidate hash to inclusion

* runtime: return candidate info in core state

* bitfield signing: stop querying runtime as much

* minimize going to runtime in availability distribution

* fix availability distribution tests

* guide: remove para ID from Occupied core

* get all crates compiling
2020-12-18 11:20:37 +03:00
Robert Habermeier eab86d6f4b address review comments from 2104 (#2136) 2020-12-17 18:23:47 -05:00