Skip to content

Commit 529e108

Browse files
author
Andre da Silva
authored
Read from ChainManager's pending blobs when proposing block (#2716)
1 parent d0090e9 commit 529e108

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

linera-core/src/client/mod.rs

+20-9
Original file line numberDiff line numberDiff line change
@@ -1859,15 +1859,26 @@ where
18591859
continue;
18601860
}
18611861

1862-
blobs.push(
1863-
self.storage_client()
1864-
.read_blob(blob_id)
1865-
.await
1866-
.map_err(|_| LocalNodeError::CannotReadLocalBlob {
1867-
chain_id: self.chain_id,
1868-
blob_id,
1869-
})?,
1870-
);
1862+
let maybe_blob = {
1863+
let chain_state_view = self.chain_state_view().await?;
1864+
chain_state_view
1865+
.manager
1866+
.get()
1867+
.pending_blobs
1868+
.get(&blob_id)
1869+
.cloned()
1870+
};
1871+
1872+
if let Some(blob) = maybe_blob {
1873+
self.client.local_node.cache_recent_blob(&blob).await;
1874+
blobs.push(blob);
1875+
continue;
1876+
}
1877+
1878+
return Err(LocalNodeError::CannotReadLocalBlob {
1879+
chain_id: self.chain_id,
1880+
blob_id,
1881+
});
18711882
}
18721883
Ok(blobs)
18731884
}

0 commit comments

Comments
 (0)