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 anvil-zksync inside devContainer to run just test-z #216

Open
s3bc40 opened this issue Feb 25, 2025 · 3 comments
Open

Missing anvil-zksync inside devContainer to run just test-z #216

s3bc40 opened this issue Feb 25, 2025 · 3 comments

Comments

@s3bc40
Copy link
Contributor

s3bc40 commented Feb 25, 2025

ERROR tests/zksync/test_unit_zksync.py::test_run_zksync_good - FileNotFoundError: [Errno 2] No such file or directory: 'anvil-zksync'
ERROR tests/zksync/test_unit_zksync.py::test_compile_zksync_bad - FileNotFoundError: [Errno 2] No such file or directory: 'anvil-zksync'
ERROR tests/zksync/test_unit_zksync.py::test_compile_zksync_one - FileNotFoundError: [Errno 2] No such file or directory: 'anvil-zksync'

Is it something to add inside DockerFile, or should it be the dev to install it on his side?

s3bc40 added a commit to s3bc40/moccasin that referenced this issue Feb 25, 2025
- add tests for install command
- add tests for impacted commands
    - run
    - test
    - deploy
    - compile
- using helper utility to handle moccasin toml scenarios
- add auto-install lib/github and lib/pypi folders when install (fix issue Cyfrin#209)
- fix issues with tests using COMPLEX_PROJECT path and not temporary one
- update test constants

WARNING: just test-z and live test KO since anvil-zksync is not installed (reported Cyfrin#216)
@s3bc40
Copy link
Contributor Author

s3bc40 commented Feb 25, 2025

I also have a script for zkvyper if it is relevant to add zkvyper:

#bin/bash

# Install ZKVyper
echo "Installing ZKVyper"

# Get arg from command line or set stable one
VERSION="${1:-"1.5.7"}"

# Download and install ZKVyper
wget https://github.com/matter-labs/era-compiler-vyper/releases/download/$VERSION/zkvyper-linux-amd64-gnu-v$VERSION -O zkvyper
chmod u+x zkvyper 
sudo rm -rf /usr/local/bin/zkvyper
sudo mv zkvyper /usr/local/bin

# Check installation
zkvyper --version

@s3bc40
Copy link
Contributor Author

s3bc40 commented Feb 27, 2025

Next PR will come soon with stable anvil-zksync and zkvyper in devcontainer.

just test-z is running but I found out that ports used by anvil-zksync are not closing and I already saw that in the past in my processes (htop):

Image

Image

I'll try to fix it inside the PR.


An example, after running a few just test-z or mox compile --network eravm in a project. Maybe it needs its proper issue since it is not just the tests.

Image

@s3bc40
Copy link
Contributor Author

s3bc40 commented Feb 27, 2025

Potential issue coming from boa-zksync:

# boa_zksync/__init__.py
def set_zksync_test_env(node_args=(), nickname=None):
    return boa.set_env(
        ZksyncEnv(rpc=AnvilZKsync(node_args=node_args), nickname=nickname)
    )

# boa_zksync/node.py
class AnvilZKsync(EthereumRPC):
    ...
    def __del__(self):
        stop_subprocess(self._test_node)

The del is not triggered properly I think.

PatrickAlphaC added a commit that referenced this issue Mar 5, 2025
* feat: auto-install dependencies

* feat: implement tests for install command

- add tests for install command
- add tests for impacted commands
    - run
    - test
    - deploy
    - compile
- using helper utility to handle moccasin toml scenarios
- add auto-install lib/github and lib/pypi folders when install (fix issue #209)
- fix issues with tests using COMPLEX_PROJECT path and not temporary one
- update test constants

WARNING: just test-z and live test KO since anvil-zksync is not installed (reported #216)

* fix: refactor auto-install tests

* fix: lint

---------

Co-authored-by: s3bc40 <s3bc40@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants