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

Add fast function for comparing attestation data #5834

Merged
merged 6 commits into from May 12, 2020
Merged

Conversation

0xKiwi
Copy link
Contributor

@0xKiwi 0xKiwi commented May 12, 2020

What type of PR is this?
Addition

What does this PR do? Why is it needed?
This PR adds a function to help check a comparison between 2 attestation data fields, since its performed a lot within the slasher.

Benchmarks:

BenchmarkAttDataIsEqual/fast
BenchmarkAttDataIsEqual/fast-8          58908008                18.1 ns/op             0 B/op          0 allocs/op
BenchmarkAttDataIsEqual/slow
BenchmarkAttDataIsEqual/slow-8            442920              4363 ns/op             384 B/op         30 allocs/op

@0xKiwi 0xKiwi requested a review from a team as a code owner May 12, 2020 20:18
@0xKiwi 0xKiwi added the Ready For Review A pull request ready for code review label May 12, 2020
@codecov
Copy link

codecov bot commented May 12, 2020

Codecov Report

Merging #5834 into master will decrease coverage by 0.14%.
The diff coverage is 88.88%.

@@            Coverage Diff             @@
##           master    #5834      +/-   ##
==========================================
- Coverage   59.77%   59.63%   -0.15%     
==========================================
  Files         312      312              
  Lines       26680    26320     -360     
==========================================
- Hits        15949    15695     -254     
+ Misses       8570     8486      -84     
+ Partials     2161     2139      -22     

Copy link
Contributor

@shayzluf shayzluf left a comment

Choose a reason for hiding this comment

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

Thanks for doing it

@0xKiwi 0xKiwi merged commit 6488ab4 into master May 12, 2020
@delete-merged-branch delete-merged-branch bot deleted the attdata-equal-func branch May 12, 2020 20:55
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.

None yet

2 participants