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

feat(share/availability/full): Introduce Q4 trimming for archival nodes #4028

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

renaynay
Copy link
Member

@renaynay renaynay commented Jan 5, 2025

This PR introduces trimming of .q4 files outside the sampling window for archival nodes.

It also updates the pruner checkpoint such that it's possible to convert from an archival node --> full pruning node but not the other way around (the node runner would need to resync the node in this case).

All deletion logic now lives in either share/availability/light or share/availability/full but the pruner service is still contained in a separate package and now runs by default as all node types will have some form of pruning happening.

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2025

Codecov Report

Attention: Patch coverage is 72.58065% with 17 lines in your changes missing coverage. Please review.

Project coverage is 45.80%. Comparing base (2469e7a) to head (69d8bbe).
Report is 412 commits behind head on main.

Files with missing lines Patch % Lines
share/availability/full/availability.go 0.00% 12 Missing ⚠️
pruner/checkpoint.go 86.36% 3 Missing ⚠️
share/availability/light/availability.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4028      +/-   ##
==========================================
+ Coverage   44.83%   45.80%   +0.97%     
==========================================
  Files         265      307      +42     
  Lines       14620    22073    +7453     
==========================================
+ Hits         6555    10111    +3556     
- Misses       7313    10894    +3581     
- Partials      752     1068     +316     

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

@@ -10,4 +10,5 @@ import (
// from the node's datastore.
type Pruner interface {
Prune(context.Context, *header.ExtendedHeader) error
Kind() string
Copy link
Member Author

Choose a reason for hiding this comment

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

Okay so i hate this

we can implicitly do this by checking for the presence of a historical block (without its .q4 file) but I think that could be much more invasive and annoying to sort out.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is the cleanest option as of right now.

@renaynay renaynay added the kind:feat Attached to feature PRs label Jan 5, 2025
@@ -42,51 +34,55 @@ func ConstructModule(tp node.Type, cfg *Config) fx.Option {
// This is necessary to invoke the pruner service as independent thanks to a
// quirk in FX.
fx.Invoke(func(_ *pruner.Service) {}),
fx.Invoke(func(ctx context.Context, ds datastore.Batching, p pruner.Pruner) error {
return pruner.DetectPreviousRun(ctx, ds, p.Kind())
Copy link
Member Author

Choose a reason for hiding this comment

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

This can now run on all node types bc the check will be ignored if previous pruner kind == current pruner kind.


if cp.PrunerKind != expectedKind {
// do not allow reversion back to archival mode
if cp.PrunerKind == "full" {
Copy link
Member Author

@renaynay renaynay Jan 7, 2025

Choose a reason for hiding this comment

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

happy to extract into consts (archival, full, light)

@renaynay renaynay changed the title WIP - introduce archival trimming feat(share/availability/full): Introduce Q4 trimming for archival nodes Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feat Attached to feature PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants