Skip to content

feat: dynamic ZKsync/LLVM solc revision selection #1055

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

Merged
merged 1 commit into from
May 26, 2025

Conversation

hedgar2017
Copy link
Contributor

@hedgar2017 hedgar2017 commented May 21, 2025

What 💻

Removes the hardcoded solc revision 1.0.1 and selects it depending on the zksolc version.

Why ✋

ZKsync/LLVM solc revision 1.0.2 with important bug fixes will be released soon. It must be handled properly DevEx-wise and make contract verification predictable.

CBOR-encoded metadata with compiler versions has been introduced in zksolc v1.5.13. Now all bytecode produced by v1.5.13 and newer will include all compiler versions used for compilation (solc_version, solc_revision, zksolc_version) unless explicitly disabled with --no-cbor-metadata.
Thus, if zksolc version is set to v1.5.12 or older, Foundry will keep using 1.0.1 as before, whereas for v1.5.13 and newer solc revision 1.0.2 will be used.

On the verifier side, CBOR-encoded metadata will be the first object to look for the solc version and revision, leading to more or less automatic experience.

Note 🗒️

Older Foundry versions that will keep using solc revision 1.0.1 with zksolc v1.5.13 and newer regardless of this update, but CBOR-encoded metadata will have this information.

Warning ⚠️

The only issue remains when all of the below is true:

  1. The plugin version is old
  2. zksolc version <= 1.5.12
  3. solc revision == 1.0.2

But in this case there is nothing we can do.

@hedgar2017 hedgar2017 requested a review from a team May 21, 2025 07:13
@hedgar2017 hedgar2017 requested a review from a team as a code owner May 21, 2025 07:13
@hedgar2017 hedgar2017 marked this pull request as draft May 21, 2025 07:26
@hedgar2017 hedgar2017 force-pushed the az-dynamic-solc-revision-selection branch from 090a652 to 5c66ce2 Compare May 21, 2025 07:34
@hedgar2017 hedgar2017 marked this pull request as ready for review May 22, 2025 02:45
@hedgar2017 hedgar2017 added this to the Q2 2025 milestone May 22, 2025
@hedgar2017 hedgar2017 force-pushed the az-dynamic-solc-revision-selection branch from 5c66ce2 to 9c16a8a Compare May 22, 2025 15:47
@hedgar2017 hedgar2017 force-pushed the az-dynamic-solc-revision-selection branch from 9c16a8a to 9aff179 Compare May 23, 2025 02:02
Copy link
Contributor

@Jrigada Jrigada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you 💯

@hedgar2017 hedgar2017 merged commit 9120621 into main May 26, 2025
26 of 27 checks passed
@hedgar2017 hedgar2017 deleted the az-dynamic-solc-revision-selection branch May 26, 2025 14:49
@github-project-automation github-project-automation bot moved this from Todo to Done in DevEx squad May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants