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

refactor(share/availability): Move window and constants to share/availability pkg #3906

Merged
merged 6 commits into from
Nov 14, 2024

Conversation

renaynay
Copy link
Member

@renaynay renaynay commented Oct 30, 2024

Partially addresses #3394

  • moves the concept of availability window to the share/availability package where it belongs and changes the names to be more clear -- light.Window -> availability.RequestWindow ; full.Window -> availability.StorageWindow
  • limits the use of availability.Window to the nodebuilder only, use time.Duration everywhere else
  • removes archival window in favour of using explicit time.Duration(0) -- will be removed entirely in follow-up PRs.

@renaynay renaynay added area:shares Shares and samples kind:refactor Attached to refactoring PRs labels Oct 30, 2024
@renaynay renaynay self-assigned this Oct 30, 2024
@renaynay renaynay marked this pull request as ready for review October 30, 2024 18:27
@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 68.08511% with 15 lines in your changes missing coverage. Please review.

Project coverage is 45.27%. Comparing base (2469e7a) to head (d29b45c).
Report is 383 commits behind head on main.

Files with missing lines Patch % Lines
nodebuilder/pruner/module.go 68.42% 6 Missing ⚠️
share/availability/window.go 0.00% 5 Missing ⚠️
das/daser.go 0.00% 0 Missing and 1 partial ⚠️
nodebuilder/das/constructors.go 0.00% 1 Missing ⚠️
nodebuilder/pruner/constructors.go 0.00% 1 Missing ⚠️
share/shwap/p2p/bitswap/getter.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3906      +/-   ##
==========================================
+ Coverage   44.83%   45.27%   +0.43%     
==========================================
  Files         265      308      +43     
  Lines       14620    21853    +7233     
==========================================
+ Hits         6555     9894    +3339     
- Misses       7313    10884    +3571     
- Partials      752     1075     +323     

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

Copy link
Member

@walldiss walldiss left a comment

Choose a reason for hiding this comment

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

Handling pruning windows just got a whole lot easier! It would be awesome to rename the variables so it's clear which window they're using. Right now, names like "window," "samplingWindow," and "availWindow" can be confusing inside the component. Being more specific about which of the two new windows is being used would help a lot.

Don’t forget the functions too, like changing WithAvailabilityWindow to WithStorageWindow. These tweaks would make the code easier to understand for everyone.

share/availability/window.go Outdated Show resolved Hide resolved
@renaynay
Copy link
Member Author

@walldiss

Right now, names like "window," "samplingWindow," and "availWindow" can be confusing inside the component

I plan to move those parameters outside of those components entirely (with exception of core pkg n which case I will name it to StorageWindow)

@renaynay renaynay force-pushed the limit-avail-window-nodebuilder branch from 35a8aa7 to 06179a2 Compare November 1, 2024 14:57
@renaynay renaynay force-pushed the limit-avail-window-nodebuilder branch from fa7ba77 to e8b6cb0 Compare November 1, 2024 15:45
@cristaloleg
Copy link
Contributor

Should #3912 be closed?

@renaynay
Copy link
Member Author

renaynay commented Nov 6, 2024

no #3912 is based on this PR @cristaloleg

@renaynay renaynay enabled auto-merge (squash) November 14, 2024 15:31
@renaynay renaynay merged commit be75628 into celestiaorg:main Nov 14, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:shares Shares and samples kind:refactor Attached to refactoring PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants