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

Add caching to flattened file compilation #3

Closed
wants to merge 3 commits into from

Conversation

mikemcdonald
Copy link
Collaborator

The flattening on the current implementation seems wrong unless I'm missing something. It groups all solidity files in a directory and flattens them together, instead of getting a specific contract and flattening all of the dependencies with it.

This is a rough draft and still needs to be cleaned, but this PR:

  • Moves the flattened folder outside of the contracts folder. Otherwise it gets messy when mixing compilers since hardhat doesn't have a great way to ignore folders
  • Adds a cache for all of the flattened files so the compiler doesn't try to recompile every time when there are no updates

I still need to add a cache invalidator if the artifacts don't exist, in scenarios where compilation fails or is cancelled.

PS: the tests require a zk-solc binary in the path and matter-labs/compiler-llvm-context repo still needs to be open sourced in order to build it

@mikemcdonald mikemcdonald changed the title DRAFT: Add caching to flattened file compilation Add caching to flattened file compilation Jan 18, 2022
@ly0va
Copy link
Member

ly0va commented Jan 20, 2022

Hi @mikemcdonald, appreciate your input! This issue is already addressed in #4 which gets rid of the flattener altogether and makes use of HH's built-in dependency resolution and caching system.

@ly0va
Copy link
Member

ly0va commented Jan 20, 2022

Closing this for now

@ly0va ly0va closed this Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants