From d572276eeb81900342eb8c8838a6ba7a545724f8 Mon Sep 17 00:00:00 2001 From: Vlad <13818348+walldiss@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:46:42 +0200 Subject: [PATCH 1/2] add q4 trimming support --- pruner/full/pruner.go | 2 +- store/metrics.go | 32 +++++-- store/store.go | 92 ++++++++++++------- store/store_test.go | 208 ++++++++++++++++++++++++++++++++---------- 4 files changed, 246 insertions(+), 88 deletions(-) diff --git a/pruner/full/pruner.go b/pruner/full/pruner.go index fac83e23fe..193dad00de 100644 --- a/pruner/full/pruner.go +++ b/pruner/full/pruner.go @@ -24,7 +24,7 @@ func NewPruner(store *store.Store) *Pruner { func (p *Pruner) Prune(ctx context.Context, eh *header.ExtendedHeader) error { log.Debugf("pruning header %s", eh.DAH.Hash()) - err := p.store.Remove(ctx, eh.Height(), eh.DAH.Hash()) + err := p.store.RemoveAll(ctx, eh.Height(), eh.DAH.Hash()) if err != nil { return err } diff --git a/store/metrics.go b/store/metrics.go index 637acb76ff..bc77351fae 100644 --- a/store/metrics.go +++ b/store/metrics.go @@ -24,7 +24,8 @@ type metrics struct { putExists metric.Int64Counter get metric.Float64Histogram has metric.Float64Histogram - remove metric.Float64Histogram + removeAll metric.Float64Histogram + removeQ4 metric.Float64Histogram unreg func() error } @@ -53,8 +54,14 @@ func (s *Store) WithMetrics() error { return err } - remove, err := meter.Float64Histogram("eds_store_remove_time_histogram", - metric.WithDescription("eds store remove time histogram(s)")) + removeQ4, err := meter.Float64Histogram("eds_store_remove_q4_time_histogram", + metric.WithDescription("eds store remove q4 data time histogram(s)")) + if err != nil { + return err + } + + removeAll, err := meter.Float64Histogram("eds_store_remove_all_time_histogram", + metric.WithDescription("eds store remove all data time histogram(s)")) if err != nil { return err } @@ -64,7 +71,8 @@ func (s *Store) WithMetrics() error { putExists: putExists, get: get, has: has, - remove: remove, + removeAll: removeAll, + removeQ4: removeQ4, } return s.metrics.addCacheMetrics(s.cache) } @@ -130,7 +138,19 @@ func (m *metrics) observeHas(ctx context.Context, dur time.Duration, failed bool attribute.Bool(failedKey, failed))) } -func (m *metrics) observeRemove(ctx context.Context, dur time.Duration, failed bool) { +func (m *metrics) observeRemoveAll(ctx context.Context, dur time.Duration, failed bool) { + if m == nil { + return + } + if ctx.Err() != nil { + ctx = context.Background() + } + + m.removeAll.Record(ctx, dur.Seconds(), metric.WithAttributes( + attribute.Bool(failedKey, failed))) +} + +func (m *metrics) observeRemoveQ4(ctx context.Context, dur time.Duration, failed bool) { if m == nil { return } @@ -138,7 +158,7 @@ func (m *metrics) observeRemove(ctx context.Context, dur time.Duration, failed b ctx = context.Background() } - m.remove.Record(ctx, dur.Seconds(), metric.WithAttributes( + m.removeQ4.Record(ctx, dur.Seconds(), metric.WithAttributes( attribute.Bool(failedKey, failed))) } diff --git a/store/store.go b/store/store.go index 00d6b3e610..582a43b8af 100644 --- a/store/store.go +++ b/store/store.go @@ -33,7 +33,7 @@ const ( var ErrNotFound = errors.New("eds not found in store") // Store is a storage for EDS files. It persists EDS files on disk in form of Q1Q4 files or ODS -// files. It provides methods to put, get and remove EDS files. It has two caches: recent eds cache +// files. It provides methods to put, get and removeAll EDS files. It has two caches: recent eds cache // and availability cache. Recent eds cache is used to cache recent blocks. Availability cache is // used to cache blocks that are accessed by sample requests. Store is thread-safe. type Store struct { @@ -149,11 +149,11 @@ func (s *Store) createFile( return true, nil } if err != nil { + // ensure we don't have partial writes if any operation fails + removeErr := s.removeAll(height, roots.Hash()) return false, errors.Join( fmt.Errorf("creating ODSQ4 file: %w", err), - // ensure we don't have partial writes - remove(pathODS), - remove(pathQ4), + removeErr, ) } @@ -161,11 +161,10 @@ func (s *Store) createFile( err = s.linkHeight(roots.Hash(), height) if err != nil { // ensure we don't have partial writes if any operation fails + removeErr := s.removeAll(height, roots.Hash()) return false, errors.Join( fmt.Errorf("hardlinking height: %w", err), - remove(pathODS), - remove(pathQ4), - s.removeLink(height), + removeErr, ) } return false, nil @@ -305,51 +304,76 @@ func (s *Store) hasByHeight(height uint64) (bool, error) { return exists(pathODS) } -func (s *Store) Remove(ctx context.Context, height uint64, datahash share.DataHash) error { +func (s *Store) RemoveAll(ctx context.Context, height uint64, datahash share.DataHash) error { + lock := s.stripLock.byHashAndHeight(datahash, height) + lock.lock() + defer lock.unlock() + tNow := time.Now() - err := s.remove(height, datahash) - s.metrics.observeRemove(ctx, time.Since(tNow), err != nil) + err := s.removeAll(height, datahash) + s.metrics.observeRemoveAll(ctx, time.Since(tNow), err != nil) return err } -func (s *Store) remove(height uint64, datahash share.DataHash) error { - lock := s.stripLock.byHeight(height) - lock.Lock() - if err := s.removeLink(height); err != nil { - return fmt.Errorf("removing link: %w", err) +func (s *Store) removeAll(height uint64, datahash share.DataHash) error { + if err := s.removeODS(height, datahash); err != nil { + return fmt.Errorf("removing ODS: %w", err) } - lock.Unlock() - - dlock := s.stripLock.byHash(datahash) - dlock.Lock() - defer dlock.Unlock() - if err := s.removeFile(datahash); err != nil { - return fmt.Errorf("removing file: %w", err) + if err := s.removeQ4(height, datahash); err != nil { + return fmt.Errorf("removing Q4: %w", err) } return nil } -func (s *Store) removeLink(height uint64) error { +func (s *Store) removeODS(height uint64, datahash share.DataHash) error { if err := s.cache.Remove(height); err != nil { return fmt.Errorf("removing from cache: %w", err) } - pathODS := s.heightToPath(height, odsFileExt) - return remove(pathODS) + pathLink := s.heightToPath(height, odsFileExt) + if err := remove(pathLink); err != nil { + return fmt.Errorf("removing hardlink: %w", err) + } + + // if datahash is empty, we don't need to remove the ODS file, only the hardlink + if datahash.IsEmptyEDS() { + return nil + } + + pathODS := s.hashToPath(datahash, odsFileExt) + if err := remove(pathODS); err != nil { + return fmt.Errorf("removing ODS file: %w", err) + } + return nil } -func (s *Store) removeFile(hash share.DataHash) error { - // we don't need to remove the empty file, it should always be there - if hash.IsEmptyEDS() { +func (s *Store) RemoveQ4(ctx context.Context, height uint64, datahash share.DataHash) error { + lock := s.stripLock.byHashAndHeight(datahash, height) + lock.lock() + defer lock.unlock() + + tNow := time.Now() + err := s.removeQ4(height, datahash) + s.metrics.observeRemoveQ4(ctx, time.Since(tNow), err != nil) + return err +} + +func (s *Store) removeQ4(height uint64, datahash share.DataHash) error { + // if datahash is empty, we don't need to remove the Q4 file + if datahash.IsEmptyEDS() { return nil } - pathODS := s.hashToPath(hash, odsFileExt) - pathQ4 := s.hashToPath(hash, q4FileExt) - return errors.Join( - remove(pathODS), - remove(pathQ4), - ) + if err := s.cache.Remove(height); err != nil { + return fmt.Errorf("removing from cache: %w", err) + } + + // remove Q4 file + pathQ4File := s.hashToPath(datahash, q4FileExt) + if err := remove(pathQ4File); err != nil { + return fmt.Errorf("removing Q4 file: %w", err) + } + return nil } func (s *Store) hashToPath(datahash share.DataHash, ext string) string { diff --git a/store/store_test.go b/store/store_test.go index dd814afcf4..14c8f0a191 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -2,6 +2,8 @@ package store import ( "context" + "os" + "path" "sync/atomic" "testing" "time" @@ -24,26 +26,25 @@ func TestEDSStore(t *testing.T) { require.NoError(t, err) // disable cache - edsStore.cache = cache.NewDoubleCache(cache.NoopCache{}, cache.NoopCache{}) height := atomic.Uint64{} height.Store(100) t.Run("Put", func(t *testing.T) { + dir := t.TempDir() + edsStore, err := NewStore(paramsNoCache(), dir) + require.NoError(t, err) + eds, roots := randomEDS(t) height := height.Add(1) - err := edsStore.Put(ctx, roots, height, eds) + err = edsStore.Put(ctx, roots, height, eds) require.NoError(t, err) - // file should become available by hash - has, err := edsStore.HasByHash(ctx, roots.Hash()) - require.NoError(t, err) - require.True(t, has) + // file should exist in the store + hasByHashAndHeight(t, edsStore, ctx, roots.Hash(), height, true, true) - // file should become available by height - has, err = edsStore.HasByHeight(ctx, height) - require.NoError(t, err) - require.True(t, has) + // block folder should contain ods and q4 files for the block and 1 link + ensureAmountFileAndLinks(t, dir, 2, 1) }) t.Run("Cached after Put", func(t *testing.T) { @@ -70,16 +71,23 @@ func TestEDSStore(t *testing.T) { }) t.Run("Second Put should be noop", func(t *testing.T) { + dir := t.TempDir() + edsStore, err := NewStore(paramsNoCache(), dir) + require.NoError(t, err) + eds, roots := randomEDS(t) height := height.Add(1) - err := edsStore.Put(ctx, roots, height, eds) + err = edsStore.Put(ctx, roots, height, eds) require.NoError(t, err) + // ensure file is written. There should be only ods + q4 files and 1 link + ensureAmountFileAndLinks(t, dir, 2, 1) err = edsStore.Put(ctx, roots, height, eds) require.NoError(t, err) - // TODO: check amount of files in the store after the second Put - // after store supports listing + + // ensure file is not duplicated. + ensureAmountFileAndLinks(t, dir, 2, 1) }) t.Run("GetByHeight", func(t *testing.T) { @@ -122,13 +130,8 @@ func TestEDSStore(t *testing.T) { _, roots := randomEDS(t) height := height.Add(1) - has, err := edsStore.HasByHash(ctx, roots.Hash()) - require.NoError(t, err) - require.False(t, has) - - has, err = edsStore.HasByHeight(ctx, height) - require.NoError(t, err) - require.False(t, has) + // file does not exist + hasByHashAndHeight(t, edsStore, ctx, roots.Hash(), height, false, false) _, err = edsStore.GetByHeight(ctx, height) require.ErrorIs(t, err, ErrNotFound) @@ -137,40 +140,118 @@ func TestEDSStore(t *testing.T) { require.ErrorIs(t, err, ErrNotFound) }) - t.Run("Remove", func(t *testing.T) { - edsStore, err := NewStore(DefaultParameters(), t.TempDir()) - require.NoError(t, err) + t.Run("RemoveAll", func(t *testing.T) { + t.Run("empty file", func(t *testing.T) { + dir := t.TempDir() + edsStore, err := NewStore(DefaultParameters(), dir) + require.NoError(t, err) - // removing file that does not exist should be noop - missingHeight := height.Add(1) - err = edsStore.Remove(ctx, missingHeight, share.DataHash{0x01, 0x02}) - require.NoError(t, err) + height := height.Add(1) + hash := share.EmptyEDSDataHash() + err = edsStore.Put(ctx, share.EmptyEDSRoots(), height, share.EmptyEDS()) + require.NoError(t, err) + ensureAmountFileAndLinks(t, dir, 0, 1) - eds, roots := randomEDS(t) - height := height.Add(1) - err = edsStore.Put(ctx, roots, height, eds) - require.NoError(t, err) + err = edsStore.RemoveAll(ctx, height, hash) + require.NoError(t, err) - err = edsStore.Remove(ctx, height, roots.Hash()) - require.NoError(t, err) + // file should be removed from cache + _, err = edsStore.cache.Get(height) + require.ErrorIs(t, err, cache.ErrCacheMiss) - // file should be removed from cache - _, err = edsStore.cache.Get(height) - require.ErrorIs(t, err, cache.ErrCacheMiss) + // empty file should be accessible by hash, but not by height + hasByHashAndHeight(t, edsStore, ctx, hash, height, true, false) - // file should not be accessible by hash - has, err := edsStore.HasByHash(ctx, roots.Hash()) - require.NoError(t, err) - require.False(t, has) + // ensure all files and links are removed + ensureAmountFileAndLinks(t, dir, 0, 0) + }) - // subsequent remove should be noop - err = edsStore.Remove(ctx, height, roots.Hash()) - require.NoError(t, err) + t.Run("non-empty file", func(t *testing.T) { + dir := t.TempDir() + edsStore, err := NewStore(DefaultParameters(), dir) + require.NoError(t, err) - // file should not be accessible by height - has, err = edsStore.HasByHeight(ctx, height) - require.NoError(t, err) - require.False(t, has) + // removing file that does not exist should be noop + missingHeight := height.Add(1) + err = edsStore.RemoveAll(ctx, missingHeight, share.DataHash{0x01, 0x02}) + require.NoError(t, err) + + eds, roots := randomEDS(t) + height := height.Add(1) + err = edsStore.Put(ctx, roots, height, eds) + require.NoError(t, err) + // ensure file is written + ensureAmountFileAndLinks(t, dir, 2, 1) + + err = edsStore.RemoveAll(ctx, height, roots.Hash()) + require.NoError(t, err) + + // file should be removed from cache + _, err = edsStore.cache.Get(height) + require.ErrorIs(t, err, cache.ErrCacheMiss) + + // file should not be accessible by hash or height + hasByHashAndHeight(t, edsStore, ctx, roots.Hash(), height, false, false) + + // ensure file and link are removed + ensureAmountFileAndLinks(t, dir, 0, 0) + + // subsequent removeAll should be noop + err = edsStore.RemoveAll(ctx, height, roots.Hash()) + require.NoError(t, err) + }) + }) + + t.Run("RemoveQ4", func(t *testing.T) { + t.Run("empty file", func(t *testing.T) { + dir := t.TempDir() + edsStore, err := NewStore(DefaultParameters(), dir) + require.NoError(t, err) + + height := height.Add(1) + hash := share.EmptyEDSDataHash() + err = edsStore.Put(ctx, share.EmptyEDSRoots(), height, share.EmptyEDS()) + require.NoError(t, err) + // empty file is not counted as a file + ensureAmountFileAndLinks(t, dir, 0, 1) + + err = edsStore.RemoveQ4(ctx, height, hash) + require.NoError(t, err) + + // file should be removed from cache + _, err = edsStore.cache.Get(height) + require.ErrorIs(t, err, cache.ErrCacheMiss) + + // empty file should be accessible by hash and by height + hasByHashAndHeight(t, edsStore, ctx, hash, height, true, true) + + // ensure ods file and link are not removed + ensureAmountFileAndLinks(t, dir, 0, 1) + }) + + t.Run("non-empty file", func(t *testing.T) { + dir := t.TempDir() + edsStore, err := NewStore(DefaultParameters(), dir) + require.NoError(t, err) + + square, roots := randomEDS(t) + height := height.Add(1) + err = edsStore.Put(ctx, roots, height, square) + require.NoError(t, err) + + err = edsStore.RemoveQ4(ctx, height, roots.Hash()) + require.NoError(t, err) + + // file should be removed from cache + _, err = edsStore.cache.Get(height) + require.ErrorIs(t, err, cache.ErrCacheMiss) + + // ODS file should be accessible by hash and by height + hasByHashAndHeight(t, edsStore, ctx, roots.Hash(), height, true, true) + + // ensure ods file and link are not removed + ensureAmountFileAndLinks(t, dir, 1, 1) + }) }) t.Run("empty EDS returned by hash", func(t *testing.T) { @@ -319,3 +400,36 @@ func randomEDS(t testing.TB) (*rsmt2d.ExtendedDataSquare, *share.AxisRoots) { return eds, roots } + +func ensureAmountFileAndLinks(t testing.TB, dir string, files, links int) { + // add empty file ods and q4 parts and heights folder to the count + files += 3 + // ensure block folder contains the correct amount of files + blockPath := path.Join(dir, blocksPath) + entries, err := os.ReadDir(blockPath) + require.NoError(t, err) + require.Len(t, entries, files) + + // ensure heights folder contains the correct amount of links + linksPath := path.Join(dir, heightsPath) + entries, err = os.ReadDir(linksPath) + require.NoError(t, err) + require.Len(t, entries, links) +} + +func hasByHashAndHeight( + t testing.TB, + store *Store, + ctx context.Context, + hash share.DataHash, + height uint64, + hasByHash, hasByHeight bool, +) { + has, err := store.HasByHash(ctx, hash) + require.NoError(t, err) + require.Equal(t, hasByHash, has) + + has, err = store.HasByHeight(ctx, height) + require.NoError(t, err) + require.Equal(t, hasByHeight, has) +} From 3d508914d07760a77aa1714659a03b1196b4ac7c Mon Sep 17 00:00:00 2001 From: Vlad <13818348+walldiss@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:56:57 +0200 Subject: [PATCH 2/2] rename removeAll -> removeODSQ4 --- pruner/full/pruner.go | 2 +- store/metrics.go | 34 +++++++++++++++++----------------- store/store.go | 14 +++++++------- store/store_test.go | 12 ++++++------ 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/pruner/full/pruner.go b/pruner/full/pruner.go index 193dad00de..5b3f409b41 100644 --- a/pruner/full/pruner.go +++ b/pruner/full/pruner.go @@ -24,7 +24,7 @@ func NewPruner(store *store.Store) *Pruner { func (p *Pruner) Prune(ctx context.Context, eh *header.ExtendedHeader) error { log.Debugf("pruning header %s", eh.DAH.Hash()) - err := p.store.RemoveAll(ctx, eh.Height(), eh.DAH.Hash()) + err := p.store.RemoveODSQ4(ctx, eh.Height(), eh.DAH.Hash()) if err != nil { return err } diff --git a/store/metrics.go b/store/metrics.go index bc77351fae..792b40f357 100644 --- a/store/metrics.go +++ b/store/metrics.go @@ -20,13 +20,13 @@ const ( var meter = otel.Meter("store") type metrics struct { - put metric.Float64Histogram - putExists metric.Int64Counter - get metric.Float64Histogram - has metric.Float64Histogram - removeAll metric.Float64Histogram - removeQ4 metric.Float64Histogram - unreg func() error + put metric.Float64Histogram + putExists metric.Int64Counter + get metric.Float64Histogram + has metric.Float64Histogram + removeODSQ4 metric.Float64Histogram + removeQ4 metric.Float64Histogram + unreg func() error } func (s *Store) WithMetrics() error { @@ -60,19 +60,19 @@ func (s *Store) WithMetrics() error { return err } - removeAll, err := meter.Float64Histogram("eds_store_remove_all_time_histogram", - metric.WithDescription("eds store remove all data time histogram(s)")) + removeODSQ4, err := meter.Float64Histogram("eds_store_remove_odsq4_time_histogram", + metric.WithDescription("eds store remove odsq4 file data time histogram(s)")) if err != nil { return err } s.metrics = &metrics{ - put: put, - putExists: putExists, - get: get, - has: has, - removeAll: removeAll, - removeQ4: removeQ4, + put: put, + putExists: putExists, + get: get, + has: has, + removeODSQ4: removeODSQ4, + removeQ4: removeQ4, } return s.metrics.addCacheMetrics(s.cache) } @@ -138,7 +138,7 @@ func (m *metrics) observeHas(ctx context.Context, dur time.Duration, failed bool attribute.Bool(failedKey, failed))) } -func (m *metrics) observeRemoveAll(ctx context.Context, dur time.Duration, failed bool) { +func (m *metrics) observeRemoveODSQ4(ctx context.Context, dur time.Duration, failed bool) { if m == nil { return } @@ -146,7 +146,7 @@ func (m *metrics) observeRemoveAll(ctx context.Context, dur time.Duration, faile ctx = context.Background() } - m.removeAll.Record(ctx, dur.Seconds(), metric.WithAttributes( + m.removeODSQ4.Record(ctx, dur.Seconds(), metric.WithAttributes( attribute.Bool(failedKey, failed))) } diff --git a/store/store.go b/store/store.go index 582a43b8af..97f6f18aec 100644 --- a/store/store.go +++ b/store/store.go @@ -33,7 +33,7 @@ const ( var ErrNotFound = errors.New("eds not found in store") // Store is a storage for EDS files. It persists EDS files on disk in form of Q1Q4 files or ODS -// files. It provides methods to put, get and removeAll EDS files. It has two caches: recent eds cache +// files. It provides methods to put, get and remove EDS files. It has two caches: recent eds cache // and availability cache. Recent eds cache is used to cache recent blocks. Availability cache is // used to cache blocks that are accessed by sample requests. Store is thread-safe. type Store struct { @@ -150,7 +150,7 @@ func (s *Store) createFile( } if err != nil { // ensure we don't have partial writes if any operation fails - removeErr := s.removeAll(height, roots.Hash()) + removeErr := s.removeODSQ4(height, roots.Hash()) return false, errors.Join( fmt.Errorf("creating ODSQ4 file: %w", err), removeErr, @@ -161,7 +161,7 @@ func (s *Store) createFile( err = s.linkHeight(roots.Hash(), height) if err != nil { // ensure we don't have partial writes if any operation fails - removeErr := s.removeAll(height, roots.Hash()) + removeErr := s.removeODSQ4(height, roots.Hash()) return false, errors.Join( fmt.Errorf("hardlinking height: %w", err), removeErr, @@ -304,18 +304,18 @@ func (s *Store) hasByHeight(height uint64) (bool, error) { return exists(pathODS) } -func (s *Store) RemoveAll(ctx context.Context, height uint64, datahash share.DataHash) error { +func (s *Store) RemoveODSQ4(ctx context.Context, height uint64, datahash share.DataHash) error { lock := s.stripLock.byHashAndHeight(datahash, height) lock.lock() defer lock.unlock() tNow := time.Now() - err := s.removeAll(height, datahash) - s.metrics.observeRemoveAll(ctx, time.Since(tNow), err != nil) + err := s.removeODSQ4(height, datahash) + s.metrics.observeRemoveODSQ4(ctx, time.Since(tNow), err != nil) return err } -func (s *Store) removeAll(height uint64, datahash share.DataHash) error { +func (s *Store) removeODSQ4(height uint64, datahash share.DataHash) error { if err := s.removeODS(height, datahash); err != nil { return fmt.Errorf("removing ODS: %w", err) } diff --git a/store/store_test.go b/store/store_test.go index 14c8f0a191..30d2c37463 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -140,7 +140,7 @@ func TestEDSStore(t *testing.T) { require.ErrorIs(t, err, ErrNotFound) }) - t.Run("RemoveAll", func(t *testing.T) { + t.Run("RemoveODSQ4", func(t *testing.T) { t.Run("empty file", func(t *testing.T) { dir := t.TempDir() edsStore, err := NewStore(DefaultParameters(), dir) @@ -152,7 +152,7 @@ func TestEDSStore(t *testing.T) { require.NoError(t, err) ensureAmountFileAndLinks(t, dir, 0, 1) - err = edsStore.RemoveAll(ctx, height, hash) + err = edsStore.RemoveODSQ4(ctx, height, hash) require.NoError(t, err) // file should be removed from cache @@ -173,7 +173,7 @@ func TestEDSStore(t *testing.T) { // removing file that does not exist should be noop missingHeight := height.Add(1) - err = edsStore.RemoveAll(ctx, missingHeight, share.DataHash{0x01, 0x02}) + err = edsStore.RemoveODSQ4(ctx, missingHeight, share.DataHash{0x01, 0x02}) require.NoError(t, err) eds, roots := randomEDS(t) @@ -183,7 +183,7 @@ func TestEDSStore(t *testing.T) { // ensure file is written ensureAmountFileAndLinks(t, dir, 2, 1) - err = edsStore.RemoveAll(ctx, height, roots.Hash()) + err = edsStore.RemoveODSQ4(ctx, height, roots.Hash()) require.NoError(t, err) // file should be removed from cache @@ -196,8 +196,8 @@ func TestEDSStore(t *testing.T) { // ensure file and link are removed ensureAmountFileAndLinks(t, dir, 0, 0) - // subsequent removeAll should be noop - err = edsStore.RemoveAll(ctx, height, roots.Hash()) + // subsequent removeODSQ4 should be noop + err = edsStore.RemoveODSQ4(ctx, height, roots.Hash()) require.NoError(t, err) }) })