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

feat: Cache invalidation on zksolc version change #871

Merged
merged 22 commits into from
Jan 29, 2025

Conversation

MBerguer
Copy link
Contributor

What 💻

  • Updating the can_use_cached in zksync, so it accounts for the selected version as well
  • Adding two tests;
    • test_zk_cache_ok is a very basic test that asserts the cache is working correctly (must have)
    • test_zk_cache_invalid_on_version_changed to demonstrate that changing the zksolc version now recompiles the project.

Why ✋

  • This was a bug, we need to recompile after changing this setting because this affects the artifacts directly.

Evidence 📷

Before this change, we had this situation:

user@local % forge build --zksync
[⠃] Using zksolc-1.5.6
[⠊] Compiling (zksync)
[⠑] Compiling 27 files with zksolc and solc 0.8.28
[⠃] zksolc and solc 0.8.28 finished in 2.72s
Compiler run successful!
user@local % nano foundry.toml        
> zksolc = "1.5.8"
user@local % forge build --zksync
[⠃] Using zksolc-1.5.8
[⠒] Compiling (zksync)
No files changed, compilation skipped

Now, it is recompiling after the change.

Documentation 📚

Please ensure the following before submitting your PR:

  • Check if these changes affect any documented features or workflows.
  • Update the book if these changes affect any documented features or workflows.

@MBerguer MBerguer requested a review from a team as a code owner January 24, 2025 22:28
crates/common/src/compile.rs Outdated Show resolved Hide resolved
crates/config/src/zksync.rs Outdated Show resolved Hide resolved
crates/forge/tests/cli/zk_build.rs Outdated Show resolved Hide resolved
crates/zksync/compilers/src/compilers/zksolc/settings.rs Outdated Show resolved Hide resolved
@Jrigada Jrigada added this to the Release 0.0.5 milestone Jan 27, 2025
crates/zksync/compilers/tests/zksync_tests.rs Outdated Show resolved Hide resolved
crates/zksync/compilers/src/compilers/zksolc/settings.rs Outdated Show resolved Hide resolved
crates/config/src/zksync.rs Outdated Show resolved Hide resolved
crates/config/src/zksync.rs Outdated Show resolved Hide resolved
@elfedy elfedy merged commit 60a8f35 into main Jan 29, 2025
23 checks passed
@elfedy elfedy deleted the tincho/cache-invalidation-on-zksolc-version branch January 29, 2025 18:20
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.

4 participants