Skip to content

Commit 2dc3550

Browse files
committed
refactor: remove pre-verification flag
1 parent 7c6a59c commit 2dc3550

8 files changed

Lines changed: 10 additions & 36 deletions

aggregation_mode/src/aggregators/risc0_aggregator.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ pub enum AlignedRisc0VerificationError {
1515
}
1616

1717
impl Risc0ProofReceiptAndImageId {
18-
pub fn new(image_id: [u8; 32], receipt: Receipt) -> Self {
19-
Self { image_id, receipt }
20-
}
21-
22-
pub fn new_with_verification(
18+
/// Constructs a new instance of the struct, verifying the provided receipt against the given image ID.
19+
pub fn new(
2320
image_id: [u8; 32],
2421
receipt: Receipt,
2522
) -> Result<Self, AlignedRisc0VerificationError> {

aggregation_mode/src/aggregators/sp1_aggregator.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,8 @@ pub enum AlignedSP1VerificationError {
3737
}
3838

3939
impl SP1ProofWithPubValuesAndElf {
40-
pub fn new(proof_with_pub_values: SP1ProofWithPublicValues, elf: Vec<u8>) -> Self {
41-
let vk = vk_from_elf(&elf);
42-
43-
Self {
44-
proof_with_pub_values,
45-
elf,
46-
vk,
47-
}
48-
}
49-
50-
pub fn new_with_verification(
40+
/// Constructs a new instance of the struct by verifying a given SP1 proof with its public values.
41+
pub fn new(
5142
proof_with_pub_values: SP1ProofWithPublicValues,
5243
elf: Vec<u8>,
5344
) -> Result<Self, AlignedSP1VerificationError> {

aggregation_mode/src/backend/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub struct Config {
2222
pub last_aggregated_block_filepath: String,
2323
pub ecdsa: ECDSAConfig,
2424
pub proofs_per_chunk: u16,
25-
pub pre_verification_enabled: bool,
2625
pub total_proofs_limit: u16,
2726
}
2827

aggregation_mode/src/backend/fetcher.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub struct ProofsFetcher {
3030
rpc_provider: RPCProvider,
3131
aligned_service_manager: AlignedLayerServiceManagerContract,
3232
last_aggregated_block: u64,
33-
pre_verification_enabled: bool,
3433
}
3534

3635
impl ProofsFetcher {
@@ -49,7 +48,6 @@ impl ProofsFetcher {
4948
rpc_provider,
5049
aligned_service_manager,
5150
last_aggregated_block,
52-
pre_verification_enabled: config.pre_verification_enabled,
5351
}
5452
}
5553

@@ -120,14 +118,10 @@ impl ProofsFetcher {
120118

121119
let elf = p.vm_program_code?;
122120
let proof_with_pub_values = bincode::deserialize(&p.proof).ok()?;
123-
let sp1_proof = if self.pre_verification_enabled {
124-
SP1ProofWithPubValuesAndElf::new_with_verification(
125-
proof_with_pub_values,
126-
elf,
127-
)
128-
} else {
129-
Ok(SP1ProofWithPubValuesAndElf::new(proof_with_pub_values, elf))
130-
};
121+
let sp1_proof = SP1ProofWithPubValuesAndElf::new_with_verification(
122+
proof_with_pub_values,
123+
elf,
124+
);
131125

132126
match sp1_proof {
133127
Ok(proof) => Some(AlignedProof::SP1(proof.into())),
@@ -152,11 +146,8 @@ impl ProofsFetcher {
152146
bincode::deserialize(&p.proof).ok()?;
153147

154148
let receipt = Receipt::new(inner_receipt, public_inputs);
155-
let risc0_proof = if self.pre_verification_enabled {
156-
Risc0ProofReceiptAndImageId::new_with_verification(image_id, receipt)
157-
} else {
158-
Ok(Risc0ProofReceiptAndImageId::new(image_id, receipt))
159-
};
149+
let risc0_proof =
150+
Risc0ProofReceiptAndImageId::new_with_verification(image_id, receipt);
160151

161152
match risc0_proof {
162153
Ok(proof) => Some(AlignedProof::Risc0(proof.into())),

config-files/config-proof-aggregator-ethereum-package.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ eth_ws_url: "ws://localhost:8546"
55
max_proofs_in_queue: 1000
66
last_aggregated_block_filepath: config-files/proof-aggregator.last_aggregated_block.json
77
proofs_per_chunk: 512 # Amount of proofs to process per chunk
8-
pre_verification_enabled: true
98
# This number comes from the blob data limit
109
# Since each blob has a capacity of (4096 * 32) = 131.072 bytes
1110
# But to not surpass the field modulus we pad with a 0xo byte so we have (4096 * 31) = 126.976 bytes

config-files/config-proof-aggregator-mock-ethereum-package.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ eth_ws_url: "ws://localhost:8546"
55
max_proofs_in_queue: 1000
66
last_aggregated_block_filepath: config-files/proof-aggregator.last_aggregated_block.json
77
proofs_per_chunk: 512 # Amount of proofs to process per chunk
8-
pre_verification_enabled: true
98
# This number comes from the blob data limit
109
# Since each blob has a capacity of (4096 * 32) = 131.072 bytes
1110
# But to not surpass the field modulus we pad with a 0xo byte so we have (4096 * 31) = 126.976 bytes

config-files/config-proof-aggregator-mock.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ eth_ws_url: "ws://localhost:8545"
55
max_proofs_in_queue: 1000
66
last_aggregated_block_filepath: config-files/proof-aggregator.last_aggregated_block.json
77
proofs_per_chunk: 512 # Amount of proofs to process per chunk
8-
pre_verification_enabled: true
98
# This number comes from the blob data limit
109
# Since each blob has a capacity of (4096 * 32) = 131.072 bytes
1110
# But to not surpass the field modulus we pad with a 0xo byte so we have (4096 * 31) = 126.976 bytes

config-files/config-proof-aggregator.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ eth_ws_url: "ws://localhost:8545"
55
max_proofs_in_queue: 1000
66
last_aggregated_block_filepath: config-files/proof-aggregator.last_aggregated_block.json
77
proofs_per_chunk: 512 # Amount of proofs to process per chunk
8-
pre_verification_enabled: true
98
# This number comes from the blob data limit
109
# Since each blob has a capacity of (4096 * 32) = 131.072 bytes
1110
# But to not surpass the field modulus we pad with a 0xo byte so we have (4096 * 31) = 126.976 bytes

0 commit comments

Comments
 (0)