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

Checking if any syscall libfuncs are used. #7189

Merged

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Jan 30, 2025

Having the problematic libfunc in the message.

@reviewable-StarkWare
Copy link

This change is Reviewable

@orizi orizi force-pushed the orizi/better-and-avoidable--syscall-err branch from 2cb4eb4 to 01586cf Compare January 30, 2025 13:16
@orizi orizi force-pushed the orizi/better-and-avoidable--syscall-err branch from 01586cf to da6c578 Compare February 1, 2025 16:53
@ilyalesokhin-starkware
Copy link
Contributor

crates/bin/cairo-execute/src/main.rs line 68 at r1 (raw file):

    ignore_warnings: bool,
    /// Allow syscalls in the program.
    #[arg(long, conflicts_with = "prebuilt")]

why does this conflict?

Code quote:

conflicts_with = "prebuilt")]

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-executable/src/compile.rs line 179 at r1 (raw file):

            }
        }
    }

isn't it better to check for usage of the system ptr?

Code quote:

    if !config.allow_syscalls {
        for libfunc in &sierra_program.libfunc_declarations {
            if libfunc.long_id.generic_id.0.ends_with("_syscall") {
                anyhow::bail!(
                    "The function is using libfunc `{}`. Syscalls are not supported in \
                     `#[executable]`.",
                    libfunc.long_id.generic_id
                );
            }
        }
    }

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 all commit messages.
Reviewable status: 0 of 5 files reviewed, 3 unresolved discussions (waiting on @ArielElp and @orizi)


crates/cairo-lang-executable/src/compile.rs line 57 at r1 (raw file):

    /// If true, will allow syscalls in the program.
    ///
    /// In general, syscalls are not allowed in executables, as they are currently not checked.

Suggestion:

verified

Having the problematic libfunc in the message.
Copy link
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.

Reviewable status: 0 of 5 files reviewed, 3 unresolved discussions (waiting on @ArielElp and @ilyalesokhin-starkware)


crates/cairo-lang-executable/src/compile.rs line 179 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

isn't it better to check for usage of the system ptr?

it seems it is give a clearer cause to the use of what caused them to use the System ptr.


crates/cairo-lang-executable/src/compile.rs line 57 at r1 (raw file):

    /// If true, will allow syscalls in the program.
    ///
    /// In general, syscalls are not allowed in executables, as they are currently not checked.

Done.

@orizi orizi force-pushed the orizi/better-and-avoidable--syscall-err branch from da6c578 to 3cc10e4 Compare February 2, 2025 07:56
Copy link
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.

Reviewable status: 0 of 5 files reviewed, 3 unresolved discussions (waiting on @ArielElp and @ilyalesokhin-starkware)


crates/bin/cairo-execute/src/main.rs line 68 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

why does this conflict?

because it was already built - you can't even check this.

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.

:lgtm:

Reviewed 4 of 5 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp)

@ilyalesokhin-starkware ilyalesokhin-starkware added this pull request to the merge queue Feb 3, 2025
Merged via the queue into main with commit 6f2d497 Feb 3, 2025
48 checks passed
@orizi orizi deleted the orizi/better-and-avoidable--syscall-err branch February 3, 2025 09:34
github-merge-queue bot pushed a commit to software-mansion/scarb that referenced this pull request Feb 3, 2025
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