Skip to content

Prevent records from sharing a storage location - #57

Open
damilolaedwards wants to merge 1 commit into
ethpandaops:masterfrom
damilolaedwards:fix/prevent-cross-record-location-reuse
Open

Prevent records from sharing a storage location#57
damilolaedwards wants to merge 1 commit into
ethpandaops:masterfrom
damilolaedwards:fix/prevent-cross-record-location-reuse

Conversation

@damilolaedwards

Copy link
Copy Markdown

Summary

A create request for a beacon state, block, bad block, bad blob, execution trace, or execution bad block could succeed even when its location was already tied to a completely different record (a different node, slot, or root). Since retention deletes blobs by location, an unrelated record could ride along on someone else's blob and later cause it to be deleted once the unrelated record aged out of retention, even though the original record was still active and untouched by the requester.

Each create handler now checks whether the location is already associated with a different record and rejects the request with AlreadyExists if so. Legitimate retries of the exact same record are unaffected.

Two of the six handlers (execution block trace, execution bad block) had no location or identity check of any kind before this change, so this also closes that gap for them.

Changes

  • pkg/server/service/indexer/indexer.go: each Create* handler now calls a location-ownership check before inserting
  • pkg/server/service/indexer/location_ownership.go: the six type-specific ownership checks
  • pkg/server/service/indexer/location_ownership_test.go: tests covering the rejection case, the legitimate-retry case, and the previously-unprotected execution bad block handler

Test plan

  • go build ./... and go vet ./... pass
  • New tests in location_ownership_test.go pass locally
  • Full existing suite in pkg/server/service/indexer (depends on a Docker-backed MinIO mock, not runnable in the sandbox this was developed in - should be verified in CI)

A create request for a beacon state, block, bad block, bad blob,
execution trace, or execution bad block could succeed even when its
location was already tied to a completely different record (a
different node, slot, or root). Since retention deletes blobs by
location, an unrelated record could ride along on someone else's
blob and later cause it to be deleted when the unrelated record
aged out, even though the original record was still active.

Each create handler now checks whether the location is already
associated with a different record and rejects the request if so.
Legitimate retries of the exact same record are unaffected.
@damilolaedwards
damilolaedwards requested a review from Savid as a code owner July 25, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant