Skip to content

Commit

Permalink
feat: expand trace decoder tests (#394)
Browse files Browse the repository at this point in the history
* feat: expand trace decoder tests

* chore: show json parsing error details

* fix: change testing image

* fix: run tests in release mode

* feat: parallel execution

* fix: comment

* fix: nit

* fix: disable cdk erigon tests until we generate witness files

* fix: format

* fix: review

* fix: review

* fix: nit
  • Loading branch information
atanmarko authored Jul 17, 2024
1 parent 3336055 commit a5b92b2
Show file tree
Hide file tree
Showing 22 changed files with 924 additions and 105 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

test_trace_decoder:
name: Test trace_decoder
runs-on: ubuntu-latest
runs-on: zero-ci
timeout-minutes: 30
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
Expand All @@ -61,10 +61,9 @@ jobs:
cache-on-failure: true

- name: Test in trace_decoder subdirectory
run: cargo test --manifest-path trace_decoder/Cargo.toml
run: cargo test --release --manifest-path trace_decoder/Cargo.toml -- --nocapture
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
RUST_LOG: 1
RUST_LOG: info
CARGO_INCREMENTAL: 1
RUST_BACKTRACE: 1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jerigon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
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 0x8 $ETH_RPC_URL jerigon true 3000 100
OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./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
141 changes: 123 additions & 18 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions trace_decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ winnow = { workspace = true }
criterion = { workspace = true }
pretty_env_logger = { workspace = true }
serde_json = { workspace = true }
prover = { workspace = true }
serde_path_to_error = { workspace = true }
plonky2_maybe_rayon = { workspace = true }
alloy-rpc-types-eth = "0.1.4"
rstest = "0.21.0"


[[bench]]
name = "block_processing"
Expand Down
13 changes: 7 additions & 6 deletions trace_decoder/src/type1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,13 @@ fn iter_leaves(node: Node) -> Box<dyn Iterator<Item = (Vec<U4>, IterLeaf)>> {
}

#[test]
fn test() {
for (ix, case) in
serde_json::from_str::<Vec<super::Case>>(include_str!("test_cases/zero_jerigon.json"))
.unwrap()
.into_iter()
.enumerate()
fn test_tries() {
for (ix, case) in serde_json::from_str::<Vec<super::Case>>(include_str!(
"../tests/data/tries/zero_jerigon.json"
))
.unwrap()
.into_iter()
.enumerate()
{
println!("case {}", ix);
let instructions = crate::wire::parse(&case.bytes).unwrap();
Expand Down
13 changes: 7 additions & 6 deletions trace_decoder/src/type2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,13 @@ fn iter_leaves(node: Node) -> Box<dyn Iterator<Item = (BitVec, Either<[u8; 32],
}

#[test]
fn test() {
for (ix, case) in
serde_json::from_str::<Vec<super::Case>>(include_str!("test_cases/hermez_cdk_erigon.json"))
.unwrap()
.into_iter()
.enumerate()
fn test_tries() {
for (ix, case) in serde_json::from_str::<Vec<super::Case>>(include_str!(
"../tests/data/tries/hermez_cdk_erigon.json"
))
.unwrap()
.into_iter()
.enumerate()
{
println!("case {}", ix);
let instructions = crate::wire::parse(&case.bytes).unwrap();
Expand Down
File renamed without changes.

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

Loading

0 comments on commit a5b92b2

Please sign in to comment.