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

Use "poseidon_hash_2" for merkle trees instead of poseidon_hash_many #312

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

feltroidprime
Copy link
Contributor

The hash trait is using "poseidon_hash_many" or "array hashing" which is more costly and useless if we know in advance how many elements we hash.

A standard way of hashing two elements is calling the permutation on (x, y, 2) and returning the first element of the state.

see

Copy link

vercel bot commented Dec 5, 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 Dec 18, 2024 10:27pm

@feltroidprime
Copy link
Contributor Author

feltroidprime commented Dec 5, 2024

Where is the script generating the jsons tests for utreexo roots ?

@maciejka
Copy link
Collaborator

maciejka commented Dec 5, 2024

Where is the script generating the jsons tests for utreexo roots ?

It is generated by Floresta node: https://github.com/keep-starknet-strange/raito/blob/main/docs/data.md#utreexo-data.

@m-kus will you have a look?

@m-kus
Copy link
Collaborator

m-kus commented Dec 17, 2024

Note to future us: we'd need to change the implementation in the accumulator here https://github.com/Davidson-Souza/rpc-utreexo-bridge/blob/115fb5f21a19fc8ed30dab14d2b6558f782fe9b2/src/udata.rs#L514 and reindex the bridge node to recreate test data

@m-kus m-kus self-assigned this Dec 17, 2024
@feltroidprime
Copy link
Contributor Author

feltroidprime commented Dec 17, 2024

Better now than after proving 1TB of data

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