feature(sierra): Added cost-token for blake.#9506
Merged
Conversation
bacb6f4 to
154b923
Compare
Contributor
|
why in audited? is it for testing? Code quote: "blake2s_compress": { "major": 1, "minor": 8, "patch": 0 },
"blake2s_finalize": { "major": 1, "minor": 8, "patch": 0 }, |
ilyalesokhin-starkware
approved these changes
Jan 26, 2026
Contributor
ilyalesokhin-starkware
left a comment
There was a problem hiding this comment.
@ilyalesokhin-starkware reviewed 8 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @liorgold2).
SIERRA_UPDATE_PATCH_CHANGE_TAG=Only added function to starknet.
154b923 to
7955d84
Compare
orizi
commented
Jan 27, 2026
Collaborator
Author
orizi
left a comment
There was a problem hiding this comment.
@orizi reviewed 2 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @liorgold2).
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.

Summary
Added Blake hash function as a cost token type for gas calculations. This PR implements proper gas accounting for the Blake hash function by adding a new
Blakecost token type and updating the gas cost calculation for Blake operations.Type of change
Please check one:
Why is this change needed?
Previously, the Blake hash function was using a placeholder gas cost calculation without a dedicated cost token. This PR adds proper gas accounting for Blake operations by introducing a dedicated
Blakecost token type with an appropriate gas cost value (491), similar to how other builtin operations are handled.What was the behavior or documentation before?
Before this change, the Blake hash function had a TODO comment indicating that a Blake token needed to be added to the gas cost calculation. It was using a simple constant cost without accounting for the actual computational complexity of the operation.
What is the behavior or documentation after?
After this change, Blake hash operations properly account for gas using a dedicated
Blakecost token type with a gas cost of 491. This ensures that gas calculations accurately reflect the computational cost of using the Blake hash function, similar to other builtin operations like Pedersen, Poseidon, etc.Additional context
This change ensures consistent gas accounting across all cryptographic primitives in the system. The Blake hash function now has proper gas accounting like other builtins, which is important for accurate resource usage estimation.