axiom_query/keygen/
mod.rs1use std::path::Path;
4
5use axiom_eth::{
6 halo2_proofs::plonk::ProvingKey, halo2curves::bn256::G1Affine,
7 utils::build_utils::pinning::aggregation::AggTreeId,
8};
9use enum_dispatch::enum_dispatch;
10use serde::{Deserialize, Serialize};
11
12use self::{
13 agg::{
14 axiom_agg_1::RecursiveAxiomAgg1Intent, axiom_agg_2::RecursiveAxiomAgg2Intent,
15 common::AggTreePinning, single_type::*, subquery_agg::RecursiveSubqueryAggIntent,
16 SupportedAggPinning,
17 },
18 shard::{keccak::ShardIntentKeccak, *},
19};
20
21pub mod agg;
22pub mod shard;
23
24pub type CircuitId = String;
25
26#[derive(Serialize, Deserialize)]
27#[enum_dispatch(ProvingKeySerializer)]
28pub enum SupportedRecursiveIntent {
29 Subquery(SupportedIntentTreeSingleType),
30 VerifyCompute(CircuitIntentVerifyCompute),
31 SubqueryAgg(RecursiveSubqueryAggIntent),
32 Keccak(IntentTreeSingleType<ShardIntentKeccak>),
33 AxiomAgg1(RecursiveAxiomAgg1Intent),
34 AxiomAgg2(RecursiveAxiomAgg2Intent),
35}
36
37#[derive(Serialize, Deserialize, Clone)]
40#[enum_dispatch(AggTreePinning)]
41pub enum SupportedPinning {
42 Shard(SupportedShardPinning),
43 Agg(SupportedAggPinning),
44}
45
46#[enum_dispatch]
49pub trait ProvingKeySerializer: Sized {
50 fn create_and_serialize_proving_key(
56 self,
57 params_dir: &Path,
58 data_dir: &Path,
59 ) -> anyhow::Result<(AggTreeId, ProvingKey<G1Affine>, SupportedPinning)>;
60}