[go: up one dir, main page]

Rollup-Node: Add reference based Mutable API for PVMs

What

Part of RV-184

  • Introduces a mutable api for the pvm in Pvm_sig

Why

  • Having a mutable API will enable ownership/move semantics to be used in the RISCV implementation of the PVM which will help avoid doing extraneous state copies when the PVM is used in a linear fashion.

How

  • In the pvm_sig.ml module, (which is the RN's view of the PVM capabilities) add a submodule Mut_api
    • Add conversion functions between mutable and immutable state types of the PVM.
    • The mutable functions will not return a new state, but modify it in place (by returning a unit Lwt.t / <side_effect_data> Lwt.t)
  • The Arith & WASM pvm will just use a <state> ref wrapper and will use the immutable api "behind the scenes"
  • The RISCV PVM will currently also use the <state> ref wrapper, but it will be later modified to call into the Rust backend. See RV-113 & RV-217 & RV-183

Manually testing the MR

This MR adds unused code, the mutable API will be used in the FUELED_PVM module which is tested by rollup node tests.

The changes are tested in !14963 (merged)

make
# Just the rollup node tests
dune exec ./tezt/tests/main.exe -- --verbose --file tezt/tests/sc_rollup.ml
# Alternatively all tests
make test

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Felix Puscasu

Merge request reports

Loading