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

Check that the headers are equal while ignoring the signature for proposer slashings #7252

Merged
merged 16 commits into from
Sep 18, 2020

Conversation

prestonvanloon
Copy link
Member

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

We had a minor spec deviation in checking proposer slashings.

Which issues(s) does this PR fix?

Fixes sigp/beacon-fuzz#74

Other notes for review

See sigp/beacon-fuzz#74 for more context.

@prestonvanloon prestonvanloon requested a review from a team as a code owner September 16, 2020 18:45
@prestonvanloon prestonvanloon added Bug Something isn't working Ready For Review A pull request ready for code review labels Sep 16, 2020
Copy link
Contributor

@rauljordan rauljordan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @prestonvanloon

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
testutil.ResetCache()
if err := blocks.VerifyProposerSlashing(tt.args.beaconState, tt.args.slashing); (err != nil || tt.wantErr != "") && err.Error() != tt.wantErr {
Copy link
Member

Choose a reason for hiding this comment

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

we should use our assertion library over here

Copy link
Member Author

Choose a reason for hiding this comment

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

Does the assertion library support this behavior?

I want: "if the test expects an error, assert the error is as expected"

Copy link
Member

Choose a reason for hiding this comment

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

Not yet, it does have assert.ErrorContains which would be the closest to it. But yeah maybe not worth it to change now.

@codecov
Copy link

codecov bot commented Sep 17, 2020

Codecov Report

Merging #7252 into master will decrease coverage by 0.60%.
The diff coverage is 67.94%.

@@            Coverage Diff             @@
##           master    #7252      +/-   ##
==========================================
- Coverage   60.07%   59.46%   -0.61%     
==========================================
  Files         323      418      +95     
  Lines       27422    29941    +2519     
==========================================
+ Hits        16473    17805    +1332     
- Misses       8733     9231     +498     
- Partials     2216     2905     +689     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FUZZ] Beaconfuzz_v2 crash-2cf82c9a6bf1e6e9e0609d767f4ea582defd9cf3 in proposer_slashing
3 participants