Skip to content

Commit

Permalink
v0.7.0 release (#808)
Browse files Browse the repository at this point in the history
* Bump with plonky2 v1.0.0

* Update CHANGELOG

* Bump versions

* Update lock
  • Loading branch information
Nashtare authored Nov 26, 2024
1 parent 4a99bcc commit cf5ad6a
Show file tree
Hide file tree
Showing 10 changed files with 274 additions and 43 deletions.
216 changes: 216 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

56 changes: 26 additions & 30 deletions Cargo.lock

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

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ num-traits = "0.2.19"
nunny = "0.2.1"
once_cell = "1.19.0"
# TODO: update when paladin is released to 0.4.4 with abort signal support
paladin-core = { git = "https://github.com/0xPolygonZero/paladin.git", branch = "main" }
paladin-core = { git = "https://github.com/0xPolygonZero/paladin.git", rev = "f58cbc14a751f1000603cfd9fdd4f350986ec2e7" }
parking_lot = "0.12.3"
pest = "2.7.10"
pest_derive = "2.7.10"
Expand Down Expand Up @@ -103,19 +103,19 @@ url = "2.5.2"
winnow = "0.6.13"

# local dependencies
evm_arithmetization = { path = "evm_arithmetization", version = "0.4.0", default-features = false }
mpt_trie = { path = "mpt_trie", version = "0.4.1" }
smt_trie = { path = "smt_trie", version = "0.1.1" }
trace_decoder = { path = "trace_decoder", version = "0.6.0", default-features = false }
evm_arithmetization = { path = "evm_arithmetization", version = "0.5.0", default-features = false }
mpt_trie = { path = "mpt_trie", version = "0.5.0" }
smt_trie = { path = "smt_trie", version = "0.2.0" }
trace_decoder = { path = "trace_decoder", version = "0.7.0", default-features = false }
zk_evm_common = { path = "common", version = "0.1.0" }
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 = "2488cdacd49ede15737bc1172546d82e9521b79b" }
plonky2_maybe_rayon = "0.2.0"
plonky2_util = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "2488cdacd49ede15737bc1172546d82e9521b79b" }
starky = { git = "https://github.com/0xPolygonZero/plonky2.git", rev = "2488cdacd49ede15737bc1172546d82e9521b79b" }
plonky2 = "1.0.0"
plonky2_maybe_rayon = "1.0.0"
plonky2_util = "1.0.0"
starky = "1.0.0"

[workspace.lints.clippy]
too_long_first_doc_paragraph = "allow"
2 changes: 1 addition & 1 deletion evm_arithmetization/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "evm_arithmetization"
description = "Implementation of STARKs for the Ethereum Virtual Machine"
version = "0.4.0"
version = "0.5.0"
authors = [
"Daniel Lubarov <[email protected]>",
"William Borgeaud <[email protected]>",
Expand Down
1 change: 1 addition & 0 deletions evm_arithmetization/src/get_challenges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ pub mod testing {
Some(&ctl_challenges),
true,
config,
None,
))
} else {
None
Expand Down
2 changes: 2 additions & 0 deletions evm_arithmetization/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ where
Some(ctl_challenges),
challenger,
&[],
None,
None,
timing,
)
.map(|proof_with_pis| StarkProofWithMetadata {
Expand Down
16 changes: 16 additions & 0 deletions evm_arithmetization/src/recursive_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use core::fmt::Debug;
use anyhow::Result;
use ethereum_types::{BigEndianHash, U256};
use plonky2::field::extension::Extendable;
use plonky2::fri::FriConfig;
use plonky2::gates::constant::ConstantGate;
use plonky2::gates::exponentiation::ExponentiationGate;
use plonky2::gates::gate::GateRef;
Expand Down Expand Up @@ -93,6 +94,7 @@ where
C: GenericConfig<D, F = F>,
C::Hasher: AlgebraicHasher<F>,
{
pub(crate) stark_fri_config: FriConfig,
pub(crate) circuit: CircuitData<F, C, D>,
pub(crate) stark_proof_target: StarkProofTarget<D>,
pub(crate) ctl_challenges_target: GrandProductChallengeSet<Target>,
Expand All @@ -113,6 +115,7 @@ where
gate_serializer: &dyn GateSerializer<F, D>,
generator_serializer: &dyn WitnessGeneratorSerializer<F, D>,
) -> IoResult<()> {
buffer.write_fri_config(&self.stark_fri_config)?;
buffer.write_circuit_data(&self.circuit, gate_serializer, generator_serializer)?;
buffer.write_target_vec(self.init_challenger_state_target.as_ref())?;
buffer.write_target(self.zero_target)?;
Expand All @@ -127,6 +130,7 @@ where
gate_serializer: &dyn GateSerializer<F, D>,
generator_serializer: &dyn WitnessGeneratorSerializer<F, D>,
) -> IoResult<Self> {
let stark_fri_config = buffer.read_fri_config()?;
let circuit = buffer.read_circuit_data(gate_serializer, generator_serializer)?;
let target_vec = buffer.read_target_vec()?;
let init_challenger_state_target =
Expand All @@ -136,6 +140,7 @@ where
let ctl_challenges_target = GrandProductChallengeSet::from_buffer(buffer)?;

Ok(Self {
stark_fri_config,
circuit,
stark_proof_target,
ctl_challenges_target,
Expand All @@ -151,10 +156,18 @@ where
) -> Result<ProofWithPublicInputs<F, C, D>> {
let mut inputs = PartialWitness::new();

let stark_config = StarkConfig {
fri_config: self.stark_fri_config.clone(),
// we only care about the FRI parameters
..Default::default()
};
let degree_bits = proof_with_metadata.proof.recover_degree_bits(&stark_config);

set_stark_proof_target(
&mut inputs,
&self.stark_proof_target,
&proof_with_metadata.proof,
degree_bits,
self.zero_target,
)?;

Expand Down Expand Up @@ -298,6 +311,8 @@ where
challenges,
Some(&ctl_vars),
inner_config,
degree_bits,
None,
);

add_common_recursion_gates(&mut builder);
Expand All @@ -309,6 +324,7 @@ where

let circuit = builder.build::<C>();
StarkWrapperCircuit {
stark_fri_config: inner_config.fri_config.clone(),
circuit,
stark_proof_target,
ctl_challenges_target,
Expand Down
2 changes: 1 addition & 1 deletion mpt_trie/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mpt_trie"
description = "Types and utility functions for building/working with partial Ethereum tries."
version = "0.4.1"
version = "0.5.0"
authors = ["Polygon Zero <[email protected]>"]
readme = "README.md"
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion smt_trie/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "smt_trie"
description = "Types and utility functions for building/working with Polygon Hermez Sparse Merkle Trees."
version = "0.1.1"
version = "0.2.0"
authors = ["William Borgeaud <[email protected]>"]
readme = "README.md"
categories = ["cryptography"]
Expand Down
2 changes: 1 addition & 1 deletion trace_decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "trace_decoder"
description = "Ethereum node witness -> Prover input"
authors = ["Polygon Zero"]
version = "0.6.0"
version = "0.7.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
Expand Down

0 comments on commit cf5ad6a

Please sign in to comment.