-
Notifications
You must be signed in to change notification settings - Fork 44
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
Unintuitive groth16::encode
API
#176
Comments
I agree this could be a lot better. On publishing, the blocker is the use of forge in the
Part of the assumption has been that this encoding is tailored to Ethereum, and so if you need it, you are already depending on |
I think this is a correct assumption. I was just including that as an option for where it could live. Assumption for that is having it under some eth feature flag, but I agree the default is likely to be in some eth specific crate. I'm just trying to think of ways to make it more discoverable/usable, while also being more typesafe if possible. |
@austinabell, do you think the changes in #179 [1] address this issue? With this, the calling code looks like the following [2]. So there is still the need to know you should use risc0-ethereum/examples/erc20-counter/apps/src/bin/publisher.rs Lines 119 to 154 in d2af848
|
I definitely think it solves the issue! Probably good to close the issue, would be opinionated to make any other changes. Only small (somewhat) unopinionated thing to improve here is just having this be released in some way, as discoverability is a bit unclear unless just going off of the template. Unrelated to this issue though so I will close the issue, and feel free to re-open if you'd like! |
Currently, it's unintuitive that from a receipt you need to know about this method, as well as the fact that you have to use a git dependency of
risc0-ethereum
since not yet released.Currently the usage looks like this:
https://github.com/risc0/risc0-foundry-template/blob/f8671069cd5f7ea54743e1007f2c26acfd0c80ad/apps/src/bin/publisher.rs#L130
and the API is slightly improved by removing the need for a clone in #175 / #174 but the API is still based around an ambiguous
[u8]
which is unclear what that represents, as well as the return value also beingVec<u8>
.The functions also return a
Result
which I assume is for future proofing it, but confusing to me personally because there doesn't seem to be anything than can error in the future.Possibly an opinionated point to have the param be more strictly typed or have the API based around the receipt type, but it seems the less opinionated action items might be:
risc0-ethereum/contracts/src/groth16.rs
Line 24 in bfea3b8
The text was updated successfully, but these errors were encountered: