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

Dev/optimize merkle root #227

Conversation

Jeanmichel7
Copy link
Collaborator

Test Before After
full_169 134001057 113894412
full_757738 9372119456 6850847496

Copy link

vercel bot commented Sep 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
raito ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2024 11:54pm

Copy link
Collaborator

@maciejka maciejka left a comment

Choose a reason for hiding this comment

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

Why you don't use Box<Digest> instead of Box<[u32;8]>?

@Jeanmichel7
Copy link
Collaborator Author

Why you don't use Box<Digest> instead of Box<[u32;8]>?

Because the hash return is Box::<[u32,8]>,
this avoids unnecessary conversions such as
next_hashes.append(BoxTrait::new(DigestTrait::new(hash.unbox())));

I've tried it, and the performance loss is very small 6851088696 instead of 6850847496
validation>block.cairo is a little more readable,
utils>merkle_tree.cairo is a little less readable

@m-kus
Copy link
Collaborator

m-kus commented Sep 27, 2024

We cannot use sha256 syscall from Starknet

@Jeanmichel7
Copy link
Collaborator Author

That's right..., I'll have to see how I can use the local sha256.

@Jeanmichel7 Jeanmichel7 marked this pull request as draft September 27, 2024 16:05
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