Skip to content

Commit

Permalink
fix blob prune
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx committed Aug 29, 2024
1 parent cbaaa06 commit f86dfc7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions core/blob_storage/blob_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ type BlobStore struct {
fs afero.Fs
chainConfig *chain.Config
blocksKept uint64
blockReader services.BlockReader
}

func NewBlobStore(db kv.RwDB, fs afero.Fs, blocksKept uint64, chainConfig *chain.Config, blockReader services.BlockReader) services.BlobStorage {
return &BlobStore{fs: fs, db: db, blocksKept: blocksKept, chainConfig: chainConfig, blockReader: blockReader}
func NewBlobStore(db kv.RwDB, fs afero.Fs, blocksKept uint64, chainConfig *chain.Config) services.BlobStorage {
return &BlobStore{fs: fs, db: db, blocksKept: blocksKept, chainConfig: chainConfig}
}

func blobSidecarFilePath(blockNumber uint64, index uint64, hash libcommon.Hash) (folderpath, filepath string) {
Expand Down
2 changes: 1 addition & 1 deletion eth/ethconsensusconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func CreateConsensusEngine(ctx context.Context, nodeConfig *nodecfg.Config, chai
if blobPrune {
blocksKept = params.MinBlocksForBlobRequests
}
blobStore := blob_storage.NewBlobStore(blobDb, afero.NewBasePathFs(afero.NewOsFs(), nodeConfig.Dirs.DataDir), blocksKept, chainConfig, blockReader)
blobStore := blob_storage.NewBlobStore(blobDb, afero.NewBasePathFs(afero.NewOsFs(), nodeConfig.Dirs.DataDir), blocksKept, chainConfig)

eng = parlia.New(chainConfig, db, blobStore, blockReader, logger)
}
Expand Down
2 changes: 1 addition & 1 deletion turbo/app/snapshots_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,6 @@ func openBlobStore(dirs datadir.Dirs, chainConfig *chain.Config, blobPrune bool)
if blobPrune {
blobKept = params.MinBlocksForBlobRequests
}
blobStore := blob_storage.NewBlobStore(blobDb, afero.NewBasePathFs(afero.NewOsFs(), dirs.Blobs), blobKept, chainConfig, nil)
blobStore := blob_storage.NewBlobStore(blobDb, afero.NewBasePathFs(afero.NewOsFs(), dirs.Blobs), blobKept, chainConfig)
return blobStore
}

0 comments on commit f86dfc7

Please sign in to comment.