Commit Graph

1279 Commits

Author SHA1 Message Date
Bastian Köcher 8cb049a75a Fixes bug that collator wasn't sending Declare message (#1895)
* Fixes bug that collator wasn't sending `Declare` message

* Apply suggestions from code review

I'm an idiot
2020-11-01 13:40:53 +01:00
Robert Habermeier ad9e1fdf75 fix service build: enable notifications protocol only under real overseer (#1894)
Co-authored-by: Robert Habermeier <rob@rob.tech>
2020-10-31 19:25:58 +01:00
Bastian Köcher f82de7b993 Adds test parachain adder collator (#1864)
* start working on building the real overseer

Unfortunately, this fails to compile right now due to an upstream
failure to compile which is probably brought on by a recent upgrade
to rustc v1.47.

* fill in AllSubsystems internal constructors

* replace fn make_metrics with Metrics::attempt_to_register

* update to account for #1740

* remove Metrics::register, rename Metrics::attempt_to_register

* add 'static bounds to real_overseer type params

* pass authority_discovery and network_service to real_overseer

It's not straightforwardly obvious that this is the best way to handle
the case when there is no authority discovery service, but it seems
to be the best option available at the moment.

* select a proper database configuration for the availability store db

* use subdirectory for av-store database path

* apply Basti's patch which avoids needing to parameterize everything on Block

* simplify path extraction

* get all tests to compile

* Fix Prometheus double-registry error

for debugging purposes, added this to node/subsystem-util/src/lib.rs:472-476:

```rust
Some(registry) => Self::try_register(registry).map_err(|err| {
	eprintln!("PrometheusError calling {}::register: {:?}", std::any::type_name::<Self>(), err);
	err
}),
```

That pointed out where the registration was failing, which led to
this fix. The test still doesn't pass, but it now fails in a new
and different way!

* authorities must have authority discovery, but not necessarily overseer handlers

* fix broken SpawnedSubsystem impls

detailed logging determined that using the `Box::new` style of
future generation, the `self.run` method was never being called,
leading to dropped receivers / closed senders for those subsystems,
causing the overseer to shut down immediately.

This is not the final fix needed to get things working properly,
but it's a good start.

* use prometheus properly

Prometheus lets us register simple counters, which aren't very
interesting. It also allows us to register CounterVecs, which are.
With a CounterVec, you can provide a set of labels, which can
later be used to filter the counts.

We were using them wrong, though. This pattern was repeated in a
variety of places in the code:

```rust
// panics with an cardinality mismatch
let my_counter = register(CounterVec::new(opts, &["succeeded", "failed"])?, registry)?;
my_counter.with_label_values(&["succeeded"]).inc()
```

The problem is that the labels provided in the constructor are not
the set of legal values which can be annotated, but a set of individual
label names which can have individual, arbitrary values.

This commit fixes that.

* get av-store subsystem to actually run properly and not die on first signal

* typo fix: incomming -> incoming

* don't disable authority discovery in test nodes

* Fix rococo-v1 missing session keys

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

* try dummying out av-store on non-full-nodes

* overseer and subsystems are required only for full nodes

* Reduce the amount of warnings on browser target

* Fix two more warnings

* InclusionInherent should actually have an Inherent module on rococo

* Ancestry: don't return genesis' parent hash

* Update Cargo.lock

* fix broken test

* update test script: specify chainspec as script argument

* Apply suggestions from code review

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

* Update node/service/src/lib.rs

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

* node/service/src/lib: Return error via ? operator

* post-merge blues

* add is_collator flag

* prevent occasional av-store test panic

* simplify fix; expand application

* run authority_discovery in Role::Discover when collating

* distinguish between proposer closed channel errors

* add IsCollator enum, remove is_collator CLI flag

* improve formatting

* remove nop loop

* Fix some stuff

* Adds test parachain adder collator

* Add sudo to Rococo, change session length to 30 seconds and some renaming

* Update to the latest changes on master

* Some fixes

* Fix compilation

* Update parachain/test-parachains/adder/collator/src/lib.rs

Co-authored-by: Sergei Shulepov <sergei@parity.io>

* Review comments

* Downgrade transaction version

* Fixes

* MOARE

* Register notification protocols

* utils: remove unused error

* av-store: more resilient to some errors

* address review nits

* address more review nits

Co-authored-by: Peter Goodspeed-Niklaus <peter.r.goodspeedniklaus@gmail.com>
Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
Co-authored-by: Robert Habermeier <robert@Roberts-MBP.lan1>
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: Sergey Shulepov <s.pepyakin@gmail.com>
Co-authored-by: Sergei Shulepov <sergei@parity.io>
2020-10-31 17:01:46 +00:00
Fedor Sakharov 16f8da1da3 A real overseer feature (#1892)
* A real overseer feature

* Fix build without feature

* Update node/service/src/lib.rs

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

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-10-31 03:20:29 +00:00
Robert Habermeier 43be64f2f7 Implementer's guide: Approval Voting Subsystem (#1691)
* add storage for approvals module

* basics of approval logic

* fix links

* Session info module

* create an approvals_inherent module

* integrate approvals module with inclusion

* Remove approvals runtime

* tweak mentions of on-chain logic

* add note on finality-grandpa voting rule

* elaborate on node-side components

* stub for availability recovery

* add another note on voting rule

* Beginnings of approval subsystems

* flesh out approval voting now

* logic for checking assignment certs

* initial scheduler logic

* scheduler logic

* adjst tranche taking logic

* approval voting import

* approval work (voting side)

* amend some TODOs

* mark some TODOs

* describe `ApprovedAncestor`

* reference protocol-approval.md

* clarity on bitfield

* remove approvals_inherent

* tweak session_info module according to review

* formatting & nits

Co-authored-by: Robert Habermeier <robert@Roberts-MacBook-Pro.local>
2020-10-30 22:07:52 -05:00
Albrecht d8b85dc3be Companion for #6912 (#1784)
* adjustments for substrate PR

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

* Update runtime/kusama/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Apply suggestions from code review

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* update substrate

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2020-10-30 12:56:39 +00:00
s3krit 6466a7f34d [CI] Switch to using paritytech/srtool (#1887)
* switch to using paritytech/srtool

* update release link
2020-10-29 20:33:17 +01:00
Bastian Köcher a4b92cd3b6 Make sure validator discovery works with a delayed peer to validator mapping (#1886)
* Make sure validator discovery works with a delayed peer to validator mapping

Currently the implementation checks on connect of a peer if this peer is
a validator by asking the authority discovery. It can now happen that
the authority discovery is not yet aware that a given peer is an
authority. This can for example happen on start up of the node.

This pr changes the behavior, to make it possible to later associate a
peer to a validator id. Instead of just storing the connected
validators, we now store all connected peers with a vector of associated
validator ids. When we get a request to connect to a given given set of
validators, we start by checking the connected peers. If we didn't find
a validator id in the connected peers, we ask the authority discovery
for the peerid of a given authority id. When the returned peerid is part
of our connected peers set, we cache and return the authority id.

* Update node/network/bridge/Cargo.toml

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

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

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* Update `Cargo.lock`

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-10-29 17:43:34 +01:00
Sergei Shulepov 0cddf51a9c DMP follow-ups (#1875)
* remove pending TODO after the DMP impl merge

* DMP: Update the impl guide

* DMP: Incorporate XCM related changes into the guide

This is the DMP related part of https://github.com/paritytech/polkadot/issues/1702
2020-10-29 13:29:19 +00:00
Qinxuan Chen 39db0688de Companion for substrate #7159 (#1747)
* Companion for paritytech/substrate#7159

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* update WithdrawReason in xcm

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* "Update Substrate"

Co-authored-by: parity-processbot <>
2020-10-29 12:35:58 +00:00
Bastian Köcher 724321cd2d Only use dummy subsystems in overseer (#1884)
* Only use dummy subsystems in overseer

* Fix compilation and warnings
2020-10-29 12:58:47 +01:00
Shawn Tabrizi 70ef6a6e12 Update Tips to go 100% to Author (#1836)
* 100% of tip goes to Author

* refactor dealwithfees into common

* add fee and tip test

* fix
2020-10-29 10:12:39 +00:00
Fedor Sakharov 935fcd1666 Change SpawnedSubsystem type to log subsystem errors (#1878)
* Change SpawnedSubsystem type to log subsystem errors

* Remove clone
2020-10-28 20:57:06 +01:00
Bernhard Schuster 8a305ac963 remove error wrapper type (#1871)
* get rid of glue wrapper error type

* cargo update -p sp-io

* cargo update -p sp-io

* "Update Substrate"

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: parity-processbot <>
2020-10-28 16:42:23 +00:00
Bastian Köcher bbf7fc8d0b Add key subcommand (#1874) 2020-10-28 16:42:03 +00:00
Fedor Sakharov 1928656361 Collator protocol should choose side (#1872)
* Collator protocol should choose side

* Update node/service/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-10-28 15:53:09 +00:00
Peter Goodspeed-Niklaus 62daee2286 remove the --disable-authority-discovery flag & related (#1870) 2020-10-28 15:18:34 +01:00
s3krit e2e57cb8f6 rollback spec_version and fix check_runtime (#1868) 2020-10-28 12:18:41 +00:00
Sergei Shulepov e0336626ae let go fees (#1867) 2020-10-28 13:11:06 +01:00
Sergei Shulepov 1d6b77fd80 Update to the latest changes on master (#1866) 2020-10-28 11:21:13 +00:00
Sergei Shulepov 9903bca259 Downward Message Processing implementation (#1859)
* DMP: data structures and plumbing

* DMP: Implement DMP logic in the router module

DMP: Integrate DMP parts into the inclusion module

* DMP: Introduce the max size limit for the size of a downward message

* DMP: Runtime API for accessing inbound messages

* OCD

Small clean ups

* DMP: fix the naming of the error

* DMP: add caution about a non-existent recipient
2020-10-28 10:41:42 +00:00
Peter Goodspeed-Niklaus 1a25c41277 start working on building the real overseer (#1795)
* start working on building the real overseer

Unfortunately, this fails to compile right now due to an upstream
failure to compile which is probably brought on by a recent upgrade
to rustc v1.47.

* fill in AllSubsystems internal constructors

* replace fn make_metrics with Metrics::attempt_to_register

* update to account for #1740

* remove Metrics::register, rename Metrics::attempt_to_register

* add 'static bounds to real_overseer type params

* pass authority_discovery and network_service to real_overseer

It's not straightforwardly obvious that this is the best way to handle
the case when there is no authority discovery service, but it seems
to be the best option available at the moment.

* select a proper database configuration for the availability store db

* use subdirectory for av-store database path

* apply Basti's patch which avoids needing to parameterize everything on Block

* simplify path extraction

* get all tests to compile

* Fix Prometheus double-registry error

for debugging purposes, added this to node/subsystem-util/src/lib.rs:472-476:

```rust
Some(registry) => Self::try_register(registry).map_err(|err| {
	eprintln!("PrometheusError calling {}::register: {:?}", std::any::type_name::<Self>(), err);
	err
}),
```

That pointed out where the registration was failing, which led to
this fix. The test still doesn't pass, but it now fails in a new
and different way!

* authorities must have authority discovery, but not necessarily overseer handlers

* fix broken SpawnedSubsystem impls

detailed logging determined that using the `Box::new` style of
future generation, the `self.run` method was never being called,
leading to dropped receivers / closed senders for those subsystems,
causing the overseer to shut down immediately.

This is not the final fix needed to get things working properly,
but it's a good start.

* use prometheus properly

Prometheus lets us register simple counters, which aren't very
interesting. It also allows us to register CounterVecs, which are.
With a CounterVec, you can provide a set of labels, which can
later be used to filter the counts.

We were using them wrong, though. This pattern was repeated in a
variety of places in the code:

```rust
// panics with an cardinality mismatch
let my_counter = register(CounterVec::new(opts, &["succeeded", "failed"])?, registry)?;
my_counter.with_label_values(&["succeeded"]).inc()
```

The problem is that the labels provided in the constructor are not
the set of legal values which can be annotated, but a set of individual
label names which can have individual, arbitrary values.

This commit fixes that.

* get av-store subsystem to actually run properly and not die on first signal

* typo fix: incomming -> incoming

* don't disable authority discovery in test nodes

* Fix rococo-v1 missing session keys

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

* try dummying out av-store on non-full-nodes

* overseer and subsystems are required only for full nodes

* Reduce the amount of warnings on browser target

* Fix two more warnings

* InclusionInherent should actually have an Inherent module on rococo

* Ancestry: don't return genesis' parent hash

* Update Cargo.lock

* fix broken test

* update test script: specify chainspec as script argument

* Apply suggestions from code review

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

* Update node/service/src/lib.rs

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

* node/service/src/lib: Return error via ? operator

* post-merge blues

* add is_collator flag

* prevent occasional av-store test panic

* simplify fix; expand application

* run authority_discovery in Role::Discover when collating

* distinguish between proposer closed channel errors

* add IsCollator enum, remove is_collator CLI flag

* improve formatting

* remove nop loop

* Fix some stuff

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
Co-authored-by: Robert Habermeier <robert@Roberts-MBP.lan1>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-10-28 10:26:50 +00:00
Bernhard Schuster 5fbb8a381c use color_eyre for its backtrace feature and error reporting (#1855)
* use color_eyre for its backtrace feature and error reporting

* lost Cargo.lock update

* wrapper

* add error glue to be able to utilize eyre

* Update src/main.rs

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

* Update src/main.rs

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

* avoid duplicate error print

* Update src/main.rs

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>
2020-10-27 21:31:57 +00:00
Kian Paimani 65106d7792 Reconfigure on_initialize weight. (#1838)
* Reconfigure transaction payment and on_initialize weight.

* Some tests to investigate with

* fix build

* Update runtime/common/src/lib.rs

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

* undo change to multiplier.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-10-27 21:05:04 +00:00
Bastian Köcher 1a3780aa79 Fix proposer factory prometheus registration (#1862)
The proposer wasn't registered in prometheus and thus, we could not see
its metrics.
2020-10-27 21:55:12 +01:00
Xiliang Chen ac1f19c68c Companion for #7188: Implement batch_all and update Utillity Pallet for Weight/Fee Refunds (#1775)
* add missing method

* "Update Substrate"

* bump spec

* cargo update -p sp-io

Co-authored-by: parity-processbot <>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-10-27 21:08:13 +01:00
Shawn Tabrizi d79b37b8fd Finish XCM Executor Assets w/ Tests (#1821)
* adding some basic tests

* min error

* fix min

* fix saturating_take

* all fungible and non fungible

* min abstract

* fix saturating take

* clean up

* some comments and fixes

* another fix

* more fixes

* comment

* remove unnecessary collect

* improve iter cloning

* better saturating_take impl

* feedback

* fix no_std build

* add doc tests

* mem::replace to be a bit more efficient

* better api
2020-10-27 20:00:14 +01:00
Fedor Sakharov a416667a2b Should check Duration subtraction (#1860) 2020-10-27 15:12:53 +00:00
Sergei Shulepov cb30705eea test-runtime: use sp-std instead of rstd (#1857)
At some point we had aliases for all the substrate crates but at some point we've switched to the full names to avoid confusion. It seems that we missed this instance.
2020-10-27 13:11:16 +00:00
s3krit d42d9dd4f2 Prep for v0.8.26: bump version & substrate (#1851)
* bump version & substrate

* update release checklist md
2020-10-27 14:08:54 +01:00
Bernhard Schuster f345123748 introduce errors with info (#1834) 2020-10-27 08:10:03 +01:00
Bastian Köcher 40ea09389c Expose the backend from a full node (#1852) 2020-10-26 18:49:40 +00:00
Andronik Ordian fa1881458f fix compilation on nightly (#1850)
* runtime: annonate some types

* cargo update -p sp-io

* add wasm overwrites to Configuration in test-service

* rename overwrite to override

Co-authored-by: Andrew Plaza <andrew.plaza@parity.io>
2020-10-26 17:25:49 +00:00
s3krit 0c316acef0 remove debug lines (#1847) 2020-10-26 11:59:20 +00:00
Bastian Köcher f2a05330ed Update everything to latest wasm-builder (#1843)
This fixes some incompatibilities between wasm-builder and wasm-builder-runner.
2020-10-26 11:54:16 +00:00
Max Inden 6d7b42b5ac node/service/src/lib: Do not spawn authority discovery on sentries (#1835)
* node/service/src/lib: Do not spawn authority discovery on sentries

The notion of sentry nodes has been deprecated (see [1] for details).
Support for sentry nodes in the `client/authority-discovery` module has
been removed.

This commit adjusts the instantiation of the authority discovery worker
accordingly, only spawning the module on authority nodes.

[1] https://github.com/paritytech/substrate/issues/6845

* "Update Substrate"

Co-authored-by: parity-processbot <>
2020-10-26 10:31:16 +00:00
Bastian Köcher 2163988f54 Improve and unify testing facilities (#1844)
* Improve and unify testing facilities

This improves the testing facilities by making the test client easier to
use. It also removes code that is not required for the test client.
Besides that it also moves the test service and test client under
`node/test`.

* Update Cargo.lock

* Update node/test/client/src/block_builder.rs

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

* Remove explicit lifetime annotation

* Fix warnings and add extra `BlockBuilderExt`

Co-authored-by: Andronik Ordian <write@reusable.software>
2020-10-25 14:45:30 +00:00
Sergei Shulepov abb282dfd0 Runtime API for checking validation outputs (#1842)
* annoying whitespaces

* update guide

Add `CheckValidationOutputs` runtime api and also change the
candidate-validation stuff

* promote ValidationOutputs to global primitives

i.e. move it from node specific primitives to global v1 primitives. This
will be needed when we share it later in the runtime inclusion module

* refactor acceptance checks in the inclusion module

factor out the common code to share it during the block inclusion and
for the forthcoming CheckValidationOutputs runtime api.

Also note that the acceptance criteria was updated to incorporate checks
that exist now in candidate-validation

* plumb the runtime api outside

* extract validation_data from ValidationOutputs

* use runtime-api to check validation outputs

apart from that refactor, update docs and tidy a bit

* Update the maxium code size

This is to fix a test that performs an upgrade.
2020-10-24 01:48:36 -05:00
Fedor Sakharov ec49d81307 Availability store pruning (#1820)
* Initial commit

* Move tests to separate module

* Move timestamps to the newtype

* Change idx name

* Use Duration for consts and update chunk records

* Ordering::Equal

* Update node/core/av-store/src/lib.rs

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

* put_ methods do the array sorting

* Fix get_block_number

* Change StoreChunk message type and relay parent method

* Add chunk tests

* Fix block number computation for StoreChunk

* Duration instead of u64 everywhere

* Add a clarifying comment

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
2020-10-24 06:03:57 +00:00
s3krit da121e4183 update generate_release_text.rb (#1812) 2020-10-23 14:37:53 -05:00
Bernhard Schuster 9ba8753916 chore: add cargo spellcheck configuration and custom topic specifc dictionary (#1841) 2020-10-23 17:28:23 +02:00
Cecile Tonglet fd138d4adb Companion PR for substrate #7328 (#1825)
* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Update node/service/src/lib.rs

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

* WIP

* "Update Substrate"

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: parity-processbot <>
2020-10-21 15:32:06 +00:00
s3krit 747103dfd2 Automation for new release process (#1754) 2020-10-20 18:24:54 +02:00
s3krit 032c68850d [CI] Docker image updates (#1799) 2020-10-19 15:44:14 +02:00
Bastian Köcher bf142f97c4 Companion for Substrate#7350 (#1829)
* Companion for Substrate#7350

* "Update Substrate"

Co-authored-by: parity-processbot <>
2020-10-19 08:45:11 +00:00
Shawn Tabrizi 11bbb076cc Companion PR for Substrate #7233 (#1791)
* Update constant weight signatures

* Keep timestamp constant time

* constant as_derivative

* cargo update -p sp-io

Co-authored-by: parity-processbot <>
2020-10-17 13:58:23 +00:00
Bastian Köcher a7e9aedbc5 Add ParasSudoWrapper to test-runtime and bring back register_parachain to test-service (#1811)
* Make register/deregister parachain dispatchables

This makes `register_parachain` and `deregister_parachain` of
`Registrar` dispatchables.

Besides that it brings back the functionality of the test node to
register a parachain.

* Fix tests

* PR review comments
2020-10-16 09:45:03 +02:00
André Silva 3687c5df11 runtime: remove finality-tracker (#1762)
* runtime: remove finality-tracker

* runtime: bump spec_version

* update substrate
2020-10-15 21:26:37 +00:00
Andronik Ordian 979b9c5556 av-store: create a db dir if missing (#1819) 2020-10-15 15:09:48 +02:00
Ashley c7e729e07b Companion PR for 'Add missing fields to the light sync state #7225' (#1801)
* Add sync_state_items

* Add SyncStateRpc

* "Update Substrate"

Co-authored-by: parity-processbot <>
2020-10-15 10:28:00 +00:00