Skip to content

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

Merged
kevaundray merged 1 commit intomasterfrom
fix-unsorted-return-values
Apr 19, 2023
Merged

fix: maintain ordering of return value witnesses when constructing ABI#1177
kevaundray merged 1 commit intomasterfrom
fix-unsorted-return-values

Conversation

@TomAFrench
Copy link
Copy Markdown
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
Copy Markdown

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

@kevaundray
Copy link
Copy Markdown
Contributor

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

@rahul-kothari
Copy link
Copy Markdown

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

@kevaundray
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@TomAFrench
Copy link
Copy Markdown
Member Author

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

@kevaundray
Copy link
Copy Markdown
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
Copy Markdown
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