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

eval/injection reverts fail to report their error message. #331

Open
AlbertoCentonze opened this issue Oct 11, 2024 · 3 comments
Open

eval/injection reverts fail to report their error message. #331

AlbertoCentonze opened this issue Oct 11, 2024 · 3 comments

Comments

@AlbertoCentonze
Copy link
Contributor

When eval/injection calls an internal function that reverts with some specific error message. The error message is not reported correctly making it very hard to debug the source of the issue.

@charles-cooper
Copy link
Member

The error message is not reported correctly

hmm, can you explain?

@AlbertoCentonze
Copy link
Contributor Author

Given a function bar() in a contract A whose source is:

@internal
@view
def bar(whatever: bool) -> uint256:
    assert whatever, "the value is false"
    return 42

Let's say we inject a function foo()

import textwrap

source = textwrap.dedent("""
@view
@external
def foo() -> uint256:
    return self.bar(False)
""")

A.inject_function(source)

If we attempt to call foo boa will ofc revert but will not be able to report that the error is "the value is false".

If this is a technical limitation, there could be a better error specifying that some assertion happened inside the injected function and it couldn't be reported.

@charles-cooper
Copy link
Member

ok gotcha. i think we should handle this in theory, the fact that we don't is a bug. see

self._source_map = source_map

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

No branches or pull requests

2 participants