Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions beacon_chain/rpc/rest_beacon_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1702,18 +1702,20 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
res.get()

# https://github.com/ethereum/beacon-APIs/blob/v2.4.2/types/deneb/blob_sidecar.yaml#L2-L28
# Define a list which allows for a larger-than-Deneb-valid blobs per block,
# per https://github.com/ethereum/beacon-APIs/pull/488 and for pre-Electra,
# those blobs just won't exist.
let data = newClone(default(List[BlobSidecar, Limit MAX_BLOBS_PER_BLOCK_ELECTRA]))
# The merkleization limit of the list is `MAX_BLOB_COMMITMENTS_PER_BLOCK`,
# the serialization limit is configurable and is:
# - `MAX_BLOBS_PER_BLOCK` from Deneb onward
# - `MAX_BLOBS_PER_BLOCK_ELECTRA` from Electra.
let data = newClone(default(
List[BlobSidecar, Limit MAX_BLOB_COMMITMENTS_PER_BLOCK]))

if indices.isErr:
return RestApiResponse.jsonError(Http400,
InvalidSidecarIndexValueError)

let indexFilter = indices.get.toHashSet

for blobIndex in 0'u64 ..< MAX_BLOBS_PER_BLOCK_ELECTRA:
for blobIndex in 0'u64 ..< node.dag.cfg.MAX_BLOBS_PER_BLOCK_ELECTRA:
if indexFilter.len > 0 and blobIndex notin indexFilter:
continue

Expand Down