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

assembly-to-bytecode conversion error when trying to compile #300

Open
2 tasks done
brotherlymite opened this issue Apr 2, 2024 · 1 comment
Open
2 tasks done
Labels
compiler Issues specific to compiling

Comments

@brotherlymite
Copy link

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (4307bfb 2024-03-20T16:57:57.936401000Z)

What command(s) is the bug in?

zkforge zkb

Operating System

macOS (Apple Silicon)

Describe the bug

When trying to compile ProtocolV3TestBase contract using zkforge zkbuild, I'm getting the following error:

Failed to compile smart contracts with zksolc: Compilation failed with stdout: "" and stderr: "Contract `src/ProtocolV3TestBase.sol:ProtocolV3LegacyTestBase` 

compiling error: The contract `src/ProtocolV3TestBase.sol:ProtocolV3LegacyTestBase` assembly-to-bytecode conversion error: assembly parse error 

Label fun_e2eTest was tried to be used for either PC or constant at offset 91848 that is more than `65535` addressable space

The contract `src/ProtocolV3TestBase.sol:ProtocolV3LegacyTestBase` assembly-to-bytecode conversion error: assembly parse error 

Label fun_e2eTest was tried to be used for either PC or constant at offset 91848 that is more than `65535` addressable space\n\n". 

Using compiler: "/path-to-compiler/.zksync/zksolc-macosx-arm64-v1.4.0", with args "/path-to-repo/aave-helpers/src/ProtocolV3TestBase.sol" CommandArgs { inner: ["--standard-json", "--solc", "/path/.svm/0.8.18/solc-0.8.18"] }

Please note running zkforge zkbuild directly on the aave-helpers repository results in the following error as described in issue #285 and #291:

The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Error("missing field `contracts`", line: 1, column: 750)
Location: crates/common/src/zk_compile.rs:1164

So to reproduce the error we should delete all contracts in the repo except ProtocolV3TestBase and its dependencies and compile.

@dutterbutter
Copy link
Collaborator

@brotherlymite thanks for posting this issue. We will investigate but at first glance looks like the max bytecode limit of the zkevm has been met meaning there may be a need to break up the file for compilation. However, we will investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Issues specific to compiling
Projects
None yet
Development

No branches or pull requests

2 participants