-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(relayer): implement poseidon hash #186
base: main
Are you sure you want to change the base?
Conversation
// let mut trace_path_span = self.trace_path.span(); | ||
// while let Option::Some(path) = trace_path_span.pop_front() { | ||
// key_builder.append_serde(path); | ||
// }; | ||
// key_builder.append_serde(self.base); | ||
key_builder.append_serde(self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why PrefixedDenom
was hashed manually when it implements Serde
already.
Is this necessary? If yes, I am fine to revert this and make it compatible at relayer e2e side.
let ibc_prefixed_denom_key = PoseidonState::digest(&[PoseidonState::digest( | ||
&cairo_encoding.encode(&ibc_prefixed_denom)?, | ||
)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .key()
method in Cairo uses,
PoseidonTrait::new().update(poseidon_hash_span(self.data.span())).finalize() |
I am not sure why the double hashing is necessary. Why can't we use the following?
poseidon_hash_span(self.data.span())
Closes #175
Closes #180
starknet-integration-tests