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

Adaptation might be needed for vyper==0.4.1 #222

Open
s3bc40 opened this issue Mar 4, 2025 · 4 comments
Open

Adaptation might be needed for vyper==0.4.1 #222

s3bc40 opened this issue Mar 4, 2025 · 4 comments
Labels

Comments

@s3bc40
Copy link
Contributor

s3bc40 commented Mar 4, 2025

Updatng vyper to 0.4.1 -> https://github.com/vyperlang/vyper/releases/tag/v0.4.1

just test
Image

mox compile in complex-project:

Image

Also take into account snekmate release to adapt to thee latest of vyper: pcaversaccio/snekmate#301

@PatrickAlphaC
Copy link
Member

Hm... What branch are you running just test on? It's working OK for me?

@ThatOneCalculator
Copy link

Unable to repro:

$ vyper --version
0.4.1+commit.8a93dd27

$  just test
uv run pytest  -x --ignore=tests/integration/ --ignore=tests/zksync/
Using CPython 3.13.0
Creating virtual environment at: .venv
      Built moccasin @ file:///tmp/moccasin
      Built lru-dict==1.3.0
░░░░░░░░░░░░░░░░░░░░ [0/92] Installing wheels...                                                          warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.
         If the cache and target directories are on different filesystems, hardlinking may not be supported.
         If this is intentional, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning.
Installed 92 packages in 49ms
========================================== test session starts ===========================================
platform linux -- Python 3.13.0, pytest-8.3.4, pluggy-1.5.0
rootdir: /tmp/moccasin
configfile: pyproject.toml
plugins: hypothesis-6.124.9, titanoboa-0.2.5, cov-6.0.0, xdist-3.6.1
collected 72 items

tests/cli/deployments/test_cli_deployments_write.py ...                                            [  4%]
tests/cli/deployments/test_unit_deployments_cli.py ...                                             [  8%]
tests/cli/deployments/test_unit_deployments_read.py ....                                           [ 13%]
tests/cli/test_cli_compile.py ....                                                                 [ 19%]
tests/cli/test_cli_deploy.py ..                                                                    [ 22%]
tests/cli/test_cli_init.py ..                                                                      [ 25%]
tests/cli/test_cli_inspect.py .                                                                    [ 26%]
tests/cli/test_cli_install.py ..                                                                   [ 29%]
tests/cli/test_cli_run.py ..........                                                               [ 43%]
tests/cli/test_cli_test.py ..........                                                              [ 56%]
tests/cli/test_cli_wallet.py .                                                                     [ 58%]
tests/live/test_live_verify.py s                                                                   [ 59%]
tests/unit/test_unit_config.py ...........                                                         [ 75%]
tests/unit/test_unit_inspect.py .                                                                  [ 76%]
tests/unit/test_unit_install.py .......                                                            [ 86%]
tests/unit/test_unit_moccasin_account.py ..                                                        [ 88%]
tests/unit/test_unit_run.py ....                                                                   [ 94%]
tests/unit/test_unit_vars.py ..                                                                    [ 97%]
tests/unit/test_unit_wallet.py ..                                                                  [100%]

===================================== 71 passed, 1 skipped in 42.98s =====================================

@s3bc40
Copy link
Contributor Author

s3bc40 commented Mar 6, 2025

$ vyper --version
0.4.1+commit.8a93dd27

$ just test
uv run pytest -x --ignore=tests/integration/ --ignore=tests/zksync/

Do you run it under your virtual environment? Because running it with just test will trigger uv run pytest -x --ignore=tests/integration/ --ignore=tests/zksync/ and take the vyper version inside the .venv


If you want to see my test on main here it is starting in the virtual env from vyper==0.4.0 to 0.4.1 (running in dev container)

Full trace
(workspace) vscode ➜ /workspace (main) $ vyper --version
0.4.0+commit.e9db8d9
(workspace) vscode ➜ /workspace (main) $ just test      
uv run pytest  -x --ignore=tests/integration/ --ignore=tests/zksync/
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.13.0, pytest-8.3.4, pluggy-1.5.0
rootdir: /workspace
configfile: pyproject.toml
plugins: titanoboa-0.2.5, cov-6.0.0, hypothesis-6.124.9, xdist-3.6.1
collected 71 items                                                                                                                                                                            

tests/cli/deployments/test_cli_deployments_write.py ...                                                                                                                                 [  4%]
tests/cli/deployments/test_unit_deployments_cli.py ...                                                                                                                                  [  8%]
tests/cli/deployments/test_unit_deployments_read.py ....                                                                                                                                [ 14%]
tests/cli/test_cli_compile.py ....                                                                                                                                                      [ 19%]
tests/cli/test_cli_deploy.py ..                                                                                                                                                         [ 22%]
tests/cli/test_cli_init.py ..                                                                                                                                                           [ 25%]
tests/cli/test_cli_inspect.py .                                                                                                                                                         [ 26%]
tests/cli/test_cli_install.py .                                                                                                                                                         [ 28%]
tests/cli/test_cli_run.py ..........                                                                                                                                                    [ 42%]
tests/cli/test_cli_test.py ..........                                                                                                                                                   [ 56%]
tests/cli/test_cli_wallet.py .                                                                                                                                                          [ 57%]
tests/live/test_live_verify.py s                                                                                                                                                        [ 59%]
tests/unit/test_unit_config.py ...........                                                                                                                                              [ 74%]
tests/unit/test_unit_inspect.py .                                                                                                                                                       [ 76%]
tests/unit/test_unit_install.py .......                                                                                                                                                 [ 85%]
tests/unit/test_unit_moccasin_account.py ..                                                                                                                                             [ 88%]
tests/unit/test_unit_run.py ....                                                                                                                                                        [ 94%]
tests/unit/test_unit_vars.py ..                                                                                                                                                         [ 97%]
tests/unit/test_unit_wallet.py ..                                                                                                                                                       [100%]

=============================================================================== 70 passed, 1 skipped in 41.44s ================================================================================
(workspace) vscode ➜ /workspace (main) $ uv add vyper==0.4.1
Resolved 119 packages in 25ms
   Built moccasin @ file:///workspace
Prepared 1 package in 192ms
Uninstalled 2 packages in 7ms
░░░░░░░░░░░░░░░░░░░░ [0/2] Installing wheels...                                                                                                                                                warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.
         If the cache and target directories are on different filesystems, hardlinking may not be supported.
         If this is intentional, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning.
Installed 2 packages in 9ms
 ~ moccasin==0.3.8 (from file:///workspace)
 - vyper==0.4.0
 + vyper==0.4.1
(workspace) vscode ➜ /workspace (main) $ vyper --version    
0.4.1+commit.8a93dd27
(workspace) vscode ➜ /workspace (main) $ just test          
uv run pytest  -x --ignore=tests/integration/ --ignore=tests/zksync/
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.13.0, pytest-8.3.4, pluggy-1.5.0
rootdir: /workspace
configfile: pyproject.toml
plugins: titanoboa-0.2.5, cov-6.0.0, hypothesis-6.124.9, xdist-3.6.1
collected 71 items                                                                                                                                                                            

tests/cli/deployments/test_cli_deployments_write.py .F

========================================================================================== FAILURES ===========================================================================================
_____________________________________________________________________________ test_checks_integrity_of_contracts ______________________________________________________________________________

mox_path = '/workspace/.venv/bin/mox', deployments_config = <moccasin.config.Config object at 0x7af6719565d0>, deployments_path = PosixPath('/tmp/tmpm1hzd2x0/project')
deployments_contract_override = None, anvil = None

    def test_checks_integrity_of_contracts(
        mox_path, deployments_config, deployments_path, deployments_contract_override, anvil
    ):
        current_dir = Path.cwd()
        try:
            os.chdir(deployments_path)
            deployments_config.set_active_network("anvil", activate_boa=False)
            active_network = deployments_config.get_active_network()
            anvil_chain_id = 31337
    
            starting_deployments_number_checked = len(
>               active_network.get_deployments_checked(
                    contract_name=COUNTER, limit=None, chain_id=anvil_chain_id
                )
            )

/workspace/tests/cli/deployments/test_cli_deployments_write.py:44: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/workspace/moccasin/config.py:527: in get_deployments_checked
    if self.has_matching_integrity(deployment, contract_name, config=config):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = Network(name='anvil', url='http://127.0.0.1:8545', chain_id=31337, is_fork=False, block_identifier='safe', is_zksync=F... live_or_staging=True, db_path=PosixPath('/tmp/tmpm1hzd2x0/project/.deployments.db'), extra_data={}, _network_env=None)
deployment = Deployment(contract_address=Address('0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9'), contract_name='Counter', filename=N...[], 'outputs': [{'name': '', 'type': 'uint256'}]}], session_id='7910451e-acc4-4eeb-8f8b-f8fe96f724a7', deployment_id=3)
contract_name = 'Counter', config = <moccasin.config.Config object at 0x7af6719565d0>

    def has_matching_integrity(
        self,
        deployment: Deployment,
        contract_name: str | None,
        config: Union["Config", None] = None,
    ) -> bool:
        """Check if the deployment has a matching integrity with the config and contract name.
    
        :param deployment: The deployment
        :type deployment: Deployment
        :param contract_name: The contract name
        :type contract_name: str | None
        :param config: The config
        :type config: Union[Config, None]
        :return: True if the deployment has a matching integrity, False otherwise
        :rtype: bool
        """
        if config is None:
            config = get_config()
        if contract_name is None:
            raise ValueError("contract_name cannot be None.")
        vyper_deployer = self.get_deployer_from_contract_name(config, contract_name)
        # REVIEW: If boa throws a warning, maybe that's all we need instead of checking the integrity
        with warnings.catch_warnings():
            warnings.filterwarnings(
                "ignore", message="casted bytecode does not match compiled bytecode at*"
            )
            contract = vyper_deployer.at(deployment.contract_address)
        verification_bundle = get_verification_bundle(contract)
>       expected_integrity = verification_bundle["integrity"]
E       TypeError: 'NoneType' object is not subscriptable

/workspace/moccasin/config.py:560: TypeError
====================================================================================== warnings summary =======================================================================================
tests/cli/deployments/test_cli_deployments_write.py::test_checks_integrity_of_contracts
  /workspace/.venv/lib/python3.13/site-packages/boa/contracts/abi/abi_contract.py:372: UserWarning: Requested <<anonymous contract> interface at 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 (WARNING: no bytecode at this address!)> but there is no bytecode at that address!
    contract = ABIContract(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================================================== short test summary info ===================================================================================
FAILED tests/cli/deployments/test_cli_deployments_write.py::test_checks_integrity_of_contracts - TypeError: 'NoneType' object is not subscriptable
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================================================== 1 failed, 1 passed, 1 warning in 1.72s ============================================================================
error: Recipe `test` failed on line 22 with exit code 1

Maybe I am missing something?

@s3bc40
Copy link
Contributor Author

s3bc40 commented Mar 7, 2025

vyperlang/titanoboa#377 maybe related to next release of boa so we can wait before going any further

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

No branches or pull requests

3 participants