Repository navigation
Support for SHA512 and SHA384 syscalls - #260
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds profiler support for the Cairo Sha512ProcessBlock syscall (and validates SHA-384 behavior via its SHA-512 syscall usage), aligning the profiler with newer Cairo/Sierra changes.
Changes:
- Recognize
Sha512ProcessBlockas a syscall in trace parsing and syscall-selector mapping. - Add
Sha512ProcessBlockcost data to versioned constants (resource file + test fixtures). - Add an e2e test suite + Cairo test contract + synthetic traces to validate syscall usage/steps/sierra-gas reporting for SHA-512 (and SHA-384 via SHA-512).
Reviewed changes
Copilot reviewed 16 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/cairo-profiler/src/trace_reader/function_trace_builder.rs | Treat Sha512ProcessBlock as a syscall during function-level profiling collection. |
| crates/cairo-profiler/src/trace_reader/function_trace_builder/stack_trace.rs | Map Sha512ProcessBlock libfunc to the corresponding syscall selector. |
| crates/cairo-profiler/resources/versioned_constants_0_14_1.json | Add step/builtin costs for Sha512ProcessBlock. |
| crates/cairo-profiler/tests/e2e.rs | Add e2e coverage for viewing SHA-512 syscall usage/steps/sierra-gas and SHA-384 emitting SHA-512 syscall usage. |
| crates/cairo-profiler/tests/data/test_versioned_constants.json | Add Sha512ProcessBlock entry to the test constants fixture. |
| crates/cairo-profiler/tests/data/missing_syscall_versioned_constants.json | Add Sha512ProcessBlock entry to the “missing syscall” fixture (still missing CallContract). |
| crates/cairo-profiler/tests/contracts/sha_hashes/src/lib.cairo | Add a Starknet test contract exposing sha512_hash and sha384_hash. |
| crates/cairo-profiler/tests/contracts/sha_hashes/tests/test_contract.cairo | Add snforge test invoking sha512_hash. |
| crates/cairo-profiler/tests/contracts/sha_hashes/Scarb.toml | Add Scarb project definition for the test contract. |
| crates/cairo-profiler/tests/contracts/sha_hashes/Scarb.lock | Add lockfile for the test contract dependencies. |
| crates/cairo-profiler/tests/contracts/sha_hashes/precompiled/trace_sha_hashes.json | Add synthetic trace exercising Sha512ProcessBlock via syscall_counter. |
| crates/cairo-profiler/tests/contracts/sha_hashes/precompiled/trace_sha_hashes_multi_call.json | Add synthetic trace validating call-count scaling for Sha512ProcessBlock. |
| crates/cairo-profiler/tests/contracts/sha_hashes/precompiled/trace_sha_hashes_sierra_gas.json | Add synthetic trace validating sierra-gas reporting with gas tracking fields. |
| crates/cairo-profiler/tests/contracts/sha_hashes/precompiled/trace_sha384.json | Add synthetic trace validating SHA-384 emits Sha512ProcessBlock syscall usage. |
| crates/cairo-profiler/tests/contracts/sha_hashes/precompiled/sha_hashes_integrationtest_ShaHashes.test.contract_class.json | Add compiled Sierra artifact used as reference/fixture. |
| crates/cairo-profiler/tests/contracts/sha_hashes/precompiled/README.md | Document how the synthetic traces and precompiled artifacts were created and how to regenerate. |
| Cargo.toml | Bump Cairo-related workspace deps to versions that include SHA-512 syscall changes. |
| Cargo.lock | Lockfile updates corresponding to dependency bumps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
piotmag769
reviewed
Jul 3, 2026
Arcticae
approved these changes
Jul 3, 2026
piotmag769
reviewed
Jul 14, 2026
piotmag769
force-pushed
the
support-for-sha-512-384-syscalls
branch
4 times, most recently
from
July 14, 2026 14:09
a5a1437 to
98e8ba0
Compare
piotmag769
enabled auto-merge
July 14, 2026 14:10
piotmag769
force-pushed
the
support-for-sha-512-384-syscalls
branch
from
July 14, 2026 14:28
98e8ba0 to
b35f618
Compare
piotmag769
enabled auto-merge
July 14, 2026 14:29
piotmag769
disabled auto-merge
July 14, 2026 14:31
piotmag769
force-pushed
the
support-for-sha-512-384-syscalls
branch
from
July 14, 2026 14:47
b35f618 to
bc19a2b
Compare
piotmag769
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #255
Introduced changes
Checklist
CHANGELOG.md