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

Improved error handling and parsing in parsing_utils.py #233

Merged
merged 18 commits into from
Oct 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feltroidprime marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
from garaga.precompiled_circuits.multi_miller_loop import MultiMillerLoopCircuit

# https://github.com/risc0/risc0-ethereum/blob/main/contracts/src/groth16/ControlID.sol
RISC0_CONTROL_ROOT = 0x8B6DCF11D463AC455361B41FB3ED053FEBB817491BDEA00FDB340E45013B852E
RISC0_CONTROL_ROOT = 0xA516A057C9FBF5629106300934D48E0E775D4230E41E503347CAD96FCBDE7E2E
RISC0_BN254_CONTROL_ID = (
0x05A022E1DB38457FB510BC347B30EB8F8CF3EDA95587653D0EAC19E1F10D164E
0x0EB6FEBCF06C5DF079111BE116F79BD8C7E85DC9448776EF9A59AAF2624AB551
)

Copy link
Collaborator

@feltroidprime feltroidprime Oct 18, 2024

Choose a reason for hiding this comment

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

This shouldn't change, they were already the latest values
https://github.com/risc0/risc0-ethereum/blob/main/contracts/src/groth16/ControlID.sol 🤔
What happened ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was debugging my program and didn't see that this it was included in the commit.

Copy link
Contributor Author

@stefanMadzharov stefanMadzharov Oct 18, 2024

Choose a reason for hiding this comment

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

Also, I am not sure they are the latest values. The latest values should be those here. You can check Issue#234. I have explained my train of thoughts there.


Expand Down Expand Up @@ -208,7 +208,7 @@ def from_dict(data: dict) -> "Groth16VerifyingKey":
curve_id = try_guessing_curve_id_from_json(data)
try:
verifying_key = find_item_from_key_patterns(data, ["verifying_key"])
except ValueError:
except KeyPatternNotFound:
verifying_key = data
try:
return Groth16VerifyingKey(
Expand Down Expand Up @@ -333,6 +333,7 @@ def from_dict(
image_id = find_item_from_key_patterns(data, ["image_id"])
journal = find_item_from_key_patterns(data, ["journal"])

print("Seal: {}\nImage_id: {}\nJournal: {}".format(seal, image_id, journal))
return Groth16Proof._from_risc0(
seal=codecs.decode(seal[2:].replace("\\x", ""), "hex"),
image_id=codecs.decode(image_id[2:].replace("\\x", ""), "hex"),
Expand Down
Loading