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

Ensure persisted zeto state and nullifiers are all 32 bytes #506

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

Conversation

jimthematrix
Copy link
Contributor

@jimthematrix jimthematrix commented Jan 8, 2025

fixes #410

The problem was that when the nullifiers were generated and persisted in state_nullifiers, they were padded to 32 bytes (because they are big numbers, they can be less than 32 bytes), but in the processing of the events for spent states, the nullifiers were NOT padded. This is not a problem when most of the time the big number from the Poseidon hash ends up being 32 bytes, but is a problem when the hash is less than 32 bytes, as it causes the mismatch when comparing the nullifier ID vs. the spend ID.

The fix is to always pad the state IDs, for both states and nullifiers when processing events

@jimthematrix jimthematrix changed the title db logs for debugging intermittent failures Ensure persisted zeto state and nullifiers are all 32 bytes Jan 9, 2025
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.

bug: Test failure in TestZeto_AnonNullifierBatch
1 participant