Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packet: Use
Bytes
instead of an array in Packet
The reason behind the switch is that `Packet` gets cloned in multiple places. `Bytes` provides a zero-copy abstraction, where calling `clone()` doesn't make an actual copy of the underlying data and all instances point to the same memory. However, the old layout containing a sized array is convenient for CUDA. To not break CUDA support, this change introduces a new struct called `PacketArray`, which a `Packet` can be converted into just before calling GPU-based sigverify. That requires a copy, ideally just one. At the same time, CPU-based sigverify and all the other components are going to benefit from zero-copy properties of `Bytes`.
- Loading branch information