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

fix: maintain ordering of return value witnesses when constructing ABI #1177

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

TomAFrench
Copy link
Member

@TomAFrench TomAFrench commented Apr 19, 2023

Related issue(s)

Resolves #1174

Description

Summary of changes

This PR switches the evaluator to track the witnesses for the return value in a Vec<Witness> rather than a BTreeSet<Witness>. While it's correct to store them as a set inside the Circuit, we rely on the ordering of these witnesses for proper ABI decoding and so we need to maintain this when we're constructing the ABI.

See #1174 for an example of this causing improper ABI decoding.

Dependency additions / changes

Test additions / changes

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.

Documentation needs

  • This PR requires documentation updates when merged.

Additional context

BEGIN_COMMIT_OVERRIDE
fix: maintain ordering of return value witnesses when constructing ABI (#1177)
END_COMMIT_OVERRIDE

@rahul-kothari
Copy link

can you add some tests to ensure future versions don't run into this?

@kevaundray
Copy link
Contributor

Can you also add an example to ensure we don't regress?

@rahul-kothari
Copy link

how did we regress in the first place? I think this is new to v0.4 - curious how it happened.

@kevaundray
Copy link
Contributor

how did we regress in the first place? I think this is new to v0.4 - curious how it happened.

I was saying that we should add an example to ensure we don't regress in the future

@TomAFrench
Copy link
Member Author

The issue is the integration tests make use of the "prove then immediately verify" feature so we're not loading the public inputs from Verifier.toml. We switched to this to cut down CI times but I can revert that.

@kevaundray
Copy link
Contributor

The issue is the integration tests make use of the "prove then immediately verify" feature so we're not loading the public inputs from Verifier.toml. We switched to this to cut down CI times but I can revert that.

Was it a large effect on CI times?

@TomAFrench
Copy link
Member Author

It was a pretty sizable percentage afaik, i.e. double digits.

@TomAFrench
Copy link
Member Author

I've made the changes to integration tests in #1179 as that dwarfs the changes in this PR.

@kevaundray
Copy link
Contributor

It was a pretty sizable percentage afaik, i.e. double digits.

oof RIP productivity, lets try to get a larger github runner to counteract this

Copy link
Contributor

@kevaundray kevaundray left a comment

Choose a reason for hiding this comment

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

LGTM - I think if separating prove and verify add 10 minutes, then we should have the larger runners in place, before merging the other PR

@kevaundray kevaundray added this pull request to the merge queue Apr 19, 2023
Merged via the queue into master with commit b799c8a Apr 19, 2023
@kevaundray kevaundray deleted the fix-unsorted-return-values branch April 19, 2023 17:48
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.

Return value witnesses being sorted results in incorrect ABI decoding
3 participants