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

test(sequencing): serialize compiled_contract_class to the central object #3115

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

Yael-Starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@Yael-Starkware Yael-Starkware marked this pull request as ready for review January 5, 2025 12:17
Copy link
Contributor

@DvirYo-starkware DvirYo-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 6 of 6 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dafnamatsry and @Yael-Starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects.rs line 295 at r1 (raw file):

// Converts the CasmContractClass into a format that serializes into the python object.
// TODO remove allow dead code once used

Add an explicit name to make sure it is not forgotten

Code quote:

// TODO remove allow dead code once used

crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects.rs line 298 at r1 (raw file):

#[allow(dead_code)]
pub fn casm_contract_class_central_format(
    compiled_class_hash: CasmContractClass,

Does this code mean that in the Rust version, the fields bytecode_segment_lengths and pythonic_hints can be None, but in the Python version, they must be some value? If so, please write this explicitly.

@Yael-Starkware Yael-Starkware force-pushed the yael/central_compiled_contract_class branch 2 times, most recently from c446ab0 to 5734542 Compare January 7, 2025 12:59
Copy link
Contributor Author

@Yael-Starkware Yael-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: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @dafnamatsry and @DvirYo-starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects.rs line 295 at r1 (raw file):

Previously, DvirYo-starkware wrote…

Add an explicit name to make sure it is not forgotten

done.


crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects.rs line 298 at r1 (raw file):

Previously, DvirYo-starkware wrote…

Does this code mean that in the Rust version, the fields bytecode_segment_lengths and pythonic_hints can be None, but in the Python version, they must be some value? If so, please write this explicitly.

Done.

Copy link
Contributor

@DvirYo-starkware DvirYo-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 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry)

@Yael-Starkware Yael-Starkware force-pushed the yael/central_sierra_contract_class branch from 440ed29 to 008e093 Compare January 8, 2025 13:13
@Yael-Starkware Yael-Starkware force-pushed the yael/central_compiled_contract_class branch from 5734542 to 996f2b9 Compare January 8, 2025 13:17
Copy link
Collaborator

@dafnamatsry dafnamatsry 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 4 files at r3, all commit messages.
Reviewable status: 4 of 6 files reviewed, 2 unresolved discussions (waiting on @DvirYo-starkware and @Yael-Starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects_test.rs line 65 at r3 (raw file):

pub const CENTRAL_SIERRA_CONTRACT_CLASS_JSON_PATH: &str = "central_sierra_contract_class.json";
pub const CENTRAL_CASM_CONTRACT_CLASS_JSON_PATH: &str = "central_contract_class.casm.json";
pub const CENTRAL_CASM_CONTRACT_CLASS_NO_OPTIONAL_JSON_PATH: &str =

What is the difference in the content of these files?

Code quote:

pub const CENTRAL_CASM_CONTRACT_CLASS_JSON_PATH: &str = "central_contract_class.casm.json";
pub const CENTRAL_CASM_CONTRACT_CLASS_NO_OPTIONAL_JSON_PATH: &str =

crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects.rs line 359 at r3 (raw file):

    CasmContractClass {
        // The rust object allows these fields to be none, while in python they are mandatory.
        bytecode_segment_lengths: Some(

What happens if we deserialize a JSON without those fields in Python?
would it fail? would it put default values?

Copy link
Contributor Author

@Yael-Starkware Yael-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: 4 of 6 files reviewed, 2 unresolved discussions (waiting on @dafnamatsry and @DvirYo-starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects.rs line 359 at r3 (raw file):

Previously, dafnamatsry wrote…

What happens if we deserialize a JSON without those fields in Python?
would it fail? would it put default values?

fail.


crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects_test.rs line 65 at r3 (raw file):

Previously, dafnamatsry wrote…

What is the difference in the content of these files?

the second json has an empty vector for pythonic_hints and bytecode_segment_lengths

@Yael-Starkware Yael-Starkware force-pushed the yael/central_compiled_contract_class branch from 996f2b9 to b92423b Compare January 8, 2025 15:39
Copy link
Collaborator

@dafnamatsry dafnamatsry 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 6 files at r1, 2 of 4 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yael-Starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects_test.rs line 65 at r3 (raw file):

Previously, Yael-Starkware (YaelD) wrote…

the second json has an empty vector for pythonic_hints and bytecode_segment_lengths

The name of the constant is misleading I think.
Maybe rename it to CENTRAL_CASM_CONTRACT_CLASS_DEFAULT_OPTIONALS_JSON_PATH

@Yael-Starkware Yael-Starkware force-pushed the yael/central_sierra_contract_class branch from 008e093 to f5dee18 Compare January 13, 2025 09:54
Copy link
Contributor Author

@Yael-Starkware Yael-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, 1 unresolved discussion (waiting on @dafnamatsry)


crates/sequencing/papyrus_consensus_orchestrator/src/cende/central_objects_test.rs line 65 at r3 (raw file):

Previously, dafnamatsry wrote…

The name of the constant is misleading I think.
Maybe rename it to CENTRAL_CASM_CONTRACT_CLASS_DEFAULT_OPTIONALS_JSON_PATH

Done.

@Yael-Starkware Yael-Starkware force-pushed the yael/central_compiled_contract_class branch from b92423b to 2c20298 Compare January 13, 2025 09:54
@Yael-Starkware Yael-Starkware force-pushed the yael/central_sierra_contract_class branch 2 times, most recently from 16a663a to 830923a Compare January 15, 2025 13:29
@Yael-Starkware Yael-Starkware force-pushed the yael/central_compiled_contract_class branch from 2c20298 to cafbd64 Compare January 15, 2025 14:39
@Yael-Starkware Yael-Starkware force-pushed the yael/central_compiled_contract_class branch from cafbd64 to 00a4cd9 Compare January 16, 2025 06:41
Copy link
Collaborator

@dafnamatsry dafnamatsry 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 6 of 6 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)

@Yael-Starkware Yael-Starkware changed the base branch from yael/central_sierra_contract_class to main January 16, 2025 14:16
@Yael-Starkware Yael-Starkware force-pushed the yael/central_compiled_contract_class branch from 00a4cd9 to c4d7077 Compare January 16, 2025 14:19
Copy link

Benchmark movements:
tree_computation_flow performance regressed!
tree_computation_flow time: [35.431 ms 35.672 ms 35.956 ms]
change: [+2.4200% +3.1770% +4.1361%] (p = 0.00 < 0.05)
Performance has regressed.
Found 13 outliers among 100 measurements (13.00%)
3 (3.00%) high mild
10 (10.00%) high severe

full_committer_flow performance regressed!
full_committer_flow time: [31.018 ms 31.090 ms 31.167 ms]
change: [+1.7455% +2.0000% +2.2980%] (p = 0.00 < 0.05)
Performance has regressed.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe

Copy link
Contributor

@DvirYo-starkware DvirYo-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:

Reviewable status: 4 of 6 files reviewed, all discussions resolved (waiting on @dafnamatsry)

Copy link
Contributor

@DvirYo-starkware DvirYo-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 4 of 6 files at r6, 2 of 2 files at r7, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)

@Yael-Starkware Yael-Starkware added this pull request to the merge queue Jan 16, 2025
Merged via the queue into main with commit 1e9cbaf Jan 16, 2025
19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 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