Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3200e0c
feat: risc0 aggregation program
MarcosNicolau Apr 15, 2025
2f54502
feat: [wip] risc0 aggregator backend
MarcosNicolau Apr 15, 2025
62bfb60
feat: ProofAggregationService risc0 verification
MarcosNicolau Apr 15, 2025
c475a63
feat: error handling + fetch risc0 proofs
MarcosNicolau Apr 15, 2025
e2dcf30
feat: send risc0 aggregated proof to AlignedProofAggregationService c…
MarcosNicolau Apr 15, 2025
1c4440b
feat: deploy AlignedProofAggregationService contract with risc0 verifier
MarcosNicolau Apr 16, 2025
df1d83a
feat: allow risc0 succinct proofs
MarcosNicolau Apr 16, 2025
4bc1a52
chore: modified risc0 no_pub_inputs to generate a succinct proof inst…
MarcosNicolau Apr 16, 2025
56a9d87
feat: fetch proofs based on zkvm engine
MarcosNicolau Apr 16, 2025
6c544d0
chore: commands to start proof agregator based on verifier
MarcosNicolau Apr 16, 2025
b137020
fix: compute image id bytes in little endian not in be
MarcosNicolau Apr 21, 2025
d0a4be6
feat: local verification of aggregated risc0 proof
MarcosNicolau Apr 21, 2025
8309ea8
Merge branch 'staging' into feat/aggregation-mode-risc0
MarcosNicolau Apr 21, 2025
369cdc6
chore: add gpu feature flag to run with cuda
MarcosNicolau Apr 21, 2025
7720553
docs: add gpu command
MarcosNicolau Apr 21, 2025
ebdc910
chore: undo no_pub_input file changes
MarcosNicolau Apr 21, 2025
1b8873a
ci: fix contracts build + install risc0 toolchain
MarcosNicolau Apr 22, 2025
01f60f4
chore: better proof aggregator makefile targets
MarcosNicolau Apr 22, 2025
20b7d61
docs: update how to run proof aggregator readme
MarcosNicolau Apr 22, 2025
454f80c
ci: skip build on clippy
MarcosNicolau Apr 22, 2025
5e43630
chore: address clippy warnings
MarcosNicolau Apr 22, 2025
4478134
feat: risc0 sdk and aligned cli
MarcosNicolau Apr 22, 2025
b130efa
chore: targets to verify agg proof
MarcosNicolau Apr 22, 2025
97c651b
Merge branch 'staging' into feat/aggregation-mode-risc0-sdk
MarcosNicolau Apr 24, 2025
6cd0a50
fix: merge
MarcosNicolau Apr 24, 2025
ff72a23
Update Makefile
MarcosNicolau Apr 25, 2025
a95b73b
Merge branch 'staging' into feat/aggregation-mode-risc0-sdk
MauroToscano Apr 28, 2025
7d510d3
Merge
MauroToscano Apr 28, 2025
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
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,30 @@ start_proof_aggregator: is_aggregator_set ## Starts proof aggregator with provin
start_proof_aggregator_gpu: is_aggregator_set ## Starts proof aggregator with proving + GPU acceleration (CUDA)
AGGREGATOR=$(AGGREGATOR) SP1_PROVER=cuda cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --features prove,gpu -- config-files/config-proof-aggregator.yaml

verify_aggregated_proof_sp1_holesky_stage:
@echo "Verifying SP1 in aggregated proofs on holesky..."
@cd batcher/aligned/ && \
cargo run verify-agg-proof \
--network holesky-stage \
--from-block $(FROM_BLOCK) \
--proving_system SP1 \
--public_input ../../scripts/test_files/sp1/sp1_fibonacci_4_1_3.pub \
--program-id-file ../../scripts/test_files/sp1/sp1_fibonacci_4_1_3.vk \
--beacon_url $(BEACON_URL) \
--rpc_url https://ethereum-holesky-rpc.publicnode.com

verify_aggregated_proof_risc0_holesky_stage:
@echo "Verifying RISC0 in aggregated proofs on holesky..."
@cd batcher/aligned/ && \
cargo run verify-agg-proof \
--network holesky-stage \
--from-block $(FROM_BLOCK) \
--proving_system Risc0 \
--program-id-file ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_2_0.bin \
--public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_2_0.pub \
--beacon_url $(BEACON_URL) \
--rpc_url https://ethereum-holesky-rpc.publicnode.com

install_aggregation_mode: ## Install the aggregation mode with proving enabled
cargo install --path aggregation_mode --features prove

Expand Down
13 changes: 13 additions & 0 deletions batcher/aligned-sdk/src/sdk/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ pub enum AggregationModeVerificationData {
vk: [u8; 32],
public_inputs: Vec<u8>,
},
Risc0 {
image_id: [u8; 32],
public_inputs: Vec<u8>,
},
}

impl AggregationModeVerificationData {
Expand All @@ -29,6 +33,15 @@ impl AggregationModeVerificationData {
hasher.update(public_inputs);
hasher.finalize().into()
}
AggregationModeVerificationData::Risc0 {
image_id,
public_inputs,
} => {
let mut hasher = Keccak256::new();
hasher.update(image_id);
hasher.update(public_inputs);
hasher.finalize().into()
}
}
}
}
Expand Down
37 changes: 23 additions & 14 deletions batcher/aligned/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,12 @@ pub struct VerifyProofInAggModeArgs {
proving_system: ProvingSystemArg,
#[arg(name = "Public input file name", long = "public_input")]
pub_input_file_name: Option<PathBuf>,
#[arg(name = "Verification key hash", long = "vk", required = true)]
verification_key_hash: PathBuf,
#[arg(
name = "Verification key hash",
long = "program-id-file",
required = true
)]
program_id_file: PathBuf,
}

#[derive(Args, Debug)]
Expand Down Expand Up @@ -790,20 +794,25 @@ async fn main() -> Result<(), AlignedError> {
return Ok(());
}
AlignedCommands::VerifyProofInAggMode(args) => {
let proof_data = match args.proving_system {
ProvingSystemArg::SP1 => {
let vk = read_file(args.verification_key_hash)?
.try_into()
.expect("Invalid hexadecimal encoded vk hash");
let program_id_key = read_file(args.program_id_file)?
.try_into()
.expect("Invalid hexadecimal encoded vk hash");

let Some(pub_inputs_file_name) = args.pub_input_file_name else {
error!("Public input file not provided");
return Ok(());
};
let public_inputs = read_file(pub_inputs_file_name)?;
let Some(pub_inputs_file_name) = args.pub_input_file_name else {
error!("Public input file not provided");
return Ok(());
};
let public_inputs = read_file(pub_inputs_file_name)?;

AggregationModeVerificationData::SP1 { vk, public_inputs }
}
let proof_data = match args.proving_system {
ProvingSystemArg::SP1 => AggregationModeVerificationData::SP1 {
vk: program_id_key,
public_inputs,
},
ProvingSystemArg::Risc0 => AggregationModeVerificationData::Risc0 {
image_id: program_id_key,
public_inputs,
},
_ => {
error!("Proving system not supported in aggregation mode");
return Ok(());
Expand Down
Loading