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

Have block proof only use final public values #459

Closed
wants to merge 4 commits into from
Closed
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
23 changes: 12 additions & 11 deletions evm_arithmetization/src/fixed_recursive_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ use crate::get_challenges::observe_public_values_target;
use crate::memory::segments::Segment;
use crate::proof::{
AllProof, BlockHashesTarget, BlockMetadataTarget, ExtraBlockData, ExtraBlockDataTarget,
FinalPublicValues, MemCapTarget, PublicValues, PublicValuesTarget, RegistersDataTarget,
TrieRoots, TrieRootsTarget, TARGET_HASH_SIZE,
FinalPublicValues, FinalPublicValuesTarget, MemCapTarget, PublicValues, PublicValuesTarget,
RegistersDataTarget, TrieRoots, TrieRootsTarget, TARGET_HASH_SIZE,
};
use crate::prover::testing::prove_all_segments;
use crate::prover::{check_abort_signal, prove, GenerationSegmentData, SegmentDataIterator};
use crate::recursive_verifier::{
add_common_recursion_gates, add_virtual_public_values, get_memory_extra_looking_sum_circuit,
recursive_stark_circuit, set_public_value_targets, PlonkWrapperCircuit, PublicInputs,
StarkWrapperCircuit,
add_common_recursion_gates, add_virtual_final_public_values, add_virtual_public_values,
get_memory_extra_looking_sum_circuit, recursive_stark_circuit, set_final_public_value_targets,
set_public_value_targets, PlonkWrapperCircuit, PublicInputs, StarkWrapperCircuit,
};
use crate::util::{h160_limbs, h256_limbs, u256_limbs};
use crate::verifier::initial_memory_merkle_cap;
Expand Down Expand Up @@ -388,7 +388,7 @@ where
has_parent_block: BoolTarget,
parent_block_proof: ProofWithPublicInputsTarget<D>,
agg_root_proof: ProofWithPublicInputsTarget<D>,
public_values: PublicValuesTarget,
public_values: FinalPublicValuesTarget,
cyclic_vk: VerifierCircuitTarget,
}

Expand Down Expand Up @@ -421,7 +421,7 @@ where
let has_parent_block = buffer.read_target_bool()?;
let parent_block_proof = buffer.read_target_proof_with_public_inputs()?;
let agg_root_proof = buffer.read_target_proof_with_public_inputs()?;
let public_values = PublicValuesTarget::from_buffer(buffer)?;
let public_values = FinalPublicValuesTarget::from_buffer(buffer)?;
let cyclic_vk = buffer.read_target_verifier_circuit()?;
Ok(Self {
circuit,
Expand Down Expand Up @@ -1214,7 +1214,7 @@ where
has_parent_block,
parent_block_proof,
agg_root_proof,
public_values,
public_values: public_values.into(),
cyclic_vk,
}
}
Expand Down Expand Up @@ -2140,9 +2140,10 @@ where
.map(|p| TrieRoots::from_public_inputs(&p.public_inputs[0..TrieRootsTarget::SIZE]))
.unwrap_or(public_values.trie_roots_before),
..public_values
};
}
.into();

set_public_value_targets(
set_final_public_value_targets(
&mut block_inputs,
&self.block.public_values,
&block_public_values,
Expand All @@ -2152,7 +2153,7 @@ where
})?;

let block_proof = self.block.circuit.prove(block_inputs)?;
Ok((block_proof, block_public_values.into()))
Ok((block_proof, block_public_values))
}

pub fn verify_block(&self, block_proof: &ProofWithPublicInputs<F, C, D>) -> anyhow::Result<()> {
Expand Down
Loading
Loading