diff --git a/lightclient-circuits/src/committee_update_circuit.rs b/lightclient-circuits/src/committee_update_circuit.rs index d85f66bc..c7c14dbf 100644 --- a/lightclient-circuits/src/committee_update_circuit.rs +++ b/lightclient-circuits/src/committee_update_circuit.rs @@ -63,7 +63,7 @@ impl CommitteeUpdateCircuit { // Finalized header let finalized_state_root = args - .finalized_header + .attested_header .state_root .as_ref() .iter() @@ -73,11 +73,11 @@ impl CommitteeUpdateCircuit { builder, &sha256_chip, [ - args.finalized_header.slot.into_witness(), - args.finalized_header.proposer_index.into_witness(), - args.finalized_header.parent_root.as_ref().into_witness(), + args.attested_header.slot.into_witness(), + args.attested_header.proposer_index.into_witness(), + args.attested_header.parent_root.as_ref().into_witness(), finalized_state_root.clone().into(), - args.finalized_header.body_root.as_ref().into_witness(), + args.attested_header.body_root.as_ref().into_witness(), ], )?; @@ -180,7 +180,7 @@ impl CommitteeUpdateCircuit { let ssz_root = pk_vector.hash_tree_root().unwrap(); - let finalized_header_root = args.finalized_header.clone().hash_tree_root().unwrap(); + let finalized_header_root = args.attested_header.clone().hash_tree_root().unwrap(); let instance_vec = iter::once(poseidon_commitment) .chain(ssz_root.as_ref().iter().map(|b| bn256::Fr::from(*b as u64))) @@ -278,7 +278,7 @@ mod tests { CommitteeRotationArgs { pubkeys_compressed, _spec: PhantomData, - finalized_header, + attested_header: finalized_header, sync_committee_branch: committee_root_branch, } } diff --git a/lightclient-circuits/src/sync_step_circuit.rs b/lightclient-circuits/src/sync_step_circuit.rs index 8b5e5041..5ec6f26a 100644 --- a/lightclient-circuits/src/sync_step_circuit.rs +++ b/lightclient-circuits/src/sync_step_circuit.rs @@ -428,9 +428,7 @@ mod tests { use ark_std::{end_timer, start_timer}; use eth_types::Testnet; use halo2_base::{ - halo2_proofs::dev::MockProver, - halo2_proofs::{halo2curves::bn256::Fr, poly::commitment::Params}, - utils::fs::gen_srs, + halo2_proofs::dev::MockProver, halo2_proofs::halo2curves::bn256::Fr, utils::fs::gen_srs, }; use snark_verifier_sdk::{ evm::{evm_verify, gen_evm_proof_shplonk}, diff --git a/lightclient-circuits/src/witness/rotation.rs b/lightclient-circuits/src/witness/rotation.rs index 89c8d0d2..a171d1cc 100644 --- a/lightclient-circuits/src/witness/rotation.rs +++ b/lightclient-circuits/src/witness/rotation.rs @@ -9,7 +9,9 @@ use std::{iter, marker::PhantomData}; pub struct CommitteeRotationArgs { pub pubkeys_compressed: Vec>, - pub finalized_header: BeaconBlockHeader, + // Attested header that containts the state root with new sync committee. + // This header going to become finilized in the adjacent step proof (that is submited along with this one in Spectre.sol::rotate). + pub attested_header: BeaconBlockHeader, pub sync_committee_branch: Vec>, @@ -57,7 +59,7 @@ impl Default for CommitteeRotationArgs { .take(S::SYNC_COMMITTEE_SIZE) .collect_vec(), sync_committee_branch, - finalized_header: BeaconBlockHeader { + attested_header: BeaconBlockHeader { state_root: state_root.as_slice().try_into().unwrap(), ..Default::default() }, diff --git a/preprocessor/src/rotation.rs b/preprocessor/src/rotation.rs index 82458d3b..58f7dfb2 100644 --- a/preprocessor/src/rotation.rs +++ b/preprocessor/src/rotation.rs @@ -89,7 +89,7 @@ where let args = CommitteeRotationArgs:: { pubkeys_compressed, - finalized_header: update.attested_header.beacon.clone(), + attested_header: update.attested_header.beacon.clone(), sync_committee_branch: sync_committee_branch .into_iter() .map(|n| n.to_vec()) @@ -120,7 +120,7 @@ pub async fn read_rotation_args(path: String) -> eyre::Result { pubkeys_compressed, - finalized_header, + attested_header: finalized_header, sync_committee_branch: committee_root_branch, _spec: PhantomData, })