Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Improve MPTWG's witness output #1658

Closed
ChihChengLiang opened this issue Oct 12, 2023 · 0 comments · Fixed by #1643
Closed

Improve MPTWG's witness output #1658

ChihChengLiang opened this issue Oct 12, 2023 · 0 comments · Fixed by #1643
Labels
T-feature Type: new features
Milestone

Comments

@ChihChengLiang
Copy link
Collaborator

Describe the feature you would like

Asserting the current MPT witness generator's correctness is hard. The only path I see is through

  1. MPTWG generates witnesses from Infura or Geth.
  2. MPTWG dumps json files, which serves as test cases for the MPT circuit.
  3. The MPT circuit reads json files and runs mock prover

We have completed step 1 of #1566, which ported MPTWG to this codebase. Now we are at step 2.

JSONs are only generated in the test run and passed directly to the circuit. We make sure the MPT circuit consumes the correct version of witness automatically.

But there's a problem, if the json is generated from a mainnet block, it might be better to store the json file, so that we don't depend on Infura on every test run.

But whether we decide to keep json files or not. It would be great to design for format for it for readability.

JSON format

  • The first thing to do is to reduce the space occupied by the bytes. We encode them in hex strings.
  • prettify the struct for readability.

Additional context

No response

@ChihChengLiang ChihChengLiang added the T-feature Type: new features label Oct 12, 2023
@ChihChengLiang ChihChengLiang added this to the MPT milestone Oct 12, 2023
@ChihChengLiang ChihChengLiang moved this to 🏗 In progress in zkEVM Community Edition Oct 12, 2023
@ChihChengLiang ChihChengLiang linked a pull request Oct 12, 2023 that will close this issue
3 tasks
@ChihChengLiang ChihChengLiang moved this from 🏗 In progress to 👀 In review in zkEVM Community Edition Oct 12, 2023
github-merge-queue bot pushed a commit that referenced this issue Oct 13, 2023
### Description


### Issue Link

#1658

### Type of change

Breaking change (fix or feature that would cause existing functionality
to not work as expected)

### Contents

- [x] Use proper Go libraries to dump the json files. This reduces the
number of serialization/deserialization codes and errors.
- [x] Regenerate JSON files.
- [x] Rewrite the parsing code in MPT circuit.

### How Has This Been Tested?

See if the new JSON format can be consumed by the MPT circuit and run
the test successfully.
@ChihChengLiang ChihChengLiang moved this from 👀 In review to ✅ Done in zkEVM Community Edition Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-feature Type: new features
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant