Skip to content

Conversation

@Snezhkko
Copy link

Previous implementation of get_instruction_encoding computed the immediate address using a modulo by the Cairo prime via BigUint, and accepted the program prime as a string parameter. In the relocated trace we work with plain usize indices into a contiguous memory vector, so (pc + 1) % prime is both unnecessary and misleading: the field modulus does not apply to memory indices. It also added avoidable allocations and parsing work per instruction and risked panics. The function now uses straightforward bounds-checked indexing (pc and pc + 1) and no longer depends on prime or BigUint, while the call site in
TracerData::new was updated accordingly.

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.

1 participant