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

[MPTWG] Reformat JSON files #1643

Merged
merged 8 commits into from
Oct 13, 2023
Merged

[MPTWG] Reformat JSON files #1643

merged 8 commits into from
Oct 13, 2023

Conversation

ChihChengLiang
Copy link
Collaborator

@ChihChengLiang ChihChengLiang commented Oct 4, 2023

Description

Issue Link

#1658

Type of change

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

Contents

  • Use proper Go libraries to dump the json files. This reduces the number of serialization/deserialization codes and errors.
  • Regenerate JSON files.
  • 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.

@github-actions github-actions bot added the crate-zkevm-circuits Issues related to the zkevm-circuits workspace member label Oct 4, 2023
@miha-stopar miha-stopar self-requested a review October 10, 2023 04:16
Copy link
Collaborator

@miha-stopar miha-stopar left a comment

Choose a reason for hiding this comment

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

Nice! I started to review this PR, but later I saw it's still draft.
It requires some changes in the circuit as well, like for example inwitness_row.rs adding

#[derive(Clone, Serialize, Deserialize, Debug)]
#[serde(transparent)]
struct HexVal {
    #[serde(with = "hex::serde")]
    hex: Vec<u8>,
}

and changing for Node struct

pub values: Vec<Vec<u8>>,

to

pub values: Vec<HexVal>,

and then changing the assign function of MainRlpGadget. Do you plan to do these changes in this PR?

Copy link
Collaborator Author

@ChihChengLiang ChihChengLiang left a comment

Choose a reason for hiding this comment

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

Hi @miha-stopar,
Thanks for the early review! The PR is still a draft, but a quick look from you is helpful!
I think the MainRLPGadget can still take &[u8] as inputs. The Deref trait on Hex resolved that issue.

zkevm-circuits/src/mpt_circuit.rs Outdated Show resolved Hide resolved
@ChihChengLiang ChihChengLiang linked an issue Oct 12, 2023 that may be closed by this pull request
@ChihChengLiang ChihChengLiang marked this pull request as ready for review October 12, 2023 18:51
@github-actions github-actions bot added T-bench Type: benchmark improvements crate-circuit-benchmarks Issues related to the circuit-benchmarks workspace member labels Oct 12, 2023
@KimiWu123 KimiWu123 self-requested a review October 13, 2023 01:27
Copy link
Contributor

@KimiWu123 KimiWu123 left a comment

Choose a reason for hiding this comment

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

I didn't check json files but others looks good to me.

Copy link
Collaborator

@miha-stopar miha-stopar left a comment

Choose a reason for hiding this comment

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

LGTM!

@ChihChengLiang ChihChengLiang added this pull request to the merge queue Oct 13, 2023
Merged via the queue into main with commit 09651d4 Oct 13, 2023
13 checks passed
@ChihChengLiang ChihChengLiang deleted the mptwg/json-reformat branch October 13, 2023 14:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crate-circuit-benchmarks Issues related to the circuit-benchmarks workspace member crate-zkevm-circuits Issues related to the zkevm-circuits workspace member T-bench Type: benchmark improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve MPTWG's witness output
3 participants