-
Notifications
You must be signed in to change notification settings - Fork 215
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
fix(blobs): Validate sidecar KzgCommitments
and disallow sidecar omission
#2291
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2291 +/- ##
==========================================
- Coverage 30.85% 30.77% -0.08%
==========================================
Files 333 333
Lines 15237 15283 +46
Branches 20 20
==========================================
+ Hits 4702 4704 +2
- Misses 10210 10254 +44
Partials 325 325
|
6831d90
to
f040e37
Compare
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.
makes sense to me
KzgCommitments
and disallow sidecar omission
// VerifyIncomingBlock). | ||
// Make sure we have the right number of BlobSidecars | ||
numCommitments := len(blk.GetBody().GetBlobKzgCommitments()) | ||
if numCommitments != sidecars.Len() { |
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.
although we already check before calling .Len()
if sidecars.IsNil()
I think we should prevent any sidecars
function from ever panicking on its own
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.
i.e. here Len, GetSidecars, Get should all check .IsNil before dereferencing the pointer.
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.
we do in line 81 right?
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
This PR fixes a few things: