zkvalidator/mina-vrf-rs

Error in running check witness

Opened this issue · 13 comments

Thanks for the program, it's very helpful!
I encountered this error some times when running checking witnesses, but not every time:

Running `target/release/mina-vrf batch-check-witness --pub B62qpJavug1VGCBSttepmXr6nh8fvXY5SigbN44ttYDia65vwbTEcq2 --epoch 9`
DEBUG 2021-07-29T12:38:29Z: reqwest::connect: starting new connection: http://localhost:3085/
DEBUG 2021-07-29T12:38:29Z: reqwest::async_impl::client: response '200 OK' for http://localhost:3085/graphql
DEBUG 2021-07-29T12:38:29Z: reqwest::connect: starting new connection: https://raw.githubusercontent.com/
DEBUG 2021-07-29T12:38:29Z: reqwest::async_impl::client: response '200 OK' for https://raw.githubusercontent.com/zkvalidator/mina-vrf-rs/main/data/epochs/jxVLvFcBbRCDSM8MHLam6UPVPo2KDegbzJN6MTZWyhTvDrPcjYk.json
ERROR 2021-07-29T12:38:29Z: mina_vrf: expected `,` or `}` at line 2071 column 1

Seems the ledger_hash returned sometimes are different?

Seems the ledger_hash returned sometimes are different?

not entirely sure, how should i check/fix please?

@lampardlamps looking at the error, it seems that one of the json files was not formatted well.
I know that you probably don't want to share the witness file since it's for the active epoch 9, so maybe an easy thing to try would be to re-run it from scratch? I suspect something got cut in the middle.

@lampardlamps looking at the error, it seems that one of the json files was not formatted well.
I know that you probably don't want to share the witness file since it's for the active epoch 9, so maybe an easy thing to try would be to re-run it from scratch? I suspect something got cut in the middle.

Thanks Kobi. I've deleted the folder and restarted from the git clone step, and still got this:

     Running `target/release/mina-vrf batch-check-witness --pub B62qp... --epoch 9`
DEBUG 2021-07-29T20:55:43Z: reqwest::connect: starting new connection: http://localhost:3085/
DEBUG 2021-07-29T20:55:48Z: reqwest::async_impl::client: response '200 OK' for http://localhost:3085/graphql
DEBUG 2021-07-29T20:55:48Z: reqwest::connect: starting new connection: https://raw.githubusercontent.com/
DEBUG 2021-07-29T20:55:48Z: reqwest::async_impl::client: response '200 OK' for https://raw.githubusercontent.com/zkvalidator/mina-vrf-rs/main/data/epochs/jxVLvFcBbRCDSM8MHLam6UPVPo2KDegbzJN6MTZWyhTvDrPcjYk.json
ERROR 2021-07-29T20:55:48Z: mina_vrf: expected `,` or `}` at line 1864 column 1

seems like every time the error happens on different lines.
Btw, what should I do if I wanted to run the vrf for two pub keys please? if I put the codes in the same sh file and execute it sequentially, for the second key, I always got that every single slot is included in the invalid slot field. Thanks.

Thanks for trying :) any chance you can share with me privately lines 1863-1865? I want to see what happened there. About two pub keys, I’d prefix every Jason file with some unique identifier like the public key so they don’t collide. If you share your script, I might be able to give some concrete advice.

On Fri, 30 Jul 2021 at 11:01 lampardlamps @.***> wrote: @lampardlamps https://github.com/lampardlamps looking at the error, it seems that one of the json files was not formatted well. I know that you probably don't want to share the witness file since it's for the active epoch 9, so maybe an easy thing to try would be to re-run it from scratch? I suspect something got cut in the middle. Thanks Kobi. I've deleted the folder and restarted from the git clone step, and still got this: Running target/release/mina-vrf batch-check-witness --pub B62qp... --epoch 9 DEBUG 2021-07-29T20:55:43Z: reqwest::connect: starting new connection: http://localhost:3085/ DEBUG 2021-07-29T20:55:48Z: reqwest::async_impl::client: response '200 OK' for http://localhost:3085/graphql DEBUG 2021-07-29T20:55:48Z: reqwest::connect: starting new connection: https://raw.githubusercontent.com/ DEBUG 2021-07-29T20:55:48Z: reqwest::async_impl::client: response '200 OK' for https://raw.githubusercontent.com/zkvalidator/mina-vrf-rs/main/data/epochs/jxVLvFcBbRCDSM8MHLam6UPVPo2KDegbzJN6MTZWyhTvDrPcjYk.json ERROR 2021-07-29T20:55:48Z: mina_vrf: expected , or } at line 1864 column 1 Btw, what should I do if I wanted to run the vrf for two pub keys please? if I put the codes in the same sh file and execute it sequentially, for the second key, I always got that every single slot is included in the invalid slot field. Thanks. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#14 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA23MGGRTCUKJ7DHWC5WK4DT2JL67ANCNFSM5BGMTZLQ .

No problem, I'll post it here, the lines in question are like this:

  "vrfOutputFractional": 0.3529406725424392,
  "thresholdMet": false

{

obviously the 3rd line is missing a }, for some reason.
The sh script I'm using looks like this. Thanks again for looking into it.

export CUR_EPOCH=9
export CODA_PRIVKEY_PASS=xxx
cargo run --release -- batch-generate-witness --pub B62qp --epoch $CUR_EPOCH > requests
cat requests | mina advanced vrf batch-generate-witness --privkey-path /home/ubuntu/keys/my-wallet | grep -v CODA_PRIVKEY_PASS > witnesses
cat witnesses | cargo run --release -- batch-patch-witness --pub B62qp --epoch $CUR_EPOCH > patches
cat patches | mina advanced vrf batch-check-witness | grep -v CODA_PRIVKEY_PASS > check
cat check | cargo run --release -- batch-check-witness --pub B62qp --epoch $CUR_EPOCH


cargo run --release -- batch-generate-witness --pub B62qif --epoch $CUR_EPOCH > sc_requests
cat sc_requests | mina advanced vrf batch-generate-witness --privkey-path /home/ubuntu/sc_keys/my-wallet | grep -v CODA_PRIVKEY_PASS > sc_witnesses
cat witnesses | cargo run --release -- batch-patch-witness --pub B62qif --epoch $CUR_EPOCH > sc_patches
cat sc_patches | mina advanced vrf batch-check-witness | grep -v CODA_PRIVKEY_PASS > sc_check
cat sc_check | cargo run --release -- batch-check-witness --pub B62qif --epoch $CUR_EPOCH

Lol Jason -> Json. Glad it was only that from autocorrect

Do you happen to have a friend last named Bourne and have you been chatting with him frequently recently?

Very interesting. The faulty json is the “check” file, right? If so it would mean something from the Mina node is incorrect. Would you be able to run the command that produce it without the grep? Maybe something is happening there. Then remove the lines with CODA manually. About the script, you mistakenly used witnesses instead of sc_witnesses :)

Thanks again Kobi. Yes, removing grep manually removing the lines with CODA did work, as I can see the occurance of }Using password from environment variable CODA_PRIVKEY_PASS, which would have been removed by the grep command. I've added a line to handle that and it should be all good now. For future reference, the commands I'm now using are (it's still clumsy):

export CUR_EPOCH=9
export CODA_PRIVKEY_PASS=xxx
cargo run --release -- batch-generate-witness --pub B62qp --epoch $CUR_EPOCH > requests
cat requests | mina advanced vrf batch-generate-witness --privkey-path /home/ubuntu/keys/my-wallet | grep -v CODA_PRIVKEY_PASS > witnesses
cat witnesses | cargo run --release -- batch-patch-witness --pub B62qp --epoch $CUR_EPOCH > patches
cat patches | mina advanced vrf batch-check-witness > check
sed -i 's/}Using password from environment variable CODA_PRIVKEY_PASS/}/g' check
cat check | grep -v CODA_PRIVKEY_PASS > check_new
cat check_new | cargo run --release -- batch-check-witness --pub B62qp --epoch $CUR_EPOCH

I apologies for my mistake on sc_witnesses.

lol