Refactor proto_alpha/bin_sc_rollup_node/interpreter
Context
This is an attempt to refactor the bin_sc_rollup_node/Interpreter. This MR contains an intermediary step which could be merged reasonably quick and thus avoid git conflicts.
The Interpreter logic contained two behaviors for the PVM. One is "Accounted" PVM, where fuel matters and the other one is "Free" PVM where fuel doesn't matter. The switch between the two behaviors was done by passing the fuel as int64 option where None meant "free execution" and Some meant accounted execution.
This MR does the following:
- Introduces an explicit signature for Interpreter_event because it was needed in the next steps
- Introduces the module type Fuel with two implementations: Free (i.e. fuel that never ends) and Accounted
- From the Interpreter code extracts the part that manages the fuel into the module Fueled_pvm
Manually testing the MR
Existing tests still succeed.
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.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Ovidiu Deac