feat: dynamic ZKsync/LLVM solc revision selection #1055
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
But in this case there is nothing we can do.