Skip to content

Commit c8df10f

Browse files
committed
perf: make prover able to certify more than 5 transactions
Some SQL query was too complex because depended on the number of block ranges to retrieve in the prover. The query is now made indiviudally on each block range.
1 parent 35ab570 commit c8df10f

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

mithril-aggregator/src/dependency_injection/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ impl DependenciesBuilder {
13771377
Ok(self.message_service.as_ref().cloned().unwrap())
13781378
}
13791379

1380-
/// build Prover service
1380+
/// Build Prover service
13811381
pub async fn build_prover_service(&mut self) -> Result<Arc<dyn ProverService>> {
13821382
let mk_map_pool_size = self
13831383
.configuration

mithril-aggregator/src/services/prover.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,14 @@ impl MithrilProverService {
106106
block_ranges: &[BlockRange],
107107
) -> StdResult<HashMap<BlockRange, Vec<CardanoTransaction>>> {
108108
let mut block_ranges_map = HashMap::new();
109-
let transactions = self
110-
.transaction_retriever
111-
.get_by_block_ranges(block_ranges.to_vec())
112-
.await?;
109+
let mut transactions = vec![];
110+
for block_range in block_ranges {
111+
let block_range_transactions = self
112+
.transaction_retriever
113+
.get_by_block_ranges(vec![block_range.clone()])
114+
.await?;
115+
transactions.extend(block_range_transactions);
116+
}
113117
for transaction in transactions {
114118
let block_range = BlockRange::from_block_number(transaction.block_number);
115119
let block_range_transactions: &mut Vec<_> =

0 commit comments

Comments
 (0)