Skip to content

Migrate Execute callers to Simulate/Trace/BuildBlock#3598

Closed
RafaelGranza wants to merge 1 commit into
granza/hide-boolean-flags-on-cairo-vm-executefrom
granza/migrate-vm-execute-calls
Closed

Migrate Execute callers to Simulate/Trace/BuildBlock#3598
RafaelGranza wants to merge 1 commit into
granza/hide-boolean-flags-on-cairo-vm-executefrom
granza/migrate-vm-execute-calls

Conversation

@RafaelGranza
Copy link
Copy Markdown
Contributor

@RafaelGranza RafaelGranza commented May 3, 2026

Part 2 of 4 in the vm.Execute refactor. See #3595 for motivation and roadmap.

This PR is purely call-site migration, it switches all callers from the positional-boolean Execute to the typed methods introduced in PR 1.
The Execute method itself is unchanged and remains in the interface.

Changes

Production (8 sites):

  • rpc/v{8,9,10}/trace.goTrace(opts vm.TraceOptions)
  • rpc/v{8,9,10}/simulation.goSimulate(opts vm.SimulateOptions)
  • builder/executor.go and genesis/genesis.goBuildBlock(opts vm.BuildBlockOptions)

Tests (~38 mock setups):

  • EXPECT().Execute(...)EXPECT().{Trace,Simulate,BuildBlock}(...) across
    rpc/v{8,9,10}/{trace,simulation,estimate_fee}_test.go

Drive-by: in rpc/v{9,10}/trace.go, the local parameter named vm was renamed to runner; the identifier vm was needed for the package qualifier (vm.TraceOptions{}).

Out of scope

  • No changes to vm/vm.go, node/throttled_vm.go, mocks, Rust, or the FFI header.
  • PR 3 will split cairo_vm_execute into three dedicated Rust entry points.
  • PR 4 removes Execute from the interface and the corresponding Rust function.

@RafaelGranza RafaelGranza added Refactor go Pull requests that update Go code labels May 3, 2026
@RafaelGranza RafaelGranza self-assigned this May 3, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.88%. Comparing base (d66be79) to head (d150af3).

Additional details and impacted files
@@                                Coverage Diff                                @@
##           granza/hide-boolean-flags-on-cairo-vm-execute    #3598      +/-   ##
=================================================================================
- Coverage                                          75.92%   75.88%   -0.04%     
=================================================================================
  Files                                                381      381              
  Lines                                              34256    34234      -22     
=================================================================================
- Hits                                               26009    25980      -29     
+ Misses                                              6425     6423       -2     
- Partials                                            1822     1831       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RafaelGranza
Copy link
Copy Markdown
Contributor Author

Move the changes to here: #3602

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

Labels

go Pull requests that update Go code Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant