risc0 / risc0-foundry-template

Template for integrating RISC Zero and Ethereum using Foundry
https://risczero.com
108 stars 60 forks source link

Fix Bonsai template compatibility w/ 0.17 #46

Closed carterbrett closed 1 year ago

carterbrett commented 1 year ago

Reminder: Need to confirm with Jeremy that the intermediate fix is on verifier contract issue (thread Slack).

capossele commented 1 year ago

In order for the RiscZeroGroth16Verifier contract to be more agnostic to changes in the WIP repo such as changes that would affect the recursion predicates and/or changes to the RV32IM circuit, a possible solution would be to make the following values modifiable via some contract call.

https://github.com/risc0/risc0/blob/81578ba46f70b9f27152a3f36fa4d8994827bac9/bonsai/ethereum/contracts/groth16/RiscZeroGroth16Verifier.sol#L84-L86

// Control ID hash for the identity_p254 predicate decomposed as implemented by splitDigest.
uint256 internal constant CONTROL_ID_0 = uint256(0x68e42d8b3ddc499f4e1799a767052ab3);
uint256 internal constant CONTROL_ID_1 = uint256(0x3802684f1645e0a028585b0445d39231);

Somewhat related to this issue is also https://github.com/risc0/risczero-wip/issues/282