Skip to content

Avoid rewriting cached aggregation keys during EVM setup#2804

Open
Kuhai9801 wants to merge 1 commit into
openvm-org:mainfrom
Kuhai9801:avoid-rewriting-cached-setup-keys
Open

Avoid rewriting cached aggregation keys during EVM setup#2804
Kuhai9801 wants to merge 1 commit into
openvm-org:mainfrom
Kuhai9801:avoid-rewriting-cached-setup-keys

Conversation

@Kuhai9801
Copy link
Copy Markdown

@Kuhai9801 Kuhai9801 commented May 21, 2026

Summary

  • reuse existing aggregation STARK and Halo2 proving keys when cargo openvm setup --evm is run without --force-agg-keygen
  • only write aggregation key files after the command actually regenerates them
  • keep verifier ASM and Solidity verifier generation working from the reused SDK keys

Changes

  • Split the cached-key and keygen paths in crates/cli/src/commands/setup.rs.
  • On the cached-key path, load the existing aggregation and Halo2 proving keys into the SDK and deserialize the existing aggregation verifying key as a validity check.
  • On the keygen path, generate the aggregation keys and write the STARK proving key, STARK verifying key, and Halo2 proving key immediately after generation.
  • Leave root verifier ASM and EVM verifier contract generation on the shared path.

Verification

  • git diff --check
  • cargo check -p cargo-openvm

Fixes #2356

@Kuhai9801 Kuhai9801 marked this pull request as ready for review May 21, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

save generated evm keys immediately after generating

1 participant