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

Added suuport for some bounded_int guarantee verifications. #5870

Open
wants to merge 5 commits into
base: dev-v2.7.0
Choose a base branch
from

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Jun 24, 2024

@ilyalesokhin-starkware
Copy link
Contributor

-- commits line 2 at r1:

Suggestion:

support

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-starknet-classes/src/allowed_libfuncs_lists/all.json line 24 at r1 (raw file):

        "bounded_int_constrain",
        "bounded_int_div_rem",
        "bounded_int_felt252_constrain",

next PR?

Code quote:

    "bounded_int_felt252_constrain",

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-sierra-to-casm/src/invocations/int/bounded.rs line 273 at r1 (raw file):

    };
    let auxiliary_vars: [_; 5] = std::array::from_fn(|_| casm_builder.alloc_var(false));
    validate_under_limit::<2>(

what happens to the done label that is defined here?

Code quote:

 validate_under_limi

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-sierra/src/extensions/modules/bounded_int.rs line 525 at r1 (raw file):

}

/// Libfunc for wrapping a given bounded int with a guarantee.

fix comment.

Code quote:

/// Libfunc for wrapping a given bounded int with a guarantee.

Copy link
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.

Reviewed 5 of 7 files at r1, all commit messages.
Reviewable status: 5 of 7 files reviewed, 3 unresolved discussions (waiting on @orizi)

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-sierra/src/extensions/modules/bounded_int.rs line 543 at r1 (raw file):

        // Ranges that aren't this large there are much more efficient algorithms.
        require((&prime - range.size()) < (&prime % u128::MAX))
            .ok_or(SpecializationError::UnsupportedGenericArg)?;

Suggestion:

        require(range.size() > &prime - (&prime % u128::MAX))
            .ok_or(SpecializationError::UnsupportedGenericArg)?;

@orizi orizi changed the base branch from pr/orizi/guarantee/9653e0a0 to dev-v2.7.0 July 16, 2024 07:20
@orizi orizi force-pushed the pr/orizi/guarantee/0f6b65a8 branch from ccaadb0 to 727ea46 Compare July 16, 2024 07:20
@orizi orizi force-pushed the pr/orizi/guarantee/0f6b65a8 branch from 727ea46 to 9357138 Compare July 16, 2024 07:30
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.

2 participants