Skip to content
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

Move circuit directory to common platform dependant directory #375

Closed
BGluth opened this issue Jul 10, 2024 · 6 comments · Fixed by #405
Closed

Move circuit directory to common platform dependant directory #375

BGluth opened this issue Jul 10, 2024 · 6 comments · Fixed by #405
Assignees
Labels
crate: zero_bin Anything related to the zero-bin subcrates.

Comments

@BGluth
Copy link
Member

BGluth commented Jul 10, 2024

Based on the discussion here.

@BGluth BGluth added the crate: zero_bin Anything related to the zero-bin subcrates. label Jul 10, 2024
@BGluth BGluth added this to the Cleanups and Misc. milestone Jul 10, 2024
@BGluth BGluth self-assigned this Jul 10, 2024
@0xaatif
Copy link
Contributor

0xaatif commented Jul 11, 2024

My opinion is #310 (comment)

@BGluth
Copy link
Member Author

BGluth commented Jul 12, 2024

Just continuing the conversation from #310.

@0xaatif from your proposal here, would the idea be that circuits are never serialized to disk without the user specifying this explicitly in the prog args? And I guess we would never attempt to look for serialized circuits if the user doesn't specify this in the args?

Also @Nashtare wdyt about either using the output of KERNEL.hash() in the circuit versioning string (either replacing or using along with semver)?

@0xaatif
Copy link
Contributor

0xaatif commented Jul 12, 2024

would the idea be that circuits are never serialized to disk without the user specifying this explicitly in the prog args?

Yes, we could keep things small and simple for now, like git's plumbing commands. We can do porcelain later.

$ zero-bin generate-circuit memory 0..16 > mem.circuit

$ zero-bin get witness http://127.0
0.1/ > witness.json

$ zero-bin prove --witness witness.json --memory mem.circuit

@Nashtare
Copy link
Collaborator

wdyt about either using the output of KERNEL.hash() in the circuit versioning string

Yes that'd be a useful safeguard against discrepancies (though I think the circuit consistency file we had got lost somewhere in the migration or the recent PRs).

@Nashtare Nashtare modified the milestones: Misc., System strengthening Jul 12, 2024
@BGluth
Copy link
Member Author

BGluth commented Jul 12, 2024

Hmm... I personally feel we should hide the internals from the user by default (I think that's what you're saying you want in the end as well). Like already at this point we're abstracting this away to some extent (we read/write to the circuits directory without the user intervening). I like your idea of using platform-dirs, and I think it actually might be easier to swap that out with what we're currently doing vs. writing to stdout.

@0xaatif
Copy link
Contributor

0xaatif commented Jul 13, 2024

I'm good with that approach :)

BGluth added a commit that referenced this issue Jul 17, 2024
- Now attempts to use the OS's specific cache dir to store circuits.
- This is done by setting the env var `ZK_EVM_CACHE_DIR` if the user has
  not already set it, which allows the user to override the circuit
  cache directory if they want to.
BGluth added a commit that referenced this issue Aug 1, 2024
- Now attempts to use the OS's specific cache dir to store circuits.
- This is done by setting the env var `ZK_EVM_CACHE_DIR` if the user has
  not already set it, which allows the user to override the circuit
  cache directory if they want to.
BGluth added a commit that referenced this issue Aug 9, 2024
- Now attempts to use the OS's specific cache dir to store circuits.
- This is done by setting the env var `ZK_EVM_CACHE_DIR` if the user has
  not already set it, which allows the user to override the circuit
  cache directory if they want to.
BGluth added a commit that referenced this issue Aug 12, 2024
* Circuit cache dir now uses os cache dir (#375)

- Now attempts to use the OS's specific cache dir to store circuits.
- This is done by setting the env var `ZK_EVM_CACHE_DIR` if the user has
  not already set it, which allows the user to override the circuit
  cache directory if they want to.

* Requested PR changes for #405

- No longer uses a lazy static.

* Requested PR changes for #405 (2)

- Fixed accidently not panicing when an `env` var is not set.

* Fixed env var not being set in AMPQ mode

* Requested PR changes for #405 (3)
atanmarko pushed a commit that referenced this issue Aug 14, 2024
* Circuit cache dir now uses os cache dir (#375)

- Now attempts to use the OS's specific cache dir to store circuits.
- This is done by setting the env var `ZK_EVM_CACHE_DIR` if the user has
  not already set it, which allows the user to override the circuit
  cache directory if they want to.

* Requested PR changes for #405

- No longer uses a lazy static.

* Requested PR changes for #405 (2)

- Fixed accidently not panicing when an `env` var is not set.

* Fixed env var not being set in AMPQ mode

* Requested PR changes for #405 (3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate: zero_bin Anything related to the zero-bin subcrates.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants