Skip to content

feat(starknet_os): integrate to_bytes and serialize_blob #4874

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

Conversation

dorimedini-starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@dorimedini-starkware dorimedini-starkware self-assigned this Mar 12, 2025
@dorimedini-starkware dorimedini-starkware marked this pull request as ready for review March 12, 2025 17:22
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from 06694cf to 5d94ed0 Compare March 12, 2025 17:44
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from d84fbbe to b531874 Compare March 12, 2025 17:44
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from 5d94ed0 to 9c18ffe Compare March 12, 2025 18:04
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from b531874 to 95496a1 Compare March 12, 2025 18:04
Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.510 ms 34.534 ms 34.559 ms]
change: [-4.1280% -2.6020% -1.2603%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe

@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from 9c18ffe to f752bbb Compare March 13, 2025 08:46
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from 95496a1 to cf4d3aa Compare March 13, 2025 08:46
Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.488 ms 34.507 ms 34.528 ms]
change: [-4.3604% -2.8446% -1.5120%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe

@aner-starkware
Copy link
Contributor

crates/starknet_os/src/hints/hint_implementation/kzg/utils.rs line 29 at r2 (raw file):

    let padding = length.saturating_sub(bytes.len());
    if padding > 0 {
        let mut padded_bytes = std::iter::repeat(0u8).take(padding).collect::<Vec<u8>>();

This is considered more idiomatic, AFAIK.

Suggestion:

vec![0; padding];

@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from f752bbb to e677920 Compare March 13, 2025 09:30
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from cf4d3aa to f480f1f Compare March 13, 2025 09:30
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from e677920 to bb48db9 Compare March 13, 2025 09:33
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from f480f1f to 2397b8f Compare March 13, 2025 09:33
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from 05b48da to 34bcf26 Compare March 16, 2025 09:36
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from ed9a6a8 to 483fa50 Compare March 16, 2025 09:36
Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.125 ms 34.199 ms 34.324 ms]
change: [-5.0675% -3.5040% -2.1347%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe

Copy link
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: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @amosStarkware, @aner-starkware, and @nimrod-starkware)


crates/starknet_os/src/hints/hint_implementation/kzg/utils.rs line 25 at r4 (raw file):

Previously, aner-starkware wrote…

If this is the only location, why not simply switch the order? In that case, yes, I think we should move to BigUint (though maybe it causes more overhead due to the checked_sub?)

Thinking again about this, I don't actually see an advantage to using biguint... the "correct" type is a "BLS field element", which we will not implement; biguint and bigint are "equally incorrect" IMO.
There is a small advantage to biguint in the sense that, if we somehow accidentally end up with a negative value, we will panic (good); I'll TAL to see how big a change this is at the top of the stack.

@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from 483fa50 to 07d1edc Compare March 16, 2025 09:55
Copy link
Contributor

@aner-starkware aner-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 r5, 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware and @nimrod-starkware)

@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from 34bcf26 to a87fcaf Compare March 16, 2025 14:08
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from 07d1edc to 3cc91e4 Compare March 16, 2025 14:08
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from a87fcaf to 88d04fa Compare March 16, 2025 16:16
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from 3cc91e4 to 9670309 Compare March 16, 2025 16:16
Copy link
Contributor

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

@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from 88d04fa to eaa9752 Compare March 17, 2025 08:20
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from 9670309 to 1b98475 Compare March 17, 2025 08:20
Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.164 ms 34.196 ms 34.232 ms]
change: [-4.0793% -2.4616% -1.0080%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
1 (1.00%) low severe
3 (3.00%) low mild
5 (5.00%) high mild
1 (1.00%) high severe

Copy link
Contributor

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

@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_the_fft_function branch from eaa9752 to 3f66375 Compare March 17, 2025 15:23
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from 1b98475 to ae26527 Compare March 17, 2025 15:24
Copy link
Contributor

@aner-starkware aner-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 r11, 1 of 1 files at r12, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware and @nimrod-starkware)

@dorimedini-starkware dorimedini-starkware changed the base branch from 03-12-feat_starknet_os_integrate_the_fft_function to main March 17, 2025 16:19
Signed-off-by: Dori Medini <dori@starkware.co>
…ementations

Signed-off-by: Dori Medini <dori@starkware.co>
@dorimedini-starkware dorimedini-starkware force-pushed the 03-12-feat_starknet_os_integrate_to_bytes_and_serialize_blob branch from ae26527 to a282a52 Compare March 17, 2025 16:25
Copy link

graphite-app bot commented Mar 17, 2025

Merge activity

  • Mar 17, 12:26 PM EDT: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.

@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue Mar 17, 2025
Merged via the queue into main with commit 8774c3a Mar 17, 2025
23 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 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.

3 participants