Skip to content

Commit 08ac238

Browse files
committed
fix: get merkle proof for task id and better names
1 parent bab93de commit 08ac238

File tree

2 files changed

+5
-5
lines changed
  • aggregation_mode/proof_aggregator/src/backend

2 files changed

+5
-5
lines changed

aggregation_mode/proof_aggregator/src/backend/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Db {
4949
.map_err(|e| DbError::Query(e.to_string()))
5050
}
5151

52-
pub async fn insert_tasks_merkle_path_and_mark_them_as_submitted(
52+
pub async fn insert_tasks_merkle_path_and_mark_them_as_verified(
5353
&self,
5454
updates: Vec<(Uuid, Vec<u8>)>,
5555
) -> Result<(), DbError> {

aggregation_mode/proof_aggregator/src/backend/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ impl ProofAggregator {
213213
);
214214

215215
info!("Storing merkle paths for each task...",);
216-
let mut merkle_paths_for_tasks = vec![];
217-
for task_id in tasks_id {
218-
let Some(proof) = merkle_tree.get_proof_by_pos(0) else {
216+
let mut merkle_paths_for_tasks: Vec<(Uuid, Vec<u8>)> = vec![];
217+
for (idx, task_id) in tasks_id.iter().enumerate() {
218+
let Some(proof) = merkle_tree.get_proof_by_pos(idx) else {
219219
warn!("Proof not found for task id {task_id}");
220220
continue;
221221
};
@@ -228,7 +228,7 @@ impl ProofAggregator {
228228
merkle_paths_for_tasks.push((task_id, proof_bytes))
229229
}
230230
self.db
231-
.insert_tasks_merkle_path_and_mark_them_as_submitted(merkle_paths_for_tasks)
231+
.insert_tasks_merkle_path_and_mark_them_as_verified(merkle_paths_for_tasks)
232232
.await
233233
.map_err(AggregatedProofSubmissionError::StoringMerklePaths)?;
234234
info!("Merkle path inserted sucessfully",);

0 commit comments

Comments
 (0)