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

Contract segmentation: Add bytecode_segment_lengths to CasmContractClass. #4515

Conversation

liorgold2
Copy link
Collaborator

@liorgold2 liorgold2 commented Dec 6, 2023

Stack:

⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.


This change is Reviewable

Copy link
Collaborator

@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.

Reviewed all commit messages.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @liorgold2)


crates/cairo-lang-starknet/src/contract_segmentation.rs line 16 at r1 (raw file):

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum NestedIntList {

why not a vec of vecs?


crates/cairo-lang-starknet/src/contract_segmentation.rs line 22 at r1 (raw file):

#[derive(Error, Debug, Eq, PartialEq)]

Suggestion:

}

#[derive(Error, Debug, Eq, PartialEq)]

Copy link
Collaborator Author

@liorgold2 liorgold2 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 3 files reviewed, 2 unresolved discussions (waiting on @orizi)


crates/cairo-lang-starknet/src/contract_segmentation.rs line 16 at r1 (raw file):

Previously, orizi wrote…

why not a vec of vecs?

The OS supports any tree. In particular, I want to do some optimizations later. E.g., if a function has one segment then it will be a leaf instead of a node with one child. Same for small functions (as there is a non-negligible overhead in the handling of segments in the OS, compared to computing Poseidon)

Copy link
Collaborator Author

@liorgold2 liorgold2 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 3 files reviewed, 2 unresolved discussions (waiting on @orizi)


crates/cairo-lang-starknet/src/contract_segmentation.rs line 22 at r1 (raw file):

#[derive(Error, Debug, Eq, PartialEq)]

Done.

@liorgold2 liorgold2 force-pushed the pr/liorgold2/lior/contract-segmentation/68464189 branch 3 times, most recently from c7a5942 to 9ae0ea3 Compare December 6, 2023 09:45
Copy link
Collaborator

@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 3 files reviewed, 2 unresolved discussions (waiting on @liorgold2)


crates/cairo-lang-starknet/src/contract_segmentation.rs line 16 at r1 (raw file):

Previously, liorgold2 wrote…

The OS supports any tree. In particular, I want to do some optimizations later. E.g., if a function has one segment then it will be a leaf instead of a node with one child. Same for small functions (as there is a non-negligible overhead in the handling of segments in the OS, compared to computing Poseidon)

what i assumed - but please add some doc as to why.

Copy link
Collaborator Author

@liorgold2 liorgold2 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 3 files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-starknet/src/contract_segmentation.rs line 16 at r1 (raw file):

Previously, orizi wrote…

what i assumed - but please add some doc as to why.

Done.

@liorgold2 liorgold2 force-pushed the pr/liorgold2/lior/contract-segmentation/68464189 branch from 9ae0ea3 to eae1920 Compare December 6, 2023 09:55
Copy link
Collaborator

@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.

:lgtm:

Reviewed 2 of 3 files at r1, 1 of 1 files at r3.
Reviewable status: 2 of 3 files reviewed, all discussions resolved (waiting on @liorgold2)

Copy link
Collaborator

@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.

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

@liorgold2 liorgold2 enabled auto-merge December 6, 2023 09:58
@liorgold2 liorgold2 added this pull request to the merge queue Dec 6, 2023
Merged via the queue into sierra-minor-update with commit 06fe95d Dec 6, 2023
76 checks passed
@orizi orizi deleted the pr/liorgold2/lior/contract-segmentation/68464189 branch December 13, 2023 11:58
@ArielElp ArielElp mentioned this pull request Dec 28, 2023
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