From c77a63b342878a9e87cd04b7fea666f2a35f7445 Mon Sep 17 00:00:00 2001 From: alaningtrump Date: Thu, 2 Jul 2026 21:15:23 +0800 Subject: [PATCH] chore: minor improvement for comments Signed-off-by: alaningtrump --- block/internal/cache/manager_test.go | 12 ++++++------ block/internal/pruner/pruner.go | 4 ++-- block/internal/submitting/da_submitter.go | 4 ++-- block/internal/submitting/submitter_test.go | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/block/internal/cache/manager_test.go b/block/internal/cache/manager_test.go index 943c4cdaff..b94ab81c4e 100644 --- a/block/internal/cache/manager_test.go +++ b/block/internal/cache/manager_test.go @@ -139,8 +139,8 @@ func TestManager_SaveAndRestoreFromStore(t *testing.T) { // The cache entry is not restored — this is correct and intentional. // Height 2 is in-flight: the window restore loads a placeholder entry keyed by - // height. The real content-hash entry is populated when the submitter re-processes - // the block after restart. Until then, DaHeight() must reflect the in-flight DA height. + // height. The real content-hash entry is populated when the submitter re-processes + // the block after restart. Until then, DaHeight() must reflect the in-flight DA height. assert.Equal(t, uint64(101), m2.DaHeight(), "DaHeight should reflect the highest in-flight DA height after restore") @@ -306,7 +306,7 @@ func TestManager_DaHeightAfterCacheClear(t *testing.T) { require.NoError(t, batch.Commit()) // Write the finalized-tip metadata exactly as setNodeHeightToDAHeight does - // in production. initDAHeightFromStore reads these keys to seed DaHeight() + // in production. initDAHeightFromStore reads these keys to seed DaHeight() // after ClearCache (the snapshot is wiped, but these keys survive). headerDABz := make([]byte, 8) binary.LittleEndian.PutUint64(headerDABz, 150) @@ -329,7 +329,7 @@ func TestManager_DaHeightAfterCacheClear(t *testing.T) { require.NoError(t, err) // DaHeight must reflect the finalized-tip DA height loaded from store - // metadata, not 0. The syncer uses this to seed daRetrieverHeight so the + // metadata, not 0. The syncer uses this to seed daRetrieverHeight so the // node does not re-scan DA from genesis after an operator-triggered clear. assert.Equal(t, uint64(155), m.DaHeight(), "DaHeight should be seeded from finalized-tip metadata even after ClearCache") @@ -351,7 +351,7 @@ func TestManager_DaHeightFromStoreOnRestore(t *testing.T) { require.NoError(t, batch.Commit()) // Persist the finalized-tip HeightToDAHeight metadata exactly as - // setNodeHeightToDAHeight does in production. These keys are the source + // setNodeHeightToDAHeight does in production. These keys are the source // of truth that initDAHeightFromStore reads — they exist independently of // the snapshot and survive across restarts and cache clears. headerDABz := make([]byte, 8) @@ -374,7 +374,7 @@ func TestManager_DaHeightFromStoreOnRestore(t *testing.T) { require.NoError(t, err) // DaHeight must reflect the highest DA height from the finalized-tip - // metadata, not 0. Without initDAHeightFromStore this would be 0 because + // metadata, not 0. Without initDAHeightFromStore this would be 0 because // there are no in-flight snapshot entries. assert.Equal(t, uint64(205), m.DaHeight(), "DaHeight should be seeded from finalized-tip HeightToDAHeight metadata on restore") diff --git a/block/internal/pruner/pruner.go b/block/internal/pruner/pruner.go index e56d9c2849..e525ca8a6a 100644 --- a/block/internal/pruner/pruner.go +++ b/block/internal/pruner/pruner.go @@ -180,8 +180,8 @@ func (p *Pruner) calculateBatchSize() uint64 { } // pruneMetadata prunes old state and execution metadata entries based on the configured retention depth. -// It does not prunes old blocks, as those are handled by the pruning logic. -// 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. +// It does not prune old blocks, as those are handled by the pruning logic. +// 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. func (p *Pruner) pruneMetadata() error { height, err := p.store.Height(p.ctx) if err != nil { diff --git a/block/internal/submitting/da_submitter.go b/block/internal/submitting/da_submitter.go index 9b11658fd8..15015d55f9 100644 --- a/block/internal/submitting/da_submitter.go +++ b/block/internal/submitting/da_submitter.go @@ -240,7 +240,7 @@ func (s *DASubmitter) SubmitHeaders(ctx context.Context, headers []*types.Signed } if err := s.headerDAHintAppender.AppendDAHint(ctx, res.Height, heights...); err != nil { s.logger.Error().Err(err).Msg("failed to append da height hint in header p2p store") - // ignoring error here, since we don't want to block the block submission' + // ignoring error here, since we don't want to block the block submission } if l := len(submitted); l > 0 { lastHeight := submitted[l-1].Height() @@ -456,7 +456,7 @@ func (s *DASubmitter) SubmitData(ctx context.Context, unsignedDataList []*types. } if err := s.dataDAHintAppender.AppendDAHint(ctx, res.Height, heights...); err != nil { s.logger.Error().Err(err).Msg("failed to append da height hint in data p2p store") - // ignoring error here, since we don't want to block the block submission' + // ignoring error here, since we don't want to block the block submission } if l := len(submitted); l > 0 { lastHeight := submitted[l-1].Height() diff --git a/block/internal/submitting/submitter_test.go b/block/internal/submitting/submitter_test.go index ff511c6a1d..ee5340a7f8 100644 --- a/block/internal/submitting/submitter_test.go +++ b/block/internal/submitting/submitter_test.go @@ -623,8 +623,8 @@ func TestSubmitter_IsHeightDAIncluded_AfterRestart(t *testing.T) { require.NoError(t, st1.SetMetadata(ctx, store.DAIncludedHeightKey, daIncBz)) // ── Step 2: simulate restart ────────────────────────────────────────────── - // Build a fresh Manager on the SAME underlying datastore. This exercises - // the RestoreFromStore → snapshot-decode path. The DA retriever has NOT + // Build a fresh Manager on the SAME underlying datastore. This exercises + // the RestoreFromStore → snapshot-decode path. The DA retriever has NOT // yet re-fired SetHeaderDAIncluded with the real hashes. cm2, err := cache.NewManager(config.DefaultConfig(), st1, zerolog.Nop()) require.NoError(t, err)