Skip to content

Commit f667fb4

Browse files
Andre da Silvaafck
Andre da Silva
authored andcommitted
Read from ChainManager's pending blobs when proposing block (#2716)
1 parent cd678d0 commit f667fb4

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
@@ -1691,15 +1691,26 @@ where
16911691
continue;
16921692
}
16931693

1694-
blobs.push(
1695-
self.storage_client()
1696-
.read_blob(blob_id)
1697-
.await
1698-
.map_err(|_| LocalNodeError::CannotReadLocalBlob {
1699-
chain_id: self.chain_id,
1700-
blob_id,
1701-
})?,
1702-
);
1694+
let maybe_blob = {
1695+
let chain_state_view = self.chain_state_view().await?;
1696+
chain_state_view
1697+
.manager
1698+
.get()
1699+
.pending_blobs
1700+
.get(&blob_id)
1701+
.cloned()
1702+
};
1703+
1704+
if let Some(blob) = maybe_blob {
1705+
self.client.local_node.cache_recent_blob(&blob).await;
1706+
blobs.push(blob);
1707+
continue;
1708+
}
1709+
1710+
return Err(LocalNodeError::CannotReadLocalBlob {
1711+
chain_id: self.chain_id,
1712+
blob_id,
1713+
});
17031714
}
17041715
Ok(blobs)
17051716
}

0 commit comments

Comments
 (0)