Skip to content

fix: add VM Execution State #2043

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

fix: add VM Execution State #2043

wants to merge 7 commits into from

Conversation

crStiv
Copy link

@crStiv crStiv commented Apr 1, 2025

Add VM Execution State

Description

Added ExecutionState structure and get_execution_state() method to capture current VM state. Helps with debugging and simplifies integration with external tools.
What's included:

  • Structure with key VM parameters (pc, ap, fp, current_step, etc.)
  • Tests to verify functionality
  • Documentation

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added
  • This change requires new documentation.
  • Documentation updated
  • CHANGELOG has been updated.

FrancoGiachetta
FrancoGiachetta previously approved these changes Apr 1, 2025
@FrancoGiachetta
Copy link
Contributor

FrancoGiachetta commented Apr 1, 2025

The changelog needs to be updated.

@FrancoGiachetta FrancoGiachetta dismissed their stale review April 1, 2025 19:38

I made it by accident

@JulianGCalderon
Copy link
Contributor

Hi @crStiv, could you share a bit more information on the usecases of this new structure? Why are those particular fields necessary?

@crStiv
Copy link
Author

crStiv commented Apr 2, 2025

Hi @crStiv, could you share a bit more information on the usecases of this new structure? Why are those particular fields necessary?

@JulianGCalderon
Hey Julian,
About the ExecutionState, I'll try to be brief, so it basically:

  • Makes debugging way easier - you get all VM state in one place
  • Simplifies testing - no need to access VM internals directly
  • Opens up better tooling options - both IDE plugins and standalone tools

I picked these specijfic fields after some trial and error - they're the minimum set that actualy gives you the full picture of what's hapening in the VM. Happy to go deeper if needed.

@crStiv
Copy link
Author

crStiv commented Apr 2, 2025

The changelog needs to be updated.

@FrancoGiachetta got you, changelog is updated now, and deleted comments to the test as well

@FrancoGiachetta
Copy link
Contributor

Is it possible for you to tell us what you are doing that needs this information at some point in the program?

@crStiv
Copy link
Author

crStiv commented Apr 3, 2025

Is it possible for you to tell us what you are doing that needs this information at some point in the program?

@FrancoGiachetta
Before this structure, I had to directly access multiple VM internals, which was messy and fragile. Having a single method that returns a complete snapshot makes the integration much cleaner and less likely to break with future VM changes.
The ExecutionState provides what external tools need without exposing too many implementation details.

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.

3 participants