You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add run_with_libfunc_profile + AotWithProgram variant for ContractExecutor
Exposes the libfunc-profiling primitives that downstream consumers (e.g.
the blockifier in starkware-libs/sequencer) currently maintain locally.
Profile collection is callback-driven so the per-call key (tx hash, etc.)
stays out of cairo-native.
- metadata::profiler::Profile is now pub (was a private type alias).
- AotContractExecutor::run_with_libfunc_profile<H, F> (gated on
with-libfunc-profiling, in new file src/executor/libfunc_profile.rs)
wraps run: allocates a unique trace ID, points the executor's
cairo_native__profiler__profile_id symbol at it, drains the resulting
Profile after run returns, and hands it to a caller-supplied
FnOnce(Profile). A ProfilerGuard restores the previous trace ID and
drops the LIBFUNC_PROFILE slot on both the success and unwind paths.
- ContractExecutor::AotWithProgram(AotWithProgram { executor, program })
is a new variant that bundles an AOT executor with the Sierra program
it was built from. From<AotWithProgram> is provided.
- ContractExecutor::run dispatches the new variant via
run_with_libfunc_profile with a no-op profile callback.
- ContractExecutor::run_with_profile<H, F> is the profile-capturing
counterpart of run; for non-AotWithProgram variants it falls through
to run (callback never fires).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments