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

When I ran forge command with zksync flag, solc consumed a huge memory in large project #459

Closed
2 tasks done
wshino opened this issue Jul 5, 2024 · 3 comments
Closed
2 tasks done

Comments

@wshino
Copy link

wshino commented Jul 5, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.0.2 (6e1c282 2024-07-03T00:22:11.972797000Z)

What command(s) is the bug in?

forge script script/DeployEmailRecoveryModule.s.sol:DeployEmailRecoveryModuleScript --zksync --rpc-url $ZKSYNC_SEPOLIA_RPC_URL --broadcast -vvvv

Operating System

macOS (Apple Silicon)

Describe the bug

It's related to this issue #378

forge build --zksync in our repo, It took an hour and 15 minutes.
But this is not the only problem.

When I ran some deployment script, I saw the solc allocated huge memory(I saw solc consumed 28GB).
So I couldn't run the deployment script in my local.
Is there any work-around way?
Actually the current solution I may need to use some instance with more memory.

@wshino wshino added the T-bug label Jul 5, 2024
@Karrq
Copy link
Contributor

Karrq commented Jul 5, 2024

Hey thanks for the report.
Unfortuantely, this is somewhat expected: as you guessed this is indeed related to #378 (but we have forgotten to update the issue), and high memory consumption was one of the things we have observed also (with similar compilation time, I reached more than 50GB in total, but macOS managed to keep my laptop alive).

Luckily the solution is simple: update to zksolc 1.5.0 and solc 0.8.26.
zksolc 1.5.0 brought a lot of improvement on memory usage and compilation time, and solc 0.8.26 provided significant speedup for the Yul pipeline (which is in use by zksolc).

@wshino
Copy link
Author

wshino commented Jul 8, 2024

Thank you so much.
Actually I have no longer need to deploy the above repo to zksync mainnet/sepolia right now, but I believe this solution will be able to fix the problems.

@nbaztec nbaztec closed this as completed Aug 6, 2024
@Karrq
Copy link
Contributor

Karrq commented Aug 7, 2024

We added support for zksolc 1.5.1 in #487, which brings the most memory and speed improvements to date :)

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

No branches or pull requests

3 participants