Skip to content

Commit 6edc47c

Browse files
committed
Add sp1 to task sender
1 parent 0d3df06 commit 6edc47c

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

crates/task-sender/src/commands.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,36 @@ pub async fn send_infinite_proofs(args: SendInfiniteProofsArgs) {
436436
proof_generator_addr: Address::zero(), // Will be set randomly in the loop
437437
}]
438438
}
439+
InfiniteProofType::SP1 {
440+
proof_path,
441+
elf_path,
442+
pub_path,
443+
} => {
444+
info!("Loading SP1 proof files");
445+
let Ok(proof) = std::fs::read(proof_path) else {
446+
error!("Could not read proof file: {}", proof_path);
447+
return;
448+
};
449+
let Ok(vm_program) = std::fs::read(elf_path) else {
450+
error!("Could not read ELF file: {}", elf_path);
451+
return;
452+
};
453+
let pub_input = if let Some(pub_path) = pub_path {
454+
std::fs::read(pub_path).ok()
455+
} else {
456+
None
457+
};
458+
459+
// Create template verification data (without proof_generator_addr)
460+
vec![VerificationData {
461+
proving_system: ProvingSystemId::SP1,
462+
proof,
463+
pub_input,
464+
verification_key: None,
465+
vm_program_code: Some(vm_program),
466+
proof_generator_addr: Address::zero(), // Will be set randomly in the loop
467+
}]
468+
}
439469
};
440470

441471
info!("Proofs loaded!");

crates/task-sender/src/structs.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ pub enum InfiniteProofType {
158158
)]
159159
pub_path: Option<String>,
160160
},
161+
#[clap(about = "Send infinite SP1 proofs from file paths")]
162+
SP1 {
163+
#[arg(name = "Path to SP1 proof file (.proof)", long = "proof-path")]
164+
proof_path: String,
165+
#[arg(name = "Path to SP1 ELF file (.elf)", long = "elf-path")]
166+
elf_path: String,
167+
#[arg(
168+
name = "Path to SP1 public input file (.pub) - optional",
169+
long = "pub-path"
170+
)]
171+
pub_path: Option<String>,
172+
},
161173
}
162174

163175
#[derive(Debug, Clone, Copy)]

0 commit comments

Comments
 (0)