After #855 passing I would like take the time to lay out what Parity is planning to deliver and when it will be delivered approximately. I also try to elaborate on how the community can contribute.
Deliverables
- pallet_revive: A heavily stripped down and simplified fork of pallet_contracts. The obvious change is that it uses PolkaVM instead of wasmi to execute contracts. But it will also include a lot of other changes that make executing cross compiled YUL much easier. For example, it will use AccountID20 instead of the runtime native address type including all the necessary mappings to AccountID32 to support AssetHub. Types like the block number and balance will also be fixed to uint256. Chain extensions will be replaced by the ability to declare custom pre-compiles. Much like it is the case on pallet_evm.
- PolkaVM: The VM to be used by pallet_revive to run the contracts.
- revive: Our YUL to EVM recompiler that will be used by contract developers in place of solc. This includes a javascript version of this compiler to be used by Web based IDEs.
- ether-js-revive: A ether.js wrapper meant as a drop-in replacement for ether.js. To be used to write Dapps.
- revive-ethereum-rpc: A proxy that translates Ethereum RPCs to Polkadot native RPC. It will enable using Metamask with AssetHub.
- REMIX Instance: We will host a REMIX instance that can be used to experiment with the new contract environment. It will not be fully functional (no debugging support) but will be enough to have a zero setup way to experiment against a soon to be launched test net: Compiling and deploying contracts.
- Validation testsuite: We will have a validation test suite written against
ether-js-revive
to make sure that existing popular contracts and artificial test cases are working.
Roadmap
Deployment to Westend AssetHub + REMIX instance (End of August)
Our current focus is to deploy pallet_revive
to the westend AssetHub as quickly as possible. To allow people to experiment we will also host a REMIX instance against this AssetHub. This test net will experience breaking changes and resets while we are ironing out bugs and make necessary changes. But it will allow for people to start hacking.
This version will use an in-runtime PolkaVM interpreter. If 64bit support is finished in time we will use that. If not it will use 32bit and will be upgraded later.
This is also when we kick off the audit of the new pallet and PolkaVM. We mostly removed functionality from the already audited pallet_contracts. So we can focus on the changed parts like account mapping here.
Deployment on Kusama AssetHub (End of October)
Once all the on-chain behaviour is finalized we can deploy on Kusama to verify economic security. This is a big step since we are dealing with immutable code here. We need to be sure that the defined interfaces are how we want them to be since we need to support them forever once deployed here.
This version will use an in-runtime PolkaVM interpreter 64bit interpreter as this is the final byte code we will be using.
We will disable all functionality that we don’t deem secure enough and launch with very strict limits. We can always relax later.
This is also when we start adding functionality to ether-js-revive
that is unique to pallet_revive
vs. original ethereum. Like for example, management of code hashes and setting explicit weights (vs. a flat gas).
Deployment on Polkadot AssetHub (December)
If everything goes to plan and the audit is finished we can deploy to Polkadot. At this time in point we will have ether-js-revive
that can be used to develop Dapps. REMIX for ad-hoc deployment.
Enabling of JIT compilation and further optimizations (end Q2 2025)
The next step is to add the necessary host functions to allow JIT compiled contracts in addition to the interpreter. This will unlock the performance benefits of using PolkaVM. The interpreter will still be around to support for running contracts which are not worth compiling. The idea is that the dry-run will tell you which execution path is cheaper. This information can then be used to specify that in the transaction: call(contract_addr, input, Execution::{Interpreted, JIT})
.
We will also add the possibility to optionally store contract code on the relay chain. Trading a higher deposit for cheaper execution so the code doesn’t have to be included into the PoV.
We will also optimize the gas model to take into account warm and cold accesses.
How the community can help with tooling
After 903 referendum (Smart Contracts Plaza Tooling) - report, learnings and a new proposal failing it become clear that it might be too early to tell on what exactly we want to fund at this point.
The absolute essentials will be delivered by us (eth-js-revive
). What we need in addition to that is hard to know. But to me it seems pretty clear that providing a HardHat based development environment is a safe bet. The following reasons:
- It is javascript based and can be developed on top of
eth-js-revive
. - It is the most popular environment as of right now.
- Web based IDE’s are more for experimentation and we already have that covered with our REMIX instance.
My advice to anyone wanting to build something right now is to wait at least until we have our testnet and the eth-js-revive
ready. And then work out a minimal proposal that focuses just on providing a minimal HardHat based development flow.