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

  1. Rename the existing Make functor to Make_pvm_machine in wasm_pvm.ml
  2. Introduce a new module type WASM_PVM_MACHINE that includes proof operations
  3. Reorder v16 environment signature so WASM can depend on Smart_rollup types
  4. Add WASM_PVM_MACHINE module type to the V16 environment
  5. Implement the PVM in the environment using the new functor
  6. Update both protocol and rollup node to use the environment's PVM
  7. 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.

Merge request reports

Loading