Skip to content

Added e2e tests of blake improvement.#9780

Merged
orizi merged 1 commit intomainfrom
orizi/03-24-added_e2e_tests_of_blake_improvement
Mar 29, 2026
Merged

Added e2e tests of blake improvement.#9780
orizi merged 1 commit intomainfrom
orizi/03-24-added_e2e_tests_of_blake_improvement

Conversation

@orizi
Copy link
Copy Markdown
Collaborator

@orizi orizi commented Mar 24, 2026

Summary

Enhanced Blake2s hash tests with new utility functions and comprehensive test coverage. Added blake2s_finalize_guarantees import, converted test assertions to use u256 format instead of raw arrays, and introduced a new test for the guarantees-based Blake2s function with proper message construction utilities.


Type of change

Please check one:

  • Bug fix (fixes incorrect behavior)
  • New feature
  • Performance improvement
  • Documentation change with concrete technical impact
  • Style, wording, formatting, or typo-only change

Why is this change needed?

The existing Blake2s tests were using raw array comparisons and lacked coverage for the guarantees-based Blake2s functions. This change provides better test coverage and more readable assertions by converting hash outputs to u256 format, while also adding comprehensive tests for the blake2s_finalize_guarantees function.


What was the behavior or documentation before?

Tests compared Blake2s hash outputs as raw u32 arrays and only tested the basic blake2s_compress and blake2s_finalize functions. There was no test coverage for blake2s_finalize_guarantees or utility functions for message construction.


What is the behavior or documentation after?

Tests now compare hash outputs as u256 values for better readability, include comprehensive testing of blake2s_finalize_guarantees with proper message construction from felt252 values, and provide utility functions for converting between different data formats used in Blake2s operations.


Related issue or discussion (if any)

N/A


Additional context

The changes include a new to_u256 conversion function and a msg module with utilities for constructing Blake2s input messages from felt252 values using bounded integer guarantees. The test data also includes new end-to-end test cases for hashing two felt252 values, demonstrating practical usage patterns.


Note

Low Risk
Low risk because changes are limited to test code and e2e fixtures, with no production hashing implementation modified. Main risk is test brittleness due to new u256 formatting and bounded-int guarantee message construction.

Overview
Updates Blake2s unit tests to assert outputs as a single u256 value (via a new to_u256 helper) instead of raw [u32; 8] arrays.

Adds new coverage for blake2s_finalize_guarantees, including utilities to build Blake2sInputGuarantee messages from two felt252 values using bounded-int guarantees, and extends the Blake e2e fixture to exercise hashing two felt252s with the guarantees-based finalize path (future Sierra enabled).

Written by Cursor Bugbot for commit bef1691. This will update automatically on new commits. Configure here.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Collaborator Author

orizi commented Mar 24, 2026

@orizi orizi marked this pull request as ready for review March 24, 2026 10:48
@orizi orizi force-pushed the orizi/03-24-added_e2e_tests_of_blake_improvement branch from 6f0d23a to b93a6e6 Compare March 24, 2026 11:03
@orizi orizi force-pushed the orizi/03-22-feature_sierra_added_guarantee_version_for_blake_libfuncs branch from 06c0ab5 to 42bdb46 Compare March 24, 2026 11:03
Copy link
Copy Markdown
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@ilyalesokhin-starkware reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on orizi).

@orizi orizi force-pushed the orizi/03-24-added_e2e_tests_of_blake_improvement branch from b93a6e6 to 6dbcad5 Compare March 26, 2026 15:34
@orizi orizi force-pushed the orizi/03-22-feature_sierra_added_guarantee_version_for_blake_libfuncs branch from 42bdb46 to d9dd45d Compare March 26, 2026 15:34
@orizi orizi force-pushed the orizi/03-24-added_e2e_tests_of_blake_improvement branch from 6dbcad5 to d334a22 Compare March 27, 2026 09:59
@orizi orizi force-pushed the orizi/03-22-feature_sierra_added_guarantee_version_for_blake_libfuncs branch from d9dd45d to 553fc47 Compare March 27, 2026 09:59
@orizi orizi changed the base branch from orizi/03-22-feature_sierra_added_guarantee_version_for_blake_libfuncs to graphite-base/9780 March 29, 2026 07:55
@orizi orizi force-pushed the orizi/03-24-added_e2e_tests_of_blake_improvement branch from d334a22 to bef1691 Compare March 29, 2026 08:06
@orizi orizi force-pushed the graphite-base/9780 branch from 553fc47 to 80f06cd Compare March 29, 2026 08:06
@orizi orizi changed the base branch from graphite-base/9780 to main March 29, 2026 08:06
Copy link
Copy Markdown
Collaborator Author

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orizi reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on orizi).

@orizi orizi added this pull request to the merge queue Mar 29, 2026
Merged via the queue into main with commit b5c6d86 Mar 29, 2026
105 checks passed
@orizi orizi deleted the orizi/03-24-added_e2e_tests_of_blake_improvement branch March 29, 2026 08:24
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.

3 participants