You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the tracer crate no_std-compliant. This one is only slightly more involved, with the exception that we need... (Make tracerno_std compatible #680)
* Change the ELF loading API to use the ELF contents as a Vec<u8> versus a PathBuf. There are several instances, in both jolt-core and tracer, where the ELF to execute is given by its path versus its contents. Obviously in a no_std environment 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. (Make tracerno_std compatible #680)
Those are the initial "easy" steps. Things get trickier with the jolt-core crate, in particular with its use of rayon.
* Make the binius-field crate no_std-compliant. Almost all crates used already have no_std compliance, exceptbinius. Fortunately, we only use binius-field, and the changes there are relatively straightforward. However, this would either require a fork of binius or for us to try to merge those changes back into binius.binius-field is not longer used.
^ Either (1) feature-mask all uses of rayon (not fun) or use (2) biniuss maybe-rayon crate, 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 on biniuss maybe-rayon, and changes made to maybe-rayon as well
* Replace std with core / alloc where appropriate, plus other changes. This is straightforward, but a lot of changes.
* Make the jolt-sdk crate no_std-compliant. Straightforward, modulo not being able to generate the guest compile function (since it calls out to cargo).
^ Develop an example (or use an existing example) to utilize no_std, alongside documentation on how to run it in, e.g., qemu.
Description
We at Galois have been exploring making
jolt-corework 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 getjoltto ano_std-compliant form. The goal of course is for everything to still work as-is when compiling as normal, with the added benefit ofno_stdsupport 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 justjoltcode.*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-corecrate, in particular with its use ofrayon.*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.