-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve portability #615
Comments
Happy to open a PR for this (I'm already working on it because I need it) |
I've got a branch I'm using for this at https://github.com/proxima-one/plonky2/tree/feature-gate-stuff |
For logging, shouldn't For For Rayon, I think the feature would ideally be in Rayon itself, see rayon-rs/rayon#861. If we don't want to wait for that we can add a shim temporarily, but I don't really like the arkworks approach since it changes all the call sites to use macros. I'd prefer either
A feature gate for |
I personally need a shim for rayon now, but I can keep that part in our branch for now if others don't need it too urgently. As for Log might actually be fine after looking at the source - I was running into some compilation issues with it but it might have actually been something else. |
Do you have an idea for how we could handle ZK configurations if rand is disabled? It looks like there's still a |
Oh, that's a good point. I guess you'd need to have that assertion. Then it can be a separate feature that some runtimes can enable. For instance in a browser, where there's no rayon but rand might be available. |
Of these, I think I prefer the second option, as it's more explicit that's what's happening and it's less code to write. In either case, the It ends up being a lot more code than the macro approach, which can be replaced later relatively easily once rayon-rs/rayon#861 happens. You just have to go through and replace all the call sites, which doesn't take that long. |
We can also just yoink similar instances of it like this: https://github.com/shssoichiro/oxipng/blob/master/src/rayon.rs. I'll look over the options and open a PR for whatever seems cleaner. |
I think the original inspiration for this (Plonky2 verification on Solana) went away, so it's at least not a priority; I think we can close for now and maybe reopen if the need arises |
There are a lot of dependencies that are either 1) only used in tests/examples (e.g.
rand
), or 2) do not compile in rust-based smart contract runtimes (e.g.env_logger
,log
,std::time
,rayon
). If we intend this library to be used outside a standard environment, we need to be able to build the library without these dependencies.To address this, I suggest the following:
log
/TimingTree
behind a feature that's enabled by default, and use conditional compilation to removetimed!
,with_context!
,TimingTree
, andContextTree
if disabledrayon
'spar_iter
with a macrocfg_iter
that conditionally switches betweeniter()
andpar_iter
like arkworks does heretest_utils
feature to deal with stuff like thegate_testing.rs
in the interrim until cargo supports this functionalityThe text was updated successfully, but these errors were encountered: