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

Worst case benches - deploy wc contracts #1550

Merged
merged 18 commits into from
Aug 5, 2023
Merged

Conversation

AronisAt79
Copy link
Contributor

@AronisAt79 AronisAt79 commented Aug 3, 2023

Description

This is the first of a PRs series aiming to implement worst case block proof bench-marking tests within zkevm-circuits/integration-tests.
The changes submitted here implement the blockchain data generation functionality* needed for the wc bencmarks.

  • compilation and deployment of new SCs

Type of change

  • Bug fix (non-breaking change which fixes an issue)
    ✅ New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Contents

1. wcerrors.rs : Recreate the solc::SolcError and solc::SolcIoError types with necessary methods and private functions
2. worst_case.rs: Recreate ethers::solc::Solc with necessary methods

3. gen_blockchain_data.rs

Rationale

Smart contracts written for generation of blocks with increased proof computational intensity use nested opcode calls in the inline assembly block that violate serde recursion limits. Modules in Contents section 1 and 2 are created to manipulate the compilation behavior and disable recursion depth limits during deserialization

Error handling has also been added in gen_blockchain_data.rs in order to catch solc compilation errors hidden in the CompilerOutput struct

How Has This Been Tested?

https://github.com/privacy-scaling-explorations/zkevm-circuits/actions/runs/5749057365/job/15583140857
https://github.com/privacy-scaling-explorations/zkevm-circuits/actions/runs/5753344249/job/15596341036

@github-actions github-actions bot added the crate-integration-tests Issues related to the integration-tests workspace member label Aug 3, 2023
Copy link
Collaborator

@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 @AronisAt79,
I ported some comments from your fork. I also added comments on the solidity wrapper.

integration-tests/src/lib.rs Show resolved Hide resolved
integration-tests/src/wcerrors.rs Outdated Show resolved Hide resolved
integration-tests/src/worst_case.rs Outdated Show resolved Hide resolved
integration-tests/src/bin/gen_blockchain_data.rs Outdated Show resolved Hide resolved
@AronisAt79 AronisAt79 marked this pull request as ready for review August 3, 2023 21:38
Copy link
Collaborator

@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.

I added more comments on small details.

integration-tests/contracts/EXTCODESIZE/EXTCODESIZE100.sol Outdated Show resolved Hide resolved
integration-tests/contracts/MLOAD/MLOAD.sol Outdated Show resolved Hide resolved
integration-tests/contracts/SDIV/SDIV.sol Outdated Show resolved Hide resolved
integration-tests/src/bin/gen_blockchain_data.rs Outdated Show resolved Hide resolved
integration-tests/src/lib.rs Outdated Show resolved Hide resolved
@ChihChengLiang ChihChengLiang linked an issue Aug 3, 2023 that may be closed by this pull request
@ChihChengLiang ChihChengLiang removed the request for review from ed255 August 3, 2023 22:23
@leolara
Copy link
Contributor

leolara commented Aug 4, 2023

@AronisAt79 don't be so hard on yourself, I don't think this is the worse case PR I have ever seen.

@leolara
Copy link
Contributor

leolara commented Aug 4, 2023

The main function is very long, I wonder if we could split it in several functions that represent different steps in the process. I would be much easier to read.

AronisAt79 and others added 5 commits August 4, 2023 11:08
Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com>
Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com>
Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com>
Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com>
Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com>
@AronisAt79 AronisAt79 changed the title Worst case benches Worst case benches - deploy wc contracts Aug 4, 2023
Copy link
Collaborator

@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.

LGTM after the CI issues are fixed.
Great work fixing the compilation output parsing.
Can you run make fmt to fix the formatting issue?

@leolara
Copy link
Contributor

leolara commented Aug 4, 2023

LGTM!

@ChihChengLiang ChihChengLiang added this pull request to the merge queue Aug 5, 2023
Merged via the queue into main with commit 68b4f06 Aug 5, 2023
11 checks passed
@ChihChengLiang ChihChengLiang deleted the worst-case-benches branch August 5, 2023 12:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crate-integration-tests Issues related to the integration-tests workspace member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port integration tests from zkevm-chains
3 participants