WASM: Generalize [reveal] to prepare for the universal reveal
Context
- Previous MR: !9646 (merged)
- Next MR: !9676 (merged)
The purpose of this MR is to be the first step towards a “universal” reveal host function for the WASM PVM.
Currently, lib_scoru_wasm declare its own reveal type, and exports it though the environment, with one variant per reveal supported. This works well… until you want to add a new case, as the size and the tediousness of this MR demonstrate.
As a consequence, we propose to add a new “universal” constructor for reveal in lib_scoru_wasm which can be used to make any reveal, as long as the kernel knows the encoding expected by the protocol. This as the advantage of making it the last MR related to reveal cases for the time being. Besides, this is safe because since Oxford, the protocol as a notion of “enabled reveals.”
The next MR will add the universal host function to the WASM PVM, started with the latest revision (V3).
Arguably, the Rust SDK should be updated to use this function instead of the previous one, which could be deprecated. This could hypothetically allow to completely remove them in the future, when we figure out how to do it.
Manually testing the MR
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