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: Capture return values during call sequence execution #533

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

anishnaik
Copy link
Collaborator

@anishnaik anishnaik commented Jan 10, 2025

Closes #505

Medusa will now capture the return values of every transaction executed (only the top-level call frame). The return value(s) must be of a primitive type (uint, int, bytes, fixed byte array, string, bool, address). These values are added to the value set during call sequence execution but are then wiped at the end of the call sequence. Thus, these values are ephemeral. This is to ensure that the value set does not blow up in size. The original value set (before the start of call sequence execution) is cached and is used to reset the call sequence.

The generation/mutation of fixed byte arrays has also been improved. Before, we always generated a completely random fixed byte array. Now, we use the value set, which should aid in finding bugs like #505. Additionally, we have reduced the probability of generating a completely random byte array/slice from 50% to 10%. It makes no sense to generate a completely random byte array/slice half the time.

Before merging we need to ensure that benchmarking shows that this does not cause immense performance degradation.

@anishnaik anishnaik requested a review from Xenomega as a code owner January 10, 2025 18:58
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.

Medusa should extract constants from the returned values of the EVM execution
1 participant