Open charles-cooper opened 1 year ago
This is killing us in terms of being able to diagnose issues inside boa. Any chance this can be remedied any time soon? We've just moved our dev environment to boa and love it compared to ape but this really misled us and continues to hinder our development.
this particular instance should be fixed in vyper v0.4.0 because it now allocates a fresh memory buffer for revert reasons
but yea, there are cases where variables can overlap memory (if they have different live ranges), and going forward the optimizer should optimize this more and more aggressively. so we will need some way of approaching that in the future
for <= v0.3.10, dev reasons should help here since they don't overwrite any evm memory
ex.
in the traceback,
32
will be displayed as the value forx
since the encoding of the reason string clobbersx
.there are two ways to fix this -- one is a short term fix, which is to optimize the handling of string literals so that the clobbering is not required here: https://github.com/vyperlang/vyper/blob/c71b0238bb8e804072a92f7ebc39cbafdb5da3e7/vyper/codegen/stmt.py#L195-L207
but the longer term issue is that local variables may be aliased in future - they may be deallocated after last use to reduce memory expansion. so we will need a plan to trace variables at the time that they are deallocated.