Don't deserialize AggregateAndProof to tree #2859
Labels
prio-medium
Resolve this some time soon (tm).
scope-performance
Performance issue and ideas to improve performance.
Describe the bug
Taking a CPU profile in Prater on a node with 1 validator 10.36% of CPU time is spent on tree_deserializeFromBytes.
I think we don't really need to deserialize to tree backed. We can manually cache the roots that we need.
The lifetime of an AggregateAndProof is relatively simple:
3A. Verify AttestationData signature. Compute the AttestationData root and keep it.
3B. Verify AggregateAndProof signature. Recycle AttestationData root to compute the signing root.
4A. Block production
4B. Pruned
A struct or even binary backed takes less memory, it's cheaper to deserialize and it's cheaper to access it's properties.
The text was updated successfully, but these errors were encountered: