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

Commit

Permalink
[word lo/hi] retain ci test on word-lo-hi branch on all subcircuit (#…
Browse files Browse the repository at this point in the history
…1496)

### Description

retain all test

### Issue Link

Close
#1478

### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

### Content

- retain/rollback ci.yml workaround changes
- fix copy circuit unittest
  • Loading branch information
hero78119 authored Jun 29, 2023
1 parent e1350c8 commit a3e4e3e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 33 deletions.
65 changes: 48 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,16 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# TODO add back light tests
# - name: Run light tests # light tests are run in parallel
# uses: actions-rs/cargo@v1
# with:
# command: test
# args: --verbose --release --all --all-features --exclude integration-tests --exclude circuit-benchmarks
# TODO remove sub circuit light tests
- name: Run circuit light tests # light tests are run in parallel
- name: Run light tests # light tests are run in parallel
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --release --all --all-features --exclude integration-tests --exclude circuit-benchmarks --package zkevm-circuits --lib -- evm_circuit keccak_circuit exp_circuit pi_circuit state_circuit # tx_circuit/copy_circuit/bytecode_circuit/root_circuit ...more subcircuits
# - name: Run heavy tests # heavy tests are run serially to avoid OOM
# uses: actions-rs/cargo@v1
# with:
# command: test
# args: --verbose --release --all --all-features --exclude integration-tests --exclude circuit-benchmarks serial_ -- --ignored --test-threads 1
args: --verbose --release --all --all-features --exclude integration-tests --exclude circuit-benchmarks
- name: Run heavy tests # heavy tests are run serially to avoid OOM
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --release --all --all-features --exclude integration-tests --exclude circuit-benchmarks serial_ -- --ignored --test-threads 1

build:
needs: [skip_check]
Expand Down Expand Up @@ -137,6 +130,47 @@ jobs:
command: test
args: --verbose --release --all-features -p circuit-benchmarks --no-run

bitrot:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')

name: Bitrot check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
override: false
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# Build benchmarks to prevent bitrot
- name: Build benchmarks
uses: actions-rs/cargo@v1
with:
command: build
args: --benches --examples --all-features

doc-links:
needs: [skip_check]
if: |
Expand Down Expand Up @@ -228,6 +262,3 @@ jobs:
with:
command: fmt
args: --all -- --check

# TODO: We plan to bring the following Github action back when merge to main
# bitrot:
36 changes: 21 additions & 15 deletions zkevm-circuits/src/copy_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,18 @@ impl<F: Field> SubCircuitConfig<F> for CopyCircuitConfig<F> {
Target::Memory.expr(),
meta.query_advice(id.lo(), Rotation::cur()), // call_id
meta.query_advice(addr, Rotation::cur()), // memory address
0.expr(),
0.expr(),
meta.query_advice(value, Rotation::cur()),
0.expr(),
0.expr(),
0.expr(),
0.expr(), // field tag
0.expr(), // storage_key_lo
0.expr(), // storage_key_hi
meta.query_advice(value, Rotation::cur()), // value_lo
0.expr(), // value_hi
0.expr(), // value_prev_lo
0.expr(), // value_prev_hi
0.expr(), // init_val_lo
0.expr(), // init_val_hi
]
.into_iter()
.zip(rw_table.table_exprs(meta).into_iter())
.zip_eq(rw_table.table_exprs(meta).into_iter())
.map(|(arg, table)| (cond.clone() * arg, table))
.collect()
});
Expand All @@ -365,15 +368,18 @@ impl<F: Field> SubCircuitConfig<F> for CopyCircuitConfig<F> {
Target::TxLog.expr(),
meta.query_advice(id.lo(), Rotation::cur()), // tx_id
meta.query_advice(addr, Rotation::cur()), // byte_index || field_tag || log_id
0.expr(),
0.expr(),
meta.query_advice(value, Rotation::cur()),
0.expr(),
0.expr(),
0.expr(),
0.expr(), // field tag
0.expr(), // storage_key_lo
0.expr(), // storage_key_hi
meta.query_advice(value, Rotation::cur()), // value_lo
0.expr(), // value_hi
0.expr(), // value_prev_lo
0.expr(), // value_prev_hi
0.expr(), // init_val_lo
0.expr(), // init_val_hi
]
.into_iter()
.zip(rw_table.table_exprs(meta).into_iter())
.zip_eq(rw_table.table_exprs(meta).into_iter())
.map(|(arg, table)| (cond.clone() * arg, table))
.collect()
});
Expand All @@ -391,7 +397,7 @@ impl<F: Field> SubCircuitConfig<F> for CopyCircuitConfig<F> {
meta.query_advice(value, Rotation::cur()),
]
.into_iter()
.zip(bytecode_table.table_exprs(meta).into_iter())
.zip_eq(bytecode_table.table_exprs(meta).into_iter())
.map(|(arg, table)| (cond.clone() * arg, table))
.collect()
});
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/super_circuit/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn super_circuit_degree() {
SuperCircuit::configure_with_params(&mut cs, params);
log::info!("super circuit degree: {}", cs.degree());
log::info!("super circuit minimum_rows: {}", cs.minimum_rows());
assert!(cs.degree() <= 9);
assert!(cs.degree() <= 12);
}

fn test_super_circuit(block: GethData, circuits_params: CircuitsParams, mock_randomness: Fr) {
Expand Down

0 comments on commit a3e4e3e

Please sign in to comment.