8000 Utility function to generate preprocessed tree roots by shaharsamocha7 · Pull Request #940 · starkware-libs/stwo-cairo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Utility function to generate preprocessed tree roots #940

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

Merged
merged 1 commit into from
May 25, 2025

Conversation

shaharsamocha7
Copy link
Collaborator
@shaharsamocha7 shaharsamocha7 commented May 25, 2025

This change is Reviewable

Copy link
Contributor
@andrewmilson andrewmilson 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 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ohad-agadi)

@shaharsamocha7 shaharsamocha7 merged commit 5df580e into main May 25, 2025
14 checks passed
@shaharsamocha7 shaharsamocha7 deleted the shahars/pp_tree/generate branch May 25, 2025 15:06
Copy link
Collaborator
@ohad-agadi ohad-agadi 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


stwo_cairo_prover/crates/prover/src/witness/utils.rs line 158 at r1 (raw file):

    )
    .into_iter()
    .collect_vec();

vec -> iter -> vec?

Code quote:

    .into_iter()
    .collect_vec();

stwo_cairo_prover/crates/prover/src/witness/utils.rs line 175 at r1 (raw file):

            .join(", ");

        info!("log_blowup_factor: {}, blake root: [{}]", i + 1, hex_string);

why log? you are now dependent on the user to have a subscriber
don't you just want to print here?


stwo_cairo_prover/crates/prover/src/witness/utils.rs line 176 at r1 (raw file):

        info!("log_blowup_factor: {}, blake root: [{}]", i + 1, hex_string);
    });

Suggestion:

    // Blake2s roots.
    let blake_roots = get_preprocessed_roots::<Blake2sMerkleChannel>(
        max_log_blowup_factor,
        PreProcessedTraceVariant::Canonical,
    );
    blake_roots.iter().enumerate().for_each(|(i, root)| {
        let root_bytes = root.0;
        let u32s_hex = root_bytes
            .array_chunks::<4>()
            .map(|&bytes| u32::from_le_bytes(bytes))
            .map(|u32| format!("{:#010x}", u32))
            .collect_vec()
            .join(", ");

        info!("log_blowup_factor: {}, blake root: [{}]", i + 1, u32s_hex);
    });

Copy link
Collaborator
@ohad-agadi ohad-agadi left a comment

Choose a reason for hiding this comment

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

dam you merged

Reviewable status: all files reviewed, 3 unresolved discussions

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.

3 participants
0