Skip to content

feat(starknet_committer_and_os_cli): add command to dump the OS compiled program to file#5876

Merged
dorimedini-starkware merged 3 commits into
main-v0.14.0from
04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file
May 28, 2025
Merged

feat(starknet_committer_and_os_cli): add command to dump the OS compiled program to file#5876
dorimedini-starkware merged 3 commits into
main-v0.14.0from
04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file

Conversation

@dorimedini-starkware
Copy link
Copy Markdown
Collaborator

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2025

Artifacts upload workflows:

@dorimedini-starkware dorimedini-starkware self-assigned this Apr 15, 2025
@dorimedini-starkware dorimedini-starkware marked this pull request as ready for review April 15, 2025 14:16
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from 47f7df8 to b2bea45 Compare April 15, 2025 14:31
@dorimedini-starkware dorimedini-starkware force-pushed the 04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file branch from 83d6363 to 1dbb071 Compare April 15, 2025 14:31
@dorimedini-starkware dorimedini-starkware marked this pull request as draft April 15, 2025 14:32
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from b2bea45 to 1c55dd5 Compare April 15, 2025 14:55
@dorimedini-starkware dorimedini-starkware force-pushed the 04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file branch from 1dbb071 to d9d9e5f Compare April 15, 2025 14:56
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from 1c55dd5 to c438e17 Compare April 15, 2025 15:09
@dorimedini-starkware dorimedini-starkware force-pushed the 04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file branch from d9d9e5f to 8688f92 Compare April 15, 2025 15:09
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from c438e17 to c57c217 Compare April 15, 2025 15:49
@dorimedini-starkware dorimedini-starkware force-pushed the 04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file branch from 8688f92 to 4061106 Compare April 15, 2025 15:49
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from c57c217 to a939bdc Compare April 15, 2025 16:15
@dorimedini-starkware dorimedini-starkware force-pushed the 04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file branch from 4061106 to 97825d7 Compare April 15, 2025 16:15
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from a939bdc to 4ed33f4 Compare April 15, 2025 16:32
@dorimedini-starkware dorimedini-starkware force-pushed the 04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file branch from 97825d7 to 2e6df53 Compare April 15, 2025 16:32
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from 4ed33f4 to 68b8a50 Compare April 16, 2025 07:31
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from d1268a9 to 831f539 Compare April 17, 2025 10:04
@dorimedini-starkware dorimedini-starkware force-pushed the 04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file branch from bd3f4a9 to 1e184ad Compare April 17, 2025 10:04
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from 831f539 to cc133cb Compare April 17, 2025 10:13
@dorimedini-starkware dorimedini-starkware force-pushed the 04-14-feat_starknet_committer_and_os_cli_add_command_to_dump_the_os_compiled_program_to_file branch 4 times, most recently from 3b066c9 to 8f7eba9 Compare April 17, 2025 10:47
@dorimedini-starkware dorimedini-starkware force-pushed the 04-13-feat_apollo_starknet_os_program_add_fixer_for_program_hash_test branch from cc133cb to 43ee0d5 Compare April 17, 2025 13:52
Copy link
Copy Markdown
Collaborator Author

@dorimedini-starkware dorimedini-starkware 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 7 files reviewed, all discussions resolved (waiting on @nimrod-starkware and @TzahiTaub)


.github/workflows/committer_ci.yml line 0 at r3 (raw file):
the CLI (used by the committer CI) now depends on the program crate, which requires a python venv to build; hence these changes, copied from other workflows.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2025

Benchmark movements: tree_computation_flow performance improved 😺 tree_computation_flow time: [34.606 ms 34.734 ms 34.906 ms] change: [-4.2981% -2.7216% -1.2970%] (p = 0.00 < 0.05) Performance has improved. Found 9 outliers among 100 measurements (9.00%) 1 (1.00%) high mild 8 (8.00%) high severe

Copy link
Copy Markdown
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 7 files at r4, 2 of 6 files at r5, 4 of 4 files at r7, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @amosStarkware and @nimrod-starkware)


.github/workflows/committer_and_os_cli_push.yml line 82 at r7 (raw file):

      - name: Build CLI binary
        run: ./build_native_in_docker.sh rustup toolchain install && cargo build -p starknet_committer_and_os_cli -r --bin starknet_committer_and_os_cli --target-dir CLI_TARGET

Is this included in the install_builld_tools script?

Code quote:

rustup toolchain install

crates/starknet_committer_and_os_cli/src/os_cli/run_os_cli.rs line 48 at r7 (raw file):

        #[clap(long, short = 'o', default_value = "stdout")]
        output_path: String,
    },

Looks like it needs to follow the same structure as the above (if this is changed in a future PR it's OK).

Code quote:

    DumpProgramHash {
        /// File path to output.
        #[clap(long, short = 'o', default_value = "stdout")]
        output_path: String,
    },

crates/starknet_committer_and_os_cli/src/os_cli/commands.rs line 115 at r7 (raw file):

    };
    // Dumping the `Program` struct won't work - it is not deserializable via cairo-lang's Program
    // class. JSONify the raw bytes instead.

The first Program is the starknet_api struct (for Cairo 0)? Isn't this struct and the Python class compatible?

Code quote:

    // Dumping the `Program` struct won't work - it is not deserializable via cairo-lang's Program
    // class. JSONify the raw bytes instead.

Copy link
Copy Markdown
Collaborator Author

@dorimedini-starkware dorimedini-starkware 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: all files reviewed, 3 unresolved discussions (waiting on @amosStarkware, @nimrod-starkware, and @TzahiTaub)


.github/workflows/committer_and_os_cli_push.yml line 82 at r7 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

Is this included in the install_builld_tools script?

in the bootstrap script


crates/starknet_committer_and_os_cli/src/os_cli/commands.rs line 115 at r7 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

The first Program is the starknet_api struct (for Cairo 0)? Isn't this struct and the Python class compatible?

it's the VM struct, and no, it is not.
python->VM works, not the other way around


crates/starknet_committer_and_os_cli/src/os_cli/run_os_cli.rs line 48 at r7 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

Looks like it needs to follow the same structure as the above (if this is changed in a future PR it's OK).

WDYM? what is missing?
we don't need a program param when dumping the program hash; we get the entire dict (OS + aggregator)

Copy link
Copy Markdown
Contributor

@TzahiTaub TzahiTaub 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: all files reviewed, 3 unresolved discussions (waiting on @amosStarkware, @dorimedini-starkware, and @nimrod-starkware)


crates/starknet_committer_and_os_cli/src/os_cli/run_os_cli.rs line 48 at r7 (raw file):

Previously, dorimedini-starkware wrote…

WDYM? what is missing?
we don't need a program param when dumping the program hash; we get the entire dict (OS + aggregator)

OK, switch to DumpProgramHashes instead. The two commands look equivalent, but the hashes are actually all programs' hashes in one file, and the "program" is for a specific program.


crates/starknet_committer_and_os_cli/src/os_cli/commands.rs line 116 at r7 (raw file):

    // Dumping the `Program` struct won't work - it is not deserializable via cairo-lang's Program
    // class. JSONify the raw bytes instead.
    let os_program_json = serde_json::from_slice::<serde_json::Value>(bytes)

As this can be "any" program

Suggestion:

program_json

Signed-off-by: Dori Medini <dori@starkware.co>
Copy link
Copy Markdown
Collaborator Author

@dorimedini-starkware dorimedini-starkware 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: all files reviewed, 2 unresolved discussions (waiting on @amosStarkware, @nimrod-starkware, and @TzahiTaub)


crates/starknet_committer_and_os_cli/src/os_cli/commands.rs line 116 at r7 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

As this can be "any" program

Done.

Copy link
Copy Markdown
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r8, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware and @nimrod-starkware)

Copy link
Copy Markdown
Collaborator Author

@dorimedini-starkware dorimedini-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 2 of 2 files at r8, 3 of 3 files at r9, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware and @nimrod-starkware)

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.

3 participants