Commit Graph

34 Commits

Author SHA1 Message Date
Sergei Shulepov 2769066136 Increase preparation timeout (#4270)
* Increase preparation-timeout to 60 seconds

* Adapt `pvf_preparation_time` metric to the new value
2021-11-15 12:48:00 +01:00
Chris Sosnin f5fbaa139f PVF host prechecking support v2 (#4123)
* pvf host: store only compiled artifacts on disk

* Correctly handle failed artifacts

* Serialize result of PVF preparation uniquely

* Set the artifact state depending on the result

* Return the result of PVF preparation directly

* Move PrepareError to the error module

* Update doc comments

* Update misleading comment

* pvf host: turn off parallel compilation

* pvf host: implement precheck requests

* Fix warnings

* Unnecessary clone

* Add a note about timed out outcome

* Revert the pool outcome handling behavior

* Move the prepare result type into error mod

* Test prepare done

* fmt

* Add an explanation to wasmtime config

* Split pvf host test

* Add precheck to dictionary

Co-authored-by: Sergei Shulepov <sergei@parity.io>
2021-11-13 17:25:59 +01:00
Sergei Shulepov ada3fe1a2b Limit the number of PVF workers (#4273)
* Limit the number of PVF workers

In particular, limit the number of preparation workers to 1 (soft &
hard) and limit the number of execution workers to 2.

The reason why we are doing this is that it seems many workers launched
at the same time can cause problems. I.e. if there are more than 2
preparation workers, the time for preparation rises significantly to the
point of reaching the timeout.

This was mostly observed with parallel_compilation=true, so each worker
used `numcpu` threads and now we are looking to flip that parameter to
`false`. That said, we want to err on the safe side here and gradually
enable it later if our measurements show that we can do that safely.

* Adjust the test to accomodate the changed config value
2021-11-13 13:02:25 +01:00
Sergei Shulepov 1cf07b2162 Increment the retired metric instead of spawned (#4269) 2021-11-12 18:16:08 +01:00
Arkadiy Paronyan 4354b6482e Remove light client companion (#4191)
* Remove light client companion

* Update substrate

* cargo fmt

* Fixed benches

* fmt
2021-11-12 15:07:33 +01:00
sandreim b0f89bbfbc Per subsystem CPU usage tracking (#4239)
* SubsystemContext: add subsystem name str

Signed-off-by: Andrei Sandu <sandu.andrei@gmail.com>

* Overseer builder proc macro changes

* initilize SubsystemContext name field.
* Add subsystem name in TaskKind::launch_task()

Signed-off-by: Andrei Sandu <sandu.andrei@gmail.com>

* Update ToOverseer enum

Signed-off-by: Andrei Sandu <sandu.andrei@gmail.com>

* Assign subsystem names to orphan tasks

Signed-off-by: Andrei Sandu <sandu.andrei@gmail.com>

* cargo fmt

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

* SubsystemContext: add subsystem name str

Signed-off-by: Andrei Sandu <sandu.andrei@gmail.com>

* Overseer builder proc macro changes

* initilize SubsystemContext name field.
* Add subsystem name in TaskKind::launch_task()

Signed-off-by: Andrei Sandu <sandu.andrei@gmail.com>

* Update ToOverseer enum

Signed-off-by: Andrei Sandu <sandu.andrei@gmail.com>

* Assign subsystem names to orphan tasks

Signed-off-by: Andrei Sandu <sandu.andrei@gmail.com>

* cargo fmt

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

* Rebase changes for new spawn() group param

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

* Add subsystem constat in JobTrait

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

* Add subsystem string

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

* Fix tests

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

* Fix spawn() calls

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

* cargo fmt

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

* Fix

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

* Fix tests

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

* fix

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

* Fix more tests

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

* Address PR review feedback #1

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

* Address PR review round 2

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

* Fixes
- remove JobTrait::Subsystem
- fix tests

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

* update Cargo.lock

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-11-11 18:53:37 +00:00
Chris Sosnin 182667830f Move artifacts states into memory in PVF validation host (#3907)
* pvf host: store only compiled artifacts on disk

* Correctly handle failed artifacts

* Serialize result of PVF preparation uniquely

* Set the artifact state depending on the result

* Return the result of PVF preparation directly

* Move PrepareError to the error module

* Update doc comments

* Update misleading comment

* Cleanup docs

* Conclude a test job with an error

Co-authored-by: Sergei Shulepov <sergei@parity.io>
2021-10-22 16:37:58 +00:00
Chris Sosnin 1af17eed39 Update wasmtime config to match new version in substrate (#4063)
* Update wasmtime config to match new version

* update Substrate

Co-authored-by: parity-processbot <>
2021-10-12 15:56:36 +00:00
Robert Habermeier 6002865874 Make candidate validation timeouts configurable (#4001)
* pvf: make execution timeout configurable

* guide: add timeouts to candidate validation params

* add timeouts to candidate validation messages

* fmt

* port backing to use the backing pvf timeout

* port approval-voting to use the execution timeout

* port dispute participation to use the correct timeout

* fmt

* address grumbles & test failure
2021-10-04 09:53:36 -05:00
Bernhard Schuster c57a1e7934 remove AllSubsystems and AllSubsystemsGen types (#3874)
* introduce the OverseerConnector, use it

* introduce is_relay_chain to RelayChainSelection

* Update node/service/src/lib.rs

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

* avoid the deferred setting of `is_relay_chain` in `RelayChainSelection`

* positive assertion is not mandated, only the negative one, to avoid a stall

* cleanup: overseer residue

* spellcheck

* fixin

* groundwork to obsolete Overseer::new and AllSubsystemsGen proc-macro

* Now all malus & tests can be ported to the builder pattern.

Obsoletes `Overseer::new`, `AllSubsystemsGen` derive macro, `AllSubsystems`.

* spellcheck

* adjust tests, minor fixes

* remove derive macro AllSubsystemsGen

* add forgotten file dummy.rs

* remove residue

* good news everyone!

* spellcheck

* address review comments

* fixup imports

* make it conditional

* fixup docs

* reduce import

* chore: fmt

* chore: fmt

* chore: spellcheck / nlprules

* fixup malus variant-a

* fmt

* fix

* fixins

* pfmt

* fixins

* chore: fmt

* remove expanded overseer generation

* tracing version

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

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

* use future::ready instead

* silence warning

* chore: fmt

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2021-09-29 14:24:56 +00:00
Sergei Shulepov 3693eb8744 Add logging for worker spawn failures (#3827) 2021-09-10 15:40:53 +02:00
Sergei Shulepov ad0e42537d Introduce metrics into PVF validation host (#3603) 2021-08-20 11:50:47 +02:00
Bernhard Schuster ac338b6c28 collect better memory stats (#3612)
* add jemalloc memory statistics tracking

* chore: move Metronome in a separate file

* add meta flag spellcheck

* adjust metrics names

* account for new metrics in test
2021-08-13 12:40:45 +02:00
Sergei Shulepov 9d6ed7ecae Add logging to PVF and other related parts (#3596)
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-08-08 19:39:16 +02:00
Sergei Shulepov 68c03f66f3 Mass replace ,); pattern (#3580)
This is an artifact left by rustfmt which is not dare to remove the
comma being conservative.
2021-08-05 19:53:17 +02:00
Sergei Shulepov 1434b20613 Companion: Limit the maximum number of wasm memory pages a runtime can have (#3449)
* Add `max_memory_pages`

* update Substrate

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
2021-08-02 20:05:31 +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
Denis Pisarev fc253e6e4d WIP: CI: add spellcheck (#3421)
* CI: add spellcheck

* revert me

* CI: explicit command for spellchecker

* spellcheck: edit misspells

* CI: run spellcheck on diff

* spellcheck: edits

* spellcheck: edit misspells

* spellcheck: add rules

* spellcheck: mv configs

* spellcheck: more edits

* spellcheck: chore

* spellcheck: one more thing

* spellcheck: and another one

* spellcheck: seems like it doesn't get to an end

* spellcheck: new words after rebase

* spellcheck: new words appearing out of nowhere

* chore

* review edits

* more review edits

* more edits

* wonky behavior

* wonky behavior 2

* wonky behavior 3

* change git behavior

* spellcheck: another bunch of new edits

* spellcheck: new words are koming out of nowhere

* CI: finding the master

* CI: fetching master implicitly

* CI: undebug

* new errors

* a bunch of new edits

* and some more

* Update node/core/approval-voting/src/approval_db/v1/mod.rs

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

* Update xcm/xcm-executor/src/assets.rs

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

* Apply suggestions from code review

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

* Suggestions from the code review

* CI: scan only changed files

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-07-14 19:22:58 +02:00
Shawn Tabrizi 0e7217b4da Companion for #9090 (include storage info) (#3424)
* update benchmark

* add host function

* update Substrate

* fix unused

Co-authored-by: parity-processbot <>
2021-07-07 23:01:00 +00:00
Sergei Shulepov 8d77738cfd pvf: Enable stack depth metering & NaN canonicalization (#3373)
* Add `canonicalize_nans` and enable `stack_depth_metering`

* Update to the latest change in the substrate PR

* Explain why the numbers are what they are.

* Update Substrate to the latest master

Co-authored-by: parity-processbot <>
2021-07-07 12:55:00 +03:00
Sergei Shulepov b7b2276555 PVF: unresponsive worker doesn't mean the candidate is bad (#3418)
* PVF: unresponsive worker doesn't mean the candidate is bad

* s/if let Some/.is_some
2021-07-07 11:28:07 +03:00
Bastian Köcher c4d45c97dd Enable logging in the puppet worker (#3411)
This is useful for tests where something is failing :D
2021-07-05 14:18:20 +02:00
Bastian Köcher ab6c79ecb6 Use wasm-builder from git (#3354)
* Use wasm-builder from git

This brings new features like compressed runtimes out of the box.

* chore: update wasm builder dep. from 3.0.0 to master

* Fix tests

* Update node/core/pvf/tests/it/main.rs

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

Co-authored-by: chevdor <chevdor@gmail.com>
Co-authored-by: Sergei Shulepov <sergei@parity.io>
2021-06-28 10:34:47 +02:00
Shawn Tabrizi da71128daf Companion for #9106 (remove_all with size limit) (#3257)
* update apis

* fix api

* rename to `KillStorageResult`

* update Substrate

Co-authored-by: parity-processbot <>
2021-06-15 13:52:54 +00:00
André Silva 097cadca19 create newtype for ValidationCodeHash (#3212)
* create newtype for ValidationCodeHash

* pvf: fix tests compilation

* primitives: fix test compilation
2021-06-12 16:44:07 +00:00
Xiliang Chen 8f4b5c3f18 update pvf heap page limit (#3198) 2021-06-09 16:35:23 +02:00
Sergei Shulepov 2239b93d31 Companion for PR 8913 (#3114)
* Companion for PR 8913

polkadot companion: https://github.com/paritytech/substrate/pull/8913

* update Substrate

Co-authored-by: parity-processbot <>
2021-06-01 13:03:34 +02:00
Robert Habermeier 92fa699f87 clear PVF cache artifacts on startup (#3084) 2021-05-24 08:59:47 +01:00
Bernhard Schuster e8652e73db cargo spellcheck (#3067) 2021-05-22 00:15:47 +00:00
Sergei Shulepov 20ab68270f Put WIP artifacts next to ready ones (#3057)
* Put WIP artifacts next to ready ones

Fixes #3044

* Apply suggestions from code review

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-05-21 09:53:03 +02:00
Sergei Shulepov 46e5316a77 Register ReadRuntimeVersionExt (#3045)
* Register ReadRuntimeVersionExt

* Update Substrate

This includes the fix of compilation for macOS platforms.
2021-05-19 12:33:33 +02:00
Xiliang Chen d4072c652f Fix ArtifactId::path (#3027)
* issue with ArtifactId::path

* fix artifacts path

* Wrap an overly long line

Co-authored-by: Sergei Shulepov <s.pepyakin@gmail.com>
2021-05-15 14:04:09 +02:00
Sergei Shulepov d326c3431e Narrow the set of available host functions for PVF (#3005) 2021-05-13 12:15:46 +02:00
Sergei Shulepov 59b4d6511f New PVF validation host (#2710)
* Implement PVF validation host

* WIP: Diener

* Increase the alloted compilation time

* Add more comments

* Minor clean up

* Apply suggestions from code review

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

* Fix pruning artifact removal

* Fix formatting and newlines

* Fix the thread pool

* Update node/core/pvf/src/executor_intf.rs

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

* Remove redundant test declaration

* Don't convert the path into an intermediate string

* Try to workaround the test failure

* Use the puppet_worker trick again

* Fix a blip

* Move `ensure_wasmtime_version` under the tests mod

* Add a macro for puppet_workers

* fix build for not real-overseer

* Rename the puppet worker for adder collator

* play it safe with the name of adder puppet worker

* Typo: triggered

* Add more comments

* Do not kill exec worker on every error

* Plumb Duration for timeouts

* typo: critical

* Add proofs

* Clean unused imports

* Revert "WIP: Diener"

This reverts commit b9f54e513366c7a6dfdd117ac19fbdc46b900b4d.

* Sync version of wasmtime

* Update cargo.lock

* Update Substrate

* Merge fixes still

* Update wasmtime version in test

* bastifmt

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

* Squash spaces

* Trailing new line for testing.rs

* Remove controversial code

* comment about biasing

* Fix suggestion

* Add comments

* make it more clear why unwrap_err

* tmpfile retry

* proper proofs for claim_idle

* Remove mutex from ValidationHost

* Add some more logging

* Extract exec timeout into a constant

* Add some clarifying logging

* Use blake2_256

* Clean up the merge

Specifically the leftovers after removing real-overseer

* Update parachain/test-parachains/adder/collator/Cargo.toml

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-04-09 00:09:56 +02:00