Wasm/PVM: Protocol WASM PVM is not dependant to the protocol context
close L2-745
What
Refactor the WASM PVM to have it's context provided by the environment rather than defined in the protocol itself.
Why
The WASM PVM implementation was duplicated between the protocol
(sc_rollup_wasm.ml) and had tight coupling with protocol internals. Moving
the PVM to the protocol environment:
- Eliminates code duplication between protocol and rollup node
- Provides a clean separation between PVM interface and implementation
- Simplifies the protocol code by delegating proof operations to the environment
How
- Rename the existing
Makefunctor toMake_pvm_machineinwasm_pvm.ml - Introduce a new module type
WASM_PVM_MACHINEthat includes proof operations - Reorder v16 environment signature so WASM can depend on Smart_rollup types
- Add
WASM_PVM_MACHINEmodule type to the V16 environment - Implement the PVM in the environment using the new functor
- Update both protocol and rollup node to use the environment's PVM
- Remove the deprecated code
The refactoring preserves all existing behavior - no functional changes.
Manually testing the MR
# Run WASM rollup tests
dune exec tezt/tests/main.exe -- --file sc_rollup.ml
Edited by Sylvain R.