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: switch to the default codegen with zksolc #1062

Merged
merged 30 commits into from
Jun 19, 2024

Conversation

kiriyaga-txfusion
Copy link
Contributor

What 💻

  • Switches to the default codegen with the zksolc

Why ✋

  • These changes with new version 1.5.0 of zksolc will affect a plugin where arguments will be sent from standard json input.

@kiriyaga-txfusion kiriyaga-txfusion requested a review from a team as a code owner May 13, 2024 22:03
@@ -29,8 +29,9 @@ zksolc: {
compilerPath: "zksolc", // optional. Ignored for compilerSource "docker". Can be used if compiler is located in a specific folder
libraries:{}, // optional. References to non-inlinable libraries
missingLibrariesPath: "./.zksolc-libraries-cache/missingLibraryDependencies.json" // optional. This path serves as a cache that stores all the libraries that are missing or have dependencies on other libraries. A `hardhat-zksync-deploy` plugin uses this cache later to compile and deploy the libraries, especially when the `deploy-zksync:libraries` task is executed
isSystem: false, // optional. Enables Yul instructions available only for zkSync system contracts and libraries
forceEvmla: false, // optional. Falls back to EVM legacy assembly if there is a bug with Yul
enableEraVMExtensions: false, // optional. Enables Yul instructions available only for zkSync system contracts and libraries
Copy link
Contributor

Choose a reason for hiding this comment

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

What we will do for the previous versions. I think we should somewhere put what was used for the previous versions.


Usage of zksolc compiler version greater or equal to 1.5.0

- It's necessary to set the viaYul or viaEVMAssembly flag to true at zksolc settings to specify the compiler codegen manually.
Copy link
Contributor

Choose a reason for hiding this comment

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

It is mandatory to specify the compiler codegen manually. This can be done by setting either the viaYul or viaEVMAssembly flag to true in the zksolc settings. Only one of these flags can be set to true at a time, ensuring that the code generation process is clearly defined.

Usage of zksolc compiler version greater or equal to 1.5.0

- It's necessary to set the viaYul or viaEVMAssembly flag to true at zksolc settings to specify the compiler codegen manually.
- When viaEVMAssembly is used, compiler expect only zkSync Era Solidity Compiler.
Copy link
Contributor

Choose a reason for hiding this comment

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

"compiler expect only zkSync Era Solidity Compiler" - please rephrase this part


const [major, minor] = getVersionComponents(compiler.version);
if (zksolc.settings.viaYul && major === 0 && minor < 8) {
console.warn(COMPILER_ZKSOLC_NEED_EVM_CODEGEN);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe: console.info(chalk.yellow(...

@kiriyaga-txfusion kiriyaga-txfusion merged commit 5ec997a into main Jun 19, 2024
20 of 21 checks passed
@kiriyaga-txfusion kiriyaga-txfusion deleted the kiriayga-txfusion-zksolc-codegen branch June 19, 2024 11:43
itsacoyote added a commit to matter-labs/zksync-docs that referenced this pull request Jul 3, 2024
<!--

Thank you for contributing to the ZKsync Docs!

Before submitting the PR, please make sure you do the following:

- Update your PR title to follow [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/)
- Read the [Contributing
Guide](https://github.com/matter-labs/zksync-docs/blob/main/CONTRIBUTING.md).
- Understand our [Code of
Conduct](https://github.com/matter-labs/zksync-docs/blob/main/CODE_OF_CONDUCT.md)
- Please delete any unused parts of the template when submitting your PR

-->

# Description

Switches to the default codegen with the zksolc
These changes with new version 1.5.0 of zksolc will affect a plugin
where arguments will be sent from standard json input.

## Additional context
matter-labs/hardhat-zksync#1176
matter-labs/hardhat-zksync#1062

Co-authored-by: Marko Arambasic <makiarambasic@gmail.com>
Co-authored-by: Sabrina <sf@matterlabs.dev>
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