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

Circuit tools with refactored CellManager #96

Open
wants to merge 107 commits into
base: mpt-sync
Choose a base branch
from

Commits on Apr 10, 2023

  1. fix a typo in comment (privacy-scaling-explorations#1351)

    ### Description
    
    Fix a typo found by another community developer
    
    ### Issue Link
    
    N/A
    
    ### 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
    
    N/A
    
    
    ### How Has This Been Tested?
    
    N/A
    smtmfft committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    8aed587 View commit details
    Browse the repository at this point in the history
  2. Gather all test-related into test mod. (privacy-scaling-explorations#…

    …1300)
    
    ### Issue Link
    
    * First mentioned in privacy-scaling-explorations#953 
    
    * Pr link
    This is the second pr for this. The older one privacy-scaling-explorations#1003 is abandoned as
    there are too much conflicts.
    
    
    ### Contents
    * Gather test related into test mod.
    * Gather most of the `impl Circuit` into `dev.mod`
    This is for distinct the `test-circuits` and the test features. privacy-scaling-explorations#1144
    SuccinctPaul committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    0e76d2b View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2023

  1. bus-mapping: more robust access parsing (privacy-scaling-explorations…

    …#1311)
    
    ### Description
    
    When building AccessSet, we read stack input of opcode(eg: read last
    element of stack when processing BALANCE opcode). But this method will
    encounter error when dealing with some ill-formed bytecode(BALANCE when
    empty stack). So in this PR, when access parsing for a single step
    encounters errors, the error is printed, the access parsing procedure
    will continue instead of being interrupted and return.
    
    ### Issue Link
    
    [_link issue here_]
    
    ### Type of change
    
    - [x] 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
    
    - [_item_]
    
    ### Rationale
    
    [_design decisions and extended information_]
    
    ### How Has This Been Tested?
    
    "StackUnderFlowContractCreation_d0_g0_v0" in testool can pass with this
    PR
    
    <hr>
    
    ## How to fill a PR description 
    
    Please give a concise description of your PR.
    
    The target readers could be future developers, reviewers, and auditors.
    By reading your description, they should easily understand the changes
    proposed in this pull request.
    
    MUST: Reference the issue to resolve
    
    ### Single responsability
    
    Is RECOMMENDED to create single responsibility commits, but not
    mandatory.
    
    Anyway, you MUST enumerate the changes in a unitary way, e.g.
    
    ```
    This PR contains:
    - Cleanup of xxxx, yyyy
    - Changed xxxx to yyyy in order to bla bla
    - Added xxxx function to ...
    - Refactored ....
    ```
    
    ### Design choices
    
    RECOMMENDED to:
    - What types of design choices did you face?
    - What decisions you have made?
    - Any valuable information that could help reviewers to think critically
    
    Co-authored-by: Ming <[email protected]>
    lispc and hero78119 committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    4e5e78a View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2023

  1. Remove code duplication between returndatacopy and others (privacy-sc…

    …aling-explorations#1340)
    
    ### Description
    
    Remove code duplication between returndatacopy and others as they use
    similar test codes to construct bytecode for testing.
    
    ### Issue Link
    
    
    privacy-scaling-explorations#1324
    
    ### Type of change
    
    - [x] Refactor code
    
    ### Contents
    
    Remove code duplication in unit tests between returndatacopy, balance,
    calldataload and others. The unit tests should behave the same.
    
    ### Rationale
    
    It's easier to manage the mock bytecode when we move similar code into
    one place.
    
    ### How Has This Been Tested?
    
    Use the command `make test` to run unit tests 
    
    <hr>
    
    ---------
    
    Co-authored-by: Brecht Devos <[email protected]>
    xiaodino and Brechtpd committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    fa320ea View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2023

  1. Fix redundant constraint in StateCircuit (privacy-scaling-explorati…

    …ons#1339)
    
    ### Description
    
    Refer to comment in
    [privacy-scaling-explorations#1161](privacy-scaling-explorations#1161 (comment))
    
    ### Issue Link
    
    
    [privacy-scaling-explorations#1308](privacy-scaling-explorations#1308)
    
    ### Type of change
    
    - [x] 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
    
    ### This PR contains: 
    
    - Deleted
    [L401-402](https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/7e9603a28a818819c071c81fd2f4f6b58737dea6/zkevm-circuits/src/state_circuit/constraint_builder.rs#L402)
    in StateCircuit
    thomaspanf committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    896cd94 View commit details
    Browse the repository at this point in the history
  2. feat/privacy-scaling-explorations#1186 Unify restore_ctx and handle_r…

    …eturn in bus_mapping (privacy-scaling-explorations#1342)
    
    ### Description
    
    - unify handle_restore_context and gen_restore_context_ops
    
    ### Issue Link
    
    fix privacy-scaling-explorations#1186 
    
    ### Type of change
    
    - [x] refactor (non-breaking change which adds functionality)
    
    ### Contents
    
    - merge `gen_restore_context_ops` into `handle_restore_context`
    KimiWu123 committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    b476ef4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8f4f55c View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2023

  1. Bytecode soundness patch on last byte (privacy-scaling-explorations#1333

    )
    
    ### Description
    
    Fixes bug soundness in bytecode circuit, where an attacker can insert as
    many bytes after the last byte (row where `q_last`=1).
    
    ### Issue Link
    
    
    privacy-scaling-explorations#1332
    
    ### Type of change
    
    - [x] 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
    
    - Bug fix 1: Add a constraint that forces the next state to be "Header"
    when the current state is "Byte" and `index == length - 1`
    - Bug fix 2: set `q_enable=1` for the row where `q_last=1`
    
    ### Rationale
    
    This would patch the possibility of an attacker inserting false bytes
    that extend beyond the correct bytecode.
    
    ### How Has This Been Tested?
    
    Created a test called `bytecode_soundness_bug_1` that overwrites the
    last rows with`tag=Byte`.
    `cargo test --features test --package zkevm-circuits --lib --
    bytecode_circuit::circuit::tests::bytecode_soundness_bug_1 --exact
    --nocapture`
    Also ran other unit tests to check correctness was maintained.
    
    ---------
    
    Co-authored-by: Eduard S <[email protected]>
    rrzhang139 and ed255 committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    6b890d5 View commit details
    Browse the repository at this point in the history
  2. Fix ExecutionState::halts_in_exception (privacy-scaling-exploration…

    …s#1299)
    
    ### Description
    
    This PR aims to remove `ExecutionState::{ErrorDepth,InsufficientBalance
    ,ErrorContractAddressCollision}` from
    `ExecutionState::halts_in_exception` and handle `InsufficientBalance`
    properly by `CallOpGadget`
    
    ### Issue Link
    
    
    privacy-scaling-explorations#1298
    
    ### Type of change
    
    - [x] 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
    
    Some exception states happen right in the moment when we are doing
    `*CALL*` or `CREATE*`, including:
    
    - `ErrorDepth`
    - `ErrorInsufficientBalance`
    - `ErrorContractAddressCollision`
    
    Which will only be treated as failure of sub-call, and won't halt
    current call.
    
    ```mermaid
    stateDiagram-v2
        state fork <<fork>>
        state join <<join>>
        state NextCall {
            ...* --> join
        }
        state CurrentCall {
            ... --> fork
            fork --> CALL|CREATE
            fork --> ErrorDepth
            fork --> ErrorInsufficientBalance
            fork --> ErrorContractAddressCollision
            CALL|CREATE --> NextCall
            ErrorDepth --> join
            ErrorInsufficientBalance --> join
            ErrorContractAddressCollision --> join
            join --> NextStep
        }
    ```
    
    However, if we want to handle these as a separate state we'd have many
    constraint duplicated (e.g. gas cost calculation), so
    `ErrorInsufficientBalance` is merged into `CALL` in
    privacy-scaling-explorations#998
    without too much overhead. For the other 2 states we could apply the
    same strategy to avoid confusion.
    
    
    ### Rationale
    
    ### How Has This Been Tested?
    
    ### Design choices
    han0110 committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    c88d82d View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2023

  1. create tx by mock crate (privacy-scaling-explorations#1360)

    ### Description
    
    Fix issue privacy-scaling-explorations#1192 
    
    ### Issue Link
    
    Issue privacy-scaling-explorations#1192
    
    ### 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
    
    - [_item_]
    
    ### Rationale
    
    [_design decisions and extended information_]
    
    ### How Has This Been Tested?
    
    [_explanation_]
    
    <hr>
    
    ## How to fill a PR description 
    
    Please give a concise description of your PR.
    
    The target readers could be future developers, reviewers, and auditors.
    By reading your description, they should easily understand the changes
    proposed in this pull request.
    
    MUST: Reference the issue to resolve
    
    ### Single responsability
    
    Is RECOMMENDED to create single responsibility commits, but not
    mandatory.
    
    Anyway, you MUST enumerate the changes in a unitary way, e.g.
    
    ```
    This PR contains:
    - Cleanup of xxxx, yyyy
    - Changed xxxx to yyyy in order to bla bla
    - Added xxxx function to ...
    - Refactored ....
    ```
    
    ### Design choices
    
    RECOMMENDED to:
    - What types of design choices did you face?
    - What decisions you have made?
    - Any valuable information that could help reviewers to think critically
    vuvoth committed Apr 17, 2023
    Configuration menu
    Copy the full SHA
    3aa36a2 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2023

  1. Update geth dependency from v1.10.18 to v1.11.5 (privacy-scaling-expl…

    …orations#1363)
    
    ### Description
    
    Updates the geth dependency in geth-utils to latest release.
    
    Pulled this out from privacy-scaling-explorations#1361.
    
    ### Issue Link
    
    Related to privacy-scaling-explorations#1362.
    
    ### Type of change
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] 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
    
    - Update geth dependency (and ran `go mod tidy` to update
    sub-dependencies)
    - Update code bindings to struct changes
    
    ### Rationale
    
    N/A
    
    ### How Has This Been Tested?
    
    Using the testing suite in the repo.
    axic committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    3429f83 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2023

  1. Implement circuit for ErrorOutOfGasMemoryCopy state (privacy-scalin…

    …g-explorations#1288)
    
    ### Description
    
    Spec Markdown PR
    privacy-scaling-explorations/zkevm-specs#397
    
    #### Summary
    
    1. Merge OOG error `ExtCodeCopy` into `MemoryCopy`.
    
    2. Implement bus-mapping and circuit for this OOG error of
    `CALLDATACOPY`, `CODECOPY`, `EXTCODECOPY` and `RETURNDATACOPY` opcodes.
    
    3. OOG error executions of `CALLDATACOPY`, `CODECOPY` and
    `RETURNDATACOPY` are same.
    
    4. `EXTCODECOPY` has extra `1` stack pop, and constant gas costs are
    different for cold (2600) and warm (100) accounts according to EIP-2929
    (could reference [go-etherum gasExtCodeCopyEIP2929
    function](https://github.com/ethereum/go-ethereum/blob/master/core/vm/operations_acl.go#L116)).
    
    5. Fix `memory_copier_gas_cost` function to not calculate memory
    expansion for zero copy size in gas utils of `eth-types`.
    
    ### Issue Link
    
    Close
    privacy-scaling-explorations#1266
    
    ### Type of change
    
    - [X] New feature (non-breaking change which adds functionality)
    
    ### How Has This Been Tested?
    
    Add new unit-test cases for this error state.
    silathdiir committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    e55ba06 View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2023

  1. [refactor] refactor and add more helper in Bytecode (privacy-scaling-…

    …explorations#1365)
    
    ### Description
    
    Refactor and add more helper functions to Bytecode:
    - Removed several functions such as `call`, `balance`, `mstore`,
    `calldatacopy`, and `return_bytecode`
    - Added `op_jumpdest` function
    - Implemented `impl_push_n` macro to generate functions for `op_push1`
    to `op_push32`
    - Implemented `impl_other_opcodes` macro to generate functions for
    various opcodes like `op_stop`, `op_add`, `op_mul`, `op_sub`, and so on
    - Renamed opcode helper functions to `op_{opcode}` for consistency and
    clarity
    
    ### Issue Link
    
    N/A
    
    ### Type of change
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] 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
    
    - Removal of several functions
    - Addition of `op_jumpdest` function
    - Implementation of `impl_push_n` macro to generate functions for
    `op_push1` to `op_push32`
    - Implementation of `impl_other_opcodes` macro to generate functions for
    various opcodes
    - Renaming of opcode helper functions
    
    ### Rationale
    
    This refactor improves the code by removing unused functions, adding a
    new function, and implementing macros to generate functions for opcodes.
    The renaming of the opcode helper functions to `op_{opcode}` provides
    consistency and clarity to the codebase.
    
    ### How Has This Been Tested?
    
    https://github.com/scroll-tech/zkevm-circuits/actions/runs/4751119765
    lightsing committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    4e64bdb View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2023

  1. [chore] upgrade toolchain to nightly-2023-04-24 (privacy-scaling-expl…

    …orations#1373)
    
    ### Description
    
    Upgrade toolchain to nightly-2023-04-24 for future compatibilities.
    
    ### Issue Link
    
    N/A
    
    ### Type of change
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] 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
    
    - Toolchain upgrade to nightly-2023-04-24
    - Fix lint errors
    
    ### Rationale
    
    The toolchain currently in use is outdated and lacks stable features.
    Issue privacy-scaling-explorations#1372 requires GAT, which has been stabilized since version
    `1.65.0`. Meanwhile, the current stable Rust version is `1.69.0`.
    
    ### How Has This Been Tested?
    
    N/A
    lightsing committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    757d1ee View commit details
    Browse the repository at this point in the history
  2. Deduplicate code between evm ConstraintBuilder and BaseConstraintBuil…

    …der (privacy-scaling-explorations#1318)
    
    ### Description
    
    evm ConstraintBuilder and BaseConstraintBuilder have:
    
    require_zero
    require_equal
    require_boolean
    require_in_set
    condition
    add_constraints
    add_constraint
    validate_degree
    all with very similar implementation. Deduplicate them
    
    ### Issue Link
    
    
    privacy-scaling-explorations#1202
    
    ### Type of change
    
    - Refactor
    
    ### Contents
    
    - Created a trait for common code.
    
    ### Rationale
    
    DRY
    
    ### How Has This Been Tested?
    
    Run tests.
    
    ### Notes (TODO?)
    
    - condition and validate_degree use the state, I don't know what could
    be the rusty way of making this code common.
    - Perhaps we should rethought the names of the trait and structs,
    BaseConstraintBuilder seems to be used mostly outside EVM circuit, while
    ConstraintBuilder is used in the EVM circuit exclusively.
    
    ---------
    
    Co-authored-by: adria0.eth <[email protected]>
    leolara and adria0 committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    3902437 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2023

  1. [feat] add memory reconstruction for precompile (privacy-scaling-expl…

    …orations#1372)
    
    ### Description
    
    Added memory reconstruction for call to precompile contracts.
    
    ### Issue Link
    
    No issue is associated with this pull request.
    
    ### Type of change
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] 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
    
    - Added a new function `is_precompiled` to check if the address of the
    contract is a precompiled contract.
    - Added a new function `execute_precompiled` to execute a precompiled
    contract.
    - Added a new helper function `code_address` associated with `Call`
    struct to get the actual address of code execution.
    - Reconstruct memory for call to precompile address.
    
    ### Rationale
    
    The addition of support for call to precompiled contracts in bus-mapping
    allows no-memory exec trace.
    
    ### How Has This Been Tested?
    
    This PR only includes the memory reconstruction part. It has been test
    locally via
    `bus_mapping::evm::opcodes::callop::tests::test_precompiled_call`.
    
    ---------
    
    Co-authored-by: Zhang Zhuo <[email protected]>
    lightsing and lispc committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    e687615 View commit details
    Browse the repository at this point in the history
  2. Add SubCircuit::unusable_rows and tests for each SubCircuit (priv…

    …acy-scaling-explorations#1282)
    
    ### Description
    
    To remove magic numbers for blinding factors, this PR adds an associated
    function `unusable_rows` for `SubCircuit` to returns their
    `unusable_rows`, which should be `meta.blinding_factors() + 1`.
    
    Tests are also added to make sure the returned values are correct. 
    
    Note that currently `KeccakCircuit` could be configured by environment
    variable `KECCAK_ROWS` to decide how many rows a round would take, which
    affect the different rotation queried, and it's unfortunately not a easy
    way to compute how many different rotations are used, so this PR
    hardcodes the unusable rows from `KECCAK_ROWS = 1` to `20` for easy
    lookup.
    
    ### Issue Link
    
    
    privacy-scaling-explorations#949
    
    ### Type of change
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] 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
    
    - [_item_]
    
    ### Rationale
    
    [_design decisions and extended information_]
    
    ### How Has This Been Tested?
    
    [_explanation_]
    
    ---------
    
    Co-authored-by: David Nevado <[email protected]>
    Co-authored-by: "adria0.eth" <[email protected]>
    Co-authored-by: Eduard S <[email protected]>
    4 people committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    ab6a91a View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2023

  1. Fix to handle successful run with Uint64 overflow for multiple opcodes (

    privacy-scaling-explorations#1317)
    
    ### Description
    
    Fix successful run cases with Uint64 overflow for multiple opcodes.
    
    1. Add `WordByteRangeGadget` to constrain if Word is within the
    specified byte range.
    
    2. Add `WordByteCapGadget` to constrain if Word is within the specified
    byte range (implemented by WordByteRangeGadget) and less than a maximum
    cap (used to replace a WordByteRangeGadget and LtGadget).
    
    3. Fix bus-mapping and zkevm-circuits to handle overflow cases. And add
    unit-tests for these cases.
    
    TODO: will try to handle memory offset overflow with zero length in
    another PR (try to rebase for this local PR
    scroll-tech#393) and related
    issue
    privacy-scaling-explorations#1301.
    
    ### Rationale
    
    Reference detailed code in `go-etherum` as:
    
    .
    [BLOCKHASH](https://github.com/ethereum/go-ethereum/blob/master/core/vm/instructions.go#L438)
    .
    [CALLDATALOAD](https://github.com/ethereum/go-ethereum/blob/master/core/vm/instructions.go#L285)
    .
    [CALLDATACOPY](https://github.com/ethereum/go-ethereum/blob/master/core/vm/instructions.go#L306)
    .
    [CODECOPY](https://github.com/ethereum/go-ethereum/blob/master/core/vm/instructions.go#L364)
    .
    [EXTCODECOPY](https://github.com/ethereum/go-ethereum/blob/master/core/vm/instructions.go#L382)
    .
    [JUMPI](https://github.com/ethereum/go-ethereum/blob/master/core/vm/instructions.go#L550)
    
    ### Issue Link
    
    Close
    privacy-scaling-explorations#1276
    
    ### Type of change
    
    - [X] Bug fix (non-breaking change which fixes an issue)
    
    ### How Has This Been Tested?
    
    Add unit-test cases for Uint64 overflow values.
    
    ---------
    
    Co-authored-by: Zhang Zhuo <[email protected]>
    silathdiir and lispc committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    22dd263 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e6096ca View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    77bc7e5 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2023

  1. Add Byte Range Checks in LtChip (privacy-scaling-explorations#1364)

    ### Description
    
    Add Byte Range Checks in `LtChip`. This PR modifies the `LtChip`:
    
    - Added Fixed Column `u8` to the configuration of the chip 
    - Added a lookup constraint between each `diff` advice column and the
    `u8` column
    - Added `load` function that assigns each integer from 0 to 255 (8bits)
    to the `u8` column
    
    Furthermore, the following have been applied to the tests: 
    
    - In `less_than` testing, the circuit now takes `k = 9` to support a
    higher number of rows
    - In `copy_circuit` testing, the `assign_copy_events` function now calls
    `load` on the `lt_chip` to load the `u8` column
     
    ### Issue Link
    
    Related to privacy-scaling-explorations#916 
    
    ### Type of change
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    
    ### How Has This Been Tested?
    
    `make test-all`
    
    ---------
    
    Co-authored-by: adria0.eth <[email protected]>
    Co-authored-by: Chih Cheng Liang <[email protected]>
    3 people committed May 1, 2023
    Configuration menu
    Copy the full SHA
    4669a87 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2023

  1. Configuration menu
    Copy the full SHA
    7abf752 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    16f4e16 View commit details
    Browse the repository at this point in the history

Commits on May 4, 2023

  1. feat/ privacy-scaling-explorations#1180 refactor gen_begin_tx_ops and…

    … gen_end_tx_ops (privacy-scaling-explorations#1336)
    
    ### Description
    
    fix privacy-scaling-explorations#1180 
    
    ### Issue Link
    
    privacy-scaling-explorations#1180 
    
    ### Type of change
    
    - [x] New feature (non-breaking change which adds functionality)
    
    ### Contents
    
    see privacy-scaling-explorations#1180 
    
    ### Rationale
    
    [_design decisions and extended information_]
    
    ### How Has This Been Tested?
    
    Pass all the existing test cases
    
    ---------
    
    Co-authored-by: Han <[email protected]>
    KimiWu123 and han0110 committed May 4, 2023
    Configuration menu
    Copy the full SHA
    5b6c250 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a04940c View commit details
    Browse the repository at this point in the history
  3. Prune tx struct fields and rm witness Call (privacy-scaling-explorati…

    …ons#1378)
    
    ### Description
    
    We tried to remove some unused tx structs.
    
    ### Issue Link
    
    privacy-scaling-explorations#528 
    
    ### Type of change
    
    - [x] 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
    
    - Remove zkevm-circuits/src/witness/call.rs and the `Call` struct
    - Remove fields in circuit_input_builder Transaction struct. Reuse Geth
    type Transaction struct whenever possible
    - Remove duplicated call data gas cost computation
    - Add APIs to get "To" address so that we know when we want contract
    address or zero address.
    
    ### Rationale
    
    We try to start the de-duplication from the low-hanging fruits. So I
    didn't remove the witness.rs Transaction struct in this PR.
    
    ### How Has This Been Tested?
    
    Local build tests and quick tests
    ChihChengLiang committed May 4, 2023
    Configuration menu
    Copy the full SHA
    68e3d98 View commit details
    Browse the repository at this point in the history
  4. zellic-fix-1: fix typo in multiplied terms (privacy-scaling-explorati…

    …ons#1389)
    
    ### Description
    
    An important typo.
    
    ### Type of change
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    
    ### Contents
    
    - Add term `a[3] * b[1]` (was written as `b[2]`).
    
    Co-authored-by: Aurélien Nicolas <[email protected]>
    naure and Aurélien Nicolas committed May 4, 2023
    Configuration menu
    Copy the full SHA
    37b8aca View commit details
    Browse the repository at this point in the history
  5. Update halo2 dependency to v2023_04_20 (privacy-scaling-explorations#…

    …1374)
    
    ### Description
    
    Update halo2 to the latest dependency, which contains some changes
    affecting the `ff` trait.
    
    ### Issue Link
    
    Resolve privacy-scaling-explorations#1366
    
    ### Type of change
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] 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
    
    
    ### Rationale
    
    I've extended the `Field` trait we define in `eth_types` to contain the
    common traits used in different places, to avoid having a custom list of
    traits in each function.
    ed255 committed May 4, 2023
    Configuration menu
    Copy the full SHA
    b8ae7af View commit details
    Browse the repository at this point in the history

Commits on May 5, 2023

  1. LookupTable

    CeciliaZ030 committed May 5, 2023
    Configuration menu
    Copy the full SHA
    82c7942 View commit details
    Browse the repository at this point in the history
  2. cargo fix

    CeciliaZ030 committed May 5, 2023
    Configuration menu
    Copy the full SHA
    a43f688 View commit details
    Browse the repository at this point in the history

Commits on May 6, 2023

  1. Configuration menu
    Copy the full SHA
    6d0e84f View commit details
    Browse the repository at this point in the history

Commits on May 9, 2023

  1. circuit tools & test:

    CeciliaZ030 committed May 9, 2023
    Configuration menu
    Copy the full SHA
    4ee4a27 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2023

  1. Simplify bytecode circuit assignment (privacy-scaling-explorations#1397)

    ### Description
    
    We simplify the assignment logic in the bytecode circuit by reducing the
    number of function arguments. The reduction is achieved by
    
    1. Construct IsZero Chips early and make them a part of the circuit
    struct so that they don't stay with the function arguments.
    2. Create a new row struct that carries all the relevant data.
    
    ### Issue Link
    
    This would be part of privacy-scaling-explorations#1391. 
    
    ### Type of change
    
    - [x] 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
    
    ### Rationale
    
    - I avoid using `BytecodeRow` in the `bytecode_unroller` since they are
    part of the future simplification plan.
    
    
    ### How Has This Been Tested?
    
    Sent to the CI and pray.
    ChihChengLiang committed May 10, 2023
    Configuration menu
    Copy the full SHA
    fbbe1bd View commit details
    Browse the repository at this point in the history
  2. fix(testool): fix coinbase, solves privacy-scaling-explorations#1160 (p…

    …rivacy-scaling-explorations#1400)
    
    ### Description
    
    When running `testool --oneliner`, set the coinbase to `MOCK_COINBASE`
    and top up with 1 wei to register it into the state db.
    
    ### Issue Link
    
    privacy-scaling-explorations#1160 
    
    ### Type of change
    
    - [x] 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
    
    Co-authored-by: adria0 <adria0@nowhere>
    adria0 and adria0 committed May 10, 2023
    Configuration menu
    Copy the full SHA
    a807754 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2023

  1. Use halo2 circuit-params feature (privacy-scaling-explorations#1399)

    Refactor SuperCircuit and PiCircuit to use circuit parameters instead of
    associated constants.
    
    Resolve
    privacy-scaling-explorations#1393
    
    ### Type of change
    
    - [x] Breaking change (fix or feature that would cause existing
    functionality to not work as expected)
    
    ### Contents
    
    Using the `circuit-params` feature recently introduced in our fork of
    halo2 allows simplifying the code for circuits that require runtime
    parameters at configuration time. It removes the annoying associated
    const of the circuit types, and also allows having a single circuit type
    (no need for an extra circuit test type).
    ed255 committed May 11, 2023
    Configuration menu
    Copy the full SHA
    14bd7c9 View commit details
    Browse the repository at this point in the history
  2. trait ChallengeSet

    CeciliaZ030 committed May 11, 2023
    Configuration menu
    Copy the full SHA
    32d81d9 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2023

  1. compiled ChallengeSet

    CeciliaZ030 committed May 12, 2023
    Configuration menu
    Copy the full SHA
    bfdf4d4 View commit details
    Browse the repository at this point in the history
  2. clippy

    CeciliaZ030 committed May 12, 2023
    Configuration menu
    Copy the full SHA
    156f847 View commit details
    Browse the repository at this point in the history
  3. Replace Witness.rs's ExecStep with CIP's (privacy-scaling-exploration…

    …s#1403)
    
    ### Description
    
    - We replace ExecStep struct in witness.rs with the one in the Circuit
    Input Builder.
    - We add some convenient methods in CIP's ExecStep so that we don't
    create extra struct fields.
    - Add `get_rws` method to `witness::Block` to streamline the logic of
    getting Read-Write records.
    
    ### Issue Link
    
    Part of privacy-scaling-explorations#1391
    
    ### Type of change
    
    - [x] 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
    
    ### Rationale
    
    - Notes for reviewers, one place that might be error-prone would be the
    rw_indices. After the cleanup in this PR, we can replace the manual
    counting of rw indices with something like
    `evm_circuit::utils::StepRws`.
    
    ---------
    
    Co-authored-by: Eduard S. <[email protected]>
    ChihChengLiang and ed255 committed May 12, 2023
    Configuration menu
    Copy the full SHA
    0e1d230 View commit details
    Browse the repository at this point in the history
  4. example 1 phase error

    CeciliaZ030 committed May 12, 2023
    Configuration menu
    Copy the full SHA
    d6923a9 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2023

  1. Set keccak logs to debug level (privacy-scaling-explorations#1405)

    ### Description
    
    Keccak circuit logs messages that make CI logs hard to reason.
    
    We can set it from "INFO" level to "DEBUG" level to suppress the
    messages in the CI output but still keep it for develoepers.
    
    
    
    https://github.com/privacy-scaling-explorations/zkevm-circuits/actions/runs/4955284960/jobs/8864549606#step:13:50
    
    <details><summary>Details</summary>
    <p>
    
    ```
    test mock_prover::serial_test_exp_circuit_multiple_transfers_0 ... ok
    [2023-05-12T05:00:22Z INFO  integration_tests::integration_test_circuits] test Keccak circuit, block: #1 - Transfer 0
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post absorb:
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 2
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 7
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post padding:
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 1
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 10
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post theta:
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 14
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 38
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post rho/pi:
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 53
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 191
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post chi:
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: [52](https://github.com/privacy-scaling-explorations/zkevm-circuits/actions/runs/4955284960/jobs/8864549606#step:13:53)
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 195
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post squeeze:
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 1
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 198
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Degree: 4
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Minimum rows: [61](https://github.com/privacy-scaling-explorations/zkevm-circuits/actions/runs/4955284960/jobs/8864549606#step:13:62)
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Total Lookups: 123
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Total Columns: 198
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] num unused cells: 229
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size absorb: 4
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size theta: 2
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size theta c: 2
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size theta t: 3
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size rho/pi: 3
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size chi base: 3
    [2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] uniform part sizes: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
    ```
    
    </p>
    </details> 
    
    
    ### Issue Link
    
    
    ### Type of change
    
    - [x] 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
    ChihChengLiang committed May 15, 2023
    Configuration menu
    Copy the full SHA
    5dba7f7 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2023

  1. Move stats to bin (privacy-scaling-explorations#1407)

    ### Description
    
    We have 4 utility commands that show us statistics of different
    circuits. Currently, these features were compiled with the tests,
    causing dependency and feature flags management troubles. The commands
    also cause confusion with the ignored test flags.
    
    We can enjoy many benefits if we keep these commands in binary
    executables.
    
    - We can compile them on demand. We remove compilation overheads for the
    main components and tests.
    - Stats commands are confined in the `bin` directory, so we don't have
    confusing testing code.
    
    ### Issue Link
    
    It was privacy-scaling-explorations#1246. After exploring, I found room for improving the status
    quo.
    
    ### Type of change
    
    - [x] 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
    
    - Move the underlying logics of `make stats_state_circuit`, `make
    stats_evm_circuit`, `make stats_copy_circuit`, and `make
    evm_exec_steps_occupancy` to `bin` directory.
    - Add a feature flag, `stats` for these specific tools.
    - Remove `DisplayTable` and replace all its use with `cli-table`'s
    feature. This has the benefit that the line of codes in the codebase
    reflects more on the core zkevm functionality. After we used
    `cli-table`, the table also rendered differently, see images below.
    - Move `cli-table` from `dev-dependency` to `dependency`, but as an
    optional dependency.
    - Remove dead dependency `subtle` and `criterion`
    
    After:
    <img width="508" alt="Screenshot 2023-05-14 at 3 26 43 PM"
    src="https://github.com/privacy-scaling-explorations/zkevm-circuits/assets/3391420/a4d32ce1-3559-4057-852e-b9b358f18553">
    Before:
    <img width="471" alt="Screenshot 2023-05-14 at 3 27 53 PM"
    src="https://github.com/privacy-scaling-explorations/zkevm-circuits/assets/3391420/a073763d-71e1-4c15-876b-7e4252970875">
    
    
    ### Rationale
    
    - Some undesirable results were introduced.
    - We left the Instrument struct unchanged. The `Instrument` is buried
    deep in the ExecutionConfig. We intend to deal with it in future PRs to
    keep the diff of this one slim.
    - We changed some visibilities of structs and functions in evm circuits
    from `pub(crate)` to `pub`
    
    ### How Has This Been Tested?
    
    Manual run `make stats_state_circuit`, `make stats_evm_circuit`, `make
    stats_copy_circuit`, and `make evm_exec_steps_occupancy` and see if they
    work.
    ChihChengLiang committed May 16, 2023
    Configuration menu
    Copy the full SHA
    ead0b3d View commit details
    Browse the repository at this point in the history
  2. Rm dead code except of zkevm circuits (privacy-scaling-explorations#1408

    )
    
    ### Description
    
    We remove `#![allow(dead_code)]` everywhere in the codebases other than
    `zkevm-circuits`.
    
    This PR should be merged after privacy-scaling-explorations#1407 
    
    ### Issue Link
    
    No issue yet
    
    ### Type of change
    
    - [x] 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
    
    - Removed `#![allow(dead_code)]` everywhere other than `zkevm-circuits`.
    - Make test utility functions like `Block::get_test_degree` and
    `Sha3CodeGen` public functions so that they don't cause `cargo build -p
    zkevm-circuits` to fail. This might come with the cost of extra
    compilation time.
    - Refactor `gen_sha3_code` into `Sha3CodeGen` so that we don't have to
    import `MemoryKind` to use it.
    ChihChengLiang committed May 16, 2023
    Configuration menu
    Copy the full SHA
    ef13927 View commit details
    Browse the repository at this point in the history
  3. Add rustdocflags config for macos in Makefile (privacy-scaling-ex…

    …plorations#1412)
    
    ### Description
    
    Add `rustdocflags` override in `Makefile` when it's macos to make doc
    test work.
    
    Note that `config.toml` doesn't support to specify `rustdocflags` under
    `[target.'cfg(target_os = "macos")']` (see
    rust-lang/cargo#11323) so we have to use command
    line override to add it manually.
    
    ### Issue Link
    
    Resolves
    privacy-scaling-explorations#1410
    
    ### Type of change
    
    - [x] 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
    
    ### How Has This Been Tested?
    
    On macos, run `make test_doc`.
    
    Co-authored-by: Chih Cheng Liang <[email protected]>
    han0110 and ChihChengLiang committed May 16, 2023
    Configuration menu
    Copy the full SHA
    255a9bc View commit details
    Browse the repository at this point in the history
  4. Retype Gas limit and nonce to u64 (privacy-scaling-explorations#1409)

    ### Description
    
    - Gas limit from Word to u64
    - Nonce from Word to u64
    
    ### Issue Link
    
    Fix privacy-scaling-explorations#1377
    
    ### Type of change
    
    - [x] 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
    
    - change geth_type Account's nonce and gas_limit to eth_core::U64. We
    can not use simple u64 because we need to serialize nonce and gas_limit
    to hex value with 0x prefix for Geth RPC to use.
    - simple u64 is used in rest of the places.
    
    ### Rationale
    ChihChengLiang committed May 16, 2023
    Configuration menu
    Copy the full SHA
    d21952d View commit details
    Browse the repository at this point in the history

Commits on May 17, 2023

  1. Split table into files (privacy-scaling-explorations#1402)

    ### Description
    Split table into files.
    
    * prior
    This is one the new pr of privacy-scaling-explorations#1061
    
    ---------
    
    Co-authored-by: Chih Cheng Liang <[email protected]>
    SuccinctPaul and ChihChengLiang committed May 17, 2023
    Configuration menu
    Copy the full SHA
    438bac5 View commit details
    Browse the repository at this point in the history
  2. Remove RwTableTag (privacy-scaling-explorations#1406)

    ### Description
    
    `RwTableTag` can be fully replaced by `Target`.
    
    ### Issue Link
    
    Part of privacy-scaling-explorations#1391 
    
    ### Type of change
    
    - [x] 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
    
    We add EnumIter, Hash, Expr to Target to let it serve different needs.
    
    Note to reviewers: the `impl From<Target> for usize` is required by
    BinaryNumberConfig.
    ChihChengLiang committed May 17, 2023
    Configuration menu
    Copy the full SHA
    69cb8a9 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2023

  1. Fix infinite loop (privacy-scaling-explorations#1421)

    ### Description
    
    Fix an infinite loop from a `From` implementation calling itself.
    
    ### Issue Link
    
    Resolve
    privacy-scaling-explorations#1420
    Related
    privacy-scaling-explorations#1417
    
    ### Type of change
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    
    ### Contents
    
    @ChihChengLiang found that this issue was introduced in
    privacy-scaling-explorations#1406
    and by debugging on the debug build I found the infinite loop (which
    caused the stack to overflow which terminated the program with a
    segfault). The segfault is not observed in the release build, I guess
    the compiler optimizes the recursive call into an infinite loop, so the
    stack is never exhausted.
    ed255 committed May 19, 2023
    Configuration menu
    Copy the full SHA
    70d7da4 View commit details
    Browse the repository at this point in the history
  2. updates

    CeciliaZ030 committed May 19, 2023
    Configuration menu
    Copy the full SHA
    244fe70 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2023

  1. Bug: fix to truncate offset from Word to Uint64 when length is zero f…

    …or some opcodes (privacy-scaling-explorations#1415)
    
    ### Description
    
    Reference go-ethereum function
    [calcMemSize64WithUint](https://github.com/ethereum/go-ethereum/blob/84c3799e21d61d677965715fe09f8209660b4009/core/vm/common.go#L38),
    ignore to check Uint64 overflow for memory offset if length is zero.
    
    it is also called by
    [calcMemSize64](https://github.com/ethereum/go-ethereum/blob/84c3799e21d61d677965715fe09f8209660b4009/core/vm/common.go#LL31C9-L31C30).
    And both are used for opcodes in
    [memory_table.go](https://github.com/ethereum/go-ethereum/blob/84c3799e21d61d677965715fe09f8209660b4009/core/vm/memory_table.go#L20)
    as `memorySize` in
    [jump_table.go](https://github.com/ethereum/go-ethereum/blob/84c3799e21d61d677965715fe09f8209660b4009/core/vm/jump_table.go#L387).
    
    For Call opcodes, in offset and size are truncated to Uint64 as
    [opCall](https://github.com/ethereum/go-ethereum/blob/84c3799e21d61d677965715fe09f8209660b4009/core/vm/instructions.go#LL672C60-L672C60).
    
    ### Issue Link
    
    Related issue
    privacy-scaling-explorations#1301
    
    Original local PR scroll-tech#393
    
    ### Type of change
    
    - [X] Bug fix (non-breaking change which fixes an issue)
    
    ### How Has This Been Tested?
    
    1. Fix `testool` case `randomStatetest85_d0_g0_v0`.
    2. Add test cases of overflow offset and zero length for related
    opcodes.
    silathdiir committed May 20, 2023
    Configuration menu
    Copy the full SHA
    43c67c9 View commit details
    Browse the repository at this point in the history
  2. refactor CellManager

    CeciliaZ030 committed May 20, 2023
    Configuration menu
    Copy the full SHA
    bcfd2d5 View commit details
    Browse the repository at this point in the history
  3. moved things around

    CeciliaZ030 committed May 20, 2023
    Configuration menu
    Copy the full SHA
    2c5f3c5 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2023

  1. compiled in mpt

    CeciliaZ030 committed May 23, 2023
    Configuration menu
    Copy the full SHA
    5508767 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c498841 View commit details
    Browse the repository at this point in the history
  3. Fix EXTCODECOPY with empty account (privacy-scaling-explorations#1429)

    ### Description
    
    We treat empty accounts by storing their code_hash in the RwTable as 0.
    EXTCODECOPY was obtaining the bytecode length by querying the bytecode
    table with code_hash=0 on existing accounts, but that entry should be
    invalid (there's no bytecode with code_hash=0). Skip the bytecode table
    length lookup when code_hash=0.
    
    I've also reintroduced the `Block::debug_print_txs_steps_rw_ops`
    function, updated to use the new `Block::get_rws` API. This function is
    not used in the code, but it's very convenient to call it when
    debugging.
    
    ### Issue Link
    
    Resolve
    privacy-scaling-explorations#1190
    
    ### Type of change
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    ed255 committed May 23, 2023
    Configuration menu
    Copy the full SHA
    626f4b9 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2023

  1. [CREATE Part A (updated)] Modification to Copy Circuit (privacy-scali…

    …ng-explorations#1419)
    
    ### Description
    
    NOTE: This is an updated version of
    privacy-scaling-explorations#1356
    
    This is Part A of a 3 part pull request to add support for
    `CREATE`/`CREATE2` opcodes.
    
    Part A:
    privacy-scaling-explorations#1356
    Part B:
    privacy-scaling-explorations#1357
    Part C:
    privacy-scaling-explorations#1358
    
    ### Issue Link
    
    privacy-scaling-explorations#1130 
    
    ### Type of change
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] 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
     
    As part of the bigger additions needed for the `CREATE`/`CREATE2`
    opcodes' gadget, this PR adds support for the copy circuit to "always"
    have a value accumulator field `value_acc`.
    
    ### Rationale
    
    We need a value accumulator (of the random linear combination) in order
    to get the `RLC(bytes)` for the bytes copied from `Memory` to `Bytecode`
    (specifically the init code). This RLC is later used to do a lookup to
    the Keccak table to check the value of `keccak256(init_code)`.
    
    ### How Has This Been Tested?
    
    The existing tests for copy circuit pass for the updated constraints on
    the copy circuit.
    
    ---------
    
    Co-authored-by: Rohit Narurkar <[email protected]>
    Co-authored-by: KimiWu <[email protected]>
    3 people committed May 25, 2023
    Configuration menu
    Copy the full SHA
    dbe67c8 View commit details
    Browse the repository at this point in the history

Commits on May 26, 2023

  1. Feat/CREATE Part B - Error cases that will be handled within opcode g…

    …adgets (privacy-scaling-explorations#1425)
    
    ### Description
    
    **NOTE: This is an updated version of
    privacy-scaling-explorations#1357
    
    This PR is actually based on top of privacy-scaling-explorations#1419
    
    ### Issue Link
    
    privacy-scaling-explorations#1130 
    
    ### Type of change
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] 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
    Error types for insufficient balance and nonce overflow. These are
    supporting changes required for the CREATE/CREATE2 opcodes' gadget.
    
    ### Rationale
    The above errors will be handled within the CREATE/CREATE2 opcodes'
    gadget. In case of insufficient balance, it is also handled in the
    CallOp gadget for call related opcodes.
    
    ---------
    
    Co-authored-by: Rohit Narurkar <[email protected]>
    KimiWu123 and roynalnaruto committed May 26, 2023
    Configuration menu
    Copy the full SHA
    5e1d35e View commit details
    Browse the repository at this point in the history

Commits on May 29, 2023

  1. Remove release drafter (privacy-scaling-explorations#1436)

    ### Description
    
    The release drafter was used to create a list of changes in the release
    note. As Github now provides this functionality by native, there's no
    need to maintain this CI script.
    
    ### Issue Link
    
    [_link issue here_]
    
    ### Type of change
    
    - [x] 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
    ChihChengLiang committed May 29, 2023
    Configuration menu
    Copy the full SHA
    96d2e3c View commit details
    Browse the repository at this point in the history

Commits on May 30, 2023

  1. Configuration menu
    Copy the full SHA
    7bfe635 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2023

  1. Configuration menu
    Copy the full SHA
    bc1d2e1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9488ddd View commit details
    Browse the repository at this point in the history
  3. Remove keccak256 crate and migrate keccak plain to eth-types (privacy…

    …-scaling-explorations#1440)
    
    ### Description
    
    - We remove the keccak256 crate.
    - We migrate the keccak256 plain implementation to the eth-types crate.
    
    As we migrate keccak circuit to the zkevm-crate, most of the functions
    left in keccak256 crate are unused except of the plain keccak hash
    implementation.
    
    Most of the crates in the codebase depend on keccak256 crate because
    they use the plain keccak hash. The plain keccak hash is only 300 lines
    big. It would be beneficial to keep a plain implementation for people to
    audit the optimized keccak circuit.
    
    ### Type of change
    
    Bug fix (non-breaking change which fixes an issue)
    ChihChengLiang committed May 31, 2023
    Configuration menu
    Copy the full SHA
    73b2aeb View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2023

  1. Configuration menu
    Copy the full SHA
    1ec2fe8 View commit details
    Browse the repository at this point in the history
  2. Sync MPT to main (privacy-scaling-explorations#1444)

    ### Description
    
    This PR simply merges the current `main` into the MPT branch `mpt2`.
    This is the first step to get some further MPT changes merged into the
    MPT branch without making the PRs too big.
    
    ```
    This PR contains:
    - Merge `main` into `mpt2` with the necessary changes to the MPT circuit
    ```
    
    ### Issue Link
    
    [_link issue here_]
    
    ### 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
    
    - [_item_]
    
    ### Rationale
    
    [_design decisions and extended information_]
    
    ### How Has This Been Tested?
    
    Intermediate step, so limited testing
    
    ---------
    
    Signed-off-by: smtmfft <[email protected]>
    Signed-off-by: smtmfft <[email protected]>
    Co-authored-by: pinkiebell <[email protected]>
    Co-authored-by: Haichen Shen <[email protected]>
    Co-authored-by: z2trillion <[email protected]>
    Co-authored-by: Eduard S <[email protected]>
    Co-authored-by: adria0.eth <[email protected]>
    Co-authored-by: Han <[email protected]>
    Co-authored-by: smtmfft <[email protected]>
    Co-authored-by: smtmfft <[email protected]>
    Co-authored-by: Chih Cheng Liang <[email protected]>
    Co-authored-by: DreamWuGit <[email protected]>
    Co-authored-by: Rohit Narurkar <[email protected]>
    Co-authored-by: Zhang Zhuo <[email protected]>
    Co-authored-by: Ming <[email protected]>
    Co-authored-by: Wu Sung Ming <[email protected]>
    Co-authored-by: xiaodino <[email protected]>
    Co-authored-by: Mason Liang <[email protected]>
    Co-authored-by: Steven <[email protected]>
    Co-authored-by: Carlos Pérez <[email protected]>
    Co-authored-by: Paul <[email protected]>
    Co-authored-by: AronisAt79 <[email protected]>
    Co-authored-by: Mason Liang <[email protected]>
    Co-authored-by: JohnWick2ETH <[email protected]>
    Co-authored-by: kunxian xia <[email protected]>
    Co-authored-by: Leo Lara <[email protected]>
    Co-authored-by: zengzengzenghuy <[email protected]>
    Co-authored-by: john xu <[email protected]>
    Co-authored-by: Miha Stopar <[email protected]>
    Co-authored-by: aguzmant103 <[email protected]>
    Co-authored-by: Richord <[email protected]>
    Co-authored-by: Kimi Wu <[email protected]>
    Co-authored-by: Mickey <[email protected]>
    Co-authored-by: Luozhu <[email protected]>
    Co-authored-by: DoHoon Kim <[email protected]>
    Co-authored-by: jeong0982 <[email protected]>
    Co-authored-by: Andy Arditi <[email protected]>
    Co-authored-by: David Nevado <[email protected]>
    Co-authored-by: omahs <[email protected]>
    Co-authored-by: Richord <[email protected]>
    Co-authored-by: ntampakas <[email protected]>
    Co-authored-by: ashWhiteHat <[email protected]>
    Co-authored-by: naure <[email protected]>
    Co-authored-by: Aurélien Nicolas <[email protected]>
    Co-authored-by: testuser-at-490752553772 <[email protected]>
    Co-authored-by: xiaodino <[email protected]>
    Co-authored-by: Thomas Pan <[email protected]>
    Co-authored-by: Akase Cho <[email protected]>
    Co-authored-by: Vu <[email protected]>
    Co-authored-by: Alex Beregszaszi <[email protected]>
    Co-authored-by: Enrico Bottazzi <[email protected]>
    Co-authored-by: adria0 <adria0@nowhere>
    Configuration menu
    Copy the full SHA
    439a389 View commit details
    Browse the repository at this point in the history
  3. static lookup work!

    CeciliaZ030 committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    c95cd91 View commit details
    Browse the repository at this point in the history
  4. WIP fixes

    Brechtpd committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    47b46f8 View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2023

  1. Replace Gas, GasCost and ProgramCounter by u64. (privacy-scaling-expl…

    …orations#1448)
    
    ### Description
    This is a very small MRs removing some overhead. It replaces the
    types/structures for Gas, GasCost and ProgramCounter by u64.
    
    ### Issue Link
    Issue privacy-scaling-explorations#1404 
    
    ### Type of change
    
    - [x] 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
    
    ### Rationale
    Keeping the existing code but removing the structures.
    
    ### How Has This Been Tested?
    No tests were added.
    
    ---------
    
    Co-authored-by: adria0.eth <[email protected]>
    rrtoledo and adria0 committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    092ab1f View commit details
    Browse the repository at this point in the history
  2. Add PiCircuit to integration tests (privacy-scaling-explorations#1447)

    ### Description
    
    This is a very small PR. While investigating
    privacy-scaling-explorations#1439
    I noticed we don't have an integration test for the Public Inputs
    Circuit, so I just added it.
    
    ### Type of change
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] 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
    ed255 committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    7715ef2 View commit details
    Browse the repository at this point in the history
  3. feat: add shanghai feature and make CI pass with Shanghai geth trac…

    …es (privacy-scaling-explorations#1424)
    
    ### Description
    
    1. Add Shanghai related fields to chain config in geth-utils.
    
    2. EIP-3651 (Warm COINBASE): add a new access-list write for coinbase to
    Begin TX.
    
    3. Part of EIP-3860 (Limit and meter initcode): only add gas cost of
    init code to Begin TX (missing gas cost changes in Create and OOG
    Create).
    
    ### Issue Link
    
    Issue
    privacy-scaling-explorations#1362
    
    Local related PRs:
    scroll-tech#497
    scroll-tech#500
    scroll-tech#507
    
    Reference previous PR:
    privacy-scaling-explorations#1361
    
    ### Type of change
    
    - [x] Breaking change (fix or feature that would cause existing
    functionality to not work as expected)
    
    ### How Has This Been Tested?
    
    Unit test cases of CI could pass with Shanghai geth traces.
    
    ---------
    
    Co-authored-by: Zhang Zhuo <[email protected]>
    silathdiir and lispc committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    de9f845 View commit details
    Browse the repository at this point in the history
  4. Fix RLC is_lt_128 (privacy-scaling-explorations#1449)

    ### Description
    
    In the RLC gadget, the indicator `is_lt_128` must be equivalent to
    `value < 128`.
    
    However, currently only the `true` case is handled. This PR handles both
    `true` and `false` cases.
    
    ### Issue Link
    
    Scroll internal.
    
    ### Type of change
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    
    ---------
    
    Co-authored-by: Aurélien Nicolas <[email protected]>
    Co-authored-by: Han <[email protected]>
    3 people committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    7b77f9c View commit details
    Browse the repository at this point in the history
  5. Most things work

    Brechtpd committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    f09702a View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2023

  1. Configuration menu
    Copy the full SHA
    64a0d81 View commit details
    Browse the repository at this point in the history
  2. Add ext key odd check

    Brechtpd committed Jun 3, 2023
    Configuration menu
    Copy the full SHA
    80d97b9 View commit details
    Browse the repository at this point in the history
  3. Better mocked randomness

    Brechtpd committed Jun 3, 2023
    Configuration menu
    Copy the full SHA
    03f0f74 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2023

  1. Add RLP decoding lookups

    Brechtpd committed Jun 4, 2023
    Configuration menu
    Copy the full SHA
    5f8c754 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    40dc38e View commit details
    Browse the repository at this point in the history
  3. small improvements

    Brechtpd committed Jun 4, 2023
    Configuration menu
    Copy the full SHA
    7346463 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2023

  1. Merge branch 'main' into mpt2

    # Conflicts:
    #	Cargo.lock
    #	circuit-benchmarks/Cargo.toml
    #	eth-types/src/geth_types.rs
    #	gadgets/src/util.rs
    #	keccak256/Cargo.toml
    #	keccak256/src/arith_helpers.rs
    #	keccak256/src/keccak_arith.rs
    #	keccak256/src/lib.rs
    #	keccak256/src/plain.rs
    #	testool/src/compiler.rs
    #	zkevm-circuits/Cargo.toml
    #	zkevm-circuits/src/evm_circuit.rs
    #	zkevm-circuits/src/pi_circuit.rs
    #	zkevm-circuits/src/state_circuit.rs
    #	zkevm-circuits/src/state_circuit/constraint_builder.rs
    #	zkevm-circuits/src/table.rs
    #	zkevm-circuits/src/table/keccak_table.rs
    #	zkevm-circuits/src/table/mpt_table.rs
    #	zkevm-circuits/src/tx_circuit/dev.rs
    #	zkevm-circuits/src/tx_circuit/sign_verify.rs
    #	zkevm-circuits/src/util.rs
    #	zkevm-circuits/src/witness/mpt.rs
    Brechtpd committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    53c8cdb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f4f33a1 View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'upstream/mpt2' into circuit-tools-wip

    # Conflicts:
    #	Cargo.lock
    #	gadgets/src/util.rs
    #	rust-toolchain
    #	zkevm-circuits/Cargo.toml
    #	zkevm-circuits/src/bytecode_circuit/circuit.rs
    #	zkevm-circuits/src/bytecode_circuit/dev.rs
    #	zkevm-circuits/src/circuit_tools/gadgets.rs
    #	zkevm-circuits/src/evm_circuit.rs
    #	zkevm-circuits/src/evm_circuit/step.rs
    #	zkevm-circuits/src/evm_circuit/util.rs
    #	zkevm-circuits/src/evm_circuit/util/instrumentation.rs
    #	zkevm-circuits/src/keccak_circuit/cell_manager.rs
    #	zkevm-circuits/src/lib.rs
    #	zkevm-circuits/src/mpt_circuit.rs
    #	zkevm-circuits/src/mpt_circuit/account_leaf.rs
    #	zkevm-circuits/src/mpt_circuit/branch.rs
    #	zkevm-circuits/src/mpt_circuit/extension.rs
    #	zkevm-circuits/src/mpt_circuit/helpers.rs
    #	zkevm-circuits/src/mpt_circuit/rlp_gadgets.rs
    #	zkevm-circuits/src/mpt_circuit/start.rs
    #	zkevm-circuits/src/mpt_circuit/storage_leaf.rs
    #	zkevm-circuits/src/table.rs
    #	zkevm-circuits/src/tx_circuit.rs
    Brechtpd committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    76b69bd View commit details
    Browse the repository at this point in the history
  4. misc cleanup

    Brechtpd committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    3a59b4c View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2023

  1. more cleanup

    Brechtpd committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    8ec4362 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2023

  1. some more cleanup

    Brechtpd committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    d3ed9ce View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    71ff2c2 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2023

  1. some more cleanup

    Brechtpd committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    6dad45a View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2023

  1. Configuration menu
    Copy the full SHA
    4abbbe5 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2023

  1. Configuration menu
    Copy the full SHA
    101be36 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    709c923 View commit details
    Browse the repository at this point in the history
  3. remove use_dynamic_lookup

    CeciliaZ030 committed Jun 17, 2023
    Configuration menu
    Copy the full SHA
    15b3794 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d330654 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2023

  1. is_split implemented from spliting at insertion time

    condition excluded, would be better if optimize condition as well
    CeciliaZ030 committed Jun 18, 2023
    Configuration menu
    Copy the full SHA
    4f7790e View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2023

  1. Configuration menu
    Copy the full SHA
    7e141c4 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2023

  1. mult_inv & mult_diff_be

    CeciliaZ030 committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    0ebd57f View commit details
    Browse the repository at this point in the history
  2. adds challenge

    CeciliaZ030 committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    51ef3f9 View commit details
    Browse the repository at this point in the history
  3. change some names

    CeciliaZ030 committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    502eb86 View commit details
    Browse the repository at this point in the history
  4. clean up

    CeciliaZ030 committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    4fdd8e7 View commit details
    Browse the repository at this point in the history
  5. clean up

    CeciliaZ030 committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    0fe1e7d View commit details
    Browse the repository at this point in the history
  6. fix & fmt

    CeciliaZ030 committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    487f570 View commit details
    Browse the repository at this point in the history
  7. clean up & comments

    CeciliaZ030 committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    626ca59 View commit details
    Browse the repository at this point in the history
  8. cleanup

    CeciliaZ030 committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    0632daf View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2023

  1. cm with ctx

    CeciliaZ030 committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    b8ae87c View commit details
    Browse the repository at this point in the history
  2. cm with ctx

    CeciliaZ030 committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    0e43ed9 View commit details
    Browse the repository at this point in the history
  3. fix & fmt

    CeciliaZ030 committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    3632f83 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    97e7c2a View commit details
    Browse the repository at this point in the history
  5. fix

    CeciliaZ030 committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    f9dc002 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #14 from CeciliaZ030/challenge-api

    Challenge api
    CeciliaZ030 committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    d58d793 View commit details
    Browse the repository at this point in the history
  7. permutable

    CeciliaZ030 committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    531a020 View commit details
    Browse the repository at this point in the history