Skip to content

Commit 08d0f42

Browse files
authored
beacon-chain/das: remove dead slot parameter (#16021)
The slot parameter in blobCacheEntry.filter was unused and redundant. All slot/epoch-sensitive checks happen before filter (commitmentsToCheck), and disk availability is handled via BlobStorageSummary (epoch-aware). Changes: - Drop slot from blobCacheEntry.filter signature. - Update call sites in availability_blobs.go and blob_cache_test.go. Mirrors the data_column_cache.filter API (which does not take slot), reduces API noise, and removes dead code without changing behavior.
1 parent 74c8a25 commit 08d0f42

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

beacon-chain/das/availability_blobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (s *LazilyPersistentStoreBlob) IsDataAvailable(ctx context.Context, current
100100
// Verify we have all the expected sidecars, and fail fast if any are missing or inconsistent.
101101
// We don't try to salvage problematic batches because this indicates a misbehaving peer and we'd rather
102102
// ignore their response and decrease their peer score.
103-
sidecars, err := entry.filter(root, blockCommitments, b.Block().Slot())
103+
sidecars, err := entry.filter(root, blockCommitments)
104104
if err != nil {
105105
return errors.Wrap(err, "incomplete BlobSidecar batch")
106106
}

beacon-chain/das/blob_cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (e *blobCacheEntry) stash(sc *blocks.ROBlob) error {
8888
// commitments were found in the cache and the sidecar slice return value can be used
8989
// to perform a DA check against the cached sidecars.
9090
// filter only returns blobs that need to be checked. Blobs already available on disk will be excluded.
91-
func (e *blobCacheEntry) filter(root [32]byte, kc [][]byte, slot primitives.Slot) ([]blocks.ROBlob, error) {
91+
func (e *blobCacheEntry) filter(root [32]byte, kc [][]byte) ([]blocks.ROBlob, error) {
9292
count := len(kc)
9393
if e.diskSummary.AllAvailable(count) {
9494
return nil, nil

beacon-chain/das/blob_cache_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func TestFilterDiskSummary(t *testing.T) {
113113
t.Run(c.name, func(t *testing.T) {
114114
entry, commits, expected := c.setup(t)
115115
// first (root) argument doesn't matter, it is just for logs
116-
got, err := entry.filter([32]byte{}, commits, 100)
116+
got, err := entry.filter([32]byte{}, commits)
117117
require.NoError(t, err)
118118
require.Equal(t, len(expected), len(got))
119119
})
@@ -195,7 +195,7 @@ func TestFilter(t *testing.T) {
195195
t.Run(c.name, func(t *testing.T) {
196196
entry, commits, expected := c.setup(t)
197197
// first (root) argument doesn't matter, it is just for logs
198-
got, err := entry.filter([32]byte{}, commits, 100)
198+
got, err := entry.filter([32]byte{}, commits)
199199
if c.err != nil {
200200
require.ErrorIs(t, err, c.err)
201201
return
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Changed
2+
3+
- Removed dead slot parameter from blobCacheEntry.filter

0 commit comments

Comments
 (0)