Skip to content

Constructor calls with symbolic parameters #2219

Closed
@RaoulSchaffranek

Description

@RaoulSchaffranek

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]

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions