Skip to content

Commit

Permalink
nodebuilder/pruner: Enforce light pruning (celestiaorg#3912)
Browse files Browse the repository at this point in the history
  • Loading branch information
renaynay authored Dec 2, 2024
1 parent 774be14 commit 61d9a32
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions nodebuilder/pruner/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,13 @@ func ConstructModule(tp node.Type, cfg *Config) fx.Option {

switch tp {
case node.Light:
if cfg.EnableService {
return fx.Module("prune",
baseComponents,
prunerService,
// TODO(@walldiss @renaynay): remove conversion after Availability and Pruner interfaces are merged
// note this provide exists in pruner module to avoid cyclical imports
fx.Provide(func(la *light.ShareAvailability) pruner.Pruner { return la }),
)
}
// We do not trigger DetectPreviousRun for Light nodes, to allow them to disable pruning at wish.
// They are not expected to store a samples outside the sampling window and so partially pruned is
// not a concern.
// LNs enforce pruning by default
return fx.Module("prune",
baseComponents,
prunerService,
// TODO(@walldiss @renaynay): remove conversion after Availability and Pruner interfaces are merged
// note this provide exists in pruner module to avoid cyclical imports
fx.Provide(func(la *light.ShareAvailability) pruner.Pruner { return la }),
)
case node.Full:
if cfg.EnableService {
Expand Down

0 comments on commit 61d9a32

Please sign in to comment.