MinaProtocol / mina

Mina is a cryptocurrency protocol with a constant size blockchain, improving scaling while maintaining decentralization and security.
https://minaprotocol.com
Apache License 2.0
1.99k stars 529 forks source link

Replace ppx_optcomp #11618

Closed ylecornec closed 1 month ago

ylecornec commented 2 years ago

As noted in the Codebase Improvement Ideas on notion, ppx_optcomp should be replaced by something else.

It seems that the main use of this preprocessor is to be able to compile the code in multiple configurations, that are defined in the src/config folder.

From what I noticed in the code base there are two important cases in particular:

Leads:

mrmr1993 commented 2 years ago

Could these configurations be handled by dune using functionalities such as virtual libraries and/or enabled_if attributes ?

That should get rid of most of the uses of optcomp, yes.

To remove the nonconsensus optcomp, we'll probably need to restructure the code so that Mina_base doesn't depend on pickles (or anything else that depends on Kimchi_bindings). I suspect that the work to extract the types in #11101 will make this significantly easier. There will probably also have to be some tweaks to Snark_params and friends to avoid pulling in dependencies from Kimchi_backend too.

robinbb commented 1 year ago

11101 is now complete, but has a follow-on task, #11771. So, @mrmr1993's comment (that this issue will be easier after that work) applies to that new issue.

mrmr1993 commented 1 month ago

ppx_optcomp is now limited to a single library since https://github.com/MinaProtocol/mina/pull/15837. Closing.