Finalize Circuit
finalize is the last step of aggregation. It verifies the root of the binary recursion tree which is either a recursive_2_leaf proof (when only one leaf was needed) or a recursive_2_inner proof and is proved with the EVM transcript so the on-chain verifier can check it.
What it does
Two responsibilities:
- Verify the root.
verify_honk_proofcheckshash(root_vk) == root_khand thatroot_proofverifies for the suppliedroot_pubs. Becauseroot_pubsis built from the public inputsfinalizewas called with, this binds the root's published[action_vk_hash, leaf_vk_hash, inner_vk_hash, publics_digest]tofinalize's own public inputs — completing the chain from on-chain calldata down to every Action. - Constrain the root's VK.
root_khmust beleaf_vk_hashorinner_vk_hash. Since both leaf and inner emit the identical 4-field layout,finalizeverifies either uniformly, while the disjunction prevents a third (attacker) VK from being substituted at the root.
Failure modes
| Symptom | Cause |
|---|---|
verify_honk_proof fails in-circuit | the root proof is invalid, or root_vk doesn't hash to root_kh |
root_kh_ok assertion fails | the root was produced under an unknown VK (a substitution attempt) |
on-chain Orchestrator__InvalidProof | reconstructed publicsDigest ≠ the proof's, or a pinned VK hash drifted |