Skip to content

Refactor production of initial terms, factor out method identification #313

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

Merged
merged 22 commits into from
Feb 1, 2024

Conversation

ehildenb
Copy link
Member

@ehildenb ehildenb commented Jan 23, 2024

This PR is pulled out of: #284.

This brings us closer to producing specifications that are usable for CSE when running individual functions directly. In particular:

  • New methods {Method,Constructor}.{is_test,is_testfail} are added for binning Solidity methods by their type.
  • The logic for deciding whether to have a more or less symbolic state is inverted. Instead, we start with the most general state (substituting the fewest number of cells), then if it's a test/testFail/setUp, the state is made more specific with it needs to be (behind guards about the type of function it is).
  • Modifications are made to the produced initial states to make them compatible for use in CSE:
    • The ORIGIN_ID and CALLER_ID are made to be Int.
    • The OUTPUT_CELL is made to start as the empty buffer.
    • The cells [OUTPUT_CELL, CALLSTACK_CELL, CALLDEPTH_CELL, ID_CELL, LOG_CELL, ACCESSEDACCOUNTS_CELL, ACCESSEDSTORAGE_CELL, INTERIMSTATES_CELL, STATIC_CELL, ACCOUNTS_CELL] are left fully symbolic for normal function calls, only filled in for setUp and test methods.
    • Similar changes are made to the final term production.
  • We make sure to add the KEVM invariant to terminal states in the setUp for producing initial states in the test methods.
  • Adds pytest-timeout module for timing out individual tests.

@ehildenb ehildenb force-pushed the refactor-init-terms branch from 37c5272 to e436e21 Compare January 25, 2024 22:45
@ehildenb ehildenb marked this pull request as ready for review January 30, 2024 01:26
@ehildenb ehildenb requested review from anvacaru and PetarMax January 30, 2024 01:26
Copy link
Contributor

@anvacaru anvacaru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments that should be addressed.

@ehildenb ehildenb requested a review from anvacaru January 31, 2024 15:04
Copy link
Contributor

@anvacaru anvacaru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! You might need to update the expected output again after 6d470cb .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants