Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions block/internal/cache/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)
Expand All @@ -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")
Expand All @@ -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)
Expand All @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions block/internal/pruner/pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions block/internal/submitting/da_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions block/internal/submitting/submitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down