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

fix(eds/cache): Fix prealloc for proof nodes #3860

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

walldiss
Copy link
Member

@walldiss walldiss commented Oct 17, 2024

Previous prealloc calc was incorrect resulting in higher allocation than needed. This is chart of amount of allocation we should have done and actually done:

eds size; needed alloc; real alloc
2 3 4
4 7 24
8 15 112
16 31 480
32 63 1984
64 127 8064
128 255 32512
256 511 130560
512 1023 523264

Fixes #3858

@walldiss walldiss added the kind:fix Attached to bug-fixing PRs label Oct 17, 2024
@walldiss walldiss self-assigned this Oct 17, 2024
@walldiss walldiss force-pushed the fix-prealloc-for-proof-nodes branch from edc9059 to c6a1685 Compare October 17, 2024 18:48
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 44.94%. Comparing base (2469e7a) to head (c6a1685).
Report is 341 commits behind head on main.

Files with missing lines Patch % Lines
share/ipld/nmt_adder.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3860      +/-   ##
==========================================
+ Coverage   44.83%   44.94%   +0.10%     
==========================================
  Files         265      314      +49     
  Lines       14620    21789    +7169     
==========================================
+ Hits         6555     9793    +3238     
- Misses       7313    10969    +3656     
- Partials      752     1027     +275     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good self catch

Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow

@Wondertan
Copy link
Member

Link #3858

@walldiss walldiss merged commit 0da16dd into celestiaorg:main Oct 17, 2024
31 checks passed
@walldiss walldiss deleted the fix-prealloc-for-proof-nodes branch October 17, 2024 22:04
@odeke-em
Copy link
Contributor

Thank you for the fix @walldiss! I highly would encourage adding a test to lock this behavior as it is subtle and even if it changed from a revert (say if something unrelated broke) it would never be caught.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:fix Attached to bug-fixing PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CPU usage spikes reports
5 participants