Skip to content

Commit 7e40653

Browse files
committed
feat: pre-verificatoin-enabled flag to avoid verification in the fetching process
1 parent e38c80a commit 7e40653

6 files changed

Lines changed: 22 additions & 13 deletions

File tree

aggregation_mode/src/backend/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ 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,
2526
}
2627

2728
impl Config {

aggregation_mode/src/backend/fetcher.rs

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

3536
impl ProofsFetcher {
@@ -48,6 +49,7 @@ impl ProofsFetcher {
4849
rpc_provider,
4950
aligned_service_manager,
5051
last_aggregated_block,
52+
pre_verification_enabled: config.pre_verification_enabled,
5153
}
5254
}
5355

@@ -154,19 +156,21 @@ impl ProofsFetcher {
154156
proofs_to_add.len()
155157
);
156158

157-
// Try to add them to the queue
158-
// We do this in parallel, as SP1 can take quite some time in verifying
159-
// because of the overhead of setting up the prover
160-
proofs_to_add = proofs_to_add
161-
.into_par_iter()
162-
.filter(|proof| match proof.verify() {
163-
Ok(_) => true,
164-
Err(err) => {
165-
error!("Could not add proof, verification failed: {:?}", err);
166-
return false;
167-
}
168-
})
169-
.collect();
159+
if self.pre_verification_enabled {
160+
// Try to add them to the queue
161+
// We do this in parallel, as SP1 can take quite some time in verifying
162+
// because of the overhead of setting up the prover
163+
proofs_to_add = proofs_to_add
164+
.into_par_iter()
165+
.filter(|proof| match proof.verify() {
166+
Ok(_) => true,
167+
Err(err) => {
168+
error!("Could not add proof, verification failed: {:?}", err);
169+
return false;
170+
}
171+
})
172+
.collect();
173+
}
170174

171175
proofs.extend(proofs_to_add);
172176
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ 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
89

910
ecdsa:
1011
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ 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
89

910
ecdsa:
1011
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ 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
89

910
ecdsa:
1011
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

config-files/config-proof-aggregator.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ 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
89

910
ecdsa:
1011
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

0 commit comments

Comments
 (0)