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

Don't deserialize AggregateAndProof to tree #2859

Closed
dapplion opened this issue Jul 20, 2021 · 0 comments · Fixed by #3760
Closed

Don't deserialize AggregateAndProof to tree #2859

dapplion opened this issue Jul 20, 2021 · 0 comments · Fixed by #3760
Labels
prio-medium Resolve this some time soon (tm). scope-performance Performance issue and ideas to improve performance.

Comments

@dapplion
Copy link
Contributor

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:

  1. Gossip
  2. Validation queue
  3. Gossip validation
    3A. Verify AttestationData signature. Compute the AttestationData root and keep it.
    3B. Verify AggregateAndProof signature. Recycle AttestationData root to compute the signing root.
  4. Op pool: Reuse the already computed AttestationData 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.

@dapplion dapplion added prio-low This is nice to have. testnet-debugging scope-performance Performance issue and ideas to improve performance. prio-medium Resolve this some time soon (tm). and removed prio-low This is nice to have. labels Jul 20, 2021
@dapplion dapplion mentioned this issue Apr 26, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio-medium Resolve this some time soon (tm). scope-performance Performance issue and ideas to improve performance.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant