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

Failed compile without reason #930

Open
2 tasks done
pegahcarter opened this issue Feb 21, 2025 · 4 comments
Open
2 tasks done

Failed compile without reason #930

pegahcarter opened this issue Feb 21, 2025 · 4 comments
Assignees
Labels
bug 🐛 Something isn't working needs triage ♟️ Issue needs to be picked up or assigned

Comments

@pegahcarter
Copy link
Contributor

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

0.0.9-dev

What version of Foundryup are you on?

foundryup-zksync: 0.3.3

What command(s) is the bug in?

forge build --zksync

Operating System

Linux

Describe the bug

I'm getting a failed compile on my scripts and don't know why:

See FraxFinance/frax-oft-upgradeable#52 to reproduce locally.

@pegahcarter pegahcarter added bug 🐛 Something isn't working needs triage ♟️ Issue needs to be picked up or assigned labels Feb 21, 2025
@Jrigada
Copy link
Contributor

Jrigada commented Feb 24, 2025

Hey @pegahcarter!
I tested the provided branch of your repository and was able to compile it successfully.

❯ forge build --zksync
[⠃] Using zksolc-1.5.11
[⠰] Compiling (zksync)
[⠒] Compiling 200 files with zksolc and solc 0.8.22
[⠢] zksolc and solc 0.8.22 finished in 570.83s
Compiler run successful with warnings:
...

Does it fail for you immediately? Also, could you try using the latest main branch of foundry-zksync with RUST_LOG=debug enabled to get more insight into what’s happening?

Additionally, I assume you’ve already tried this, but running forge clean can sometimes resolve cache-related issues.

@Jrigada Jrigada self-assigned this Feb 24, 2025
@pegahcarter
Copy link
Contributor Author

Hey @Jrigada here's what we have:

carter@laptop:~/Documents/frax/frax-oft-upgradeable$ curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/install-foundry-zksync | bash
 
...

foundryup-zksync: installed - forge Version: 0.0.9-dev
Commit SHA: VERGEN_IDEMPOTENT_OUTPUT
Build Timestamp: 2025-02-20T21:07:56.344312967Z (1740085676)
Build Profile: release
foundryup-zksync: installed - cast Version: 0.0.9-dev
Commit SHA: VERGEN_IDEMPOTENT_OUTPUT
Build Timestamp: 2025-02-20T21:07:56.344312967Z (1740085676)
Build Profile: release
foundryup-zksync: downloading latest anvil-zksync

...

foundryup-zksync: installed - anvil-zksync 0.3.1
foundryup-zksync: done!
Cleaning up installation artifacts...
Cleanup completed.
Installation completed successfully!
Verifying installation...
forge Version: 0.0.9-dev Commit SHA: VERGEN_IDEMPOTENT_OUTPUT Build Timestamp: 2025-02-20T21:07:56.344312967Z (1740085676) Build Profile: release
Forge is successfully installed with version: forge Version: 0.0.9-dev
Commit SHA: VERGEN_IDEMPOTENT_OUTPUT
Build Timestamp: 2025-02-20T21:07:56.344312967Z (1740085676)
Build Profile: release

carter@laptop:~/Documents/frax/frax-oft-upgradeable$ forge cache clean

carter@laptop:~/Documents/frax/frax-oft-upgradeable$ rm -rf cache

carter@laptop:~/Documents/frax/frax-oft-upgradeable$ RUST_LOG=debug && forge build --zksync
[⠃] Using zksolc-1.5.11
[⠒] Compiling (zksync)
[⠒] Compiling 201 files with zksolc and solc 0.8.22
[⠒] zksolc and solc 0.8.22 finished in 842.42s
Error: Compiler run failed:
Error

carter@laptop:~/Documents/frax/frax-oft-upgradeable$ foundryup-zksync --version
foundryup-zksync: 1.0.1

carter@laptop:~/Documents/frax/frax-oft-upgradeable$ rm -rf out zkout cache

carter@laptop:~/Documents/frax/frax-oft-upgradeable$ forge cache clean

carter@laptop:~/Documents/frax/frax-oft-upgradeable$ forge script scripts/DeployFraxOFTProtocol/DeployFraxOFTProtocol.s.sol --rpc-url https://mainnet.era.zksync.io --zksync
[⠰] Compiling...
[⠊] Compiling 200 files with Solc 0.8.22
[⠆] Solc 0.8.22 finished in 198.96s
Compiler run successful!
[⠃] Using zksolc-1.5.11
[⠒] Compiling (zksync)
[⠘] Compiling 200 files with zksolc and solc 0.8.22
[⠑] zksolc and solc 0.8.22 finished in 1003.08s
Error: Compiler run failed:
Error

@Jrigada Jrigada moved this from Todo to In Progress in DevEx squad Feb 26, 2025
@Jrigada
Copy link
Contributor

Jrigada commented Feb 27, 2025

Hey!
I was able to reproduce the issue on a Linux machine. I am currently working on creating the smallest reproducible example to share with the compiler team. I will update this issue as soon as I have it.

@pegahcarter
Copy link
Contributor Author

pegahcarter commented Feb 27, 2025

@Jrigada great! Thank you 🙏

Edit: I'm going out on a limb to guess that the issue is from a foundry script using assembly create. I'm looking forward to see what you find!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working needs triage ♟️ Issue needs to be picked up or assigned
Projects
Status: In Progress
Development

No branches or pull requests

2 participants