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

fix: accept raw values as well as hash #4

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

huitseeker
Copy link
Member

This allows passing in the raw values if they haven't been pre-hashed.

Copy link
Member

@wwared wwared left a comment

Choose a reason for hiding this comment

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

non-blocking nit below

I've also tested with the epoch_change_fixture.json from argumentcomputer/zk-light-clients#216 and it works perfectly!

// Check the bit length (bytes * 8 should be 256 bits), hash if necessary
let bit_length = decoded_bytes.len() * 8;

let public_inputs: String = if bit_length > 256 {
Copy link
Member

@wwared wwared Sep 11, 2024

Choose a reason for hiding this comment

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

I think it would be better if we always unconditionally did the Sha256 hashing here, since this heuristic would be confusing to callers.

What about removing the if entirely and the assets/fibonacci_fixture.json test case?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've opened #5

@huitseeker huitseeker merged commit 6dd8758 into main Sep 11, 2024
1 check passed
@wwared wwared mentioned this pull request Sep 11, 2024
5 tasks
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.

2 participants