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

PolkaVM parachain runtimes MVP #6704

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

s0me0ne-unkn0wn
Copy link
Contributor

Overview

This PR aims to enable parachain runtime authors to use PolkaVM as a compilation and execution target for PVFs. It brings in numerous advantages of PolkaVM over the Wasm executor:

  • One-shot execution with near-instant compilation; compilation artifacts are not stored on disk anymore;
  • Much less performance degradation compared to native execution;
  • More deterministic execution;
  • Out-of-the-box sandboxing;
  • ...
  • PROFIT!

Although PolkaVM potentially enables us also to use advanced gas metering for PVFs in the future, eliminating a lot of non-determinism issues, it's out of the scope of this MVP PR for now.

Current status

Fully working hacky PoC. Leaks host memory. Doesn't use execution workers and blocks the candidate validation subsystem on execution instead.

CC @eskimor @sandreim @koute @bkchr

@koute
Copy link
Contributor

koute commented Dec 7, 2024

Note that we've recently updated the builder crate to use the newest PolkaVM and we're also updating the executor here, so you'll have to align to those changes.

@jasl
Copy link
Contributor

jasl commented Dec 8, 2024

Questions:

  • Can pallet-revive gain advantages if the parachain runtime is based on PolkaVM?
  • When Polkadot-SDK supports PolkaVM-based parachain, do we have to wait for Polkadot/Kusama support?
  • Is there a PoC for a standalone PolkaVM-based runtime?
  • Is it possible to migrate an existing WASM-based runtime to a PolkaVM-based runtime?

@athei
Copy link
Member

athei commented Dec 10, 2024

Can pallet-revive gain advantages if the parachain runtime is based on PolkaVM?

No it doesn't make any difference for pallet-revive. Unless we also enable gas metering for the runtime itself. Then we could get rid of a lot of annoying benchmarks there.

When Polkadot-SDK supports PolkaVM-based parachain, do we have to wait for Polkadot/Kusama support?

I guess the relay chain runtime can stay wasm. But they still need to be updated to accept PVM PvFs. So yes they need to support this.

Is there a PoC for a standalone PolkaVM-based runtime?

We currently build the following runtimes to PVM as part of CI:

forklift cargo check -p minimal-template-runtime
forklift cargo check -p westend-runtime
forklift cargo check -p rococo-runtime
forklift cargo check -p polkadot-test-runtime

Is it possible to migrate an existing WASM-based runtime to a PolkaVM-based runtime?

Yeah sure. It will just be like a runtime upgrade. You replace the wasm blob with a PVM blob that does the same thing.

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/12481565251
Failed job name: test-linux-stable-no-try-runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants