Skip to content

Commit fdc2b50

Browse files
authored
chore: minor improvement for comments (#3377)
Signed-off-by: alaningtrump <alaningtrump@outlook.com>
1 parent e23f9b8 commit fdc2b50

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

block/internal/cache/manager_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ func TestManager_SaveAndRestoreFromStore(t *testing.T) {
139139
// The cache entry is not restored — this is correct and intentional.
140140

141141
// Height 2 is in-flight: the window restore loads a placeholder entry keyed by
142-
// height. The real content-hash entry is populated when the submitter re-processes
143-
// the block after restart. Until then, DaHeight() must reflect the in-flight DA height.
142+
// height. The real content-hash entry is populated when the submitter re-processes
143+
// the block after restart. Until then, DaHeight() must reflect the in-flight DA height.
144144
assert.Equal(t, uint64(101), m2.DaHeight(),
145145
"DaHeight should reflect the highest in-flight DA height after restore")
146146

@@ -306,7 +306,7 @@ func TestManager_DaHeightAfterCacheClear(t *testing.T) {
306306
require.NoError(t, batch.Commit())
307307

308308
// Write the finalized-tip metadata exactly as setNodeHeightToDAHeight does
309-
// in production. initDAHeightFromStore reads these keys to seed DaHeight()
309+
// in production. initDAHeightFromStore reads these keys to seed DaHeight()
310310
// after ClearCache (the snapshot is wiped, but these keys survive).
311311
headerDABz := make([]byte, 8)
312312
binary.LittleEndian.PutUint64(headerDABz, 150)
@@ -329,7 +329,7 @@ func TestManager_DaHeightAfterCacheClear(t *testing.T) {
329329
require.NoError(t, err)
330330

331331
// DaHeight must reflect the finalized-tip DA height loaded from store
332-
// metadata, not 0. The syncer uses this to seed daRetrieverHeight so the
332+
// metadata, not 0. The syncer uses this to seed daRetrieverHeight so the
333333
// node does not re-scan DA from genesis after an operator-triggered clear.
334334
assert.Equal(t, uint64(155), m.DaHeight(),
335335
"DaHeight should be seeded from finalized-tip metadata even after ClearCache")
@@ -351,7 +351,7 @@ func TestManager_DaHeightFromStoreOnRestore(t *testing.T) {
351351
require.NoError(t, batch.Commit())
352352

353353
// Persist the finalized-tip HeightToDAHeight metadata exactly as
354-
// setNodeHeightToDAHeight does in production. These keys are the source
354+
// setNodeHeightToDAHeight does in production. These keys are the source
355355
// of truth that initDAHeightFromStore reads — they exist independently of
356356
// the snapshot and survive across restarts and cache clears.
357357
headerDABz := make([]byte, 8)
@@ -374,7 +374,7 @@ func TestManager_DaHeightFromStoreOnRestore(t *testing.T) {
374374
require.NoError(t, err)
375375

376376
// DaHeight must reflect the highest DA height from the finalized-tip
377-
// metadata, not 0. Without initDAHeightFromStore this would be 0 because
377+
// metadata, not 0. Without initDAHeightFromStore this would be 0 because
378378
// there are no in-flight snapshot entries.
379379
assert.Equal(t, uint64(205), m.DaHeight(),
380380
"DaHeight should be seeded from finalized-tip HeightToDAHeight metadata on restore")

block/internal/pruner/pruner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ func (p *Pruner) calculateBatchSize() uint64 {
180180
}
181181

182182
// pruneMetadata prunes old state and execution metadata entries based on the configured retention depth.
183-
// It does not prunes old blocks, as those are handled by the pruning logic.
184-
// Pruning old state does not lose history but limit the ability to recover (replay or rollback) to the last HEAD-N blocks, where N is the retention depth.
183+
// It does not prune old blocks, as those are handled by the pruning logic.
184+
// Pruning old state does not lose history but limits the ability to recover (replay or rollback) to the last HEAD-N blocks, where N is the retention depth.
185185
func (p *Pruner) pruneMetadata() error {
186186
height, err := p.store.Height(p.ctx)
187187
if err != nil {

block/internal/submitting/da_submitter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func (s *DASubmitter) SubmitHeaders(ctx context.Context, headers []*types.Signed
240240
}
241241
if err := s.headerDAHintAppender.AppendDAHint(ctx, res.Height, heights...); err != nil {
242242
s.logger.Error().Err(err).Msg("failed to append da height hint in header p2p store")
243-
// ignoring error here, since we don't want to block the block submission'
243+
// ignoring error here, since we don't want to block the block submission
244244
}
245245
if l := len(submitted); l > 0 {
246246
lastHeight := submitted[l-1].Height()
@@ -456,7 +456,7 @@ func (s *DASubmitter) SubmitData(ctx context.Context, unsignedDataList []*types.
456456
}
457457
if err := s.dataDAHintAppender.AppendDAHint(ctx, res.Height, heights...); err != nil {
458458
s.logger.Error().Err(err).Msg("failed to append da height hint in data p2p store")
459-
// ignoring error here, since we don't want to block the block submission'
459+
// ignoring error here, since we don't want to block the block submission
460460
}
461461
if l := len(submitted); l > 0 {
462462
lastHeight := submitted[l-1].Height()

block/internal/submitting/submitter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,8 @@ func TestSubmitter_IsHeightDAIncluded_AfterRestart(t *testing.T) {
623623
require.NoError(t, st1.SetMetadata(ctx, store.DAIncludedHeightKey, daIncBz))
624624

625625
// ── Step 2: simulate restart ──────────────────────────────────────────────
626-
// Build a fresh Manager on the SAME underlying datastore. This exercises
627-
// the RestoreFromStore → snapshot-decode path. The DA retriever has NOT
626+
// Build a fresh Manager on the SAME underlying datastore. This exercises
627+
// the RestoreFromStore → snapshot-decode path. The DA retriever has NOT
628628
// yet re-fired SetHeaderDAIncluded with the real hashes.
629629
cm2, err := cache.NewManager(config.DefaultConfig(), st1, zerolog.Nop())
630630
require.NoError(t, err)

0 commit comments

Comments
 (0)