Skip to content

Commit

Permalink
Replace MAX_BLOB_EPOCHS usages with more accurate terms (#13098)
Browse files Browse the repository at this point in the history
Co-authored-by: terencechain <[email protected]>
Co-authored-by: Nishant Das <[email protected]>
  • Loading branch information
3 people authored Oct 24, 2023
1 parent f55708b commit 45f68fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions beacon-chain/db/kv/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (rk blobRotatingKey) BlockRoot() []byte {

// SaveBlobSidecar saves the blobs for a given epoch in the sidecar bucket. When we receive a blob:
//
// 1. Convert slot using a modulo operator to [0, maxSlots] where maxSlots = MAX_BLOB_EPOCHS*SLOTS_PER_EPOCH
// 1. Convert slot using a modulo operator to [0, maxSlots] where maxSlots = MAX_EPOCHS_TO_PERSIST_BLOBS*SLOTS_PER_EPOCH
//
// 2. Compute key for blob as bytes(slot_to_rotating_buffer(blob.slot)) ++ bytes(blob.slot) ++ blob.block_root
//
Expand Down Expand Up @@ -121,7 +121,8 @@ func (s *Store) SaveBlobSidecar(ctx context.Context, scs []*ethpb.BlobSidecar) e
})
}

// validUniqueSidecars ensures that all sidecars have the same slot, parent root, block root, and proposer index, and no more than MAX_BLOB_EPOCHS.
// validUniqueSidecars ensures that all sidecars have the same slot, parent root, block root, and proposer index, and
// there are no more than MAX_BLOBS_PER_BLOCK sidecars.
func validUniqueSidecars(scs []*ethpb.BlobSidecar) ([]*ethpb.BlobSidecar, error) {
if len(scs) == 0 {
return nil, errEmptySidecar
Expand Down

0 comments on commit 45f68fa

Please sign in to comment.