Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert: deserialize stored transactions in a rayon thread #4933

Merged
merged 4 commits into from
Aug 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions zebra-state/src/service/finalized_state/disk_format/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
dconnolly marked this conversation as resolved.
Show resolved Hide resolved
bytes
.as_ref()
.zcash_deserialize_into()
.expect("deserialization format should match the serialization format used by IntoDisk")
}
}

Expand Down