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

feat: return response data #563

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

feat: return response data #563

wants to merge 7 commits into from

Conversation

0xJepsen
Copy link
Contributor

Pull Request

This is a very small change but very important feature for the user. This change just ensures that the data from the response (that we are proving) is returned to the user.

devloper
devloper previously approved these changes Mar 11, 2025
@devloper devloper self-requested a review March 12, 2025 01:31
@devloper devloper dismissed their stale review March 12, 2025 01:32

wrong values

@devloper
Copy link
Contributor

devloper commented Mar 12, 2025

This current approach dumps the entire body, not the extract value. This is inconsistent with the old APIs. It should only output the value.

FYI @piotr-roslaniec , this probably needs to reflect the output of the ManifestV2 multi-extractions as well. The approach I took in my other PR is naive.

pluto@d66d0d9

@piotr-roslaniec
Copy link
Contributor

I must have misled you @0xJepsen, you need the extraction implemented as proposed by @devloper

I recall I already implemented this as an intermediate step somewhere. We could also merge #541, but I think we want to avoid breaking changes (new release) here.

@0xJepsen
Copy link
Contributor Author

Okay lets merge in the V2 and then i will rebase and take a look here.

@0xJepsen 0xJepsen force-pushed the feat/return_value branch from f2921d0 to a6402ec Compare March 12, 2025 20:36
let path = manifest.response.body.json_path().clone();
let body = serde_json::from_slice(&response.notary_response_body.clone().body.unwrap()).unwrap();
let value = get_value_from_json_path(&body, &path);
let manifest_hash = KeccakHasher::hash(serde_json::to_string(&manifest)?.as_bytes());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@piotr-roslaniec we need to make the hash like this so that the same proof produces the same hash. This is because in the on chain verifier, we shouldn't let users submit duplicate proofs. and we need to enable users to recreate the root hash.

@devloper
Copy link
Contributor

Would also be nice to have support for these extractions all the way out to the contract. I created an issue on solidity-verifier for that: pluto/solidity-verifier#4 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants