Skip to content

Commit

Permalink
feat(prover): parallelized memory queues simulation in BWG (#2652)
Browse files Browse the repository at this point in the history
## What ❔

The updated logic of memory queue simulation in the test_harness
requires changing the structure of the BWG artifacts. When processing
memory queues for ram permutation circuit, part of the witness is sent
to storage separately. For this reason, a new type of circuit wrapper
has been added - partial base circuit. Also added logic required to
transform a partial base layer circuit into a full one (merging
structures) for WVG and proving.

These changes can significantly reduce peak RAM usage in BWG, while
speeding up the slowest part of the witness generation process.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
  • Loading branch information
0xVolosnikov committed Aug 16, 2024
1 parent cd6d648 commit b4ffcd2
Show file tree
Hide file tree
Showing 16 changed files with 349 additions and 125 deletions.
56 changes: 28 additions & 28 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ circuit_sequencer_api_1_3_3 = { package = "circuit_sequencer_api", version = "0.
circuit_sequencer_api_1_4_0 = { package = "circuit_sequencer_api", version = "0.140" }
circuit_sequencer_api_1_4_1 = { package = "circuit_sequencer_api", version = "0.141" }
circuit_sequencer_api_1_4_2 = { package = "circuit_sequencer_api", version = "0.142" }
circuit_sequencer_api_1_5_0 = { package = "circuit_sequencer_api", version = "=0.150.2" }
circuit_sequencer_api_1_5_0 = { package = "circuit_sequencer_api", version = "=0.150.4" }
crypto_codegen = { package = "zksync_solidity_vk_codegen", version = "=0.1.0" }
kzg = { package = "zksync_kzg", version = "=0.150.2" }
kzg = { package = "zksync_kzg", version = "=0.150.4" }
zk_evm = { version = "=0.133.0" }
zk_evm_1_3_1 = { package = "zk_evm", version = "0.131.0-rc.2" }
zk_evm_1_3_3 = { package = "zk_evm", version = "0.133.0" }
zk_evm_1_4_0 = { package = "zk_evm", version = "0.140.0" }
zk_evm_1_4_1 = { package = "zk_evm", version = "0.141.0" }
zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.0" }
zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.4" }

# New VM; pinned to a specific commit because of instability
vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "9a38900d7af9b1d72b47ce3be980e77c1239a61d" }
Expand Down
1 change: 1 addition & 0 deletions core/lib/object_store/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ impl FileBackedObjectStore {
Bucket::ProofsFri,
Bucket::StorageSnapshot,
Bucket::TeeVerifierInput,
Bucket::RamPermutationCircuitQueueWitness,
] {
let bucket_path = format!("{base_dir}/{bucket}");
fs::create_dir_all(&bucket_path).await?;
Expand Down
2 changes: 2 additions & 0 deletions core/lib/object_store/src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub enum Bucket {
StorageSnapshot,
DataAvailability,
TeeVerifierInput,
RamPermutationCircuitQueueWitness,
}

impl Bucket {
Expand All @@ -39,6 +40,7 @@ impl Bucket {
Self::StorageSnapshot => "storage_logs_snapshots",
Self::DataAvailability => "data_availability",
Self::TeeVerifierInput => "tee_verifier_inputs",
Self::RamPermutationCircuitQueueWitness => "ram_permutation_witnesses",
}
}
}
Expand Down
Loading

0 comments on commit b4ffcd2

Please sign in to comment.