Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: one zero package #625

Merged
merged 27 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
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':
Comment on lines +21 to 22
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: we may want to rename the lint to crate: zero as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept this the same for convenience (e.g looking at historical issues). Happy to change :)

- 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
32 changes: 26 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
/**/target
# Alphabetically, by-category

# Build artifacts
#################
# Ours
/circuits
# Rust's
/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
Loading