vyperlang / titanoboa

a vyper interpreter
https://titanoboa.readthedocs.io
Other
242 stars 41 forks source link

fix RecursionError tracing child computations #171

Closed cfcfs closed 5 months ago

cfcfs commented 5 months ago

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

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 commented 5 months ago

nice catch. thanks for the fix!