moccasin: AssertionError when deploying on eravm network.
When deploying the contract on the network eravm it launch Anvil-ZKsync follow by half of a page of file issues ending with an AssertionError. See below:
mox run deploy --network eravm Running run command…
testing
16:59:12 INFO Version: 0.2.1
16:59:12 INFO Repository: https://github.com/matter-labs/anvil-zksync
....
16:59:12 INFO ========================================
16:59:12 INFO Listening on 127.0.0.1:62769
16:59:12 INFO ========================================
Traceback (most recent call last):
File "/Users/myname/.local/bin/mox", line 8, in <module>
sys.exit(main())
Follow by half of a page of File issus
.....
File "/Users/myname/.local/share/uv/tools/moccasin/lib/python3.11/site-packages/boa_zksync/environment.py", line 306, in _hash_code
assert bytecode_len % 32 == 0, "Bytecode length must be a multiple of 32 bytes"
^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Bytecode length must be a multiple of 32 bytes
My Setup:
Mac mini 2018, mac OS Sequoia 15.2
Processor: 3,2 GHz 6-Core Intel Core i7
IDE: jupyterlab 4.3.4
@Patricks-Mac-mini mox-favorites-cu % mox --version
Moccasin CLI v0.3.6
@Patricks-Mac-mini mox-favorites-cu % zkvyper --version
Vyper compiler for ZKsync v1.5.4 (LLVM build
f9f732c8ebdb88fb8cd4528482a00e4f65bcb8b7)
Note: I had first v1.5.7 installed, on demand off our dear friend s3bc40 I installed today v 1.5.4 --> same issue
@Patricks-Mac-mini mox-favorites-cu % anvil-zksync --version
anvil-zksync 0.2.1
@Patricks-Mac-mini mox-favorites-cu % echo $SHELL
/bin/zsh
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (11 by maintainers)
Yeah, I think it is coming from vscode terminal. I saw that even when I was deactivating my virtual env in vscode like terminal, I was still using the
mox&vyperfrom the.venvdir of the project.Also, I do not know how the
vyper0.4.1b4.ended up in your bins, but it would be better to go to the stablev0.4.0.But that’s a great news we are coming to a positive conclusion! Enjoy the course to its fullest!
We can share a virtual bottle of champagne 🍾
@PatrickAlphaC keeping this issue under the hood to prepare for potential feedback or breaking change later since we depend on
boaandvyper👍Yes, that is a stupid error on my part sorry. When I run it I get the following:
Solved now with the uv add package and uv sync.
Can continue my journey on issues solving. Thank you again s3bc40. Time to take a break… for sure. lol
Hi s3bc40 ,
See, you put a lot of effort into this. Thank you.
Yes I have a vyper and a vyper-0.4.1b4.dist-info directory. When I do in the terminal:
I get a 0.4.0 version. So I tried the second option below.
Activating the virtual environment inside the project and adding moccasin too:
It is working!!! Hoeraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
Conclusion:
Where do I need to send that bottle of champagne?
I reviewed everything from the beginning I saw so far. I am now at section 4 no 11 “Mox Testing” Intermediate Python & Vyper. So far so good. I noticed that after each section I needed to quit the IDE Jupyter Lab and the terminal and restart Jupyter Lab. As long I am doing that I have no issues so far. I will answer on Monday or Tuesday if I still have an issue. I keep you informed. Thank you.
Yes, you are right, the beginning was a mistake on my part but it’s good you explained the concept again. Thank you.
I noticed that I have to refresh my terminal quite often to avoid problems. Maybe that is one of the issues I am struggling with here on my setup. Will continue step by step, hope to solve my issue with the era compiler in section 4. To be continued.
Link to discussion prior to the issue for further info in
moccasin-full-course-cu: https://github.com/Cyfrin/moccasin-full-course-cu/discussions/32