Skip to content

Constructor calls with symbolic parameters #2219

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

Closed
RaoulSchaffranek opened this issue Dec 11, 2023 · 2 comments
Closed

Constructor calls with symbolic parameters #2219

RaoulSchaffranek opened this issue Dec 11, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@RaoulSchaffranek
Copy link
Member

KEVM currently doesn't handle constructor calls with symbolic parameters.
The problem is that the parameters are appended to the init code, and #computeValidJumpDests will start branching on them to collect all JUMPDEST locations. The branching leads to a path-explosion problem and eventually produces the following error message: Error internalising cterm: [PredicateExpected ....

Notice that the parameters are just data and not executable bytecode.
The init code will utilize a CODECOPY operation to copy the data from the init code to the memory.
Hence, looking for JUMPDESTS in this data is not needed.

We solved this issue by replacing the ahead-of-time computation of the valid jump destinations with a just-in-time algorithm. See: #2112

We also needed the following lemma to lookup opcodes in partially symbolic init code:

    rule [bytes-concat-left-lookup]:
        (A:Bytes +Bytes B:Bytes) [I] => A [I] requires 0 <=Int I andBool I <Int lengthBytes(A) [simplification]
@ehildenb
Copy link
Member

The lemma can be added to KEVM as well as a test of it, in its own PR now, so that we can avoid that problem in the future.

@palinatolmach
Copy link
Contributor

Closed as completed by runtimeverification/kontrol#596.

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

No branches or pull requests

5 participants