-
Notifications
You must be signed in to change notification settings - Fork 266
Description
Description
We at Galois have been exploring making jolt-core work in a bare-metal environment (mostly to run the verifier on bare-metal, potentially to run the prover as well). I've done some initial work on this and have a compiling version, although I'm still working on running an actual example in an emulated bare-metal environment. As part of this process, I've identified several concrete steps (read: PRs) that could get jolt to a no_std-compliant form. The goal of course is for everything to still work as-is when compiling as normal, with the added benefit of no_std support when compiling with --no-default-features.
The steps are listed below, would love to hear your thoughts and/or if I should start supplying PRs.
Steps
Steps listed with a * are PR-ready, and steps listed with a ^ need more work. Text in italics discusses changes that go beyond just jolt code.
-
*Make thecommoncrateno_std-compliant. This one is fairly straightforward. (Make thecommoncrateno_std-compliant #677) -
*Make thetracercrateno_std-compliant. This one is only slightly more involved, with the exception that we need... (Maketracerno_stdcompatible #680) -
*Change the ELF loading API to use the ELF contents as aVec<u8>versus aPathBuf. There are several instances, in bothjolt-coreandtracer, where the ELF to execute is given by its path versus its contents. Obviously in ano_stdenvironment paths are not available, so this task would change the API to deal with the ELF contents itself, and then the higher level application could do whatever conversion from file-to-contents is necessary. (Maketracerno_stdcompatible #680)
Those are the initial "easy" steps. Things get trickier with the jolt-core crate, in particular with its use of rayon.
-
*Make thebinius-fieldcrateno_std-compliant. Almost all crates used already haveno_stdcompliance, exceptbinius. Fortunately, we only usebinius-field, and the changes there are relatively straightforward. However, this would either require a fork ofbiniusor for us to try to merge those changes back intobinius.binius-fieldis not longer used. -
^Either (1) feature-mask all uses ofrayon(not fun) or use (2)biniussmaybe-rayoncrate, adapted as necessary. I'm still exploring this second option, and did the first option as part of my effort to get everything compiled (it works, but is obviously not sustainable). This change would require a dependency onbiniussmaybe-rayon, and changes made tomaybe-rayonas well -
*Replacestdwithcore/allocwhere appropriate, plus other changes. This is straightforward, but a lot of changes. -
*Make thejolt-sdkcrateno_std-compliant. Straightforward, modulo not being able to generate the guestcompilefunction (since it calls out tocargo). -
^Develop an example (or use an existing example) to utilizeno_std, alongside documentation on how to run it in, e.g.,qemu.