Skip to content

chore(blockifier_test_utils): extract logic into starknet_sierra_compile#5587

Merged
dorimedini-starkware merged 1 commit into
mainfrom
04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile
Apr 27, 2025
Merged

chore(blockifier_test_utils): extract logic into starknet_sierra_compile#5587
dorimedini-starkware merged 1 commit into
mainfrom
04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile

Conversation

@dorimedini-starkware

Copy link
Copy Markdown
Collaborator

No description provided.

dorimedini-starkware commented Apr 5, 2025

Copy link
Copy Markdown
Collaborator Author

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@dorimedini-starkware dorimedini-starkware self-assigned this Apr 5, 2025
@dorimedini-starkware dorimedini-starkware marked this pull request as ready for review April 5, 2025 12:20
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from d4f41c9 to fedbe71 Compare April 5, 2025 12:28
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch 2 times, most recently from cbca1cd to 342b7ed Compare April 5, 2025 12:44
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from fedbe71 to 2e664ed Compare April 5, 2025 19:45
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from 342b7ed to 03fe325 Compare April 5, 2025 19:45
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from 2e664ed to 888fe21 Compare April 7, 2025 07:39
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from 03fe325 to 96667ec Compare April 7, 2025 07:39
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from 888fe21 to f786982 Compare April 7, 2025 07:57
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from 96667ec to a60a9c9 Compare April 7, 2025 07:57

@giladchase giladchase left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @elintul and @noaov1)


crates/blockifier_test_utils/src/cairo_compile.rs line 191 at r1 (raw file):

    sierra_compile_command.args([
        "starknet-sierra-compile",
        path.as_str(),

nit
(also for consistency with sn_compile above)

Suggestion:

    &path,

@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from f786982 to ff113b5 Compare April 7, 2025 09:16
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from a60a9c9 to fb5bcb3 Compare April 7, 2025 09:16

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @elintul, @giladchase, and @noaov1)


crates/blockifier_test_utils/src/cairo_compile.rs line 191 at r1 (raw file):

Previously, giladchase wrote…

nit
(also for consistency with sn_compile above)

lol done

@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from ff113b5 to 977afe9 Compare April 9, 2025 11:56
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from fb5bcb3 to 1529e24 Compare April 9, 2025 11:56
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from 977afe9 to 53e06d5 Compare April 9, 2025 11:59
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from 1529e24 to 2139eee Compare April 9, 2025 11:59
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from 53e06d5 to f5e51e5 Compare April 9, 2025 14:47
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from 2139eee to 6a283e6 Compare April 9, 2025 14:47
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from f5e51e5 to 79486d3 Compare April 9, 2025 14:55
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from 6a283e6 to daedaaf Compare April 9, 2025 14:55
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from 79486d3 to 0475b9f Compare April 12, 2025 13:03
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from daedaaf to 7cdec1d Compare April 12, 2025 13:03

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @elintul and @noaov1)

@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from 0475b9f to 4e0bd9b Compare April 18, 2025 10:22
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from 7cdec1d to ca70f6a Compare April 18, 2025 10:22
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from 4e0bd9b to cb5749f Compare April 18, 2025 10:25
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from ca70f6a to 15e617a Compare April 18, 2025 10:25
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package branch from cb5749f to 33ff587 Compare April 26, 2025 15:18
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch 2 times, most recently from 61ac940 to f5d805b Compare April 27, 2025 10:30
@dorimedini-starkware dorimedini-starkware changed the base branch from 04-05-chore_blockifier_test_utils_implement_verify_cairo1_package to main April 27, 2025 10:30
@github-actions

Copy link
Copy Markdown

Artifacts upload workflows:

@github-actions

Copy link
Copy Markdown

Benchmark movements:
full_committer_flow performance improved 😺
full_committer_flow time: [30.267 ms 30.316 ms 30.368 ms]
change: [-1.6937% -1.3503% -1.0354%] (p = 0.00 < 0.05)
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe

@TzahiTaub TzahiTaub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @elintul and @noaov1)


crates/blockifier_test_utils/src/cairo_compile.rs line 148 at r3 (raw file):

        format!("--manifest-path={}/Cargo.toml", cairo1_compiler_path.to_string_lossy()),
        "--bin".into(),
    ]);

Suggestion:

    verify_cairo1_compiler_deps(git_tag_override);

    let cairo1_compiler_path = local_cairo1_compiler_repo_path();
    

    // Command args common to both compilation phases.
    let mut base_compile_args = vec![
        "run".into(),
        format!("--manifest-path={}/Cargo.toml", cairo1_compiler_path.to_string_lossy()),
        "--bin".into(),
    ]);

crates/blockifier_test_utils/src/cairo_compile.rs line 169 at r3 (raw file):

}

/// Compile Cairo1 Contract into their Sierra version using the compiler version set in the

Suggestion:

// Compiles

crates/blockifier_test_utils/src/cairo_compile.rs line 171 at r3 (raw file):

/// Compile Cairo1 Contract into their Sierra version using the compiler version set in the
/// Cargo.toml
pub fn starknet_compile(path: String, base_compile_args: &mut [String]) -> Vec<u8> {

Why is this mutable?

Code quote:

base_compile_args: &mut [String]

crates/blockifier_test_utils/src/cairo_compile.rs line 188 at r3 (raw file):

}

/// Compile Sierra code into CASM.

Suggestion:

/// Compiles 

crates/blockifier_test_utils/src/cairo_compile.rs line 189 at r3 (raw file):

/// Compile Sierra code into CASM.
fn starknet_sierra_compile(path: String, base_compile_args: &mut Vec<String>) -> Vec<u8> {

Why is this mutable (and why isn't it the same type as in starknet_compile)?

Code quote:

 base_compile_args: &mut Vec<String>

@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from f5d805b to 8815395 Compare April 27, 2025 14:34
@dorimedini-starkware dorimedini-starkware force-pushed the 04-05-chore_blockifier_test_utils_extract_logic_into_starknet_sierra_compile branch from 8815395 to 08e5606 Compare April 27, 2025 14:36

@TzahiTaub TzahiTaub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @elintul and @noaov1)

@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue Apr 27, 2025
Merged via the queue into main with commit 9541737 Apr 27, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants