-
Notifications
You must be signed in to change notification settings - Fork 146
refactor(l1): reduce hashing in engine_getBlobsV2
#5684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor(l1): reduce hashing in engine_getBlobsV2
#5684
Conversation
There was a problem hiding this 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_hashto map versioned hashes to (tx_hash, blob_index) tuples - Implements
get_blob_tuple_by_indexmethod inBlobsBundleto retrieve blob data by index - Refactors
get_blobs_and_proofto 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.
56cd1d9 to
1b9fdf3
Compare
|
fixes pushed. |
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
Closes #5679