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

[WIP] Add manual symbolic calldata support #223

Closed
wants to merge 74 commits into from

Conversation

palinatolmach
Copy link
Collaborator

@palinatolmach palinatolmach commented Dec 1, 2023

Related: #121
WIP. Depends on runtimeverification/evm-semantics#2201.

This PR adds basic support for dynamic arrays used in calldata; it automatically makes calldata symbolic (selector +Bytes SYMBOLIC_CALLDATA) if a dynamically-sized type (bytes, bytes[], uint256[], etc) is encountered in the function ABI.

The original idea was to add the ability to make calldata after a function selector symbolic to support symbolic bytes and dynamic array arguments (e.g., by adding kevm.symbolicCallData() and kevm.assumeBytesLength(b, 256) cheatcodes), but in this case the constraints generated by the compiler at the function entry would still reference the old calldata.

At the moment, the PR adds assumptions corresponding to either

  • a particular test w/calldata built in KEVM symbolic-calldata branch
  • constraints generated by the compiler for the same test executed with fully symbolic calldata

@palinatolmach palinatolmach changed the title Add symbolic calldata cheatcode [WIP] Add symbolic calldata cheatcode Dec 11, 2023
palinatolmach and others added 16 commits December 22, 2023 22:58
* deps/kevm_release: Set Version 1.0.406

* Set Version: 0.1.103

* Sync Poetry files: kevm-pyk version 1.0.406

* deps/k_release: sync release file version 6.1.72

* flake.{nix,lock}: update Nix derivations

---------

Co-authored-by: devops <[email protected]>
* deps/kevm_release: Set Version 1.0.406

* Set Version: 0.1.103

* Sync Poetry files: kevm-pyk version 1.0.406

* deps/k_release: sync release file version 6.1.72

* flake.{nix,lock}: update Nix derivations

---------

Co-authored-by: devops <[email protected]>
@palinatolmach palinatolmach changed the title [WIP] Add symbolic calldata support & cheatcode [WIP] Add manual symbolic calldata support Jan 22, 2024
@anvacaru anvacaru self-assigned this Jan 22, 2024
@palinatolmach
Copy link
Collaborator Author

This PR should be closed as the necessary changes for dynamic types support are implemented by @anvacaru in #321.

@PetarMax shall we move the [preserves-definedness] attribute change in cheatcodes.md to another PR, if we still need them?

@palinatolmach
Copy link
Collaborator Author

Closed, as dynamic types support is implemented in #321, and [preserves-definedness] change to cheatcodes in factored out into separate PRs in KEVM and Kontrol.

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

Successfully merging this pull request may close these issues.

4 participants