From c18867816987b7180e2f8d18e223d089a78b3a8b Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 30 Aug 2022 12:39:34 +1000 Subject: [PATCH] Revert: deserialize stored transactions in a rayon thread (#4933) * Revert: deserialize stored transactions in a rayon thread * Add a TODO for the reverted bug fix Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../finalized_state/disk_format/block.rs | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/zebra-state/src/service/finalized_state/disk_format/block.rs b/zebra-state/src/service/finalized_state/disk_format/block.rs index 939408c7..4ce8689e 100644 --- a/zebra-state/src/service/finalized_state/disk_format/block.rs +++ b/zebra-state/src/service/finalized_state/disk_format/block.rs @@ -231,21 +231,12 @@ impl FromDisk for Transaction { fn from_bytes(bytes: impl AsRef<[u8]>) -> Self { let bytes = bytes.as_ref(); - let mut tx = None; - - // # Performance - // - // Move CPU-intensive deserialization cryptography into the rayon thread pool. - // This avoids blocking the tokio executor. - rayon::in_place_scope_fifo(|scope| { - scope.spawn_fifo(|_scope| { - tx = Some(bytes.as_ref().zcash_deserialize_into().expect( - "deserialization format should match the serialization format used by IntoDisk", - )); - }); - }); - - tx.expect("scope has already run") + // TODO: skip cryptography verification during transaction deserialization from storage, + // or do it in a rayon thread (ideally in parallel with other transactions) + bytes + .as_ref() + .zcash_deserialize_into() + .expect("deserialization format should match the serialization format used by IntoDisk") } }