Skip to content

Commit

Permalink
fix(l2): fix zkVM performance test (#1202)
Browse files Browse the repository at this point in the history
**Motivation**

This test uses the `test_data/genesis-l2.json` and
`test_data/l2-loadtest.rlp` files. The genesis file was changed in
#1158, breaking the test because now the genesis block hash changed and
so the second block's parent isn't present in the chain anymore. The
test only executed in the CI whenever a file in `crates/l2/prover/` was
touched, leaving the breaking change unnoticed.


Needed for #1133

**Description**

- bring back the old genesis file as `test_data/genesis-l2-old.json` (a
better solution would be to regenerate`test_data/l2-loadtest.rlp`).
- change the test's CI job to always execute.
  • Loading branch information
xqft authored Nov 19, 2024
1 parent 80f9d34 commit 064bd79
Show file tree
Hide file tree
Showing 3 changed files with 551 additions and 12 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/l2_prover_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ name: L2 Prover CI
on:
push:
branches: ["main"]
paths:
- "crates/l2/prover/**"
pull_request:
branches: ["**"]
paths:
- "crates/l2/prover/**"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
11 changes: 3 additions & 8 deletions crates/l2/prover/tests/perf_zkvm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::path::PathBuf;
use std::path::Path;
use tracing::info;

use ethereum_rust_blockchain::add_block;
Expand All @@ -11,15 +11,10 @@ use ethereum_rust_vm::execution_db::ExecutionDB;
async fn test_performance_zkvm() {
tracing_subscriber::fmt::init();

let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
// Go back 3 levels (Go to the root of the project)
for _ in 0..3 {
path.pop();
}
path.push("test_data");
let mut path = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/../../../test_data"));

// Another use is genesis-execution-api.json in conjunction with chain.rlp(20 blocks not too loaded).
let genesis_file_path = path.join("genesis-l2.json");
let genesis_file_path = path.join("genesis-l2-old.json");
// l2-loadtest.rlp has blocks with many txs.
let chain_file_path = path.join("l2-loadtest.rlp");

Expand Down
Loading

0 comments on commit 064bd79

Please sign in to comment.