Skip to content

Commit

Permalink
Read from ChainManager's pending blobs when proposing block (linera-i…
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre da Silva authored and afck committed Oct 26, 2024
1 parent cd678d0 commit f667fb4
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions linera-core/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1691,15 +1691,26 @@ where
continue;
}

blobs.push(
self.storage_client()
.read_blob(blob_id)
.await
.map_err(|_| LocalNodeError::CannotReadLocalBlob {
chain_id: self.chain_id,
blob_id,
})?,
);
let maybe_blob = {
let chain_state_view = self.chain_state_view().await?;
chain_state_view
.manager
.get()
.pending_blobs
.get(&blob_id)
.cloned()
};

if let Some(blob) = maybe_blob {
self.client.local_node.cache_recent_blob(&blob).await;
blobs.push(blob);
continue;
}

return Err(LocalNodeError::CannotReadLocalBlob {
chain_id: self.chain_id,
blob_id,
});
}
Ok(blobs)
}
Expand Down

0 comments on commit f667fb4

Please sign in to comment.