Commit eec22ef
extract shared cairo-starknet-syscalls crate
Both cairo-native and sierra-emu now re-export the StarknetSyscallHandler
trait and supporting types (U256, Block/Tx/Execution Info v{1,2,3},
ResourceBounds, Secp256{k1,r1}Point) from the new
`cairo-starknet-syscalls` crate. The crate is workspace-local at the
top level (sibling to `test_utils/`).
The two crates' types are now nominally identical, so a single handler
impl can drive both runtimes without an adapter / bridge.
Notes:
- `cairo-starknet-syscalls` rather than `cairo-native-syscalls`: the
crate's content doesn't depend on cairo-native semantically; the
cairo-native prefix would imply ownership it doesn't have.
- StubSyscallHandler's `unimplemented!()` stubs now carry a one-line
rationale each (deploy needs constructor execution, call_contract
needs address-to-class resolution, send_message_to_l1 needs an L1
queue, etc.), plus a scope doc-comment on the type itself.
- sierra-emu's previous inherent into_value/from_value methods (which
depend on sierra-emu's `Value` enum and can't follow the moved types)
become free functions in the new sub-module
`sierra_emu::starknet::value_conv`, each with a doc comment.
- `cheatcode` trait method's default impl returns an error felt instead
of panicking with unimplemented!(). On the sierra-emu path, a contract
invoking the cheatcode libfunc against a handler that didn't override
it would otherwise unwind through the VM and abort the host;
production handlers (e.g. blockifier's NativeSyscallHandler) don't
implement cheatcode, so the default is what runs.
- The per-type files under debug_utils/sierra-emu/src/starknet/* are
deleted now that the struct definitions live in the shared crate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b757ad4 commit eec22ef
21 files changed
Lines changed: 708 additions & 934 deletions
File tree
- cairo-starknet-syscalls
- src
- debug_utils/sierra-emu
- src
- starknet
- vm
- src
- metadata
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments