Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add alternative hint code for hint on _block_permutation used by 0.10.3 whitelist #958

Merged
merged 10 commits into from
Apr 14, 2023

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Apr 11, 2023

The method _block_permutation (in common/cairo_keccak/keccak) has the following string:

        from starkware.cairo.common.keccak_utils.keccak_utils import keccak_func
        _keccak_state_size_felts = int(ids.KECCAK_STATE_SIZE_FELTS)
        assert 0 <= _keccak_state_size_felts < 100

        output_values = keccak_func(memory.get_range(
            ids.keccak_ptr - _keccak_state_size_felts, _keccak_state_size_felts))
        segments.write_arg(ids.keccak_ptr, output_values)

While the 0.10.3.json whitelist contains the same hint with the first line changed to:
from starkware.cairo.common.cairo_keccak.keccak_utils import keccak_func

Both hints behave the same, as common/cairo_keccak/keccak_utils just imports everything from common/keccak_utils/keccak_utils

So now both code strings lead to the same hint function

@fmoletta fmoletta changed the title Add alternative string for hint on _block_permutation used by 10.3 whitelist Add alternative string for hint on _block_permutation used by 0.10.3 whitelist Apr 11, 2023
@fmoletta fmoletta changed the title Add alternative string for hint on _block_permutation used by 0.10.3 whitelist Add alternative hint code for hint on _block_permutation used by 0.10.3 whitelist Apr 11, 2023
@fmoletta fmoletta added the whitelisted-hint Implementation of hint on whitelist directory label Apr 11, 2023
@fmoletta fmoletta marked this pull request as ready for review April 11, 2023 15:51
@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #958 (1ec07a3) into main (1a188e7) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #958   +/-   ##
=======================================
  Coverage   97.75%   97.75%           
=======================================
  Files          75       75           
  Lines       30970    30970           
=======================================
  Hits        30274    30274           
  Misses        696      696           
Impacted Files Coverage Δ
...int_processor/builtin_hint_processor_definition.rs 98.69% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@fmoletta fmoletta changed the title Add alternative hint code for hint on _block_permutation used by 0.10.3 whitelist feat: Add alternative hint code for hint on _block_permutation used by 0.10.3 whitelist Apr 13, 2023
@Oppen Oppen added this pull request to the merge queue Apr 13, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 14, 2023
tests/cairo_run_test.rs Outdated Show resolved Hide resolved
@fmoletta fmoletta enabled auto-merge April 14, 2023 15:35
@fmoletta fmoletta disabled auto-merge April 14, 2023 15:36
@fmoletta fmoletta enabled auto-merge April 14, 2023 15:36
@fmoletta fmoletta disabled auto-merge April 14, 2023 15:37
@Oppen Oppen added this pull request to the merge queue Apr 14, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Apr 14, 2023
@fmoletta fmoletta enabled auto-merge April 14, 2023 17:49
@fmoletta fmoletta added this pull request to the merge queue Apr 14, 2023
Merged via the queue into main with commit b84acae Apr 14, 2023
@fmoletta fmoletta deleted the block_permutation_hint branch April 14, 2023 18:36
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
… by 0.10.3 whitelist (lambdaclass#958)

* Add alternative hint string

* Fix whitelist name

* Add integration test

* Add changelog entry

* Remove old file

* Fix broken tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whitelisted-hint Implementation of hint on whitelist directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants