-
Notifications
You must be signed in to change notification settings - Fork 124
fix(l1): validate incoming pooled tx blobs #4963
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…bTxWithoutSidecar
Lines of code reportTotal lines added: Detailed view |
7085f7d to
4556943
Compare
mpaulucci
approved these changes
Oct 22, 2025
ElFantasma
approved these changes
Oct 27, 2025
Contributor
ElFantasma
left a comment
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.
LGTM
ElFantasma
reviewed
Oct 27, 2025
Comment on lines
+177
to
193
| pub fn validate_blob_commitment_hashes( | ||
| &self, | ||
| blob_versioned_hashes: &[H256], | ||
| ) -> Result<(), BlobsBundleError> { | ||
| if self.commitments.len() != blob_versioned_hashes.len() { | ||
| return Err(BlobsBundleError::BlobVersionedHashesError); | ||
| } | ||
| for (commitment, blob_versioned_hash) in | ||
| self.commitments.iter().zip(blob_versioned_hashes.iter()) | ||
| { | ||
| if *blob_versioned_hash != kzg_commitment_to_versioned_hash(commitment) { | ||
| return Err(BlobsBundleError::BlobVersionedHashesError); | ||
| } | ||
| } | ||
| Ok(()) | ||
| } | ||
| } |
Contributor
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.
Another version maybe:
Suggested change
| pub fn validate_blob_commitment_hashes( | |
| &self, | |
| blob_versioned_hashes: &[H256], | |
| ) -> Result<(), BlobsBundleError> { | |
| if self.commitments.len() != blob_versioned_hashes.len() { | |
| return Err(BlobsBundleError::BlobVersionedHashesError); | |
| } | |
| for (commitment, blob_versioned_hash) in | |
| self.commitments.iter().zip(blob_versioned_hashes.iter()) | |
| { | |
| if *blob_versioned_hash != kzg_commitment_to_versioned_hash(commitment) { | |
| return Err(BlobsBundleError::BlobVersionedHashesError); | |
| } | |
| } | |
| Ok(()) | |
| } | |
| } | |
| pub fn validate_blob_commitment_hashes(&self, hashes: &[H256]) -> Result<(), BlobsBundleError> { | |
| if self.commitments.len() != hashes.len() | |
| || self | |
| .commitments | |
| .iter() | |
| .zip(hashes.iter()) | |
| .any(|(commitment, hash)| *hash != kzg_commitment_to_versioned_hash(commitment)) | |
| { | |
| Err(BlobsBundleError::BlobVersionedHashesError) | |
| } else { | |
| Ok(()) | |
| } | |
| } | |
| } |
xqft
pushed a commit
that referenced
this pull request
Nov 11, 2025
**Motivation** Enable hive p2p tests `TestBlobTxWithMismatchedSidecar ` & `TestBlobTxWithoutSidecar` In order to pass these tests we have to: * Be able to decode pooled transactions without blobs (aka plain eip4844 transactions instead of a wrapped eip4844 with its blobsbundle) * Disconnect from peers that send transactions without blobs or blob bundles that don't match the versioned hashes <!-- Why does this pull request exist? What are its goals? --> **Description** * Handle the case of plain `Eip4844` transaction when RLP-decoding `WrappedEip4844` transactions * Disconnect from peers that send empty/mismatched blobs <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #3745, part of #4941 --------- Co-authored-by: Martin Paulucci <martin.c.paulucci@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Enable hive p2p tests
TestBlobTxWithMismatchedSidecar&TestBlobTxWithoutSidecarIn order to pass these tests we have to:
Description
Eip4844transaction when RLP-decodingWrappedEip4844transactionsCloses #3745, part of #4941