Skip to content

Conversation

@lakshya-sky
Copy link
Contributor

Motivation

We're currently hashing all the blob commitments in the mempool for each request. Instead, this pr stores the blobs keyed by versioned hash inside the mempool, to retrieve them inexpensively during engine_getBlobsV2

Description

  • Adds a new map to retrieve blob bundle by their commitment hashes.
  • Adds a new method for blob bundle to retrieve data at given index.

Closes #5679

Copilot AI review requested due to automatic review settings December 18, 2025 20:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the engine_getBlobsV2 RPC method to reduce computational overhead by pre-computing and storing blob versioned hashes in the mempool, eliminating redundant hashing on each request.

  • Adds a new HashMap blobs_bundle_by_versioned_hash to map versioned hashes to (tx_hash, blob_index) tuples
  • Implements get_blob_tuple_by_index method in BlobsBundle to retrieve blob data by index
  • Refactors get_blobs_and_proof to use the new mempool method instead of iterating over all blob bundles

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
crates/networking/rpc/engine/blobs.rs Refactored blob retrieval to use new mempool method, removed CELLS_PER_EXT_BLOB import from main code
crates/common/types/blobs_bundle.rs Added BlobTuple type alias and get_blob_tuple_by_index method for retrieving blob data by index
crates/blockchain/mempool.rs Added blobs_bundle_by_versioned_hash HashMap and get_blobs_data_by_versioned_hashes method; updated add_blobs_bundle and remove_transaction_with_lock to maintain the new mapping

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lakshya-sky lakshya-sky force-pushed the reduce-hashing-in-engine-getblobsv2 branch from 56cd1d9 to 1b9fdf3 Compare December 22, 2025 15:42
@lakshya-sky
Copy link
Contributor Author

fixes pushed.

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.

Reduce hashing in engine_getBlobsV2

2 participants