Skip to content

Commit

Permalink
fix(collation-manager): restore all blocks from subgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
SmaGMan committed Jun 7, 2024
1 parent d803ea9 commit c47a561
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions collator/src/manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1454,10 +1454,9 @@ where
"Not all blocks are valid in master block ({}) subgraph",
block_id.as_short_id(),
);
mc_block_container.restore_entry(
subgraph.mc_block.entry,
subgraph.mc_block.send_sync_status,
)?;
let mut blocks_to_restore = vec![subgraph.mc_block];
blocks_to_restore.append(&mut subgraph.shard_blocks);
self.restore_blocks_in_cache(blocks_to_restore)?;
return Ok(None);
}
subgraph.shard_blocks.push(BlockCandidateToSend {
Expand Down Expand Up @@ -1509,8 +1508,15 @@ where
Ok(())
}

async fn restore_blocks_in_cache_async(
&mut self,
blocks_to_restore: Vec<BlockCandidateToSend>,
) -> Result<()> {
self.restore_blocks_in_cache(blocks_to_restore)
}

/// Find and restore block entries in cache updating sync statuses
async fn restore_blocks_in_cache(
fn restore_blocks_in_cache(
&mut self,
blocks_to_restore: Vec<BlockCandidateToSend>,
) -> Result<()> {
Expand Down Expand Up @@ -1730,7 +1736,7 @@ where
// queue blocks restore task
dispatcher
.enqueue_task(method_to_async_task_closure!(
restore_blocks_in_cache,
restore_blocks_in_cache_async,
blocks_to_send
))
.await?;
Expand Down

0 comments on commit c47a561

Please sign in to comment.