Commit Graph

31 Commits

Author SHA1 Message Date
maksimryndin 426136671a PVF: re-preparing artifact on failed runtime construction (#3187)
resolve https://github.com/paritytech/polkadot-sdk/issues/3139

- [x] use a distinguishable error for `execute_artifact`
- [x] remove artifact in case of a `RuntimeConstruction` error during
the execution
- [x] augment the `validate_candidate_with_retry` of `ValidationBackend`
with the case of retriable `RuntimeConstruction` error during the
execution
- [x] update the book
(https://paritytech.github.io/polkadot-sdk/book/node/utility/pvf-host-and-workers.html#retrying-execution-requests)
- [x] add a test
- [x] run zombienet tests

---------

Co-authored-by: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
2024-02-28 16:29:27 +00:00
Liam Aharon 3717ec3802 Sync Cargo.toml and crates.io versions (#3034)
Related https://github.com/paritytech/polkadot-sdk/issues/3032

---

Using https://github.com/liamaharon/cargo-workspace-version-tools/ 

`cargo run -- sync --path ../polkadot-sdk`

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2024-01-26 18:14:03 +00:00
jserrat 21ef949b6e Use clone instead of fork on pvf (#2477)
@mrcnski Done the change on the prepare worker, once the prepare worker
part is good I'll do the same for the execute worker.

This is based on
https://github.com/koute/polkavm/blob/11beebd06276ce9b84f335350138479e714f6caf/crates/polkavm/src/sandbox/linux.rs#L711.

## TODO

- [x] Add a check for this capability at startup
- [x] Add prdoc mentioning the new Secure Validator Mode (optional)
requirement.

## Related

Closes #2162

---------

Co-authored-by: Marcin S <marcin@realemail.net>
2024-01-21 11:15:36 +00:00
dependabot[bot] 66b2fa2e59 Bump libc from 0.2.149 to 0.2.152 (#2994)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.149 to 0.2.152.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/libc/releases">libc's
releases</a>.</em></p>
<blockquote>
<h2>0.2.152</h2>
<h2>What's Changed</h2>
<ul>
<li>openbsd: syscall() has been removed in upcoming OpenBSD 7.5 by <a
href="https://github.com/semarie"><code>@​semarie</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3479">rust-lang/libc#3479</a></li>
<li>adding tcp_info to openbsd by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3481">rust-lang/libc#3481</a></li>
<li>iadding yser_fpxregs_struct data to linux/musl i686. by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3477">rust-lang/libc#3477</a></li>
<li>strftime* api for *BSD by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3483">rust-lang/libc#3483</a></li>
<li>strftime_l for Linux glibc/musl by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3484">rust-lang/libc#3484</a></li>
<li>adding iocb data for io_submit syscall for linux/glibc. by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3486">rust-lang/libc#3486</a></li>
<li>Re-enable <code>i686-pc-windows-gnu</code> CI by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3489">rust-lang/libc#3489</a></li>
<li>Stop testing on FreeBSD 12 by <a
href="https://github.com/asomers"><code>@​asomers</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3475">rust-lang/libc#3475</a></li>
<li>Add <code>ifreq</code>, <code>ifconf</code> and related constants to
Android by <a
href="https://github.com/arctic-alpaca"><code>@​arctic-alpaca</code></a>
in <a
href="https://redirect.github.com/rust-lang/libc/pull/3487">rust-lang/libc#3487</a></li>
<li>Add waitid function for OpenBSD by <a
href="https://github.com/lcheylus"><code>@​lcheylus</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3490">rust-lang/libc#3490</a></li>
<li>adding SOMAXCONN to redox by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3491">rust-lang/libc#3491</a></li>
<li>Fix typos in comments by <a
href="https://github.com/asomers"><code>@​asomers</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3492">rust-lang/libc#3492</a></li>
<li>fix typos in libc by <a
href="https://github.com/Takashiidobe"><code>@​Takashiidobe</code></a>
in <a
href="https://redirect.github.com/rust-lang/libc/pull/3496">rust-lang/libc#3496</a></li>
<li>apple adding tcp_connection_info struct by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3482">rust-lang/libc#3482</a></li>
<li>Improve the version parser of Emscripten by <a
href="https://github.com/kleisauke"><code>@​kleisauke</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3498">rust-lang/libc#3498</a></li>
<li>Add constants from <!-- raw HTML omitted --> by <a
href="https://github.com/GuillaumeGomez"><code>@​GuillaumeGomez</code></a>
in <a
href="https://redirect.github.com/rust-lang/libc/pull/3505">rust-lang/libc#3505</a></li>
<li>Define <code>TFD_TIMER_*</code> constants on FreeBSD. by <a
href="https://github.com/sunfishcode"><code>@​sunfishcode</code></a> in
<a
href="https://redirect.github.com/rust-lang/libc/pull/3506">rust-lang/libc#3506</a></li>
<li>Add support for posix_spawn on OpenBSD by <a
href="https://github.com/nuudlman"><code>@​nuudlman</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3502">rust-lang/libc#3502</a></li>
<li>clock_nanosleep for dragonflybsd, moving constants freebsd only too.
by <a href="https://github.com/devnexen"><code>@​devnexen</code></a> in
<a
href="https://redirect.github.com/rust-lang/libc/pull/3509">rust-lang/libc#3509</a></li>
<li>solarish add fcntl's O_DIRECT constant. by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3503">rust-lang/libc#3503</a></li>
<li>Unpin cc dependency version by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3511">rust-lang/libc#3511</a></li>
<li>redox: add openpty, login_tty, TIOCSCTTY, and organize functions by
<a href="https://github.com/jackpot51"><code>@​jackpot51</code></a> in
<a
href="https://redirect.github.com/rust-lang/libc/pull/3512">rust-lang/libc#3512</a></li>
<li>Move all seccomp consts and structs into top-level mod by <a
href="https://github.com/boustrophedon"><code>@​boustrophedon</code></a>
in <a
href="https://redirect.github.com/rust-lang/libc/pull/3343">rust-lang/libc#3343</a></li>
<li>freebsd 15 support proposal. by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3508">rust-lang/libc#3508</a></li>
<li>Prepare workflow for merge queue by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3514">rust-lang/libc#3514</a></li>
<li>Allow dead_code on <code>clockid_t</code> by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3516">rust-lang/libc#3516</a></li>
<li>Add more items from <code>include/linux/sched.h</code> header by <a
href="https://github.com/GuillaumeGomez"><code>@​GuillaumeGomez</code></a>
in <a
href="https://redirect.github.com/rust-lang/libc/pull/3515">rust-lang/libc#3515</a></li>
<li>fix typo by <a
href="https://github.com/shuoer86"><code>@​shuoer86</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3517">rust-lang/libc#3517</a></li>
<li>Add sigsuspend to more targets: bsd, haiku, and solarish by <a
href="https://github.com/asomers"><code>@​asomers</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3518">rust-lang/libc#3518</a></li>
<li>Tweak libc-0.2 CI by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3519">rust-lang/libc#3519</a></li>
<li>fuchsia adding pthread_set/getname_np by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3520">rust-lang/libc#3520</a></li>
<li>Prepare docs for libc v0.3 by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3510">rust-lang/libc#3510</a></li>
<li>Merge main into libc-0.2 by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3521">rust-lang/libc#3521</a></li>
<li>Prepare release for v0.2.152 by <a
href="https://github.com/JohnTitor"><code>@​JohnTitor</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3522">rust-lang/libc#3522</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/Takashiidobe"><code>@​Takashiidobe</code></a>
made their first contribution in <a
href="https://redirect.github.com/rust-lang/libc/pull/3496">rust-lang/libc#3496</a></li>
<li><a href="https://github.com/nuudlman"><code>@​nuudlman</code></a>
made their first contribution in <a
href="https://redirect.github.com/rust-lang/libc/pull/3502">rust-lang/libc#3502</a></li>
<li><a
href="https://github.com/boustrophedon"><code>@​boustrophedon</code></a>
made their first contribution in <a
href="https://redirect.github.com/rust-lang/libc/pull/3343">rust-lang/libc#3343</a></li>
<li><a href="https://github.com/shuoer86"><code>@​shuoer86</code></a>
made their first contribution in <a
href="https://redirect.github.com/rust-lang/libc/pull/3517">rust-lang/libc#3517</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rust-lang/libc/compare/0.2.151...0.2.152">https://github.com/rust-lang/libc/compare/0.2.151...0.2.152</a></p>
<h2>0.2.151</h2>
<h2>What's Changed</h2>
<ul>
<li>Add new constants to be used in (linux) sysctl by <a
href="https://github.com/GuillaumeGomez"><code>@​GuillaumeGomez</code></a>
in <a
href="https://redirect.github.com/rust-lang/libc/pull/3423">rust-lang/libc#3423</a></li>
<li>openbsd ifreq implementation refinement ifru_data member using
proper… by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3390">rust-lang/libc#3390</a></li>
<li>adding reboot to netbsd/openbsd. by <a
href="https://github.com/devnexen"><code>@​devnexen</code></a> in <a
href="https://redirect.github.com/rust-lang/libc/pull/3426">rust-lang/libc#3426</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rust-lang/libc/commit/3d175191e6c6ad2b97de090d86d28dbfa4d271a3"><code>3d17519</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/3522">#3522</a>
from JohnTitor/libc-0.2.152</li>
<li><a
href="https://github.com/rust-lang/libc/commit/0f5d2c1d419543819f072169eab72a85abd2e9d2"><code>0f5d2c1</code></a>
Prepare release for v0.2.152</li>
<li><a
href="https://github.com/rust-lang/libc/commit/ee500ca0541809005b4ec4c7157add1e170dc545"><code>ee500ca</code></a>
Merge pull request <a
href="https://redirect.github.com/rust-lang/libc/issues/3521">#3521</a>
from rust-lang/main</li>
<li><a
href="https://github.com/rust-lang/libc/commit/72093f38fbc3c3fec485b0aba6f1ef81ad59ca1e"><code>72093f3</code></a>
Auto merge of <a
href="https://redirect.github.com/rust-lang/libc/issues/3510">#3510</a>
- JohnTitor:prepare-libc-0.3, r=JohnTitor</li>
<li><a
href="https://github.com/rust-lang/libc/commit/e5612b92d30668eea24495a2d6d84ed1f601f437"><code>e5612b9</code></a>
Auto merge of <a
href="https://redirect.github.com/rust-lang/libc/issues/3520">#3520</a>
- devnexen:fuchsia_upd, r=JohnTitor</li>
<li><a
href="https://github.com/rust-lang/libc/commit/44ba265df55df13b37a3e1e2145053b68196074d"><code>44ba265</code></a>
fuchsia adding pthread_set/getname_np</li>
<li><a
href="https://github.com/rust-lang/libc/commit/2f93bfb7678e18a9fc5373dec49384bd23f601c3"><code>2f93bfb</code></a>
Auto merge of <a
href="https://redirect.github.com/rust-lang/libc/issues/3519">#3519</a>
- JohnTitor:tweak-libc-0.2-ci, r=JohnTitor</li>
<li><a
href="https://github.com/rust-lang/libc/commit/11f7c7b89d9bfe8c53dcca7571c4965fa3375aab"><code>11f7c7b</code></a>
Auto merge of <a
href="https://redirect.github.com/rust-lang/libc/issues/3518">#3518</a>
- asomers:more-sigsuspend, r=JohnTitor</li>
<li><a
href="https://github.com/rust-lang/libc/commit/0b9596b22c59cd97409c017cc4dc0620e15bd87c"><code>0b9596b</code></a>
Tweak libc-0.2 CI</li>
<li><a
href="https://github.com/rust-lang/libc/commit/5594447694db909c1ad8fa191a8ac0df734cdd23"><code>5594447</code></a>
Auto merge of <a
href="https://redirect.github.com/rust-lang/libc/issues/3517">#3517</a>
- shuoer86:main, r=JohnTitor</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-lang/libc/compare/0.2.149...0.2.152">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libc&package-manager=cargo&previous-version=0.2.149&new-version=0.2.152)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-19 15:04:02 +00:00
maksimryndin 47a3faa41e Pvf thiserror (#2958)
resolve #2157 

- [x] fix broken doc links
- [x] fix codec macro typo
https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/node/core/pvf/common/src/error.rs#L81
(see the comment below)
- [x] refactor `ValidationError`, `PrepareError` and related error types
to use `thiserror` crate

## `codec` issue

`codec` macro was mistakenly applied two times to `Kernel` error (so it
was encoded with 10 instead of 11 and the same as `JobDied`). The PR
changes it to 11 because

- it was an initial goal of the code author
- Kernel is less frequent than JobDied so in case of existing error
encoding it is more probable to have 10 as JobDied than Kernel

See https://github.com/paritytech/parity-scale-codec/issues/555

----
polkadot address: 13zCyRG2a1W2ih5SioL8byqmQ6mc8vkgFwQgVzJSdRUUmp46

---------

Co-authored-by: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
2024-01-19 14:10:09 +00:00
Marcin S 8bf5a1c0b3 PVF: ensure job processes are cleaned up, add tests (#2643)
Fixes a potential memory leak.

`PR_SET_PDEATHSIG` is used to terminate children when the parent dies.
Note that this is subject to a race. There seems to be a raceless
alternative [here](https://stackoverflow.com/a/42498370/6085242), but
the concern is small enough that a bit more complexity doesn't seem
worth it. Left a bit more info in the code comment.
2023-12-29 16:27:18 +01:00
Squirrel be8e626806 Set clippy lints in workspace (requires rust 1.74) (#2390)
We currently use a bit of a hack in `.cargo/config` to make sure that
clippy isn't too annoying by specifying the list of lints.

There is now a stable way to define lints for a workspace. The only down
side is that every crate seems to have to opt into this so there's a
*few* files modified in this PR.

Dependencies:

- [x] PR that upgrades CI to use rust 1.74 is merged.

---------

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
2023-12-13 15:11:07 +01:00
Marcin S c046a9d5ed PVF: Add Secure Validator Mode (#2486)
Co-authored-by: Javier Viola <javier@parity.io>
2023-12-05 14:32:56 +02:00
Liam Aharon 4a293bc5a2 Enforce consistent and correct toml formatting (#2518)
Using taplo, fixes all our broken and inconsistent toml formatting and
adds CI to keep them tidy.

If people want we can customise the format rules as described here
https://taplo.tamasfe.dev/configuration/formatter-options.html

@ggwpez, I suggest zepter is used only for checking features are
propagated, and leave formatting for taplo to avoid duplicate work and
conflicts.

TODO
- [x] Use `exclude = [...]` syntax in taplo file to ignore zombienet
tests instead of deleting the dir

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
2023-12-01 07:38:02 +00:00
Marcin S dbd8d20b25 PVF: Add test instructions (#2058) 2023-11-28 14:23:25 +01:00
Marcin S 552be4800d PVF worker: switch on seccomp networking restrictions (#2221) 2023-11-21 12:52:46 +01:00
jserrat 54f84285bf change prepare worker to use fork instead of threads (#1685)
Co-authored-by: Marcin S <marcin@realemail.net>
2023-11-14 18:50:18 +01:00
jserrat 2726d5af65 remove gum dependency on jaeger (#2106)
Co-authored-by: Marcin S <marcin@realemail.net>
2023-11-01 15:58:46 +01:00
Marcin S 9faea380dc PVF worker: Add seccomp restrictions (restrict networking) (#2009) 2023-10-31 11:08:08 +01:00
Julian Eager 9f7656df15 Discard Executor (#1855)
closes #622 

Pros:
* simpler interface, just functions:
`create_runtime_from_artifact_bytes()` and `execute_artifact()`

Cons:
* extra overhead of constructing executor semantics each time

I could make it a combination of
* `create_runtime_config(params)` (such that we could clone the
constructed semantics)
* `create_runtime(blob, config)`
* `execute_artifact(blob, config, params)`

Not sure if it's worth it though.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-10-14 23:06:00 +02:00
Julian Eager 681e7bbfb2 Check executor params coherence (#1774)
Co-authored-by: Marcin S <marcin@realemail.net>
2023-10-13 15:52:04 +02:00
Marcin S 51c0c24213 PVF: Add back socket path parameter, use tmp socket path (#1780) 2023-10-05 18:37:54 +02:00
Marcin S c1eb342b14 PVF: more filesystem sandboxing (#1373) 2023-09-28 18:24:29 +02:00
Bastian Köcher a33d7922f8 Rename polkadot-parachain to polkadot-parachain-primitives (#1334)
* Rename `polkadot-parachain` to `polkadot-parachain-primitives`

While doing this it also fixes some last `rustdoc` issues and fixes
another Cargo warning related to `pallet-paged-list`.

* Fix compilation

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

* Fix XCM docs

---------

Co-authored-by: command-bot <>
2023-08-31 23:53:29 +02:00
Lulu aedd280874 Fix polkadot-node-core-pvf-prepare-worker build with jemalloc (#1315)
* Fix polkadot-node-core-pvf-prepare-worker build with jemalloc

The jemalloc feature on polkadot-node-core-pvf-prepare-worker depended
on some feature gated code in polkadot-node-core-pvf-common but there
way no way to enable this feature gate.

This commit adds the feature and makes prepare-worker enable it.

* More jemalloc-allocator fixes

* Fix jemalloc-allocator feature dep

* Run `zepter format features`

---------

Co-authored-by: Marcin S <marcin@realemail.net>
2023-08-31 17:13:09 +02:00
Oliver Tale-Yazdi dcda0e50f5 Fix build profiles (#1229)
* Fix build profiles

Closes https://github.com/paritytech/polkadot-sdk/issues/1155

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

* Manually set version to 1.0.0

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

* Use workspace repo

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

* 'Authors and Edition from workspace

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

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-08-29 13:39:41 +02:00
alvicsam f441a5fc93 Diener workspacify
Signed-off-by: alvicsam <alvicsam@gmail.com>
2023-08-25 11:05:17 +02:00
Bastian Köcher cf3271fea2 Remove superflous parameter overseer_enable_anyways and make parachain node type more explicit (#7617)
* Remove superflous parameter `overseer_enable_anyways`

We don't need this flag, as we don't need the overseer enabled when the
node isn't a collator or validator.

* Rename `IsCollator` to `IsParachainNode`

`IsParachainNode` is more expressive and also encapsulates the state of
the parachain node being a full node. Some functionality like the
overseer needs to run always when the node runs alongside a parachain
node. The parachain node needs the overseer to e.g. recover PoVs. Other
things like candidate validation or pvf checking are only required for
when the node is running as validator.

* FMT

* Fix CI
2023-08-15 08:51:27 +00:00
Oliver Tale-Yazdi 342d720573 Use same fmt and clippy configs as in Substrate (#7611)
* Use same rustfmt.toml as Substrate

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

* format format file

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

* Format with new config

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

* Add Substrate Clippy config

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

* Print Clippy version in CI

Otherwise its difficult to reproduce locally.

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

* Make fmt happy

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

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

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

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

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
2023-08-14 14:29:29 +00:00
Marcin S ffb742310f PVF: Add missing crate descriptions (#7587) 2023-08-08 09:51:40 -04:00
Lulu 0142a01353 Add license to crates (#7578)
* Add license to crates

This is required to publish to crates.io

* Add more licenses
2023-08-04 18:33:05 +02:00
Marcin S 85b06f18b9 98.6% OF DEVELOPERS CANNOT REVIEW THIS PR! [read more...] (#7337)
* [WIP] PVF: Split out worker binaries

* Address compilation problems and re-design a bit

* Reorganize once more, fix tests

* Reformat with new nightly to make `cargo fmt` test happy

* Address `clippy` warnings

* Add temporary trace to debug zombienet tests

* Fix zombienet node upgrade test

* Fix malus and its CI

* Fix building worker binaries with malus

* More fixes for malus

* Remove unneeded cli subcommands

* Support placing auxiliary binaries to `/usr/libexec`

* Fix spelling

* Spelling

Co-authored-by: Marcin S. <marcin@realemail.net>

* Implement review comments (mostly nits)

* Fix worker node version flag

* Rework getting the worker paths

* Address a couple of review comments

* Minor restructuring

* Fix CI error

* Add tests for worker binaries detection

* Improve tests; try to fix CI

* Move workers module into separate file

* Try to fix failing test and workers not printing latest version

- Tests were not finding the worker binaries
- Workers were not being rebuilt when the version changed
- Made some errors easier to read

* Make a bunch of fixes

* Rebuild nodes on version change

* Fix more issues

* Fix tests

* Pass node version from node into dependencies to avoid recompiles

- [X] get version in CLI
- [X] pass it in to service
- [X] pass version along to PVF
- [X] remove rerun from service
- [X] add rerun to CLI

- [X] don’t rerun pvf/worker’s (these should be built by nodes which have rerun enabled)

* Some more improvements for smoother tests

- [X] Fix tests
- [X] Make puppet workers pass None for version and remove rerun
- [X] Make test collators self-contained

* Add back rerun to PVF workers

* Move worker binaries into files in cli crate

As a final optimization I've separated out each worker binary from its own crate
into the CLI crate. Before, the worker bin shared a crate with the worker lib,
so when the binaries got recompiled so did the libs and everything transitively
depending on the libs. This commit fixes this regression that was causing
recompiles after every commit.

* Fix bug (was passing worker version for node version)

* Move workers out of cli into root src/bin/ dir

- [X] Pass in node version from top-level (polkadot)
- [X] Add build.rs with rerun-git-head to root dir

* Add some sanity checks for workers to dockerfiles

* Update malus

  + [X] Make it self-contained
  + [X] Undo multiple binary changes

* Try to fix clippy errors

* Address `cargo run` issue

- [X] Add default-run for polkadot
- [X] Add note about installation to error

* Update readme (installation instructions)

* Allow disabling external workers for local/testing setups

  + [X] cli flag to enable single-binary mode
  + [X] Add message to error

* Revert unnecessary Cargo.lock changes

* Remove unnecessary build scripts from collators

* Add back missing malus commands (should fix failing ZN job)

* Some minor fixes

* Update Cargo.lock

* Fix some build errors

* Undo self-contained binaries; cli flag to disable version check

  + [X] Remove --dont-run-external-workers
  + [X] Add --disable-worker-version-check
  + [X] Remove PVF subcommands
  + [X] Redo malus changes

* Try to fix failing job and add some docs for local tests

---------

Co-authored-by: Dmitry Sinyavin <dmitry.sinyavin@parity.io>
Co-authored-by: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
Co-authored-by: parity-processbot <>
2023-07-31 13:35:42 +00:00
Marcin S 2b9c4f82a7 PVF: add landlock sandboxing (#7303)
* Begin adding landlock + test

* Move PVF implementer's guide section to own page, document security

* Implement test

* Add some docs

* Do some cleanup

* Fix typo

* Warn on host startup if landlock is not supported

* Clarify docs a bit

* Minor improvements

* Add some docs about determinism

* Address review comments (mainly add warning on landlock error)

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

Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>

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

Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>

* Fix unused fn

* Update ABI docs to reflect latest discussions

* Remove outdated notes

* Try to trigger new test-linux-oldkernel-stable job

Job introduced in https://github.com/paritytech/polkadot/pull/7371.

---------

Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
2023-07-05 12:57:53 -04:00
Koute 8eda0a039f Bump parity-scale-codec to 3.6.1 (#7382) 2023-06-21 19:24:24 +09:00
Marcin S 5bbb87c46b PVF: Instantiate wasm in pre-checking (#7246)
* PVF: Instantiate wasm in pre-checking

* Move `runtime_construction_check` to prepare thread, use bytes

* [minor] Update comment

* Fix compile error

* Update Cargo.lock

* Update docs

* Add some missing docs!
2023-06-02 12:04:04 +00:00
Marcin S 8782dde411 PVF: Refactor workers into separate crates, remove host dependency (#7253)
* PVF: Refactor workers into separate crates, remove host dependency

* Fix compile error

* Remove some leftover code

* Fix compile errors

* Update Cargo.lock

* Remove worker main.rs files

I accidentally copied these from the other PR. This PR isn't intended to
introduce standalone workers yet.

* Address review comments

* cargo fmt

* Update a couple of comments

* Update log targets
2023-05-25 20:29:13 +00:00