Skip to content

Conversation

@splinter012
Copy link

Refactored bytecode_hash_node nested node processing to compute results in a single pass.

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@reviewable-StarkWare
Copy link

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.

@orizi made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @splinter012).


crates/cairo-lang-starknet-classes/src/casm_contract_class.rs line 209 at r1 (raw file):

            }
            let hash = H::hash_array(&hash_elements) + 1;
            (total_len, hash)

Suggestion:

            for node in nodes {
                let (len, hash) = bytecode_hash_node::<H>(iter, node);
                total_len += len;
                hash_elements.extend([len.into(), hash]);
            }
            (total_len, H::hash_array(&hash_elements) + 1)

@splinter012
Copy link
Author

@orizi made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @splinter012).

crates/cairo-lang-starknet-classes/src/casm_contract_class.rs line 209 at r1 (raw file):

            }
            let hash = H::hash_array(&hash_elements) + 1;
            (total_len, hash)

Suggestion:

            for node in nodes {
                let (len, hash) = bytecode_hash_node::<H>(iter, node);
                total_len += len;
                hash_elements.extend([len.into(), hash]);
            }
            (total_len, H::hash_array(&hash_elements) + 1)

ready))

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