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>
This commit is contained in:
teor 2022-08-30 12:39:34 +10:00 committed by GitHub
parent c85e482fa0
commit c188678169
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 15 deletions

View File

@ -231,21 +231,12 @@ impl FromDisk for Transaction {
fn from_bytes(bytes: impl AsRef<[u8]>) -> Self { fn from_bytes(bytes: impl AsRef<[u8]>) -> Self {
let bytes = bytes.as_ref(); let bytes = bytes.as_ref();
let mut tx = None; // TODO: skip cryptography verification during transaction deserialization from storage,
// or do it in a rayon thread (ideally in parallel with other transactions)
// # Performance bytes
// .as_ref()
// Move CPU-intensive deserialization cryptography into the rayon thread pool. .zcash_deserialize_into()
// This avoids blocking the tokio executor. .expect("deserialization format should match the serialization format used by IntoDisk")
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")
} }
} }