Skip to content

Commit fec4fb4

Browse files
committed
remove ai comments
1 parent b1a6a09 commit fec4fb4

File tree

3 files changed

+2
-23
lines changed

3 files changed

+2
-23
lines changed

pkg/config/config.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,9 @@ func (c *Config) Validate() error {
386386

387387
// Validate pruning configuration
388388
if c.Node.PruningEnabled {
389-
// When pruning is enabled, pruning_interval must be >= 1
390389
if c.Node.PruningInterval == 0 {
391390
return fmt.Errorf("pruning_interval must be >= 1 when pruning is enabled")
392391
}
393-
394-
// When pruning is enabled, keeping 0 blocks is contradictory; use pruning_enabled=false
395-
// for archive mode instead.
396392
if c.Node.PruningKeepRecent == 0 {
397393
return fmt.Errorf("pruning_keep_recent must be > 0 when pruning is enabled; use pruning_enabled=false to keep all blocks")
398394
}

pkg/store/cached_store.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,8 @@ func (cs *CachedStore) Rollback(ctx context.Context, height uint64, aggregator b
157157
return nil
158158
}
159159

160-
// PruneBlocks wraps the underlying store's PruneBlocks and invalidates caches.
161-
// After pruning historical block data from disk, any cached entries for pruned
162-
// heights must not be served, so we conservatively clear the entire cache.
160+
// PruneBlocks wraps the underlying store's PruneBlocks and invalidates caches
161+
// up to the heigh that we purne
163162
func (cs *CachedStore) PruneBlocks(ctx context.Context, height uint64) error {
164163
if err := cs.Store.PruneBlocks(ctx, height); err != nil {
165164
return err

pkg/store/types.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,12 @@ type Batch interface {
3030
}
3131

3232
// Store is minimal interface for storing and retrieving blocks, commits and state.
33-
//
34-
// It is composed from three concerns:
35-
// - Reader: read access to blocks, state, and metadata
36-
// - Rollback: consensus rollback logic (used for chain reorgs / recovery)
37-
// - Pruner: long-term height-based pruning of historical block data
3833
type Store interface {
3934
Reader
4035
Metadata
4136
Rollback
4237
Pruner
4338

44-
// SetMetadata saves arbitrary value in the store.
45-
//
46-
// This method enables evolve to safely persist any information.
47-
SetMetadata(ctx context.Context, key string, value []byte) error
48-
49-
// DeleteMetadata removes a metadata key from the store.
50-
DeleteMetadata(ctx context.Context, key string) error
51-
5239
// Close safely closes underlying data storage, to ensure that data is actually saved.
5340
Close() error
5441

@@ -107,9 +94,6 @@ type Rollback interface {
10794
}
10895

10996
// Pruner provides long-term, height-based pruning of historical block data.
110-
//
111-
// Implementations SHOULD be idempotent and safe to call multiple times for
112-
// the same or increasing target heights.
11397
type Pruner interface {
11498
// PruneBlocks removes block data (header, data, signature, and hash index)
11599
// up to and including the given height from the store, without modifying

0 commit comments

Comments
 (0)