Skip to content

Commit 3a1cd9b

Browse files
committed
purge unused committee circuit
1 parent f16921b commit 3a1cd9b

File tree

11 files changed

+3
-275
lines changed

11 files changed

+3
-275
lines changed

Cargo.lock

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ members = [
55
"prover",
66
"iso-step",
77
"circuits/sp1-step",
8-
"circuits/sp1-committee",
98
"circuits/sp1-rotation",
109
"preprocessor",
1110
"eth-types",

circuits/Cargo.lock

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

circuits/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["sp1-committee", "sp1-step", "sp1-rotation"]
2+
members = ["sp1-step", "sp1-rotation"]
33

44
[workspace.dependencies]
55
sp1-zkvm = "4.0.1"

circuits/sp1-committee/Cargo.toml

Lines changed: 0 additions & 19 deletions
This file was deleted.

circuits/sp1-committee/src/main.rs

Lines changed: 0 additions & 52 deletions
This file was deleted.

iso-committee/src/types.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,6 @@ pub struct CommitteeUpdateArgs {
3434
pub sync_committee_branch: Branch,
3535
}
3636

37-
#[derive(Debug, Clone, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
38-
pub struct CommitteeCircuitOutput {
39-
pub commitment: [u8; 32],
40-
pub finalized_header_root: [u8; 32],
41-
}
42-
43-
impl CommitteeCircuitOutput {
44-
pub fn new(commitment: [u8; 32], finalized_header_root: [u8; 32]) -> Self {
45-
Self {
46-
commitment,
47-
finalized_header_root,
48-
}
49-
}
50-
}
51-
5237
lazy_static! {
5338
pub static ref ZERO_HASHES: [[u8; 32]; 2] = {
5439
std::iter::successors(Some([0; 32]), |&prev| {
@@ -60,10 +45,3 @@ lazy_static! {
6045
.unwrap()
6146
};
6247
}
63-
64-
sol! {
65-
struct WrappedOutput{
66-
bytes32 commitment;
67-
bytes32 finalized_header_root;
68-
}
69-
}

prover/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ fn main() {
88
args.features = vec!["wrapped".to_string()];
99
}
1010
build_program_with_args("../circuits/sp1-step", args.clone());
11-
build_program_with_args("../circuits/sp1-committee", args.clone());
1211
build_program_with_args("../circuits/sp1-rotation", Default::default());
1312
}

prover/src/fixture.rs

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
use std::path::PathBuf;
22

3+
use crate::ProverOps;
34
use alloy_sol_types::SolType;
4-
use committee_iso::types::WrappedOutput as CommitteeWrappedOutput;
55
use rotation_iso::types::WrappedOutput as RotatoinWrappedOutput;
66
use serde::{Deserialize, Serialize};
77
use sp1_sdk::{HashableKey, SP1ProofWithPublicValues, SP1VerifyingKey};
88
use step_iso::types::WrappedOutput as StepWrappedOutput;
99

10-
use crate::ProverOps;
11-
12-
#[derive(Debug, Clone, Serialize, Deserialize)]
13-
#[serde(rename_all = "camelCase")]
14-
struct CommitteeUpdateFixture {
15-
root: String,
16-
commitment: String,
17-
vkey: String,
18-
public_values: String,
19-
proof: String,
20-
}
21-
2210
#[derive(Debug, Clone, Serialize, Deserialize)]
2311
#[serde(rename_all = "camelCase")]
2412
struct StepUpdateFixture {
@@ -42,37 +30,6 @@ struct RotationUpdateFixture {
4230
proof: String,
4331
}
4432

45-
pub fn create_committee_proof_fixture(
46-
proof: &SP1ProofWithPublicValues,
47-
vk: &SP1VerifyingKey,
48-
ops: &ProverOps,
49-
) {
50-
let bytes = proof.public_values.as_slice();
51-
let CommitteeWrappedOutput {
52-
finalized_header_root,
53-
commitment,
54-
} = CommitteeWrappedOutput::abi_decode(bytes, false).unwrap();
55-
let fixture = CommitteeUpdateFixture {
56-
root: format!("0x{}", hex::encode(finalized_header_root)),
57-
commitment: format!("0x{}", hex::encode(commitment)),
58-
vkey: vk.bytes32().to_string(),
59-
public_values: format!("0x{}", hex::encode(bytes)),
60-
proof: format!("0x{}", hex::encode(proof.bytes())),
61-
};
62-
let prefix = match ops {
63-
ProverOps::Default => panic!("No point in generating a fixture for a default proof!"),
64-
ProverOps::Groth16 => "groth16-fixture.json",
65-
ProverOps::Plonk => "plonk-fixture.json",
66-
};
67-
let fixture_path = PathBuf::from("./");
68-
std::fs::create_dir_all(&fixture_path).expect("failed to create fixture path");
69-
std::fs::write(
70-
fixture_path.join(prefix),
71-
serde_json::to_string_pretty(&fixture).unwrap(),
72-
)
73-
.expect("failed to write fixture");
74-
}
75-
7633
pub fn create_step_proof_fixture(
7734
proof: &SP1ProofWithPublicValues,
7835
vk: &SP1VerifyingKey,

prover/src/lib.rs

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
pub mod eth;
22
pub mod fixture;
3-
use committee_iso::types::CommitteeUpdateArgs;
43
use rotation_iso::types::RotationCircuitInputs;
54
use sp1_sdk::{include_elf, ProverClient, SP1ProofWithPublicValues, SP1Stdin, SP1VerifyingKey};
65
use step_iso::types::{SyncStepArgs, SyncStepCircuitInput};
@@ -15,62 +14,6 @@ pub enum ProverOps {
1514
Plonk,
1615
}
1716

18-
pub fn generate_committee_update_proof_sp1(
19-
ops: &ProverOps,
20-
committee_update: CommitteeUpdateArgs,
21-
compressed: &ProofCompressionBool,
22-
) -> (SP1ProofWithPublicValues, SP1VerifyingKey) {
23-
use std::time::Instant;
24-
let start_time = Instant::now();
25-
#[allow(deprecated)]
26-
let client = ProverClient::new();
27-
let mut stdin = SP1Stdin::new();
28-
stdin.write_vec(borsh::to_vec(&committee_update).expect("Failed to serialize"));
29-
30-
let (proof, _, vk) = match ops {
31-
ProverOps::Default => {
32-
const COMMITTEE_ELF: &[u8] = include_elf!("sp1-committee");
33-
let (pk, vk) = client.setup(COMMITTEE_ELF);
34-
let proof = match compressed {
35-
ProofCompressionBool::Compressed => client
36-
.prove(&pk, &stdin)
37-
.compressed()
38-
.run()
39-
.expect("failed to generate proof"),
40-
ProofCompressionBool::Uncompressed => client
41-
.prove(&pk, &stdin)
42-
.run()
43-
.expect("failed to generate proof"),
44-
};
45-
(proof, pk, vk)
46-
}
47-
ProverOps::Groth16 => {
48-
const COMMITTEE_ELF: &[u8] = include_elf!("sp1-committee");
49-
let (pk, vk) = client.setup(COMMITTEE_ELF);
50-
let proof = client
51-
.prove(&pk, &stdin)
52-
.groth16()
53-
.run()
54-
.expect("failed to generate proof");
55-
(proof, pk, vk)
56-
}
57-
ProverOps::Plonk => {
58-
const COMMITTEE_ELF: &[u8] = include_elf!("sp1-committee");
59-
let (pk, vk) = client.setup(COMMITTEE_ELF);
60-
let proof = client
61-
.prove(&pk, &stdin)
62-
.plonk()
63-
.run()
64-
.expect("failed to generate proof");
65-
(proof, pk, vk)
66-
}
67-
};
68-
println!("Successfully generated proof!");
69-
let duration = start_time.elapsed();
70-
println!("Elapsed time: {:?}", duration);
71-
(proof, vk)
72-
}
73-
7417
pub fn generate_step_proof_sp1(
7518
ops: &ProverOps,
7619
commitment: [u8; 32],

0 commit comments

Comments
 (0)