Skip to content

Commit 1f043c3

Browse files
committed
feat: make prover cache pool size configurable
1 parent 9fe15c9 commit 1f043c3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

mithril-aggregator/src/configuration.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ pub struct Configuration {
153153
///
154154
/// Will be ignored on (pre)production networks.
155155
pub allow_unparsable_block: bool,
156+
157+
/// Cardano transactions prover cache pool size
158+
pub cardano_transactions_prover_cache_pool_size: u32,
156159
}
157160

158161
/// Uploader needed to copy the snapshot once computed.
@@ -225,6 +228,7 @@ impl Configuration {
225228
cexplorer_pools_url: None,
226229
signer_importer_run_interval: 1,
227230
allow_unparsable_block: false,
231+
cardano_transactions_prover_cache_pool_size: 3,
228232
}
229233
}
230234

@@ -358,6 +362,9 @@ pub struct DefaultConfiguration {
358362
///
359363
/// Will be ignored on (pre)production networks.
360364
pub allow_unparsable_block: String,
365+
366+
/// Cardano transactions prover cache pool size
367+
pub cardano_transactions_prover_cache_pool_size: u32,
361368
}
362369

363370
impl Default for DefaultConfiguration {
@@ -378,6 +385,7 @@ impl Default for DefaultConfiguration {
378385
snapshot_use_cdn_domain: "false".to_string(),
379386
signer_importer_run_interval: 720,
380387
allow_unparsable_block: "false".to_string(),
388+
cardano_transactions_prover_cache_pool_size: 10,
381389
}
382390
}
383391
}
@@ -452,6 +460,10 @@ impl Source for DefaultConfiguration {
452460
"allow_unparsable_block".to_string(),
453461
into_value(myself.allow_unparsable_block),
454462
);
463+
result.insert(
464+
"cardano_transactions_prover_cache_pool_size".to_string(),
465+
into_value(myself.cardano_transactions_prover_cache_pool_size),
466+
);
455467

456468
Ok(result)
457469
}

mithril-aggregator/src/dependency_injection/builder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,9 @@ impl DependenciesBuilder {
13651365

13661366
/// build Prover service
13671367
pub async fn build_prover_service(&mut self) -> Result<Arc<dyn ProverService>> {
1368-
let mk_map_pool_size = 30; // TODO: make this configurable
1368+
let mk_map_pool_size = self
1369+
.configuration
1370+
.cardano_transactions_prover_cache_pool_size as usize;
13691371
let transaction_retriever = self.get_transaction_repository().await?;
13701372
let block_range_root_retriever = self.get_transaction_repository().await?;
13711373
let logger = self.get_logger().await?;

0 commit comments

Comments
 (0)