Commit Graph

27 Commits

Author SHA1 Message Date
Bastian Köcher 0ff60f7da1 Companion for removal of execution strategies (#7443)
* Companion for removal of execution strategies

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

* Fix some tests

* 🤦

* Adapt to latest changes

* Start supporting the offchain transaction pool

* Fix tests

* FMT

* Remove patches

* Update Substrate

* update lockfile for {"substrate"}

* Fix parachain upgrade smoke test

* Fix test

* Rewrite all tests to use `MockSubstemClient`

---------

Co-authored-by: parity-processbot <>
2023-07-11 21:55:43 +00:00
Bastian Köcher e53d15aa20 Do not depend on native runtimes for RuntimeApi (#7451)
* Implement runtime apis for fake runtime

These runtime api implementations are only used to make the compiler
think that we have implemented all required runtime apis. They will not
be called as we switch the executor to `WasmExecutor`. In the near
future we will not require these fake implementations anymore after
Substrate has shifted away from this compile time requirement.

This brings us the advantage that the `polkadot-service` doesn't need to
depend on the runtimes for getting the `RuntimeApi` type.

It also removes around 1min of build time on my machine ;)

* Fix warning

* FMT

* ".git/.scripts/commands/fmt/fmt.sh"

* Use more descriptive id

* Fix warnings

* Adapt path

* Fix 🙈

---------

Co-authored-by: command-bot <>
2023-07-04 10:09:14 +02:00
Niklas Adolfsson dcbf8b70f7 companion for #13384 (#6987)
* companion for #13384

* adjust parsing RPC address from process output

* update rpc cli

* update lockfile for {"substrate"}

* bump zombienet v1.3.48

* bump zombienet version

* allow zombienet-tests-misc-upgrade-node to fail

* add comment and issue link to allowed_failure

* grumbles: disable failed job

* disabled the correct test

---------

Co-authored-by: parity-processbot <>
Co-authored-by: Javier Viola <javier@parity.io>
2023-05-04 11:48:08 +02:00
s0me0ne-unkn0wn 64660ee8d2 Remove years from copyright notes (#7034)
* Happy New Year!

* Remove year entierly

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove years from copyright notice in the entire repo

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-04-08 20:38:35 +00:00
Oliver Tale-Yazdi e17130cd13 Feature gate test benchmark_storage_works (#6376)
* Feature gate storage bench test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* typo

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
2022-12-08 14:12:04 +00:00
alexgparity 9ea14e66c8 Clippyfy (#6341)
* Add clippy config and remove .cargo from gitignore

* first fixes

* Clippyfied

* Add clippy CI job

* comment out rusty-cachier

* minor

* fix ci

* remove DAG from check-dependent-project

* add DAG to clippy

Co-authored-by: alvicsam <alvicsam@gmail.com>
2022-11-30 08:34:06 +00:00
Niklas Adolfsson 400ee474a5 companion for #12212 (#6162)
* companion for #12212

* cargo fmt

* fix build

* update Cargo.lock

* update Cargo.lock
2022-10-18 20:09:37 +02:00
Piotr Mikołajczyk 5c843b3015 Companion for: try-runtime::follow-chain - keep connection (#5968)
* Adjust to the new API

* Remove mutability

* Async constructor

* unwrap result

* do not panic

* suggestion

* leftover

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
2022-09-06 08:46:12 +00:00
Oliver Tale-Yazdi 54cbfa0afd Fix benchmarking tests (#5791)
* Re-add tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Test with release profile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Re-add tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Test with diener

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert "Test with release profile"

This reverts commit d5384c5b603e1f8b7d14871ee57d2661e61bdb75.

* Revert "Test with diener"

This reverts commit 9e035759c780c2dfaf431456c8d0ff1a78e68d64.

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update tests/benchmark_block.rs

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
2022-07-20 18:32:02 +02:00
Oliver Tale-Yazdi 340e7be60d Co #11456: Expose benchmark extrinsic command (#5620)
* Expose 'benchmark extrinsic' command

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Split benchmarking into own mod

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Simplify code

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fixup

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Cleanup

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Spell

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert Cargo.lock updates

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* update lockfile for {"substrate"}

* Fix brittle test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Bump spec version to 9270

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Sleep in test to make it work in CI...

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Disable failing test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert "Bump spec version to 9270"

This reverts commit c1c385d7a4dc849e7f4d4723740aec66c2b7be09.

* Delete brittle test, see #5788

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Disable failing test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Delete more failing tests...

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: parity-processbot <>
2022-07-19 14:11:38 +02:00
Niklas Adolfsson 804d0f38a5 companion for #8783 - jsonrpsee (#4344)
* add jsonrpsee glue code

* diener --substrate dp-jsonrpsee-integration-2

* cargo fmt

* update substrate

* fix build

* update substrate

* fix tests

* update substrate

* update substrate

* revert Cargo.toml

* revert changes in Cargo.toml

* jsonrpsee v0.11

* fix staking miner

* chore: update jsonrpsee v0.12

* update companion

* update companion

* fix changes in substrate

* revert requires_full_sync removal

* fix: read WS address from polkadot output

* fit nits

* fix more nits

* update lockfile for {"substrate"}

* cargo fmt

Co-authored-by: parity-processbot <>
2022-05-10 12:13:38 +02:00
Roman Gafiyatullin d9f6c206a9 A companion PR to the https://github.com/paritytech/substrate/pull/10995 (#5446)
* Add BlockBackend::requires_full_sync() implementation

* do not specify --pruning explicitly

* update lockfile for {"substrate"}

* Please re-run the CI

* Please re-run the CI

Co-authored-by: Roman Gafiyatullin <rg@rgmbp-16-m1.lan>
Co-authored-by: parity-processbot <>
2022-05-06 11:33:06 +00:00
Koute b049d4f1c9 Add hardware benchmark telemetry (Companion for Substrate#11062) (#5206)
* Align to changes in Substrate

* Align to the newest changes in substrate

* Rename `--disable-hardware-benchmarks` to `--no-hardware-benchmarks`

* Fix `polkadot-test-service` compilation

* Fix compilation of test parachains
2022-04-26 09:16:31 +00:00
Oliver Tale-Yazdi 08163de073 Co #11164: Sub-commands for benchmark (#5247)
* Restructure benchmark commands

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add benchmark storage test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo update -p sp-io

* Revert "cargo update -p sp-io"

This reverts commit c321b570cef806934acfb7e1a18f543a681b9927.

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* update lockfile for {"substrate"}

* remove `useless_attribute`

* Remove rococo-native cfg

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make cumulus build

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix benchmark commands for the CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make cumulus build

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make cumulus build

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Disable new bench commands for rococo

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make cumulus build

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
2022-04-07 22:29:16 +00:00
Qinxuan Chen 74078d8eb9 Comanion for substrate#11136 (#5218)
* Comanion for substrate#11136

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

* revert changes in bridge

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2022-04-04 11:13:34 +02:00
Oliver Tale-Yazdi c8cdf9fc03 Integrate benchmark-overhead command (#5137)
* Integrate benchmark-overhead command

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Beauty fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Spellcheck on

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove constants:: module

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update block+extrinsic weights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert "Update block+extrinsic weights"

This reverts commit d77bf977f6bca0b1ded35daa2fd54b97e18a67db.

* Revert "Remove constants:: module"

This reverts commit 2d3bcd0212c438f6b96755900a01762592d90265.

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: parity-processbot <>
2022-04-01 10:34:40 +00:00
Oliver Tale-Yazdi bd33013a4b Integrate benchmark-block (#5224)
* Integrate benchmark-block

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add dep

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: parity-processbot <>
2022-04-01 10:38:32 +02:00
cheme d5ddb1a809 paritydb support for parachains db. (#4838)
* parity db subsystem without cache and no splitted column

* fmt

* fix path (auto from parity-db fail)

* lru cache for db column with cache

* Revert "lru cache for db column with cache"

This reverts commit ae177bc5e107a075eff6a21f651218ada6599b74.

* Write_lock mutex

* theoric code for bridges

* revert changes

* Revert bridge changes

* fix spec_version

* update parity db

* test purge-db

* Use specific ordered collection with paritydb.

* Revert "Use specific ordered collection with paritydb."

This reverts commit 8b66d0a4ae914cba1af0f44050d45dd6d9327c6b.

* fix chain selection tests.

* remove patch

* fix auto.

* Remove useless exists directory method

* purge chain without parity-db removal

* spellcheck

* renamings and filtering.

* fix assertion

* format

* update parity-db and fmt

* Auto keep using rocksdb when it exists.

* Revert "Auto keep using rocksdb when it exists."

This reverts commit cea49b32ae590bdce31fed5c45f3c028ae0c7564.

* Update kvdb version.
2022-03-03 11:49:38 +00:00
Bernhard Schuster d946582707 fatality based errors (#4448)
* seed commit for fatality based errors

* fatality

* first draft of fatality

* cleanup

* differnt approach

* simplify

* first working version for enums, with documentation

* add split

* fix simple split test case

* extend README.md

* update fatality impl

* make tests passed

* apply fatality to first subsystem

* fatality fixes

* use fatality in a subsystem

* fix subsystemg

* fixup proc macro

* fix/test: log::*! do not execute when log handler is missing

* fix spelling

* rename Runtime2 to something sane

* allow nested split with `forward` annotations

* add free license

* enable and fixup all tests

* use external fatality

Makes this more reviewable.

* bump fatality dep

Avoid duplicate expander compilations.

* migrate availability distribution

* more fatality usage

* chore: bump fatality to 0.0.6

* fixup remaining subsystems

* chore: fmt

* make cargo spellcheck happy

* remove single instance of `#[fatal(false)]`

* last quality sweep

* fixup
2022-02-25 17:25:26 +00:00
Bastian Köcher f3f18ace7d Remove node-primitives (#4877)
This is some Substrate crate that shouldn't be used outside of Substrate.
2022-02-08 23:48:12 +01:00
sandreim 0da05cac26 Remove sleep from tests (#4639)
* Remove sleep and use polkadot test service

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* updates

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Fix other tests

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Run metrics tests separately

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* copy some substrate utilities

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* update runtime metric test

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Remove sleep from cli tests

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* cargo

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Polkadot companion for Substrate#10463 (#4519)

* Grandpa and Beefy protocol names include chain id

Signed-off-by: acatangiu <adrian@parity.io>

* chain_spec: include fork id

* use simplified protocol name

* fix after merge

* avoid using hash default, even for protocol names

* update lockfile for substrate

Co-authored-by: parity-processbot <>

* configuration: Update upgrade validation delay doc (#4662)

* typo

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* review feedback

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* cargo lock

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* use testnet profile

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Don't run with runtime-benchmark feature

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* conditional compile up one level

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

Co-authored-by: Sergei Shulepov <sergei@parity.io>
2022-01-10 11:00:46 +00:00
Falco Hirschenberger 24b7ec9108 Store the database in a role specific subdirectory (#2923)
* Store the database in a role specific subdirectory

companion PR for https://github.com/paritytech/substrate/issues/6880

* fix test

* update Substrate

Co-authored-by: parity-processbot <>
2021-09-07 14:14:10 +00:00
Shawn Tabrizi ff5d56fb76 cargo +nightly fmt (#3540)
* cargo +nightly fmt

* add cargo-fmt check to ci

* update ci

* fmt

* fmt

* skip macro

* ignore bridges
2021-08-02 10:47:33 +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
pscott 14b9ea691c Use tempdir for tests (#993)
* Use tempdir for tests

* Rename tmp to tempdir

* Update Cargo.lock

* Update expect error message in run_command_and_kill

* Call with .path() rather than creating an string slice

* Call tempdir with arg instead of args

* Update tests/purge_chain_works.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-04-13 18:48:51 +02:00
Cecile Tonglet 6051a2b272 Fix invalid argument order (#832)
Make sure that --dev purge-chain is rejected

```
[0] [11:24:02] ~/r/polkadot master > ./target/debug/polkadot purge-chain --dev -y
"/home/cecile/.local/share/polkadot/chains/dev/db" did not exist.
[0] [11:25:36] ~/r/polkadot cecton-fix-invalid-argument-order > ./target/debug/polkadot --dev purge-chain -y
error: Found argument 'purge-chain' which wasn't expected, or isn't valid in this context

USAGE:
    polkadot --dev

For more information try --help
```
2020-02-10 13:21:21 +01:00
Cecile Tonglet c93b142692 Test node exits properly (#831)
* Initial commit

Forked at: 703ac8bbbc
Parent branch: origin/master

* Test running node and interrupts

* WIP

Forked at: 1942ae27ae23809a40f955545dfbf0467faa7750
Parent branch: origin/cumulus-branch

* Update Cargo.lock

* WIP

Forked at: 1942ae27ae23809a40f955545dfbf0467faa7750
Parent branch: origin/cumulus-branch

* WIP

Forked at: 1942ae27ae23809a40f955545dfbf0467faa7750
Parent branch: origin/cumulus-branch

* WIP

Forked at: 1942ae27ae23809a40f955545dfbf0467faa7750
Parent branch: origin/cumulus-branch
2020-02-10 10:32:10 +01:00