Skip to content

Commit

Permalink
refactor: one zero package (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xaatif authored Sep 16, 2024
1 parent e1def1b commit 6932ab3
Show file tree
Hide file tree
Showing 59 changed files with 169 additions and 621 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
* @muursh @Nashtare
/evm_arithmetization/ @wborgeaud @muursh @Nashtare @LindaGuiga
/zero_bin/ @muursh @Nashtare @atanmarko
/zero/ @muursh @Nashtare @atanmarko
/smt_trie/ @0xaatif @muursh @Nashtare
/mpt_trie/ @0xaatif @Nashtare @muursh
/trace_decoder/ @0xaatif @muursh @Nashtare
Expand Down
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
- changed-files:
- any-glob-to-any-file: proof_gen/**

# Add 'crate: zero_bin' label to any changes within 'zero_bin' folder.
# Add 'crate: zero_bin' label to any changes within 'zero' folder.
'crate: zero_bin':
- changed-files:
- any-glob-to-any-file: zero_bin/**
- any-glob-to-any-file: zero/**

# Add 'specs' label to any changes within 'docs' or `book` folder.
'specs':
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,7 @@ jobs:

- name: Test in zero_bin subdirectory
run: |
cargo test --manifest-path zero_bin/common/Cargo.toml
cargo test --manifest-path zero_bin/leader/Cargo.toml
cargo test --manifest-path zero_bin/ops/Cargo.toml
cargo test --manifest-path zero_bin/prover/Cargo.toml
cargo test --manifest-path zero_bin/rpc/Cargo.toml
cargo test --manifest-path zero_bin/verifier/Cargo.toml
cargo test --manifest-path zero_bin/worker/Cargo.toml
cargo test --manifest-path zero/Cargo.toml
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
Expand Down Expand Up @@ -188,9 +182,7 @@ jobs:
uses: actions/checkout@v3

- name: Run the script
run: |
pushd zero_bin/tools
./prove_stdio.sh artifacts/witness_b19807080.json
run: ./scripts/prove_stdio.sh artifacts/witness_b19807080.json

simple_proof_witness_only:
name: Execute bash script to generate the proof witness for a small block.
Expand All @@ -201,9 +193,7 @@ jobs:
uses: actions/checkout@v3

- name: Run the script
run: |
pushd zero_bin/tools
./prove_stdio.sh artifacts/witness_b19807080.json test_only
run: ./scripts/prove_stdio.sh artifacts/witness_b19807080.json test_only

multi_blocks_proof_regular:
name: Execute bash script to generate and verify a proof for multiple blocks using parallel proving.
Expand All @@ -214,9 +204,7 @@ jobs:
uses: actions/checkout@v3

- name: Run the script
run: |
pushd zero_bin/tools
./prove_stdio.sh artifacts/witness_b3_b6.json
run: ./scripts/prove_stdio.sh artifacts/witness_b3_b6.json

lints:
name: Rustdoc, Formatting and Clippy
Expand Down Expand Up @@ -244,7 +232,7 @@ jobs:
run: cargo clippy --all-targets -- -D warnings -A incomplete-features

- name: Run cargo clippy (with `cdk_erigon` flag)
run: cargo clippy --all-targets --no-default-features --features cdk_erigon -- -D warnings -A incomplete-features
run: cargo clippy --package zero --all-targets --no-default-features --features cdk_erigon -- -D warnings -A incomplete-features

- name: Rustdoc
run: cargo doc --all
6 changes: 2 additions & 4 deletions .github/workflows/jerigon-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,15 @@ jobs:
- name: Run prove blocks with native tracer in test_only mode
run: |
ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)"
cd zero_bin/tools
ulimit -n 8192
OUTPUT_TO_TERMINAL=true ./prove_rpc.sh 0x1 0xf $ETH_RPC_URL native true 3000 100 test_only
OUTPUT_TO_TERMINAL=true ./scripts/prove_rpc.sh 0x1 0xf $ETH_RPC_URL native true 3000 100 test_only
echo "Proving blocks in test_only mode finished"
- name: Run prove blocks with native tracer in real mode
run: |
ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)"
cd zero_bin/tools
rm -rf proofs/* circuits/* ./proofs.json test.out verify.out leader.out
OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./prove_rpc.sh 0x4 0x7 $ETH_RPC_URL native true 3000 100
OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./scripts/prove_rpc.sh 0x4 0x7 $ETH_RPC_URL native true 3000 100
echo "Proving blocks in real mode finished"
- name: Shut down network
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/jerigon-zero.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,16 @@ jobs:
- name: Run prove blocks with zero tracer in test_only mode
run: |
ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)"
cd zero_bin/tools
ulimit -n 8192
OUTPUT_TO_TERMINAL=true ./prove_rpc.sh 0x1 0xf $ETH_RPC_URL jerigon true 3000 100 test_only
OUTPUT_TO_TERMINAL=true ./scripts/prove_rpc.sh 0x1 0xf $ETH_RPC_URL jerigon true 3000 100 test_only
echo "Proving blocks in test_only mode finished"
- name: Run prove blocks with zero tracer in real mode
run: |
ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)"
cd zero_bin/tools
rm -rf proofs/* circuits/* ./proofs.json test.out verify.out leader.out
OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./prove_rpc.sh 0x2 0x5 $ETH_RPC_URL jerigon true 3000 100
OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./scripts/prove_rpc.sh 0x2 0x5 $ETH_RPC_URL jerigon true 3000 100
echo "Proving blocks in real mode finished"
- name: Shut down network
Expand Down
29 changes: 23 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
/**/target
# Alphabetically, by-category

# Build artifacts
#################
/target
**/*.rs.bk
*.iml
.idea/
.vscode

# Editors
#########
/.idea/
/.vscode
/*.iml

# Misc
######
/**/*.ignoreme
**/output.log
/**/*.ipynb
/**/*.log
/**/*.out
# Hardcoded in https://github.com/0xPolygonZero/zk_evm/blob/v0.6.0/zero_bin/common/src/debug_utils.rs#L9
/debug

# Proof artifacts
#################
/proofs
/**/*.zkproof
154 changes: 19 additions & 135 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6932ab3

Please sign in to comment.