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

fix RecursionError tracing child computations #171

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

cfcfs
Copy link
Contributor

@cfcfs cfcfs commented Feb 22, 2024

What I did

Fix a RecursionError: maximum recursion depth exceeded in comparison happening while running tests with code coverage enabled.

.venv/lib/python3.11/site-packages/boa/contracts/vyper/vyper_contract.py:1007: in __call__
    computation = self.env.execute_code(
.venv/lib/python3.11/site-packages/boa/environment.py:709: in execute_code
    self._hook_trace_computation(ret, contract)
.venv/lib/python3.11/site-packages/boa/environment.py:726: in _hook_trace_computation
    self._hook_trace_computation(computation, child_contract)
.venv/lib/python3.11/site-packages/boa/environment.py:726: in _hook_trace_computation
    self._hook_trace_computation(computation, child_contract)
.venv/lib/python3.11/site-packages/boa/environment.py:726: in _hook_trace_computation
    self._hook_trace_computation(computation, child_contract)
E   RecursionError: maximum recursion depth exceeded in comparison
!!! Recursion detected (same locals & position)

How I did it

  • Fix computation's children iteration in _hook_trace_computation
  • Add unit test to check the fix

How to verify it

The test (tests/unitary/test_coverage.py) should pass with the fix and fail without it

Description for the changelog

Cute Animal Picture

core_image_v2_lora_cute_animals

@charles-cooper
Copy link
Member

nice catch. thanks for the fix!

@charles-cooper charles-cooper merged commit 1d2c0df into vyperlang:master Feb 22, 2024
6 of 9 checks passed
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 this pull request may close these issues.

2 participants