Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PVF host: Specialize on Linux, support macOS #881

Closed
pepyakin opened this issue Jan 14, 2022 · 5 comments · Fixed by #2486 · May be fixed by paritytech/polkadot#7073
Closed

PVF host: Specialize on Linux, support macOS #881

pepyakin opened this issue Jan 14, 2022 · 5 comments · Fixed by #2486 · May be fixed by paritytech/polkadot#7073
Assignees
Labels
T0-node This PR/Issue is related to the topic “node”.

Comments

@pepyakin
Copy link
Contributor

(This is not an actionable issue, just a platform for discussion and linking from other issues)

To my knowledge, we do not support Windows explicitly. Maybe mingw may work, but MSVC almost surely won't work. That's fine since Windows has WSL for those who need to run Polkadot there.

There is quite a bunch of people who are using macOS for development either of Polkadot or parachains. While running Polkadot is possible inside a docker container, it comes with many inconveniences:

  • polkadot-launch does not support docker,
  • macOS does not support docker natively so it spins up a virtual machine, which can eat a decent amount of memory and CPU, and then on top of that the host and the guest do not share the resources.
  • profiling inside of a docker is not the best experience on macOS either

So therefore we probably want to keep supporting polkadot directly on macOS.

However, PVF host or other parts of wasm execution may want to use special features of Linux for performance, security or other reasons. To name a few:

  1. Linux supports uffd which is useful for low-latency instantiation in wasmtime. Maybe macOS' mach layer supports for something like that, but it would be take additional effort to implement that.
  2. we are interested in security hardening of the worker processes PVF host: sandbox/harden worker process #882. Even if macOS supports something of that sort, it would take us to reimplement the same for it.
  3. we may need to constrain the workers with amount of resources they can take. The best we can hope on macOS is probably rlimit (and the last time I looked I wanted to use cgroups, Linux only feature). And again if there are required facilities, we would have to reimplement everything for macOS again.

Thus, it may make sense to specialize our implementation efforts on Linux for production deployments. We can implement good enough fallbacks that would allow deploying simple localnets, but running validators on macOS will be discouraged.

@mrcnski
Copy link
Contributor

mrcnski commented Apr 7, 2023

Due to #882 becoming high-priority for parathreads, we are now forced to specialize on Linux. But we will still support MacOS with e.g. an --insecure-validator-mode flag.

mrcnski referenced this issue in paritytech/polkadot Apr 13, 2023
Due to #4718 becoming high-priority for parathreads, we are now forced to provide a secure validator mode only for Linux x86-64 (to start).

We will still support MacOS with an `--insecure-validator-i-know-what-i-do` flag. (Naming follows [`interpreted-i-know-what-i-do`](https://github.com/paritytech/substrate/blob//client/cli/src/arg_enums.rs#L58).)

See https://github.com/paritytech/polkadot/issues/4718#issuecomment-1484137059

Closes https://github.com/paritytech/polkadot/issues/4720
@mrcnski
Copy link
Contributor

mrcnski commented Aug 8, 2023

Now that we use Linux landlock (paritytech/polkadot#7303) we've taken the first step down this path.

@Sophia-Gold Sophia-Gold transferred this issue from paritytech/polkadot Aug 24, 2023
@mrcnski mrcnski mentioned this issue Oct 31, 2023
8 tasks
@mrcnski mrcnski moved this from Backlog to In Progress in parachains team board Oct 31, 2023
@nazar-pc
Copy link
Contributor

nazar-pc commented Dec 5, 2023

To my knowledge, we do not support Windows explicitly. Maybe mingw may work, but MSVC almost surely won't work. That's fine since Windows has WSL for those who need to run Polkadot there.

For us at Subspace Windows support is essential for user adoption (tens to hundreds of thousands of consensus nodes), we use Substrate as a library, including in GUI desktop apps and run software on Windows in addition to macOS and Linux. It compiles with MSVC and works just fine (modulo rare minor issues from time to time that we report back and that are getting fixed fairly quickly).

So while it is not really officially supported (that was mentioned multiple times), it is important for us that it remains available and working, we also run it in CI all the time and BTW would be great if polkadot-sdk also had Windows in CI just to make sure things at least compile.

@mrcnski
Copy link
Contributor

mrcnski commented Dec 5, 2023

@nazar-pc Thanks for raising the concern. This issue is just about validator nodes, which are (and have been for a long time) Unix-only. They already are not expected to compile on Windows.

would be great if polkadot-sdk also had Windows in CI just to make sure things at least compile.

If substrate is expected to support Windows then that could be worth doing just for substrate. Can you please raise a separate issue, if there isn't one?

@github-project-automation github-project-automation bot moved this from In Progress to Completed in parachains team board Dec 5, 2023
@mrcnski mrcnski self-assigned this Dec 5, 2023
@mrcnski mrcnski added the T0-node This PR/Issue is related to the topic “node”. label Dec 5, 2023
@bkchr
Copy link
Member

bkchr commented Dec 5, 2023

If substrate is expected to support Windows then that could be worth doing just for substrate. Can you please raise a separate issue, if there isn't one?

Will not be done. We are open to merge fixes for Windows, but we will not have any CI job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T0-node This PR/Issue is related to the topic “node”.
Projects
Status: Completed
4 participants