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

Bump plonky2 (serialization fix) #729

Merged
merged 8 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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);
}
Comment on lines +437 to +439
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can't add such check for the MEMORY_CTL_IDX constant, because the looked_table field within CrossTableLookup is crate-private, though I could change it in the sibling PR if wanted.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can add a comment before ctl_memory(), to indicate we cannot change its position.

}
Loading
Loading