Skip to content

Commit 061cee8

Browse files
authored
Merge pull request #4133 from ProvableHQ/perf/unchecked_cdn_deser
[Perf] Use unchecked deserialization in CDN sync
2 parents a111517 + 0b6229a commit 061cee8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

node/cdn/src/blocks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use snarkos_utilities::{SignalHandler, Stoppable};
2121

2222
use snarkvm::{
2323
prelude::{Deserialize, DeserializeOwned, Ledger, Network, Serialize, block::Block, store::ConsensusStorage},
24-
utilities::flatten_error,
24+
utilities::{flatten_error, unchecked_deserialize},
2525
};
2626

2727
use anyhow::{Context, Result, anyhow, bail};
@@ -480,7 +480,7 @@ async fn cdn_get<T: 'static + DeserializeOwned + Send>(client: Client, url: &str
480480
};
481481

482482
// Parse the objects.
483-
match tokio::task::spawn_blocking(move || (bincode::deserialize::<T>(&bytes), bytes)).await {
483+
match tokio::task::spawn_blocking(move || (unchecked_deserialize::<T>(&bytes), bytes)).await {
484484
Ok((Ok(objects), _)) => Ok(objects),
485485
Ok((Err(error), response_bytes)) => {
486486
let bytes_as_string = String::from_utf8_lossy(&response_bytes);

0 commit comments

Comments
 (0)