Move network transaction deserialization to a dedicated blocking and CPU-heavy thread #4787
Labels
A-cryptography
Area: Cryptography related
A-network
Area: Network protocol updates or fixes
C-bug
Category: This is a bug
I-integration-fail
Continuous integration fails, including build and test failures
I-slow
Problems with performance or responsiveness
Motivation
Zebra's sync can be slow or fail, because transaction deserialization involves some CPU-heavy cryptography.
So we want to move transaction deserialization into a
rayon
CPU thread poolscope
.API Reference
Blocking threads:
https://docs.rs/tokio/latest/tokio/task/fn.spawn_blocking.html
CPU-heavy threads:
https://docs.rs/rayon/latest/rayon/fn.scope_fifo.html
Detailed Analysis
See #4583 (comment)
Designs
When
zebra-network
deserializes a block or transaction, move that work to therayon
thread pool.Example code for
rayon
intokio
blocking threads:zebra/zebra-consensus/src/primitives/ed25519.rs
Lines 121 to 134 in 81727d7
Related Work
State deserialization is handled in #4788
The text was updated successfully, but these errors were encountered: