Skip to content
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

GetBlock: Refactor attestation packing #5632

Merged
merged 4 commits into from
Apr 26, 2020

Conversation

prestonvanloon
Copy link
Member

@prestonvanloon prestonvanloon commented Apr 26, 2020

What type of PR is this?

Feature

What does this PR do? Why is it needed?

wOEPnCaQqJAlwAAAABJRU5ErkJggg

We see process slots and hash tree root applied multiple times. This PR reduces the redundant work and should save 50ms to 100ms on block proposals.

Which issues(s) does this PR fix?

N/A -- minor tweak

Other notes for review

I fixed imports in beacon-chain/rpc/validator/server.go on accident.

@prestonvanloon prestonvanloon requested a review from a team as a code owner April 26, 2020 20:35
@prestonvanloon prestonvanloon added the Ready For Review A pull request ready for code review label Apr 26, 2020
if err != nil {
return nil, errors.Wrap(err, "could fetch head state")
}
if st.Slot() < slot {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this can be
SlotsToEpoch(st.Slot()) < SlotsToEpoch(slot)

In other word, having the base state up to epoch boundary slot is sufficient enough

Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

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

Other than the out of the scope thought, this looks good

@prylabs-bulldozer prylabs-bulldozer bot merged commit 258d041 into master Apr 26, 2020
@delete-merged-branch delete-merged-branch bot deleted the refactor-attestation-packing branch April 26, 2020 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants