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

snarkjs pot contribute with same file as input and ouput causes issue #427

Open
samlaf opened this issue Sep 15, 2023 · 0 comments
Open

Comments

@samlaf
Copy link

samlaf commented Sep 15, 2023

Took me a while to figure out this bug. I was contributing to a phase1 powersoftau file with the following commands:

snarkjs powersoftau new bn128 14 pot14.ptau -v
snarkjs powersoftau contribute pot14.ptau pot14.ptau --name="First contribution"
snarkjs powersoftau beacon pot14.ptau pot14_beacon.ptau 

But realized that the second command (notice input file and output file have same name)

snarkjs powersoftau contribute pot14.ptau pot14.ptau --name="First contribution"

causes the file to probably overwrite parts of itself and results in an error

$$$ snarkjs powersoftau verify pot14.ptau         
[INFO]  snarkJS: Powers Of tau file OK!
[ERROR] snarkJS: tauG1 section. Powers do not match

I guess overwriting previous pot contribution files is not a good idea... but would be nice if this was more newbie proof. Made me lose a lot of time to figure this out. Either making this possible, or causing an error like "input and output files must be different" would be very nice.

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

No branches or pull requests

1 participant