Skip to content

Comments

binary search is the wrong tool for the job, derp#12757

Merged
kasey merged 2 commits intodeneb-integrationfrom
devnet8-blobverify-bugfix
Aug 18, 2023
Merged

binary search is the wrong tool for the job, derp#12757
kasey merged 2 commits intodeneb-integrationfrom
devnet8-blobverify-bugfix

Conversation

@kasey
Copy link
Collaborator

@kasey kasey commented Aug 18, 2023

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?
This fixes a bug in the lowestSlotNeedsBlob func. This method was trying to use binary search to find the first block in the sorted list that contained commitments. Which was an utterly deranged thing to do. Now the func iterates through the slice in order and returns the slot of the first block that contains commitments.

@kasey kasey requested a review from a team as a code owner August 18, 2023 18:14
@kasey kasey requested review from james-prysm, nisdas and saolyn and removed request for a team August 18, 2023 18:14
continue
}
commits, err := bwb[i].Block.Block().Body().BlobKzgCommitments()
commits, err := b.Block.Block().Body().BlobKzgCommitments()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really want to return nil here on errors? the caller will also return early with a nil when perhaps we want to propagate an error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Something I'm trying to do more often is minimize error handling to callers. In this case we know these accessors just return errors when a property isn't supported by the version. It isn't worth propagating that IMO.

@kasey kasey merged commit 00aaeb9 into deneb-integration Aug 18, 2023
@kasey kasey deleted the devnet8-blobverify-bugfix branch August 18, 2023 19:24
kasey added a commit that referenced this pull request Aug 21, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
kasey added a commit that referenced this pull request Aug 22, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
kasey added a commit that referenced this pull request Aug 22, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
kasey added a commit that referenced this pull request Aug 22, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
kasey added a commit that referenced this pull request Aug 23, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
kasey added a commit that referenced this pull request Aug 23, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
kasey added a commit that referenced this pull request Aug 23, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
kasey added a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
kasey added a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 24, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 30, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 30, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
prestonvanloon pushed a commit that referenced this pull request Aug 31, 2023
* binary search is the wrong tool for the job, derp

* restore protection from array index panics

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
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.

3 participants