zkemail / zk-regex

A library to do regex verification in circom, adapted from the original zk-email. It additionally generates lookup tables for halo2-regex.
GNU General Public License v3.0
79 stars 27 forks source link

Cannot compile new regrx: lib.rs error on unwrap #58

Closed Divide-By-0 closed 8 months ago

Divide-By-0 commented 9 months ago

We have no visibility into errors due to any failures as the error does not show the cause.

"parts":[
    {
      "is_public": false,
      "regex_def": "((\r\n)|^)tx="
    },
    {
      "is_public": true,
      "regex_def": "{[^;]+}"
    },
    {
      "is_public": false,
      "regex_def": ";"
    }
  ]
}
➜  circom git:(feat/groth16) ✗ zk-regex decomposed -d ./tx_body.json -c ./tx_body_regex.circom -t TxBody -g true
regex ((
)|\^)tx=
concat_str ^tx={;};
regex ((
)|\^)tx={[      

 !"#$%&'\(\)\*\+,\-\./0123456789:<=>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]\\^_\`abcdefghijklmnopqrstuvwxyz{\|}~                                 ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ]+}
concat_str ^tx={;};
thread 'main' panicked at packages/compiler/src/lib.rs:301:62:
called Option::unwrap() on a None value

Can we re-architect this such that we at least know the precise error from where it's triggered instead of a generic unwrap issue?