Skip to content

Commit

Permalink
Bump plonky2 (serialization fix) (#729)
Browse files Browse the repository at this point in the history
* Bump plonky2

* Fix test and add serialization check

* Add test

* Move test to empty_tables

* Apply comments

* Revert "Apply comments"

This reverts commit 50553fd.

* Tweak test

* Pin to main branch
  • Loading branch information
Nashtare authored Oct 17, 2024
1 parent fa1e2f9 commit 4f70195
Show file tree
Hide file tree
Showing 9 changed files with 347 additions and 198 deletions.
15 changes: 8 additions & 7 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 @@ -111,10 +111,10 @@ zk_evm_proc_macro = { path = "proc_macro", version = "0.1.0" }
zero = { path = "zero", default-features = false }

# plonky2-related dependencies
plonky2 = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "8463effe0dd1472a52906cd12ffb047885db42ee" }
plonky2 = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "2488cdacd49ede15737bc1172546d82e9521b79b" }
plonky2_maybe_rayon = "0.2.0"
plonky2_util = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "8463effe0dd1472a52906cd12ffb047885db42ee" }
starky = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "8463effe0dd1472a52906cd12ffb047885db42ee" }
plonky2_util = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "2488cdacd49ede15737bc1172546d82e9521b79b" }
starky = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "2488cdacd49ede15737bc1172546d82e9521b79b" }

[workspace.lints.clippy]
too_long_first_doc_paragraph = "allow"
19 changes: 19 additions & 0 deletions evm_arithmetization/src/all_stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ impl Table {
}
}

/// The total number of CTLs used by the zkEVM.
pub(crate) const NUM_CTLS: usize = if cfg!(feature = "cdk_erigon") { 13 } else { 10 };
/// The position of the Memory CTL within all CTLs of the zkEVM.
pub(crate) const MEMORY_CTL_IDX: usize = 6;

/// Returns all the `CrossTableLookups` used for proving the EVM.
pub(crate) fn all_cross_table_lookups<F: Field>() -> Vec<CrossTableLookup<F>> {
vec![
Expand Down Expand Up @@ -419,3 +424,17 @@ fn ctl_poseidon_general_output<F: Field>() -> CrossTableLookup<F> {
poseidon_stark::ctl_looked_general_output(),
)
}

#[cfg(test)]
mod tests {
use plonky2::field::goldilocks_field::GoldilocksField;

use super::*;

type F = GoldilocksField;

#[test]
fn check_num_ctls() {
assert_eq!(all_cross_table_lookups::<F>().len(), NUM_CTLS);
}
}
Loading

0 comments on commit 4f70195

Please sign in to comment.