diff --git a/beacon-chain/db/filesystem/blob.go b/beacon-chain/db/filesystem/blob.go index 2c227233c49c..00ffb3d660de 100644 --- a/beacon-chain/db/filesystem/blob.go +++ b/beacon-chain/db/filesystem/blob.go @@ -121,11 +121,18 @@ type BlobStorage struct { // will be populated at node startup, avoiding a costly cold prune (~4s in syscalls) during syncing. func (bs *BlobStorage) WarmCache() { start := time.Now() - if bs.layoutName == LayoutNameFlat { - log.Info("Blob filesystem cache warm-up started. This may take a few minutes") - } else { - log.Info("Blob filesystem cache warm-up started") + + dirs, err := listDir(bs.fs, ".") + if err != nil { + log.WithError(err).Warn("Failed to list blob storage directories") } + est := time.Duration(len(dirs)) * time.Millisecond + + log.WithFields(logrus.Fields{ + "layout": bs.layout.name(), + "dir_count": len(dirs), + "estimated": est.String(), + }).Info("Warming up blob filesystem cache") if err := warmCache(bs.layout, bs.cache); err != nil { log.WithError(err).Error("Error encountered while warming up blob filesystem cache") diff --git a/changelog/conj40_better-warmcache-logging.md b/changelog/conj40_better-warmcache-logging.md new file mode 100644 index 000000000000..32a7fd93bfed --- /dev/null +++ b/changelog/conj40_better-warmcache-logging.md @@ -0,0 +1,3 @@ +### Changed + +- Improved logging in `WarmCache` to provide better insights during blob filesystem cache warm-up, including estimated time and directory count. \ No newline at end of file