This crate is intended for use by runtime code (e.g pallet-contracts) to spawn PolkaVM instances and execute calls into them. Its purpose is to add one layer of abstraction to that it works transparently from the actual runtime (via the host functions defined in this crate) but also from tests (which run natively).
Additionally, this crate is also used (by the executor) to implement the host functions that are defined in this crate. This allows us to encapsulate all the logic regarding PolkaVM setup in one place.
Please keep in mind that the interface is kept simple because it has to match the interface of the host function so that the abstraction works. It will never expose the whole PolkaVM interface.
⚠️ Unstable API — Do Not Use in Production ⚠️
This crate's API is unstable and subject to breaking changes without notice.
The virtualization host functions exposed by this crate have not been stabilized and are not available on Polkadot (or any other production relay/parachain) until they are. Using them in a production runtime will cause your runtime to break when the API changes.
This crate should only be used for:
- Local testing and development
- Experimentation on test networks
Do not ship runtimes that depend on this crate to any chain you care about. There is no stability guarantee and no deprecation period — the interface may change at any time.