Skip to content

Commit 5226977

Browse files
committed
cleanups
1 parent fbd665f commit 5226977

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

block/internal/pruner/pruner.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Pruner struct {
2323
execPruner coreexecutor.ExecPruner
2424
cfg config.PruningConfig
2525
blockTime time.Duration
26-
daEnabled bool // Whether DA is enabled (determined by DA address)
26+
daEnabled bool
2727
logger zerolog.Logger
2828

2929
// Lifecycle
@@ -39,7 +39,7 @@ func New(
3939
execPruner coreexecutor.ExecPruner,
4040
cfg config.PruningConfig,
4141
blockTime time.Duration,
42-
daAddress string, // DA address to determine if DA is enabled
42+
daAddress string,
4343
) *Pruner {
4444
return &Pruner{
4545
store: store,
@@ -115,14 +115,13 @@ func (p *Pruner) pruneBlocks() error {
115115

116116
upperBound := storeHeight
117117

118-
// If DA is enabled, only prune blocks that are DA included for safety
118+
// If DA is enabled, only prune blocks that are DA included
119119
if p.daEnabled {
120120
var currentDAIncluded uint64
121121
currentDAIncludedBz, err := p.store.GetMetadata(p.ctx, store.DAIncludedHeightKey)
122122
if err == nil && len(currentDAIncludedBz) == 8 {
123123
currentDAIncluded = binary.LittleEndian.Uint64(currentDAIncludedBz)
124124
} else {
125-
// if we cannot get the current DA height, we cannot safely prune, so we skip pruning until we can get it.
126125
p.logger.Debug().Msg("skipping pruning: DA is enabled but DA included height is not available yet")
127126
return nil
128127
}

0 commit comments

Comments
 (0)