Skip to content

Conversation

chong-he
Copy link
Member

Issue Addressed

Proposed change

Rename current blob_sidecars endpoint from get_blobs to get_blob_sidecars to "give way" to the new get blobs endpoint. I thought this is the better way to have this new get_blobs endpoint name it this way in the code, but I am happy to change if that's not suitable/confusing

Additional Info

Testing results:

Query with:
curl -X 'GET' 'http://localhost:5052/eth/v1/beacon/blobs/12647385' | jq

Response:

{
  "execution_optimistic": true,
  "finalized": true,
  "data": [
    "blob1"
    "blob2"
    "blob3" 
    "and so on"
  ]
}

Query with versioned_hashes:
curl -X 'GET' \ 'http://localhost:5052/eth/v1/beacon/blobs/12647385?versioned_hashes=0x01171d78b2bd7cf3c3e458f7337f37272bfe6972cdd07b6e12f399a94ff6627c&versioned_hashes=0x011384275182442b69831cc581de3b80fe60b13a8efd870f8b680422087b960e' \ -H 'accept: application/json' | jq

Response:

{
  "execution_optimistic": true,
  "finalized": true,
  "data": [
      "blob1"
      "blob2"
  ]
}

@chong-he chong-he added ready-for-review The code is ready for review HTTP-API v8.0.0-rc.0 Q3 2025 release for Fusaka on Holesky labels Sep 23, 2025
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey CK, thanks for the PR. I've added my thoughts, let me know what you think and if you have any questions!

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Sep 23, 2025
@jimmygchen
Copy link
Member

jimmygchen commented Sep 23, 2025

btw very thorough with the spec compliance, i think the impl great in terms of correctness, and thanks for the test outputs. Nice work 👍

@jimmygchen jimmygchen added v8.0.0 Q4 2025 Fusaka Mainnet Release and removed v8.0.0-rc.0 Q3 2025 release for Fusaka on Holesky labels Sep 25, 2025
@jimmygchen
Copy link
Member

Bumping this to v8 mainnet release

@chong-he chong-he added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Oct 2, 2025
@chong-he
Copy link
Member Author

chong-he commented Oct 2, 2025

btw very thorough with the spec compliance, i think the impl great in terms of correctness, and thanks for the test outputs. Nice work 👍

Thanks so much for the thorough review. This PR is ready for another round of review.

Thank you both @michaelsproul and @jimmygchen

.map_err(|e| {
format!("Failed to recover cells and compute KZG proofs: {e:?}")
})?;
cells.into_iter().collect()
Copy link
Member

@jimmygchen jimmygchen Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to avoid the collect into Vec here? it doesn't seem necessary and we're just converting the vec back into into_inter() below.

debug!("Downloading finalized blobs");
if let Some(response) = remote
.get_blobs::<E>(BlockId::Root(block_root), None, &spec)
.get_blob_sidecars::<E>(BlockId::Root(block_root), None, &spec)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint is being deprecated and will likely be removed soon - we can probably address this in a separate PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're handling this gracefully at the moment so it's not a problem, i think we might eventually just remove this call and download columns from peers.

})
.map(|index| index as u64)
.collect()
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need this else statement here, because the get_blobs_from_data_columns and get_blobs functions accept Option and already handles this.

So this could just be simplified to:

        let blob_indices_opt = query.versioned_hashes.map(|versioned_hashes| {
            versioned_hashes
                .iter()
                .flat_map(|versioned_hash| {
                    blob_kzg_commitments.iter().position(move |commitment| {
                        let computed_hash = kzg_commitment_to_versioned_hash(commitment);
                        computed_hash == *versioned_hash
                    })
                })
                .map(|index| index as u64)
                .collect::<Vec<_>>()
        });

let blobs = blob_sidecar_list
.into_iter()
.map(|sidecar| BlobWrapper::<T::EthSpec> {
blob: sidecar.blob.clone(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is an expensive clone as blob isn't Arc'd.
However I don't see easy way around this unless we change the functions above to return Blobs instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note and no change required here

let list: Vec<_> = vec
.into_iter()
.filter(|blob_sidecar| vec.contains(&blob_sidecar.index))
.flat_map(|index| blob_sidecar_list.get(index as usize).cloned())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this change?

Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a few minor comments and i think we can merge this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTTP-API ready-for-review The code is ready for review v8.0.0 Q4 2025 Fusaka Mainnet Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants