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

Missing .zbin files #225

Closed
qd-qd opened this issue Feb 23, 2024 · 7 comments · Fixed by #230
Closed

Missing .zbin files #225

qd-qd opened this issue Feb 23, 2024 · 7 comments · Fixed by #230

Comments

@qd-qd
Copy link

qd-qd commented Feb 23, 2024

Hey guys,

First, thanks for all!
I cloned the main branch of the repository and then tried to run a node using make run-node or make run-node-light without success.

Here is the errors

Compiling era_test_node v0.1.0-alpha.14 (/Users/qdqd/workspace/zksync_era_precompiles/.test-node-subtree)
error: couldn't read src/deps/contracts/EcAddG2.yul.zbin: No such file or directory (os error 2)
   --> src/deps/system_contracts.rs:168:13
    |
168 |             include_bytes!("contracts/EcAddG2.yul.zbin").to_vec(),
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

error: couldn't read src/deps/contracts/EcMulG2.yul.zbin: No such file or directory (os error 2)
   --> src/deps/system_contracts.rs:178:13
    |
178 |             include_bytes!("contracts/EcMulG2.yul.zbin").to_vec(),
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
    
error: could not compile `era_test_node` (lib) due to 2 previous errors
make[1]: *** [rust-build] Error 101
make: *** [/Users/XXXX/YYYYY/zksync_era_precompiles/.test-node-subtree/target/release/era_test_node] Error 2

It seems that both EcAddG2.yul.zbin and EcMulG2.yul.zbin are missing on main. Am I missing something? Should I generate them or something? I am not familiar with this file format.

Any advice would be appreciated.

@IAvecilla
Copy link
Contributor

Hey @qd-qd! thanks for opening the issue can you provide the Rust version that you are using to compile this?

@qd-qd
Copy link
Author

qd-qd commented Feb 23, 2024

Hey @IAvecilla, thanks for your response. Here's the version I use: rustc 1.74.0 (79e9716c9 2023-11-13)

Hope it helps

@IAvecilla
Copy link
Contributor

I understand. It seems like some corrupted state occurred, leading to those errors. I tried with both 1.74.0 and 1.76.0, and it's working for me. You can try running make clean, and then when you execute make run-node again, you should see some logs from the era-test-node logging the following:

+ precompiles=("EcAdd" "EcMul" "EcPairing" "Ecrecover" "Keccak256" "ModExp" "P256VERIFY" "SHA256" "secp256k1VERIFY" "EcAddG2" "EcMulG2")

This indicates that EcAddG2 and EcMulG2 are included in the precompile list. Additionally, you should see logs like this:

+ for precompile in '"${precompiles[@]}"'
+ cp etc/system-contracts/contracts/precompiles/artifacts/EcAddG2.yul/EcAddG2.yul.zbin src/deps/contracts/
+ for precompile in '"${precompiles[@]}"'
+ cp etc/system-contracts/contracts/precompiles/artifacts/EcMulG2.yul/EcMulG2.yul.zbin src/deps/contracts/

This is where the .zbin files will be copied inside the contracts of the era-test-node. I'll see if I can reproduce the issue to provide you with a more detailed answer.

@rdubois-crypto
Copy link

Hello.

Working on macosx, with M3pro, rustc 1.78.0-nightly (0ecbd0605 2024-02-25), i face the same errors as described above.

@IAvecilla
Copy link
Contributor

Okay, I see. It's possible that I have a strange local state of the precompiles. Let me get back to you with a more detailed answer.

@IAvecilla
Copy link
Contributor

Hey @rdubois-crypto, @qd-qd, I believe the required files have been successfully pushed. Could you please attempt the compilation again to confirm if the issue has indeed been resolved? If not, please feel free to reopen the issue.

@rdubois-crypto
Copy link

#225 is fixed as well as #223, however a new issue occured with ecmul, described in #232

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 a pull request may close this issue.

3 participants